summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormananth <mananth>2004-03-08 05:32:41 +0000
committermananth <mananth>2004-03-08 05:32:41 +0000
commitce4e46e91edeb9c1cd4f1269e6ede20303bdcb08 (patch)
treeb8c492dd84d25899a49ac6e65c761e5c2e2f97c0
parentd57b4a56b223b6a0bade7d74f3285047374216d1 (diff)
downloadsysfsutils-ce4e46e91edeb9c1cd4f1269e6ede20303bdcb08.tar.gz
Lev's changes for C++ compatibility
-rw-r--r--ChangeLog3
-rw-r--r--include/dlist.h2
-rw-r--r--include/libsysfs.h12
-rw-r--r--lib/sysfs_class.c16
4 files changed, 18 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog
index 4a7a7bd..a9e3871 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,7 @@
+03/08/2004 - Lev Makhlis <mlev@despammed.com>
+ * Changes for C++ compatibility
+
03/08/2004 - Ananth Mavinakayanahalli <ananth@in.ibm.com>
* Changed version number in configure.ac to 1.1.0
diff --git a/include/dlist.h b/include/dlist.h
index 1616a1b..b32723b 100644
--- a/include/dlist.h
+++ b/include/dlist.h
@@ -77,7 +77,7 @@ void dlist_end(Dlist *);
void *dlist_insert(Dlist *,void *,int) ;
-void *dlist_insert_sorted(struct dlist *list, void *new, int (*sorter)(void *, void *));
+void *dlist_insert_sorted(struct dlist *list, void *new_elem, int (*sorter)(void *, void *));
void dlist_delete(Dlist *,int);
diff --git a/include/libsysfs.h b/include/libsysfs.h
index 3e9514c..095792b 100644
--- a/include/libsysfs.h
+++ b/include/libsysfs.h
@@ -253,7 +253,7 @@ extern void sysfs_close_class_device(struct sysfs_class_device *dev);
extern struct sysfs_class_device *sysfs_open_class_device_path
(const unsigned char *path);
extern struct sysfs_class_device *sysfs_open_class_device
- (const unsigned char *class, const unsigned char *name);
+ (const unsigned char *classname, const unsigned char *name);
extern struct sysfs_device *sysfs_get_classdev_device
(struct sysfs_class_device *clsdev);
extern struct sysfs_driver *sysfs_get_classdev_driver
@@ -264,7 +264,7 @@ extern void sysfs_close_class(struct sysfs_class *cls);
extern struct sysfs_class *sysfs_open_class(const unsigned char *name);
extern struct dlist *sysfs_get_class_devices(struct sysfs_class *cls);
extern struct sysfs_class_device *sysfs_get_class_device
- (struct sysfs_class *class, unsigned char *name);
+ (struct sysfs_class *cls, unsigned char *name);
extern struct dlist *sysfs_get_classdev_attributes
(struct sysfs_class_device *cdev);
extern struct dlist *sysfs_refresh_classdev_attributes
@@ -285,11 +285,11 @@ extern struct sysfs_attribute *sysfs_open_classdev_attr
* lement of all libsysfs structures. Hence, this function will work
* AS IS for _ALL_ the lists that have to be sorted.
*/
-static inline int sort_list(void *new, void *old)
+static inline int sort_list(void *new_elem, void *old_elem)
{
- return ((strncmp(((struct sysfs_attribute *)new)->name,
- ((struct sysfs_attribute *)old)->name,
- strlen(((struct sysfs_attribute *)new)->name))) < 0 ? 1 : 0);
+ return ((strncmp(((struct sysfs_attribute *)new_elem)->name,
+ ((struct sysfs_attribute *)old_elem)->name,
+ strlen(((struct sysfs_attribute *)new_elem)->name))) < 0 ? 1 : 0);
}
diff --git a/lib/sysfs_class.c b/lib/sysfs_class.c
index f20822d..28d891f 100644
--- a/lib/sysfs_class.c
+++ b/lib/sysfs_class.c
@@ -66,7 +66,7 @@ void sysfs_close_class_device(struct sysfs_class_device *dev)
/**
* sysfs_close_class: close single class
- * @class: class structure
+ * @cls: class structure
*/
void sysfs_close_class(struct sysfs_class *cls)
{
@@ -172,7 +172,7 @@ struct sysfs_class_device *sysfs_open_class_device_path
/**
* sysfs_get_class_devices: gets all devices for class
- * @class: class to get devices for
+ * @cls: class to get devices for
* returns dlist of class_devices with success and NULL with error
*/
struct dlist *sysfs_get_class_devices(struct sysfs_class *cls)
@@ -275,20 +275,20 @@ struct sysfs_class *sysfs_open_class(const unsigned char *name)
* @class: class to find device on
* @name: class name of the device
*/
-struct sysfs_class_device *sysfs_get_class_device(struct sysfs_class *class,
+struct sysfs_class_device *sysfs_get_class_device(struct sysfs_class *cls,
unsigned char *name)
{
- if (class == NULL || name == NULL) {
+ if (cls == NULL || name == NULL) {
errno = EINVAL;
return NULL;
}
- if (class->devices == NULL) {
- class->devices = sysfs_get_class_devices(class);
- if (class->devices == NULL)
+ if (cls->devices == NULL) {
+ cls->devices = sysfs_get_class_devices(cls);
+ if (cls->devices == NULL)
return NULL;
}
- return (struct sysfs_class_device *)dlist_find_custom(class->devices,
+ return (struct sysfs_class_device *)dlist_find_custom(cls->devices,
name, class_name_equal);
}