diff options
author | Andy Hertzfeld <andy@src.gnome.org> | 2000-04-10 20:04:15 +0000 |
---|---|---|
committer | Andy Hertzfeld <andy@src.gnome.org> | 2000-04-10 20:04:15 +0000 |
commit | 6e865e79dec218521814ceafe6fe140ca8eb53ff (patch) | |
tree | 362f0d3bb7f8fb10f56215340e218fb52868f0b8 | |
parent | f193a5adc6c8664fa2bfe2ce3d45fc25098df3b2 (diff) | |
download | nautilus-6e865e79dec218521814ceafe6fe140ca8eb53ff.tar.gz |
added io port info to hardware configuration synopsis
added io port info to hardware configuration synopsis
-rw-r--r-- | ChangeLog-20000414 | 5 | ||||
-rw-r--r-- | components/services/startup/eazel-register.c | 36 |
2 files changed, 40 insertions, 1 deletions
diff --git a/ChangeLog-20000414 b/ChangeLog-20000414 index 918653df2..8d9d0439d 100644 --- a/ChangeLog-20000414 +++ b/ChangeLog-20000414 @@ -1,3 +1,8 @@ +2000-04-10 Andy Hertzfeld <andy@eazel.com> + + * components/services/startup/eazel-register.c: + added io ports to hardware configuration synopsis + 2000-04-10 John Sullivan <sullivan@eazel.com> Fixed bug 377 (clipping emblems in list view looks bad diff --git a/components/services/startup/eazel-register.c b/components/services/startup/eazel-register.c index 70003503f..e498491c0 100644 --- a/components/services/startup/eazel-register.c +++ b/components/services/startup/eazel-register.c @@ -40,6 +40,7 @@ void add_package_info(xmlDoc* configuration_metafile); void add_hardware_info(xmlDoc* configuration_metafile); gchar* read_proc_info(const gchar* proc_filename); void add_info(xmlNode *node_ptr, gchar* data, const gchar *tag, const gchar *field_name); +void add_io_info(xmlNode *node_ptr, gchar *io_data); /* add package data from the package database to the passed in xml document */ @@ -154,11 +155,39 @@ void add_info(xmlNode *node_ptr, gchar* data, const gchar *tag, const gchar *fie g_strfreev(info_array); } +/* utility routine to process io info */ + +void add_io_info(xmlNode *node_ptr, gchar *io_data) +{ + gint index; + gchar *temp_str; + xmlNode *new_node; + gchar **info_array; + + /* parse the data into a string array */ + info_array = g_strsplit(io_data, "\n", 64); + /* iterate through the data creating a record for each line */ + for (index = 0; index < 64; index++) { + if (info_array[index] == NULL) + break; + new_node = xmlNewChild(node_ptr, NULL, "IORANGE", NULL); + temp_str = strchr(info_array[index], ':'); + if (temp_str) { + *temp_str = '\0'; + xmlSetProp(new_node, "RANGE", g_strstrip(info_array[index])); + xmlSetProp(new_node, "TYPE", g_strstrip(temp_str + 1)); + } + + } + + g_strfreev(info_array); +} + /* add hardware info from the /proc directory to the passed in xml document */ void add_hardware_info(xmlDoc *configuration_metafile) { - xmlNode *cpu_node; + xmlNode *cpu_node, *this_node; gchar *temp_string; /* add the HARDWARE node */ @@ -185,6 +214,11 @@ void add_hardware_info(xmlDoc *configuration_metafile) add_info(cpu_node, temp_string, "CACHE", "cache size"); g_free(temp_string); + /* now handle IO port info */ + this_node = xmlNewChild(hardware_node, NULL, "IOPORTS", NULL); + temp_string = read_proc_info("ioports"); + add_io_info(this_node, temp_string); + g_free(temp_string); } /* synchronize an existing metafile with the rpm database */ |