Main Page | Modules | Data Structures | File List | Data Fields | Related Pages

common.h

00001 /***************************************************************************
00002  * CVSID: $Id: common.h,v 1.1 2004/03/14 17:09:35 david Exp $
00003  *
00004  * Common functionality used by Linux implementation
00005  *
00006  * Copyright (C) 2003 David Zeuthen, <david@fubar.dk>
00007  *
00008  * Licensed under the Academic Free License version 2.0
00009  *
00010  * This program is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License as published by
00012  * the Free Software Foundation; either version 2 of the License, or
00013  * (at your option) any later version.
00014  *
00015  * This program is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  * GNU General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU General Public License
00021  * along with this program; if not, write to the Free Software
00022  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00023  *
00024  **************************************************************************/
00025 
00026 #ifndef COMMON_H
00027 #define COMMON_H
00028 
00029 #include <dbus/dbus.h>
00030 
00031 #include "../device_store.h"
00032 #include "libsysfs/libsysfs.h"
00033 
00040 double parse_double (const char *str);
00041 dbus_int32_t parse_dec (const char *str);
00042 dbus_int32_t parse_hex (const char *str);
00043 
00044 long int find_num (char *pre, char *s, int base);
00045 double find_double (char *pre, char *s);
00046 int find_bcd2 (char *pre, char *s);
00047 char *find_string (char *pre, char *s);
00048 
00049 char *read_single_line (char *filename_format, ...);
00050 
00051 const char *get_last_element (const char *s);
00052 
00053 /* returns the path of the udevinfo program */
00054 const char *udevinfo_path (void);
00055 
00064 typedef char *(*ComputeFDI) (HalDevice * d, int append_num);
00065 
00066 char *rename_and_merge (HalDevice *d, ComputeFDI naming_func, const char *namespace);
00067 
00068 char *get_parent_sysfs_path (const char *path);
00069 
00070 void find_and_set_physical_device (HalDevice * device);
00071 
00072 dbus_bool_t class_device_get_major_minor (const char *sysfs_path, int *major, int *minor);
00073 
00074 dbus_bool_t class_device_get_device_file (const char *sysfs_path, char *dev_file, int dev_file_length);
00075 
00076 
00077 const char *drivers_lookup (const char *device_path);
00078 
00079 void drivers_collect (const char *bus_name);
00080 
00093 #define HAL_LINUX_HOTPLUG_TIMEOUT 30000
00094 
00095 extern dbus_bool_t is_probing;
00096 
00097 extern char sysfs_mount_path[SYSFS_PATH_MAX];
00098 
00099 /* @} */
00100 
00101 #endif              /* COMMON_H */

Generated on Sat Apr 24 19:57:44 2004 for HAL by doxygen 1.3.6-20040222