diff options
775 files changed, 7939 insertions, 8594 deletions
diff --git a/Makefile.in b/Makefile.in index 032b2629..6acd957a 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,17 +1,18 @@ CC = gcc -O3 $(ARCHOPTS) CCSLOW = gcc -O0 -CFLAGS = -fPIC -pipe -Wall -g $(GTK_CFLAGS) $(GLADE_CFLAGS) -I. +CFLAGS = -fPIC -pipe -Wall -g $(GTK_CFLAGS) $(GLADE_CFLAGS) $(SOUP_CFLAGS) -I. # ---------------------------------------------------------------------------- OBJECTS = hardinfo.o shell.o util.o iconcache.o loadgraph.o sha1.o md5.o \ - menu.o stock.o callbacks.o expr.o report.o blowfish.o binreloc.o + menu.o stock.o callbacks.o expr.o report.o blowfish.o binreloc.o \ + vendor.o socket.o fbench.o syncmanager.o MODULES = computer.so devices.so benchmark.so all: $(OBJECTS) $(MODULES) $(CC) $(CFLAGS) -o hardinfo -Wl,-export-dynamic $(OBJECTS) $(GTK_LIBS) $(GTK_FLAGS) \ - $(GLADE_LIBS) $(GLADE_FLAGS) + $(GLADE_LIBS) $(GLADE_FLAGS) $(SOUP_LIBS) $(SOUP_FLAGS) md5.o: $(CCSLOW) $(CFLAGS) -c md5.c -o $@ @@ -22,11 +23,20 @@ blowfish.o: sha1.o: $(CCSLOW) $(CFLAGS) -c sha1.c -o $@ +fbench.o: + $(CCSLOW) $(CFLAGS) -c fbench.c -o $@ + +benchmark.so: benchmark.c + @echo "[01;34m--- Module: $< ($@)[00m" + $(CCSLOW) $(CFLAGS) -o $@ -shared $< $(GTK_FLAGS) $(GTK_LIBS) \ + $(GLADE_LIBS) $(GLADE_FLAGS) + ln -sf ../$@ modules + %.so: %.c @echo "[01;34m--- Module: $< ($@)[00m" $(CC) $(CFLAGS) -o $@ -shared $< $(GTK_FLAGS) $(GTK_LIBS) \ $(GLADE_LIBS) $(GLADE_FLAGS) - mv -f $@ modules + ln -sf ../$@ modules clean: rm -rf .xvpics pixmaps/.xvpics *.o *.so hardinfo modules/*.so report @@ -61,19 +71,19 @@ install: all cp hardinfo ${DESTDIR}/usr/bin/hardinfo @echo '[01;34m*** Installing modules...[00m' - cp -r modules/*.so ${DESTDIR}/usr/lib/hardinfo/modules + cp -Lr modules/*.so ${DESTDIR}/usr/lib/hardinfo/modules @echo '[01;34m*** Installing pixmaps...[00m' - cp -r pixmaps/* ${DESTDIR}/usr/share/hardinfo/pixmaps + cp -Lr pixmaps/* ${DESTDIR}/usr/share/hardinfo/pixmaps @echo '[01;34m*** Installing misc data...[00m' - cp uidefs.xml ${DESTDIR}/usr/share/hardinfo - cp modules.conf ${DESTDIR}/usr/share/hardinfo cp benchmark.conf ${DESTDIR}/usr/share/hardinfo cp benchmark.data ${DESTDIR}/usr/share/hardinfo @echo '[01;34m*** Fixing permissions...[00m' - chmod -R 755 ${DESTDIR}/usr/share/hardinfo chmod 755 ${DESTDIR}/usr/bin/hardinfo @echo '[01;34m*** Done installing.[00m' + +installer: + makeinstaller diff --git a/arch/.svn/README.txt b/arch/.svn/README.txt deleted file mode 100644 index 271a8ce9..00000000 --- a/arch/.svn/README.txt +++ /dev/null @@ -1,2 +0,0 @@ -This is a Subversion working copy administrative directory. -Visit http://subversion.tigris.org/ for more information. diff --git a/arch/.svn/empty-file b/arch/.svn/empty-file deleted file mode 100644 index e69de29b..00000000 --- a/arch/.svn/empty-file +++ /dev/null diff --git a/arch/.svn/entries b/arch/.svn/entries deleted file mode 100644 index 1e500800..00000000 --- a/arch/.svn/entries +++ /dev/null @@ -1,20 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<wc-entries - xmlns="svn:"> -<entry - committed-rev="9" - name="" - committed-date="2006-03-07T18:26:23.507991Z" - url="svn+ssh://lafp@svn.berlios.de/svnroot/repos/hardinfo/trunk/hardinfo2/arch" - last-author="lafp" - kind="dir" - uuid="03931a0e-0c0b-0410-87e6-c9e79dddb921" - repos="svn+ssh://lafp@svn.berlios.de/svnroot/repos/hardinfo" - revision="9"/> -<entry - name="linux" - kind="dir"/> -<entry - name="common" - kind="dir"/> -</wc-entries> diff --git a/arch/.svn/format b/arch/.svn/format deleted file mode 100644 index b8626c4c..00000000 --- a/arch/.svn/format +++ /dev/null @@ -1 +0,0 @@ -4 diff --git a/arch/common/.svn/README.txt b/arch/common/.svn/README.txt deleted file mode 100644 index 271a8ce9..00000000 --- a/arch/common/.svn/README.txt +++ /dev/null @@ -1,2 +0,0 @@ -This is a Subversion working copy administrative directory. -Visit http://subversion.tigris.org/ for more information. diff --git a/arch/common/.svn/empty-file b/arch/common/.svn/empty-file deleted file mode 100644 index e69de29b..00000000 --- a/arch/common/.svn/empty-file +++ /dev/null diff --git a/arch/common/.svn/entries b/arch/common/.svn/entries deleted file mode 100644 index 04b48187..00000000 --- a/arch/common/.svn/entries +++ /dev/null @@ -1,101 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<wc-entries - xmlns="svn:"> -<entry - committed-rev="5" - name="" - committed-date="2006-02-01T00:06:47.257372Z" - url="svn+ssh://lafp@svn.berlios.de/svnroot/repos/hardinfo/trunk/hardinfo2/arch/common" - last-author="lafp" - kind="dir" - uuid="03931a0e-0c0b-0410-87e6-c9e79dddb921" - repos="svn+ssh://lafp@svn.berlios.de/svnroot/repos/hardinfo" - revision="9"/> -<entry - committed-rev="10" - name="sha1.h" - text-time="2006-05-20T14:32:18.000000Z" - committed-date="2006-05-20T14:41:28.523270Z" - checksum="7254615d07c6be90bdafc764ca8e8f9f" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:28.000000Z" - revision="10"/> -<entry - committed-rev="10" - name="blowfish.h" - text-time="2006-05-20T14:32:18.000000Z" - committed-date="2006-05-20T14:41:28.523270Z" - checksum="d9411117551a66fd14fc8d6b13f1a04c" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:28.000000Z" - revision="10"/> -<entry - committed-rev="1" - name="fib.h" - text-time="2006-05-20T14:32:18.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="3de942d27f53135b370c1b88f45220c8" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:28.000000Z"/> -<entry - committed-rev="10" - name="zlib.h" - text-time="2006-05-20T14:32:18.000000Z" - committed-date="2006-05-20T14:41:28.523270Z" - checksum="e7c594c5913d0847a0e2b9bfd5d062d4" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:28.000000Z" - revision="10"/> -<entry - committed-rev="10" - name="users.h" - text-time="2006-05-22T11:31:37.000000Z" - committed-date="2006-05-20T14:41:28.523270Z" - checksum="216feeb3fed867dacbc8a8181d0d960d" - last-author="lafp" - kind="file" - revision="10"/> -<entry - committed-rev="1" - name="display.h" - text-time="2006-05-20T14:32:18.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="9b9fe0f1472481b59436cdd18dbacfd4" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:30.000000Z"/> -<entry - committed-rev="10" - name="md5.h" - text-time="2006-05-20T14:32:18.000000Z" - committed-date="2006-05-20T14:41:28.523270Z" - checksum="6f1b0aaf6549a02d95e1a56a42e4088b" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:30.000000Z" - revision="10"/> -<entry - committed-rev="10" - name="languages.h" - text-time="2006-05-20T14:32:18.000000Z" - committed-date="2006-05-20T14:41:28.523270Z" - checksum="5c168fa59cb0589bf24d62cba96943e6" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:30.000000Z" - revision="10"/> -<entry - committed-rev="17" - name="printers.h" - text-time="2006-06-10T12:43:57.000000Z" - committed-date="2006-06-10T12:46:54.945064Z" - checksum="6c4f384feae5b86188161fe27530c3b7" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:30.000000Z" - revision="17"/> -</wc-entries> diff --git a/arch/common/.svn/format b/arch/common/.svn/format deleted file mode 100644 index b8626c4c..00000000 --- a/arch/common/.svn/format +++ /dev/null @@ -1 +0,0 @@ -4 diff --git a/arch/common/.svn/prop-base/blowfish.h.svn-base b/arch/common/.svn/prop-base/blowfish.h.svn-base deleted file mode 100644 index e69de29b..00000000 --- a/arch/common/.svn/prop-base/blowfish.h.svn-base +++ /dev/null diff --git a/arch/common/.svn/prop-base/display.h.svn-base b/arch/common/.svn/prop-base/display.h.svn-base deleted file mode 100644 index e69de29b..00000000 --- a/arch/common/.svn/prop-base/display.h.svn-base +++ /dev/null diff --git a/arch/common/.svn/prop-base/fib.h.svn-base b/arch/common/.svn/prop-base/fib.h.svn-base deleted file mode 100644 index e69de29b..00000000 --- a/arch/common/.svn/prop-base/fib.h.svn-base +++ /dev/null diff --git a/arch/common/.svn/prop-base/languages.h.svn-base b/arch/common/.svn/prop-base/languages.h.svn-base deleted file mode 100644 index e69de29b..00000000 --- a/arch/common/.svn/prop-base/languages.h.svn-base +++ /dev/null diff --git a/arch/common/.svn/prop-base/md5.h.svn-base b/arch/common/.svn/prop-base/md5.h.svn-base deleted file mode 100644 index e69de29b..00000000 --- a/arch/common/.svn/prop-base/md5.h.svn-base +++ /dev/null diff --git a/arch/common/.svn/prop-base/printers.h.svn-base b/arch/common/.svn/prop-base/printers.h.svn-base deleted file mode 100644 index e69de29b..00000000 --- a/arch/common/.svn/prop-base/printers.h.svn-base +++ /dev/null diff --git a/arch/common/.svn/prop-base/sha1.h.svn-base b/arch/common/.svn/prop-base/sha1.h.svn-base deleted file mode 100644 index e69de29b..00000000 --- a/arch/common/.svn/prop-base/sha1.h.svn-base +++ /dev/null diff --git a/arch/common/.svn/prop-base/zlib.h.svn-base b/arch/common/.svn/prop-base/zlib.h.svn-base deleted file mode 100644 index e69de29b..00000000 --- a/arch/common/.svn/prop-base/zlib.h.svn-base +++ /dev/null diff --git a/arch/common/.svn/props/blowfish.h.svn-work b/arch/common/.svn/props/blowfish.h.svn-work deleted file mode 100644 index e69de29b..00000000 --- a/arch/common/.svn/props/blowfish.h.svn-work +++ /dev/null diff --git a/arch/common/.svn/props/display.h.svn-work b/arch/common/.svn/props/display.h.svn-work deleted file mode 100644 index e69de29b..00000000 --- a/arch/common/.svn/props/display.h.svn-work +++ /dev/null diff --git a/arch/common/.svn/props/fib.h.svn-work b/arch/common/.svn/props/fib.h.svn-work deleted file mode 100644 index e69de29b..00000000 --- a/arch/common/.svn/props/fib.h.svn-work +++ /dev/null diff --git a/arch/common/.svn/props/languages.h.svn-work b/arch/common/.svn/props/languages.h.svn-work deleted file mode 100644 index e69de29b..00000000 --- a/arch/common/.svn/props/languages.h.svn-work +++ /dev/null diff --git a/arch/common/.svn/props/md5.h.svn-work b/arch/common/.svn/props/md5.h.svn-work deleted file mode 100644 index e69de29b..00000000 --- a/arch/common/.svn/props/md5.h.svn-work +++ /dev/null diff --git a/arch/common/.svn/props/printers.h.svn-work b/arch/common/.svn/props/printers.h.svn-work deleted file mode 100644 index e69de29b..00000000 --- a/arch/common/.svn/props/printers.h.svn-work +++ /dev/null diff --git a/arch/common/.svn/props/sha1.h.svn-work b/arch/common/.svn/props/sha1.h.svn-work deleted file mode 100644 index e69de29b..00000000 --- a/arch/common/.svn/props/sha1.h.svn-work +++ /dev/null diff --git a/arch/common/.svn/props/zlib.h.svn-work b/arch/common/.svn/props/zlib.h.svn-work deleted file mode 100644 index e69de29b..00000000 --- a/arch/common/.svn/props/zlib.h.svn-work +++ /dev/null diff --git a/arch/common/.svn/text-base/blowfish.h.svn-base b/arch/common/.svn/text-base/blowfish.h.svn-base deleted file mode 100644 index ad4bdb92..00000000 --- a/arch/common/.svn/text-base/blowfish.h.svn-base +++ /dev/null @@ -1,70 +0,0 @@ -/* - * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, version 2. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include <blowfish.h> - -gchar * -benchmark_fish(void) -{ - BLOWFISH_CTX ctx; - GTimer *timer = g_timer_new(); - gdouble elapsed = 0; - gchar src[65536], *tmpsrc; - glong srclen = 65536; - unsigned long L, R; - int i; - - tmpsrc = src; - - L = 0xBEBACAFE; - R = 0xDEADBEEF; - - gchar *bdata_path; - - bdata_path = g_strdup_printf("%s/hardinfo/benchmark.data", - gbr_find_data_dir(PREFIX)); - - if (!g_file_get_contents(bdata_path, &tmpsrc, NULL, NULL)) { - g_free(bdata_path); - return g_strdup("[Error]\n" - PREFIX "benchmark.data not found=\n"); - } - - shell_view_set_enabled(FALSE); - shell_status_update("Benchmarking..."); - - for (i = 0; i <= 50000; i++) { - g_timer_start(timer); - - Blowfish_Init(&ctx, (unsigned char*)tmpsrc, srclen); - Blowfish_Encrypt(&ctx, &L, &R); - Blowfish_Decrypt(&ctx, &L, &R); - - g_timer_stop(timer); - elapsed += g_timer_elapsed(timer, NULL); - - shell_status_set_percentage(i/500); - } - - g_timer_destroy(timer); - g_free(bdata_path); - - gchar *retval = g_strdup_printf("[Results <i>(in seconds; lower is better)</i>]\n" - "<b>This Machine</b>=<b>%.2f</b>\n", elapsed); - return benchmark_include_results(retval, "Blowfish"); -} diff --git a/arch/common/.svn/text-base/display.h.svn-base b/arch/common/.svn/text-base/display.h.svn-base deleted file mode 100644 index 6731e3e3..00000000 --- a/arch/common/.svn/text-base/display.h.svn-base +++ /dev/null @@ -1,137 +0,0 @@ -/* - * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, version 2. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -static void -get_glx_info(DisplayInfo *di) -{ - gchar *output; - if (g_spawn_command_line_sync("glxinfo", &output, NULL, NULL, NULL)) { - gchar **output_lines, **old; - - output_lines = g_strsplit(output, "\n", 0); - g_free(output); - - old = output_lines; - while (*(++output_lines)) { - if (strstr(*output_lines, "OpenGL")) { - gchar **tmp = g_strsplit(*output_lines, ":", 0); - - tmp[1] = g_strchug(tmp[1]); - - get_str("OpenGL vendor str", di->ogl_vendor); - get_str("OpenGL renderer str", di->ogl_renderer); - get_str("OpenGL version str", di->ogl_version); - - g_strfreev(tmp); - } - } - - g_strfreev(old); - - if (!di->ogl_vendor) - di->ogl_vendor = "Unknown"; - if (!di->ogl_renderer) - di->ogl_renderer = "Unknown"; - if (!di->ogl_version) - di->ogl_version = "Unknown"; - } else { - di->ogl_vendor = di->ogl_renderer = di->ogl_version = "Unknown"; - } - -} - -static void -get_x11_info(DisplayInfo *di) -{ - gchar *output; - - if (g_spawn_command_line_sync("xdpyinfo", &output, NULL, NULL, NULL)) { - gchar **output_lines, **old; - - output_lines = g_strsplit(output, "\n", 0); - g_free(output); - - old = output_lines; - while (*(output_lines++)) { - gchar **tmp = g_strsplit(*output_lines, ":", 0); - - if (tmp[1] && tmp[0]) { - tmp[1] = g_strchug(tmp[1]); - - get_str("vendor string", di->vendor); - get_str("X.Org version", di->version); - get_str("XFree86 version", di->version); - - if (g_str_has_prefix(tmp[0], "number of extensions")) { - int n; - - di->extensions = ""; - - for (n = atoi(tmp[1]); n; n--) { - di->extensions = g_strconcat(di->extensions, - g_strstrip(*(++output_lines)), - "=\n", - NULL); - } - g_strfreev(tmp); - - break; - } - } - - g_strfreev(tmp); - } - - g_strfreev(old); - } - - GdkScreen *screen = gdk_screen_get_default(); - - if (screen && GDK_IS_SCREEN(screen)) { - gint n_monitors = gdk_screen_get_n_monitors(screen); - gint i; - - di->monitors = ""; - for (i = 0; i < n_monitors; i++) { - GdkRectangle rect; - - gdk_screen_get_monitor_geometry(screen, i, &rect); - - di->monitors = g_strdup_printf("%sMonitor %d=%dx%d pixels\n", - di->monitors, i, rect.width, rect.height); - } - } else { - di->monitors = ""; - } -} - -static DisplayInfo * -computer_get_display(void) -{ - DisplayInfo *di = g_new0(DisplayInfo, 1); - - GdkScreen *screen = gdk_screen_get_default(); - - di->width = gdk_screen_get_width(screen); - di->height = gdk_screen_get_height(screen); - - get_glx_info(di); - get_x11_info(di); - - return di; -} diff --git a/arch/common/.svn/text-base/languages.h.svn-base b/arch/common/.svn/text-base/languages.h.svn-base deleted file mode 100644 index 71e05dab..00000000 --- a/arch/common/.svn/text-base/languages.h.svn-base +++ /dev/null @@ -1,102 +0,0 @@ -/* - * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, version 2. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ -void -scan_languages(OperatingSystem * os) -{ - FILE *locale; - gchar buf[512], *retval = ""; - - locale = popen("locale -va", "r"); - if (!locale) - return; - - gchar name[32]; - gchar *title = NULL, - *source = NULL, - *address = NULL, - *email = NULL, - *language = NULL, - *territory = NULL, - *revision = NULL, - *date = NULL, - *codeset = NULL; - - while (fgets(buf, 512, locale)) { - if (!strncmp(buf, "locale:", 7)) { - sscanf(buf, "locale: %s", name); - fgets(buf, 128, locale); - } else if (strchr(buf, '|')) { - gchar **tmp = g_strsplit(buf, "|", 2); - - tmp[0] = g_strstrip(tmp[0]); - - if (tmp[1]) { - tmp[1] = g_strstrip(tmp[1]); - - get_str("title", title); - get_str("source", source); - get_str("address", address); - get_str("email", email); - get_str("language", language); - get_str("territory", territory); - get_str("revision", revision); - get_str("date", date); - get_str("codeset", codeset); - } - - g_strfreev(tmp); - } else { - gchar *currlocale; - - retval = g_strdup_printf("%s$%s$%s=%s\n", retval, name, name, title); - - currlocale = g_strdup_printf("[Locale Information]\n" - "Name=%s (%s)\n" - "Source=%s\n" - "Address=%s\n" - "Email=%s\n" - "Language=%s\n" - "Territory=%s\n" - "Revision=%s\n" - "Date=%s\n" - "Codeset=%s\n", name, title, - source, address, email, language, - territory, revision, date, - codeset); - - g_hash_table_insert(moreinfo, g_strdup(name), currlocale); - - g_free(title); - g_free(source); - g_free(address); - g_free(email); - g_free(language); - g_free(territory); - g_free(revision); - g_free(date); - g_free(codeset); - - title = source = address = email = language = territory = \ - revision = date = codeset = NULL; - } - } - - fclose(locale); - - os->languages = retval; -} diff --git a/arch/common/.svn/text-base/md5.h.svn-base b/arch/common/.svn/text-base/md5.h.svn-base deleted file mode 100644 index 256d6c3b..00000000 --- a/arch/common/.svn/text-base/md5.h.svn-base +++ /dev/null @@ -1,67 +0,0 @@ -/* - * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, version 2. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include <md5.h> - -gchar * -benchmark_md5(void) -{ - struct MD5Context ctx; - guchar checksum[16]; - int i; - GTimer *timer = g_timer_new(); - gdouble elapsed = 0; - gchar src[65536], *tmpsrc; - glong srclen = 65536; - - tmpsrc = src; - - gchar *bdata_path; - - bdata_path = g_strdup_printf("%s/hardinfo/benchmark.data", - gbr_find_data_dir(PREFIX)); - if (!g_file_get_contents(bdata_path, &tmpsrc, NULL, NULL)) { - g_free(bdata_path); - return g_strdup("[Error]\n" - PREFIX "benchmark.data not found=\n"); - } - - shell_view_set_enabled(FALSE); - shell_status_update("Generating MD5 sum for 312MiB of data..."); - - for (i = 0; i <= 5000; i++) { - g_timer_start(timer); - - MD5Init(&ctx); - MD5Update(&ctx, (guchar*)tmpsrc, srclen); - MD5Final(checksum, &ctx); - - g_timer_stop(timer); - elapsed += g_timer_elapsed(timer, NULL); - - shell_status_set_percentage(i/50); - } - - g_timer_destroy(timer); - g_free(bdata_path); - - gchar *retval = g_strdup_printf("[Results <i>(in seconds; lower is better)</i>]\n" - "<b>This Machine</b>=<b>%.2f</b>\n", elapsed); - return benchmark_include_results(retval, "MD5"); -} - diff --git a/arch/common/.svn/text-base/printers.h.svn-base b/arch/common/.svn/text-base/printers.h.svn-base deleted file mode 100644 index 01beb5dd..00000000 --- a/arch/common/.svn/text-base/printers.h.svn-base +++ /dev/null @@ -1,81 +0,0 @@ -/* - * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, version 2. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -void -scan_printers(void) -{ - static GModule *cups = NULL; - static int (*cupsGetPrinters) (char ***printers) = NULL; - static char *(*cupsGetDefault) (void) = NULL; - static char *libcups[] = { "libcups", - "libcups.so", - "libcups.so.1", - "libcups.so.2", - NULL }; - - if (printer_list) - g_free(printer_list); - - if (!(cupsGetPrinters && cupsGetDefault)) { - int i; - - for (i = 0; libcups[i] != NULL; i++) { - cups = g_module_open(libcups[i], G_MODULE_BIND_LAZY); - if (cups) - break; - } - - if (!cups) { - printer_list = g_strdup("[Printers]\n" - "CUPS libraries cannot be found="); - return; - } - - if (!g_module_symbol(cups, "cupsGetPrinters", (gpointer) & cupsGetPrinters) - || !g_module_symbol(cups, "cupsGetDefault", - (gpointer) & cupsGetDefault)) { - printer_list = - g_strdup("[Printers]\n" - "No suitable CUPS library found="); - g_module_close(cups); - return; - } - } - - gchar **printers; - int noprinters, i; - const char *default_printer; - - noprinters = cupsGetPrinters(&printers); - default_printer = cupsGetDefault(); - - if (noprinters > 0) { - printer_list = g_strdup_printf("[Printers (CUPS)]\n"); - for (i = 0; i < noprinters; i++) { - printer_list = g_strconcat(printer_list, printers[i], - !strcmp(default_printer, - printers[i]) ? - "=<i>(Default)</i>\n" : "=\n", - NULL); - g_free(printers[i]); - } - } else { - printer_list = g_strdup("[Printers]\n" - "No printers found"); - } -} diff --git a/arch/common/.svn/text-base/sha1.h.svn-base b/arch/common/.svn/text-base/sha1.h.svn-base deleted file mode 100644 index 4bd07276..00000000 --- a/arch/common/.svn/text-base/sha1.h.svn-base +++ /dev/null @@ -1,67 +0,0 @@ -/* - * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, version 2. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ -#include <sha1.h> - -gchar * -benchmark_sha1(void) -{ - SHA1_CTX ctx; - guchar checksum[20]; - int i; - GTimer *timer = g_timer_new(); - gdouble elapsed = 0; - gchar src[65536], *tmpsrc; - glong srclen = 65536; - - tmpsrc = src; - - gchar *bdata_path; - - bdata_path = g_strdup_printf("%s/hardinfo/benchmark.data", - gbr_find_data_dir(PREFIX)); - - if (!g_file_get_contents(bdata_path, &tmpsrc, NULL, NULL)) { - g_free(bdata_path); - return g_strdup("[Error]\n" - PREFIX "benchmark.data not found=\n"); - } - - shell_view_set_enabled(FALSE); - shell_status_update("Generating SHA1 sum for 312MiB of data..."); - - for (i = 0; i <= 5000; i++) { - g_timer_start(timer); - - SHA1Init(&ctx); - SHA1Update(&ctx, (guchar*)tmpsrc, srclen); - SHA1Final(checksum, &ctx); - - g_timer_stop(timer); - elapsed += g_timer_elapsed(timer, NULL); - - shell_status_set_percentage(i/50); - } - - g_timer_destroy(timer); - g_free(bdata_path); - - gchar *retval = g_strdup_printf("[Results <i>(in seconds; lower is better)</i>]\n" - "<b>This Machine</b>=<b>%.2f</b>\n", elapsed); - return benchmark_include_results(retval, "SHA1"); -} - diff --git a/arch/common/.svn/text-base/users.h.svn-base b/arch/common/.svn/text-base/users.h.svn-base deleted file mode 100644 index 08acd97a..00000000 --- a/arch/common/.svn/text-base/users.h.svn-base +++ /dev/null @@ -1,63 +0,0 @@ -static gchar *sys_users = NULL, - *human_users = NULL; - -static gboolean -remove_users(gpointer key, gpointer value, gpointer data) -{ - if (!strncmp((gchar *) key, "USER", 4)) { - /* - * g_free((gchar *) key); - * g_free((GtkTreeIter *) value); - */ - return TRUE; - } - return FALSE; -} - -void scan_users(void) -{ - FILE *passwd; - char buffer[512]; - - passwd = fopen("/etc/passwd", "r"); - if (!passwd) - return; - - if (sys_users) { - g_free(sys_users); - g_free(human_users); - - g_hash_table_foreach_remove(moreinfo, remove_users, NULL); - } - - sys_users = g_strdup(""); - human_users = g_strdup(""); - - while (fgets(buffer, 512, passwd)) { - gchar **tmp; - gint uid; - - tmp = g_strsplit(buffer, ":", 0); - - gchar *key = g_strdup_printf("USER%s", tmp[0]); - gchar *val = g_strdup_printf("[User Information]\n" - "User ID=%s\n" - "Group ID=%s\n" - "Home directory=%s\n" - "Default shell=%s\n", - tmp[2], tmp[3], tmp[5], tmp[6]); - g_hash_table_insert(moreinfo, key, val); - - uid = atoi(tmp[2]); - strend(tmp[4], ','); - if (uid >= 1000 && uid <= 65530) { - human_users = g_strdup_printf("%s$%s$%s=%s\n", human_users, key, tmp[0], tmp[4]); - } else { - sys_users = g_strdup_printf("%s$%s$%s=%s\n", sys_users, key, tmp[0], tmp[4]); - } - - g_strfreev(tmp); - } - - fclose(passwd); -} diff --git a/arch/common/.svn/text-base/zlib.h.svn-base b/arch/common/.svn/text-base/zlib.h.svn-base deleted file mode 100644 index 2a1007ed..00000000 --- a/arch/common/.svn/text-base/zlib.h.svn-base +++ /dev/null @@ -1,90 +0,0 @@ -/* - * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, version 2. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -static gchar * -benchmark_zlib(void) -{ - GModule *libz; - static gulong (*compressBound) (glong srclen) = NULL; - static gint (*compress) (gchar *dst, glong *dstlen, - const gchar *src, glong srclen) = NULL; - - if (!(compress && compressBound)) { - libz = g_module_open("libz", G_MODULE_BIND_LAZY); - if (!libz) { - libz = g_module_open("/lib/libz.so", G_MODULE_BIND_LAZY); - if (!libz) { - g_warning("Cannot load ZLib: %s", g_module_error()); - return g_strdup("[Error]\n" - "ZLib not found="); - } - } - - if (!g_module_symbol(libz, "compress", (gpointer) & compress) - || !g_module_symbol(libz, "compressBound", (gpointer) & compressBound)) { - - g_module_close(libz); - return g_strdup("[Error]\n" - "Invalid Z-Lib found="); - } - } - - shell_view_set_enabled(FALSE); - - int i; - GTimer *timer = g_timer_new(); - gdouble elapsed = 0; - gchar src[65536], *tmpsrc; - glong srclen = 65536; - gchar *bdata_path; - - bdata_path = g_strdup_printf("%s/hardinfo/benchmark.data", - gbr_find_data_dir(PREFIX)); - - if (!g_file_get_contents(bdata_path, &tmpsrc, NULL, NULL)) { - g_free(bdata_path); - return g_strdup("[Error]\n" - PREFIX "benchmark.data not found=\n"); - } - - shell_status_update("Compressing 64MB with default options..."); - - for (i = 0; i <= 1000; i++) { - g_timer_start(timer); - - gchar *dst; - glong dstlen = compressBound(srclen); - - dst = g_new0(gchar, dstlen); - compress(dst, &dstlen, src, srclen); - - g_timer_stop(timer); - elapsed += g_timer_elapsed(timer, NULL); - g_free(dst); - - shell_status_set_percentage(i/10); - } - - g_timer_destroy(timer); - g_free(bdata_path); - - gchar *retval = g_strdup_printf("[Results <i>(in seconds; lower is better)</i>]\n" - "<b>This Machine</b>=<b>%.2f</b>\n", elapsed); - return benchmark_include_results(retval, "ZLib"); -} - diff --git a/arch/common/blowfish.h b/arch/common/blowfish.h index ad4bdb92..ceec7a96 100644 --- a/arch/common/blowfish.h +++ b/arch/common/blowfish.h @@ -1,6 +1,6 @@ /* * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> + * Copyright (C) 2003-2007 Leandro A. F. Pereira <leandro@linuxmag.com.br> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,7 +18,7 @@ #include <blowfish.h> -gchar * +static void benchmark_fish(void) { BLOWFISH_CTX ctx; @@ -36,17 +36,14 @@ benchmark_fish(void) gchar *bdata_path; - bdata_path = g_strdup_printf("%s/hardinfo/benchmark.data", - gbr_find_data_dir(PREFIX)); - + bdata_path = g_build_filename(params.path_data, "benchmark.data", NULL); if (!g_file_get_contents(bdata_path, &tmpsrc, NULL, NULL)) { g_free(bdata_path); - return g_strdup("[Error]\n" - PREFIX "benchmark.data not found=\n"); + return; } shell_view_set_enabled(FALSE); - shell_status_update("Benchmarking..."); + shell_status_update("Performing Blowfish benchmark..."); for (i = 0; i <= 50000; i++) { g_timer_start(timer); @@ -63,8 +60,6 @@ benchmark_fish(void) g_timer_destroy(timer); g_free(bdata_path); - - gchar *retval = g_strdup_printf("[Results <i>(in seconds; lower is better)</i>]\n" - "<b>This Machine</b>=<b>%.2f</b>\n", elapsed); - return benchmark_include_results(retval, "Blowfish"); + + bench_results[BENCHMARK_BLOWFISH] = elapsed; } diff --git a/arch/common/display.h b/arch/common/display.h index 6731e3e3..b4fe643e 100644 --- a/arch/common/display.h +++ b/arch/common/display.h @@ -1,6 +1,6 @@ /* * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> + * Copyright (C) 2003-2007 Leandro A. F. Pereira <leandro@linuxmag.com.br> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,15 +21,14 @@ get_glx_info(DisplayInfo *di) { gchar *output; if (g_spawn_command_line_sync("glxinfo", &output, NULL, NULL, NULL)) { - gchar **output_lines, **old; - - output_lines = g_strsplit(output, "\n", 0); - g_free(output); + gchar **output_lines; + gint i = 0; - old = output_lines; - while (*(++output_lines)) { - if (strstr(*output_lines, "OpenGL")) { - gchar **tmp = g_strsplit(*output_lines, ":", 0); + for (output_lines = g_strsplit(output, "\n", 0); + output_lines && output_lines[i]; + i++) { + if (strstr(output_lines[i], "OpenGL")) { + gchar **tmp = g_strsplit(output_lines[i], ":", 0); tmp[1] = g_strchug(tmp[1]); @@ -38,10 +37,13 @@ get_glx_info(DisplayInfo *di) get_str("OpenGL version str", di->ogl_version); g_strfreev(tmp); + } else if (strstr(output_lines[i], "direct rendering: Yes")) { + di->dri = TRUE; } } - g_strfreev(old); + g_free(output); + g_strfreev(output_lines); if (!di->ogl_vendor) di->ogl_vendor = "Unknown"; @@ -126,9 +128,13 @@ computer_get_display(void) DisplayInfo *di = g_new0(DisplayInfo, 1); GdkScreen *screen = gdk_screen_get_default(); - - di->width = gdk_screen_get_width(screen); - di->height = gdk_screen_get_height(screen); + + if (screen && GDK_IS_SCREEN(screen)) { + di->width = gdk_screen_get_width(screen); + di->height = gdk_screen_get_height(screen); + } else { + di->width = di->height = 0; + } get_glx_info(di); get_x11_info(di); diff --git a/arch/common/fib.h b/arch/common/fib.h index 493cfd0f..645002fa 100644 --- a/arch/common/fib.h +++ b/arch/common/fib.h @@ -1,6 +1,6 @@ /* * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> + * Copyright (C) 2003-2007 Leandro A. F. Pereira <leandro@linuxmag.com.br> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,35 +16,33 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -static unsigned long long -fib(unsigned long long n) +static gulong +fib(gulong n) { if (n == 0) return 0; - else if (n == 1 || n == 2) + else if (n <= 2) return 1; return fib(n - 1) + fib(n - 2); } -static gchar * +static void benchmark_fib(void) { GTimer *timer = g_timer_new(); - gdouble elapsed = 0; + gdouble elapsed; shell_view_set_enabled(FALSE); - shell_status_update("Calculating the 42<sup>th</sup> Fibonacci number..."); + shell_status_update("Calculating the 42nd Fibonacci number..."); + g_timer_reset(timer); g_timer_start(timer); - fib(42); /* the answer? :) */ - g_timer_stop(timer); - elapsed = g_timer_elapsed(timer, NULL); + fib(42); + g_timer_stop(timer); + elapsed = g_timer_elapsed(timer, NULL); g_timer_destroy(timer); - - gchar *retval = g_strdup_printf("[Results <i>(in seconds; lower is better)</i>]\n" - "<b>This Machine</b>=<b>%.2f</b>\n", elapsed); - return benchmark_include_results(retval, "Fibonacci"); + + bench_results[BENCHMARK_FIB] = elapsed; } - diff --git a/arch/common/languages.h b/arch/common/languages.h index 71e05dab..786b829f 100644 --- a/arch/common/languages.h +++ b/arch/common/languages.h @@ -1,6 +1,6 @@ /* * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> + * Copyright (C) 2003-2007 Leandro A. F. Pereira <leandro@linuxmag.com.br> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,6 +15,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + void scan_languages(OperatingSystem * os) { @@ -65,6 +66,7 @@ scan_languages(OperatingSystem * os) retval = g_strdup_printf("%s$%s$%s=%s\n", retval, name, name, title); +#define FIELD(f) f ? f : "(Unknown)" currlocale = g_strdup_printf("[Locale Information]\n" "Name=%s (%s)\n" "Source=%s\n" @@ -74,10 +76,13 @@ scan_languages(OperatingSystem * os) "Territory=%s\n" "Revision=%s\n" "Date=%s\n" - "Codeset=%s\n", name, title, - source, address, email, language, - territory, revision, date, - codeset); + "Codeset=%s\n", + FIELD(name), FIELD(title), + FIELD(source), FIELD(address), + FIELD(email), FIELD(language), + FIELD(territory), FIELD(revision), + FIELD(date), FIELD(codeset)); +#undef FIELD g_hash_table_insert(moreinfo, g_strdup(name), currlocale); diff --git a/arch/common/md5.h b/arch/common/md5.h index 256d6c3b..95d683bd 100644 --- a/arch/common/md5.h +++ b/arch/common/md5.h @@ -1,6 +1,6 @@ /* * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> + * Copyright (C) 2003-2007 Leandro A. F. Pereira <leandro@linuxmag.com.br> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,7 +18,7 @@ #include <md5.h> -gchar * +static void benchmark_md5(void) { struct MD5Context ctx; @@ -33,12 +33,10 @@ benchmark_md5(void) gchar *bdata_path; - bdata_path = g_strdup_printf("%s/hardinfo/benchmark.data", - gbr_find_data_dir(PREFIX)); + bdata_path = g_build_filename(params.path_data, "benchmark.data", NULL); if (!g_file_get_contents(bdata_path, &tmpsrc, NULL, NULL)) { g_free(bdata_path); - return g_strdup("[Error]\n" - PREFIX "benchmark.data not found=\n"); + return; } shell_view_set_enabled(FALSE); @@ -59,9 +57,7 @@ benchmark_md5(void) g_timer_destroy(timer); g_free(bdata_path); - - gchar *retval = g_strdup_printf("[Results <i>(in seconds; lower is better)</i>]\n" - "<b>This Machine</b>=<b>%.2f</b>\n", elapsed); - return benchmark_include_results(retval, "MD5"); + + bench_results[BENCHMARK_MD5] = 312.0 / elapsed; } diff --git a/arch/common/printers.h b/arch/common/printers.h index 01beb5dd..3daf28e6 100644 --- a/arch/common/printers.h +++ b/arch/common/printers.h @@ -1,6 +1,6 @@ /* * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> + * Copyright (C) 2003-2007 Leandro A. F. Pereira <leandro@linuxmag.com.br> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,11 +17,12 @@ */ void -scan_printers(void) +__scan_printers(void) { static GModule *cups = NULL; static int (*cupsGetPrinters) (char ***printers) = NULL; static char *(*cupsGetDefault) (void) = NULL; + static char *libcups[] = { "libcups", "libcups.so", "libcups.so.1", @@ -47,11 +48,9 @@ scan_printers(void) } if (!g_module_symbol(cups, "cupsGetPrinters", (gpointer) & cupsGetPrinters) - || !g_module_symbol(cups, "cupsGetDefault", - (gpointer) & cupsGetDefault)) { - printer_list = - g_strdup("[Printers]\n" - "No suitable CUPS library found="); + || !g_module_symbol(cups, "cupsGetDefault", (gpointer) & cupsGetDefault)) { + printer_list = g_strdup("[Printers]\n" + "No suitable CUPS library found="); g_module_close(cups); return; } @@ -63,19 +62,22 @@ scan_printers(void) noprinters = cupsGetPrinters(&printers); default_printer = cupsGetDefault(); - + + if (!default_printer) { + default_printer = ""; + } + if (noprinters > 0) { printer_list = g_strdup_printf("[Printers (CUPS)]\n"); for (i = 0; i < noprinters; i++) { printer_list = g_strconcat(printer_list, printers[i], - !strcmp(default_printer, - printers[i]) ? + g_str_equal(default_printer, printers[i]) ? "=<i>(Default)</i>\n" : "=\n", NULL); g_free(printers[i]); } } else { printer_list = g_strdup("[Printers]\n" - "No printers found"); + "No printers found=\n"); } } diff --git a/arch/common/.svn/text-base/fib.h.svn-base b/arch/common/raytrace.h index 493cfd0f..af9f2afa 100644 --- a/arch/common/.svn/text-base/fib.h.svn-base +++ b/arch/common/raytrace.h @@ -1,6 +1,6 @@ /* * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> + * Copyright (C) 2003-2007 Leandro A. F. Pereira <leandro@linuxmag.com.br> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,35 +16,31 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -static unsigned long long -fib(unsigned long long n) -{ - if (n == 0) - return 0; - else if (n == 1 || n == 2) - return 1; - return fib(n - 1) + fib(n - 2); -} +void fbench(); /* fbench.c */ -static gchar * -benchmark_fib(void) +static void +benchmark_raytrace(void) { + int i; GTimer *timer = g_timer_new(); gdouble elapsed = 0; shell_view_set_enabled(FALSE); - shell_status_update("Calculating the 42<sup>th</sup> Fibonacci number..."); + shell_status_update("Performing John Walker's FBENCH..."); - g_timer_start(timer); - fib(42); /* the answer? :) */ - g_timer_stop(timer); - - elapsed = g_timer_elapsed(timer, NULL); + for (i = 0; i <= 1000; i++) { + g_timer_start(timer); + + fbench(); + + g_timer_stop(timer); + elapsed += g_timer_elapsed(timer, NULL); + + shell_status_set_percentage(i/10); + } g_timer_destroy(timer); - - gchar *retval = g_strdup_printf("[Results <i>(in seconds; lower is better)</i>]\n" - "<b>This Machine</b>=<b>%.2f</b>\n", elapsed); - return benchmark_include_results(retval, "Fibonacci"); + + bench_results[BENCHMARK_RAYTRACE] = elapsed; } diff --git a/arch/common/sha1.h b/arch/common/sha1.h index 4bd07276..3b7f7652 100644 --- a/arch/common/sha1.h +++ b/arch/common/sha1.h @@ -1,6 +1,6 @@ /* * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> + * Copyright (C) 2003-2007 Leandro A. F. Pereira <leandro@linuxmag.com.br> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,7 +17,7 @@ */ #include <sha1.h> -gchar * +static void benchmark_sha1(void) { SHA1_CTX ctx; @@ -32,13 +32,10 @@ benchmark_sha1(void) gchar *bdata_path; - bdata_path = g_strdup_printf("%s/hardinfo/benchmark.data", - gbr_find_data_dir(PREFIX)); - + bdata_path = g_build_filename(params.path_data, "benchmark.data", NULL); if (!g_file_get_contents(bdata_path, &tmpsrc, NULL, NULL)) { g_free(bdata_path); - return g_strdup("[Error]\n" - PREFIX "benchmark.data not found=\n"); + return; } shell_view_set_enabled(FALSE); @@ -59,9 +56,7 @@ benchmark_sha1(void) g_timer_destroy(timer); g_free(bdata_path); - - gchar *retval = g_strdup_printf("[Results <i>(in seconds; lower is better)</i>]\n" - "<b>This Machine</b>=<b>%.2f</b>\n", elapsed); - return benchmark_include_results(retval, "SHA1"); + + bench_results[BENCHMARK_SHA1] = 312.0 / elapsed; } diff --git a/arch/common/users.h b/arch/common/users.h index 08acd97a..84cec9d9 100644 --- a/arch/common/users.h +++ b/arch/common/users.h @@ -14,7 +14,8 @@ remove_users(gpointer key, gpointer value, gpointer data) return FALSE; } -void scan_users(void) +static void +scan_users_do(void) { FILE *passwd; char buffer[512]; diff --git a/arch/common/zlib.h b/arch/common/zlib.h index 2a1007ed..96d20944 100644 --- a/arch/common/zlib.h +++ b/arch/common/zlib.h @@ -1,6 +1,6 @@ /* * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> + * Copyright (C) 2003-2007 Leandro A. F. Pereira <leandro@linuxmag.com.br> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -static gchar * +static void benchmark_zlib(void) { GModule *libz; @@ -27,11 +27,10 @@ benchmark_zlib(void) if (!(compress && compressBound)) { libz = g_module_open("libz", G_MODULE_BIND_LAZY); if (!libz) { - libz = g_module_open("/lib/libz.so", G_MODULE_BIND_LAZY); + libz = g_module_open("/usr/lib/libz.so", G_MODULE_BIND_LAZY); if (!libz) { g_warning("Cannot load ZLib: %s", g_module_error()); - return g_strdup("[Error]\n" - "ZLib not found="); + return; } } @@ -39,8 +38,7 @@ benchmark_zlib(void) || !g_module_symbol(libz, "compressBound", (gpointer) & compressBound)) { g_module_close(libz); - return g_strdup("[Error]\n" - "Invalid Z-Lib found="); + return; } } @@ -53,13 +51,10 @@ benchmark_zlib(void) glong srclen = 65536; gchar *bdata_path; - bdata_path = g_strdup_printf("%s/hardinfo/benchmark.data", - gbr_find_data_dir(PREFIX)); - + bdata_path = g_build_filename(params.path_data, "benchmark.data", NULL); if (!g_file_get_contents(bdata_path, &tmpsrc, NULL, NULL)) { g_free(bdata_path); - return g_strdup("[Error]\n" - PREFIX "benchmark.data not found=\n"); + return; } shell_status_update("Compressing 64MB with default options..."); @@ -82,9 +77,6 @@ benchmark_zlib(void) g_timer_destroy(timer); g_free(bdata_path); - - gchar *retval = g_strdup_printf("[Results <i>(in seconds; lower is better)</i>]\n" - "<b>This Machine</b>=<b>%.2f</b>\n", elapsed); - return benchmark_include_results(retval, "ZLib"); + + bench_results[BENCHMARK_ZLIB] = 65536.0 / elapsed; } - diff --git a/arch/linux/.svn/README.txt b/arch/linux/.svn/README.txt deleted file mode 100644 index 271a8ce9..00000000 --- a/arch/linux/.svn/README.txt +++ /dev/null @@ -1,2 +0,0 @@ -This is a Subversion working copy administrative directory. -Visit http://subversion.tigris.org/ for more information. diff --git a/arch/linux/.svn/empty-file b/arch/linux/.svn/empty-file deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/.svn/empty-file +++ /dev/null diff --git a/arch/linux/.svn/entries b/arch/linux/.svn/entries deleted file mode 100644 index 5a69dcd8..00000000 --- a/arch/linux/.svn/entries +++ /dev/null @@ -1,47 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<wc-entries - xmlns="svn:"> -<entry - committed-rev="9" - name="" - committed-date="2006-03-07T18:26:23.507991Z" - url="svn+ssh://lafp@svn.berlios.de/svnroot/repos/hardinfo/trunk/hardinfo2/arch/linux" - last-author="lafp" - kind="dir" - uuid="03931a0e-0c0b-0410-87e6-c9e79dddb921" - repos="svn+ssh://lafp@svn.berlios.de/svnroot/repos/hardinfo" - revision="9"/> -<entry - name="parisc" - kind="dir"/> -<entry - name="ppc" - kind="dir"/> -<entry - name="m68k" - kind="dir"/> -<entry - name="x86" - kind="dir"/> -<entry - name="armv4l" - kind="dir"/> -<entry - name="common" - kind="dir"/> -<entry - name="mips" - kind="dir"/> -<entry - name="sparc" - kind="dir"/> -<entry - committed-rev="1" - name="x86_64" - text-time="2006-05-20T14:29:28.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="6a53d0a8e77cb5fc139bb4eb46911fa9" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:28.000000Z"/> -</wc-entries> diff --git a/arch/linux/.svn/format b/arch/linux/.svn/format deleted file mode 100644 index b8626c4c..00000000 --- a/arch/linux/.svn/format +++ /dev/null @@ -1 +0,0 @@ -4 diff --git a/arch/linux/.svn/prop-base/x86_64.svn-base b/arch/linux/.svn/prop-base/x86_64.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/.svn/prop-base/x86_64.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/.svn/props/x86_64.svn-work b/arch/linux/.svn/props/x86_64.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/.svn/props/x86_64.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/.svn/text-base/x86_64.svn-base b/arch/linux/.svn/text-base/x86_64.svn-base deleted file mode 100644 index f3c08968..00000000 --- a/arch/linux/.svn/text-base/x86_64.svn-base +++ /dev/null @@ -1 +0,0 @@ -link x86
\ No newline at end of file diff --git a/arch/linux/alpha/alsa.h b/arch/linux/alpha/alsa.h new file mode 120000 index 00000000..ede8a364 --- /dev/null +++ b/arch/linux/alpha/alsa.h @@ -0,0 +1 @@ +../../../arch/linux/common/alsa.h
\ No newline at end of file diff --git a/arch/linux/alpha/boots.h b/arch/linux/alpha/boots.h new file mode 120000 index 00000000..97384500 --- /dev/null +++ b/arch/linux/alpha/boots.h @@ -0,0 +1 @@ +../../../arch/linux/common/boots.h
\ No newline at end of file diff --git a/arch/linux/alpha/devmemory.h b/arch/linux/alpha/devmemory.h new file mode 120000 index 00000000..f8a833e7 --- /dev/null +++ b/arch/linux/alpha/devmemory.h @@ -0,0 +1 @@ +../../../arch/linux/common/devmemory.h
\ No newline at end of file diff --git a/arch/linux/alpha/filesystem.h b/arch/linux/alpha/filesystem.h new file mode 120000 index 00000000..d884bcd0 --- /dev/null +++ b/arch/linux/alpha/filesystem.h @@ -0,0 +1 @@ +../../../arch/linux/common/filesystem.h
\ No newline at end of file diff --git a/arch/linux/alpha/inputdevices.h b/arch/linux/alpha/inputdevices.h new file mode 120000 index 00000000..0f594231 --- /dev/null +++ b/arch/linux/alpha/inputdevices.h @@ -0,0 +1 @@ +../../../arch/linux/common/inputdevices.h
\ No newline at end of file diff --git a/arch/linux/alpha/loadavg.h b/arch/linux/alpha/loadavg.h new file mode 120000 index 00000000..1f64e107 --- /dev/null +++ b/arch/linux/alpha/loadavg.h @@ -0,0 +1 @@ +../../../arch/linux/common/loadavg.h
\ No newline at end of file diff --git a/arch/linux/alpha/memory.h b/arch/linux/alpha/memory.h new file mode 120000 index 00000000..64c6e0ed --- /dev/null +++ b/arch/linux/alpha/memory.h @@ -0,0 +1 @@ +../../../arch/linux/common/memory.h
\ No newline at end of file diff --git a/arch/linux/alpha/modules.h b/arch/linux/alpha/modules.h new file mode 120000 index 00000000..d21c9a20 --- /dev/null +++ b/arch/linux/alpha/modules.h @@ -0,0 +1 @@ +../../../arch/linux/common/modules.h
\ No newline at end of file diff --git a/arch/linux/alpha/net.h b/arch/linux/alpha/net.h new file mode 120000 index 00000000..488b5ae3 --- /dev/null +++ b/arch/linux/alpha/net.h @@ -0,0 +1 @@ +../../../arch/linux/common/net.h
\ No newline at end of file diff --git a/arch/linux/alpha/nfs.h b/arch/linux/alpha/nfs.h new file mode 120000 index 00000000..73e0b8c9 --- /dev/null +++ b/arch/linux/alpha/nfs.h @@ -0,0 +1 @@ +../../../arch/linux/common/nfs.h
\ No newline at end of file diff --git a/arch/linux/alpha/os.h b/arch/linux/alpha/os.h new file mode 120000 index 00000000..44051626 --- /dev/null +++ b/arch/linux/alpha/os.h @@ -0,0 +1 @@ +../../../arch/linux/common/os.h
\ No newline at end of file diff --git a/arch/linux/alpha/pci.h b/arch/linux/alpha/pci.h new file mode 120000 index 00000000..8df04a0e --- /dev/null +++ b/arch/linux/alpha/pci.h @@ -0,0 +1 @@ +../../../arch/linux/common/pci.h
\ No newline at end of file diff --git a/arch/linux/ppc/.svn/text-base/processor.h.svn-base b/arch/linux/alpha/processor.h index f4ff5b0e..081a4f7d 100644 --- a/arch/linux/ppc/.svn/text-base/processor.h.svn-base +++ b/arch/linux/alpha/processor.h @@ -16,8 +16,14 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -static Processor * -computer_get_processor(void) +struct _Processor { + gchar *model_name; + gfloat bogomips; + gchar *strmodel; +}; + +static GSList * +__scan_processors(void) { Processor *processor; FILE *cpuinfo; @@ -35,39 +41,35 @@ computer_get_processor(void) tmp[0] = g_strstrip(tmp[0]); tmp[1] = g_strstrip(tmp[1]); - get_str("cpu", processor->model_name); - get_str("machine", processor->vendor_id); - get_int("L2 cache", processor->cache_size); - get_float("clock", processor->cpu_mhz); - get_float("bogomips", processor->bogomips); + get_str("cpu model", processor->model_name); + get_float("BogoMIPS", processor->bogomips); + get_str("platform string", processor->strmodel); } g_strfreev(tmp); } - gchar *tmp = g_strconcat("PowerPC ", processor->model_name, NULL); + gchar *tmp = g_strconcat("Alpha ", processor->model_name, NULL); g_free(processor->model_name); processor->model_name = tmp; fclose(cpuinfo); - return processor; + return g_slist_append(NULL, processor); } static gchar * -processor_get_info(Processor *processor) +processor_get_info(GSList *processors) { + Processor *processor = (Processor *)processors->data; + return g_strdup_printf("[Processor]\n" - "Machine=%s\n" - "CPU=%s\n" - "L2 Cache=%.2f\n" - "Frequency=%.2fMHz\n" - "BogoMips=%.2f" + "Model=%s\n" + "Platform String=%s\n" + "BogoMIPS=%.2f" "Byte Order=%s\n", - processor->vendor_id, processor->model_name, - processor->cache_size, - processor->cpu_mhz, + processor->strmodel, processor->bogomips, #if G_BYTE_ORDER == G_LITTLE_ENDIAN "Little Endian" diff --git a/arch/linux/alpha/samba.h b/arch/linux/alpha/samba.h new file mode 120000 index 00000000..ebab9b11 --- /dev/null +++ b/arch/linux/alpha/samba.h @@ -0,0 +1 @@ +../../../arch/linux/common/samba.h
\ No newline at end of file diff --git a/arch/linux/alpha/sensors.h b/arch/linux/alpha/sensors.h new file mode 120000 index 00000000..3b799377 --- /dev/null +++ b/arch/linux/alpha/sensors.h @@ -0,0 +1 @@ +../../../arch/linux/common/sensors.h
\ No newline at end of file diff --git a/arch/linux/alpha/storage.h b/arch/linux/alpha/storage.h new file mode 120000 index 00000000..3ea886ce --- /dev/null +++ b/arch/linux/alpha/storage.h @@ -0,0 +1 @@ +../../../arch/linux/common/storage.h
\ No newline at end of file diff --git a/arch/linux/alpha/uptime.h b/arch/linux/alpha/uptime.h new file mode 120000 index 00000000..a5bac980 --- /dev/null +++ b/arch/linux/alpha/uptime.h @@ -0,0 +1 @@ +../../../arch/linux/common/uptime.h
\ No newline at end of file diff --git a/arch/linux/alpha/usb.h b/arch/linux/alpha/usb.h new file mode 120000 index 00000000..aee3046c --- /dev/null +++ b/arch/linux/alpha/usb.h @@ -0,0 +1 @@ +../../../arch/linux/common/usb.h
\ No newline at end of file diff --git a/arch/linux/armv4l/.svn/README.txt b/arch/linux/armv4l/.svn/README.txt deleted file mode 100644 index 271a8ce9..00000000 --- a/arch/linux/armv4l/.svn/README.txt +++ /dev/null @@ -1,2 +0,0 @@ -This is a Subversion working copy administrative directory. -Visit http://subversion.tigris.org/ for more information. diff --git a/arch/linux/armv4l/.svn/empty-file b/arch/linux/armv4l/.svn/empty-file deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/armv4l/.svn/empty-file +++ /dev/null diff --git a/arch/linux/armv4l/.svn/entries b/arch/linux/armv4l/.svn/entries deleted file mode 100644 index b43822b6..00000000 --- a/arch/linux/armv4l/.svn/entries +++ /dev/null @@ -1,156 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<wc-entries - xmlns="svn:"> -<entry - committed-rev="16" - name="" - committed-date="2006-05-28T10:40:24.784981Z" - url="svn+ssh://lafp@svn.berlios.de/svnroot/repos/hardinfo/trunk/hardinfo2/arch/linux/armv4l" - last-author="lafp" - kind="dir" - repos="svn+ssh://lafp@svn.berlios.de/svnroot/repos/hardinfo" - revision="16"/> -<entry - committed-rev="16" - name="usb.h" - text-time="2006-05-28T10:27:47.000000Z" - committed-date="2006-05-28T10:40:24.784981Z" - checksum="0ed17ec7082ecf81bc512f4d2add7bec" - last-author="lafp" - kind="file" - prop-time="2006-05-28T10:32:37.000000Z"/> -<entry - committed-rev="16" - name="sensors.h" - text-time="2006-05-28T10:27:47.000000Z" - committed-date="2006-05-28T10:40:24.784981Z" - checksum="ba83966be8f142e8f9fbed44bfc77b7a" - last-author="lafp" - kind="file" - prop-time="2006-05-28T10:32:37.000000Z"/> -<entry - committed-rev="16" - name="inputdevices.h" - text-time="2006-05-28T10:27:47.000000Z" - committed-date="2006-05-28T10:40:24.784981Z" - checksum="1307b7aff245fa7fba84aa91f08d27fc" - last-author="lafp" - kind="file" - prop-time="2006-05-28T10:32:37.000000Z"/> -<entry - committed-rev="16" - name="uptime.h" - text-time="2006-05-28T10:27:47.000000Z" - committed-date="2006-05-28T10:40:24.784981Z" - checksum="760f1adef4fbcec7d74200abc3a4f6eb" - last-author="lafp" - kind="file" - prop-time="2006-05-28T10:32:37.000000Z"/> -<entry - committed-rev="16" - name="storage.h" - text-time="2006-05-28T10:27:47.000000Z" - committed-date="2006-05-28T10:40:24.784981Z" - checksum="602ef4aa9053cd983170660f53334cef" - last-author="lafp" - kind="file" - prop-time="2006-05-28T10:32:37.000000Z"/> -<entry - committed-rev="16" - name="memory.h" - text-time="2006-05-28T10:27:47.000000Z" - committed-date="2006-05-28T10:40:24.784981Z" - checksum="765f1eed8d98b9bbb06c4c034ce9fa32" - last-author="lafp" - kind="file" - prop-time="2006-05-28T10:32:37.000000Z"/> -<entry - committed-rev="16" - name="modules.h" - text-time="2006-05-28T10:27:47.000000Z" - committed-date="2006-05-28T10:40:24.784981Z" - checksum="45dfbaaabb31981ac06e021773429228" - last-author="lafp" - kind="file" - prop-time="2006-05-28T10:32:37.000000Z"/> -<entry - committed-rev="16" - name="pci.h" - text-time="2006-05-28T10:27:47.000000Z" - committed-date="2006-05-28T10:40:24.784981Z" - checksum="cab1a2936974aed489c107f3643b3484" - last-author="lafp" - kind="file" - prop-time="2006-05-28T10:32:37.000000Z"/> -<entry - committed-rev="16" - name="loadavg.h" - text-time="2006-05-28T10:27:47.000000Z" - committed-date="2006-05-28T10:40:24.784981Z" - checksum="1c83a008e883018ff1092781358ec2da" - last-author="lafp" - kind="file" - prop-time="2006-05-28T10:32:37.000000Z"/> -<entry - committed-rev="16" - name="processor.h" - text-time="2006-05-28T10:32:28.000000Z" - committed-date="2006-05-28T10:40:24.784981Z" - checksum="4b8c2f74f5ec835ccb17253235b789b5" - last-author="lafp" - kind="file"/> -<entry - committed-rev="16" - name="alsa.h" - text-time="2006-05-28T10:27:47.000000Z" - committed-date="2006-05-28T10:40:24.784981Z" - checksum="dc249687377b2de88793ee09bf54f1f1" - last-author="lafp" - kind="file" - prop-time="2006-05-28T10:32:37.000000Z"/> -<entry - committed-rev="16" - name="os.h" - text-time="2006-05-28T10:27:47.000000Z" - committed-date="2006-05-28T10:40:24.784981Z" - checksum="048c3f4b338d765be4f10b5067d8b50e" - last-author="lafp" - kind="file" - prop-time="2006-05-28T10:32:37.000000Z"/> -<entry - committed-rev="16" - name="samba.h" - text-time="2006-05-28T10:27:47.000000Z" - committed-date="2006-05-28T10:40:24.784981Z" - checksum="b541109072721d735717a33724ce9127" - last-author="lafp" - kind="file" - prop-time="2006-05-28T10:32:37.000000Z"/> -<entry - committed-rev="16" - name="filesystem.h" - text-time="2006-05-28T10:27:47.000000Z" - committed-date="2006-05-28T10:40:24.784981Z" - checksum="7f23b37be4cf5009414843bfe5c4e450" - last-author="lafp" - kind="file" - prop-time="2006-05-28T10:32:37.000000Z"/> -<entry - committed-rev="16" - name="nfs.h" - text-time="2006-05-28T10:27:47.000000Z" - committed-date="2006-05-28T10:40:24.784981Z" - checksum="382976a6eab28131079a346dd16edcd7" - last-author="lafp" - kind="file" - prop-time="2006-05-28T10:32:37.000000Z"/> -<entry - committed-rev="16" - name="net.h" - text-time="2006-05-28T10:27:47.000000Z" - committed-date="2006-05-28T10:40:24.784981Z" - checksum="22e5b201692010dee02e9562ce6cba1b" - last-author="lafp" - kind="file" - prop-time="2006-05-28T10:32:37.000000Z"/> -</wc-entries> diff --git a/arch/linux/armv4l/.svn/format b/arch/linux/armv4l/.svn/format deleted file mode 100644 index b8626c4c..00000000 --- a/arch/linux/armv4l/.svn/format +++ /dev/null @@ -1 +0,0 @@ -4 diff --git a/arch/linux/armv4l/.svn/prop-base/alsa.h.svn-base b/arch/linux/armv4l/.svn/prop-base/alsa.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/armv4l/.svn/prop-base/alsa.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/armv4l/.svn/prop-base/filesystem.h.svn-base b/arch/linux/armv4l/.svn/prop-base/filesystem.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/armv4l/.svn/prop-base/filesystem.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/armv4l/.svn/prop-base/inputdevices.h.svn-base b/arch/linux/armv4l/.svn/prop-base/inputdevices.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/armv4l/.svn/prop-base/inputdevices.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/armv4l/.svn/prop-base/loadavg.h.svn-base b/arch/linux/armv4l/.svn/prop-base/loadavg.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/armv4l/.svn/prop-base/loadavg.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/armv4l/.svn/prop-base/memory.h.svn-base b/arch/linux/armv4l/.svn/prop-base/memory.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/armv4l/.svn/prop-base/memory.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/armv4l/.svn/prop-base/modules.h.svn-base b/arch/linux/armv4l/.svn/prop-base/modules.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/armv4l/.svn/prop-base/modules.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/armv4l/.svn/prop-base/net.h.svn-base b/arch/linux/armv4l/.svn/prop-base/net.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/armv4l/.svn/prop-base/net.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/armv4l/.svn/prop-base/nfs.h.svn-base b/arch/linux/armv4l/.svn/prop-base/nfs.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/armv4l/.svn/prop-base/nfs.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/armv4l/.svn/prop-base/os.h.svn-base b/arch/linux/armv4l/.svn/prop-base/os.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/armv4l/.svn/prop-base/os.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/armv4l/.svn/prop-base/pci.h.svn-base b/arch/linux/armv4l/.svn/prop-base/pci.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/armv4l/.svn/prop-base/pci.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/armv4l/.svn/prop-base/samba.h.svn-base b/arch/linux/armv4l/.svn/prop-base/samba.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/armv4l/.svn/prop-base/samba.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/armv4l/.svn/prop-base/sensors.h.svn-base b/arch/linux/armv4l/.svn/prop-base/sensors.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/armv4l/.svn/prop-base/sensors.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/armv4l/.svn/prop-base/storage.h.svn-base b/arch/linux/armv4l/.svn/prop-base/storage.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/armv4l/.svn/prop-base/storage.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/armv4l/.svn/prop-base/uptime.h.svn-base b/arch/linux/armv4l/.svn/prop-base/uptime.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/armv4l/.svn/prop-base/uptime.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/armv4l/.svn/prop-base/usb.h.svn-base b/arch/linux/armv4l/.svn/prop-base/usb.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/armv4l/.svn/prop-base/usb.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/armv4l/.svn/props/alsa.h.svn-work b/arch/linux/armv4l/.svn/props/alsa.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/armv4l/.svn/props/alsa.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/armv4l/.svn/props/filesystem.h.svn-work b/arch/linux/armv4l/.svn/props/filesystem.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/armv4l/.svn/props/filesystem.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/armv4l/.svn/props/inputdevices.h.svn-work b/arch/linux/armv4l/.svn/props/inputdevices.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/armv4l/.svn/props/inputdevices.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/armv4l/.svn/props/loadavg.h.svn-work b/arch/linux/armv4l/.svn/props/loadavg.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/armv4l/.svn/props/loadavg.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/armv4l/.svn/props/memory.h.svn-work b/arch/linux/armv4l/.svn/props/memory.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/armv4l/.svn/props/memory.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/armv4l/.svn/props/modules.h.svn-work b/arch/linux/armv4l/.svn/props/modules.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/armv4l/.svn/props/modules.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/armv4l/.svn/props/net.h.svn-work b/arch/linux/armv4l/.svn/props/net.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/armv4l/.svn/props/net.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/armv4l/.svn/props/nfs.h.svn-work b/arch/linux/armv4l/.svn/props/nfs.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/armv4l/.svn/props/nfs.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/armv4l/.svn/props/os.h.svn-work b/arch/linux/armv4l/.svn/props/os.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/armv4l/.svn/props/os.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/armv4l/.svn/props/pci.h.svn-work b/arch/linux/armv4l/.svn/props/pci.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/armv4l/.svn/props/pci.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/armv4l/.svn/props/samba.h.svn-work b/arch/linux/armv4l/.svn/props/samba.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/armv4l/.svn/props/samba.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/armv4l/.svn/props/sensors.h.svn-work b/arch/linux/armv4l/.svn/props/sensors.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/armv4l/.svn/props/sensors.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/armv4l/.svn/props/storage.h.svn-work b/arch/linux/armv4l/.svn/props/storage.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/armv4l/.svn/props/storage.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/armv4l/.svn/props/uptime.h.svn-work b/arch/linux/armv4l/.svn/props/uptime.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/armv4l/.svn/props/uptime.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/armv4l/.svn/props/usb.h.svn-work b/arch/linux/armv4l/.svn/props/usb.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/armv4l/.svn/props/usb.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/armv4l/.svn/text-base/alsa.h.svn-base b/arch/linux/armv4l/.svn/text-base/alsa.h.svn-base deleted file mode 100644 index e17b92c3..00000000 --- a/arch/linux/armv4l/.svn/text-base/alsa.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/alsa.h
\ No newline at end of file diff --git a/arch/linux/armv4l/.svn/text-base/filesystem.h.svn-base b/arch/linux/armv4l/.svn/text-base/filesystem.h.svn-base deleted file mode 100644 index 0d23c803..00000000 --- a/arch/linux/armv4l/.svn/text-base/filesystem.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/filesystem.h
\ No newline at end of file diff --git a/arch/linux/armv4l/.svn/text-base/inputdevices.h.svn-base b/arch/linux/armv4l/.svn/text-base/inputdevices.h.svn-base deleted file mode 100644 index 58695156..00000000 --- a/arch/linux/armv4l/.svn/text-base/inputdevices.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/inputdevices.h
\ No newline at end of file diff --git a/arch/linux/armv4l/.svn/text-base/loadavg.h.svn-base b/arch/linux/armv4l/.svn/text-base/loadavg.h.svn-base deleted file mode 100644 index 354f872f..00000000 --- a/arch/linux/armv4l/.svn/text-base/loadavg.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/loadavg.h
\ No newline at end of file diff --git a/arch/linux/armv4l/.svn/text-base/memory.h.svn-base b/arch/linux/armv4l/.svn/text-base/memory.h.svn-base deleted file mode 100644 index 2b2ad528..00000000 --- a/arch/linux/armv4l/.svn/text-base/memory.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/memory.h
\ No newline at end of file diff --git a/arch/linux/armv4l/.svn/text-base/modules.h.svn-base b/arch/linux/armv4l/.svn/text-base/modules.h.svn-base deleted file mode 100644 index d80f7d7a..00000000 --- a/arch/linux/armv4l/.svn/text-base/modules.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/modules.h
\ No newline at end of file diff --git a/arch/linux/armv4l/.svn/text-base/net.h.svn-base b/arch/linux/armv4l/.svn/text-base/net.h.svn-base deleted file mode 100644 index 2b4ac97a..00000000 --- a/arch/linux/armv4l/.svn/text-base/net.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/net.h
\ No newline at end of file diff --git a/arch/linux/armv4l/.svn/text-base/nfs.h.svn-base b/arch/linux/armv4l/.svn/text-base/nfs.h.svn-base deleted file mode 100644 index c10bd829..00000000 --- a/arch/linux/armv4l/.svn/text-base/nfs.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/nfs.h
\ No newline at end of file diff --git a/arch/linux/armv4l/.svn/text-base/os.h.svn-base b/arch/linux/armv4l/.svn/text-base/os.h.svn-base deleted file mode 100644 index 49613b1f..00000000 --- a/arch/linux/armv4l/.svn/text-base/os.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/os.h
\ No newline at end of file diff --git a/arch/linux/armv4l/.svn/text-base/pci.h.svn-base b/arch/linux/armv4l/.svn/text-base/pci.h.svn-base deleted file mode 100644 index 2386d2ad..00000000 --- a/arch/linux/armv4l/.svn/text-base/pci.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/pci.h
\ No newline at end of file diff --git a/arch/linux/armv4l/.svn/text-base/processor.h.svn-base b/arch/linux/armv4l/.svn/text-base/processor.h.svn-base deleted file mode 100644 index 7a9c1f2e..00000000 --- a/arch/linux/armv4l/.svn/text-base/processor.h.svn-base +++ /dev/null @@ -1,71 +0,0 @@ -/* - * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, version 2. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -static Processor * -computer_get_processor(void) -{ - Processor *processor; - FILE *cpuinfo; - gchar buffer[128]; - - cpuinfo = fopen("/proc/cpuinfo", "r"); - if (!cpuinfo) - return NULL; - - processor = g_new0(Processor, 1); - while (fgets(buffer, 128, cpuinfo)) { - gchar **tmp = g_strsplit(buffer, ":", 2); - - if (tmp[0] && tmp[1]) { - tmp[0] = g_strstrip(tmp[0]); - tmp[1] = g_strstrip(tmp[1]); - - get_str("Processor", processor->model_name); - get_str("Features", processor->flags); - get_float("BogoMIPS", processor->bogomips); - - get_str("Hardware", processor->has_fpu); - } - g_strfreev(tmp); - } - - fclose(cpuinfo); - - return processor; -} - -static gchar * -processor_get_info(Processor *processor) -{ - return g_strdup_printf("[Processor]\n" - "Name=%s\n" - "Features=%s\n" - "BogoMips=%.2f\n" - "Endianesss=" -#if G_BYTE_ORDER == G_LITTLE_ENDIAN - "Little Endian", -#else - "Big Endian", -#endif - "\n" - "Hardware=%s\n", - processor->model_name, - processor->flags, - processor->bogomips, - processor->has_fpu); -} diff --git a/arch/linux/armv4l/.svn/text-base/samba.h.svn-base b/arch/linux/armv4l/.svn/text-base/samba.h.svn-base deleted file mode 100644 index 246e9ed0..00000000 --- a/arch/linux/armv4l/.svn/text-base/samba.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/samba.h
\ No newline at end of file diff --git a/arch/linux/armv4l/.svn/text-base/sensors.h.svn-base b/arch/linux/armv4l/.svn/text-base/sensors.h.svn-base deleted file mode 100644 index 822de7b7..00000000 --- a/arch/linux/armv4l/.svn/text-base/sensors.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/sensors.h
\ No newline at end of file diff --git a/arch/linux/armv4l/.svn/text-base/storage.h.svn-base b/arch/linux/armv4l/.svn/text-base/storage.h.svn-base deleted file mode 100644 index 24568f89..00000000 --- a/arch/linux/armv4l/.svn/text-base/storage.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/storage.h
\ No newline at end of file diff --git a/arch/linux/armv4l/.svn/text-base/uptime.h.svn-base b/arch/linux/armv4l/.svn/text-base/uptime.h.svn-base deleted file mode 100644 index 25cc41e9..00000000 --- a/arch/linux/armv4l/.svn/text-base/uptime.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/uptime.h
\ No newline at end of file diff --git a/arch/linux/armv4l/.svn/text-base/usb.h.svn-base b/arch/linux/armv4l/.svn/text-base/usb.h.svn-base deleted file mode 100644 index 8aece87f..00000000 --- a/arch/linux/armv4l/.svn/text-base/usb.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/usb.h
\ No newline at end of file diff --git a/arch/linux/armv4l/battery.h b/arch/linux/armv4l/battery.h new file mode 120000 index 00000000..e4c794f2 --- /dev/null +++ b/arch/linux/armv4l/battery.h @@ -0,0 +1 @@ +../../linux/common/battery.h
\ No newline at end of file diff --git a/arch/linux/armv4l/boots.h b/arch/linux/armv4l/boots.h new file mode 120000 index 00000000..97384500 --- /dev/null +++ b/arch/linux/armv4l/boots.h @@ -0,0 +1 @@ +../../../arch/linux/common/boots.h
\ No newline at end of file diff --git a/arch/linux/armv4l/devmemory.h b/arch/linux/armv4l/devmemory.h new file mode 120000 index 00000000..f8a833e7 --- /dev/null +++ b/arch/linux/armv4l/devmemory.h @@ -0,0 +1 @@ +../../../arch/linux/common/devmemory.h
\ No newline at end of file diff --git a/arch/linux/armv4l/processor.h b/arch/linux/armv4l/processor.h index 7a9c1f2e..d66d6f25 100644 --- a/arch/linux/armv4l/processor.h +++ b/arch/linux/armv4l/processor.h @@ -16,8 +16,17 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -static Processor * -computer_get_processor(void) +struct _Processor { + gchar *model_name; + gchar *flags; + gfloat bogomips; + + gchar *has_fpu; +}; + + +static GSList * +__scan_processors(void) { Processor *processor; FILE *cpuinfo; @@ -46,12 +55,14 @@ computer_get_processor(void) fclose(cpuinfo); - return processor; + return g_slist_append(NULL, processor); } static gchar * -processor_get_info(Processor *processor) +processor_get_info(GSList *processors) { + Processor *processor = (Processor *)processors->data; + return g_strdup_printf("[Processor]\n" "Name=%s\n" "Features=%s\n" diff --git a/arch/linux/common/.svn/README.txt b/arch/linux/common/.svn/README.txt deleted file mode 100644 index 271a8ce9..00000000 --- a/arch/linux/common/.svn/README.txt +++ /dev/null @@ -1,2 +0,0 @@ -This is a Subversion working copy administrative directory. -Visit http://subversion.tigris.org/ for more information. diff --git a/arch/linux/common/.svn/empty-file b/arch/linux/common/.svn/empty-file deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/common/.svn/empty-file +++ /dev/null diff --git a/arch/linux/common/.svn/entries b/arch/linux/common/.svn/entries deleted file mode 100644 index 590cfded..00000000 --- a/arch/linux/common/.svn/entries +++ /dev/null @@ -1,151 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<wc-entries - xmlns="svn:"> -<entry - committed-rev="9" - name="" - committed-date="2006-03-07T18:26:23.507991Z" - url="svn+ssh://lafp@svn.berlios.de/svnroot/repos/hardinfo/trunk/hardinfo2/arch/linux/common" - last-author="lafp" - kind="dir" - uuid="03931a0e-0c0b-0410-87e6-c9e79dddb921" - repos="svn+ssh://lafp@svn.berlios.de/svnroot/repos/hardinfo" - revision="9"/> -<entry - committed-rev="1" - name="usb.h" - text-time="2006-05-20T14:29:25.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="0c0cac5253587505cc065f0e256a5d4d" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:24.000000Z"/> -<entry - committed-rev="1" - name="sensors.h" - text-time="2006-05-20T14:29:25.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="29e1c509624467fe7314b4735e7111c0" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:24.000000Z"/> -<entry - committed-rev="12" - name="inputdevices.h" - text-time="2006-05-20T19:41:49.000000Z" - committed-date="2006-05-20T19:59:34.736889Z" - checksum="01a7b3bd4ca502e604a6feb9092523d8" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:24.000000Z" - revision="12"/> -<entry - committed-rev="1" - name="uptime.h" - text-time="2006-05-20T14:29:25.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="4f5d1b5cb05b0f74f1cc5030d58568a4" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:24.000000Z"/> -<entry - committed-rev="1" - name="storage.h" - text-time="2006-05-20T14:29:25.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="d5793dc35001654f593b7b20028065d8" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:25.000000Z"/> -<entry - committed-rev="1" - name="memory.h" - text-time="2006-05-20T14:29:25.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="6003144cee387dca46d2ef91429c1d49" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:25.000000Z"/> -<entry - committed-rev="1" - name="modules.h" - text-time="2006-05-20T14:29:25.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="1ad54b4dd6e3eec6b953ad4ddf0fd860" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:25.000000Z"/> -<entry - committed-rev="4" - name="pci.h" - text-time="2006-05-20T14:29:25.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="37a5c5e99c34cbb4adbc4aa31e7fd457" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:24.000000Z"/> -<entry - committed-rev="1" - name="loadavg.h" - text-time="2006-05-20T14:29:25.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="d5c6e755bc626cbad504197c6806f532" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:24.000000Z"/> -<entry - committed-rev="1" - name="alsa.h" - text-time="2006-05-20T14:29:25.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="59621ae90495ca734fffde1d5c6a17f8" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:24.000000Z"/> -<entry - committed-rev="4" - name="os.h" - text-time="2006-05-20T14:29:25.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="5096953136a76251742ceedbe95b4b27" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:24.000000Z"/> -<entry - committed-rev="18" - name="samba.h" - text-time="2006-06-16T14:09:12.000000Z" - committed-date="2006-06-16T14:09:52.687901Z" - checksum="41d760d05bea9c45eba0622fe168b2fd" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:24.000000Z" - revision="18"/> -<entry - committed-rev="9" - name="filesystem.h" - text-time="2006-05-20T14:29:25.000000Z" - committed-date="2006-03-07T18:26:23.507991Z" - checksum="964d2ae62a1d35e125607b9e13d56762" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:25.000000Z"/> -<entry - committed-rev="4" - name="net.h" - text-time="2006-05-20T14:29:25.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="cda86d4df0a7b91c598f6da5ec63b13e" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:25.000000Z"/> -<entry - committed-rev="14" - name="nfs.h" - text-time="2006-05-22T16:03:07.000000Z" - committed-date="2006-05-22T16:05:56.041082Z" - checksum="65db4676d1ef228ef7821c71ae185f67" - last-author="lafp" - kind="file" - revision="14"/> -</wc-entries> diff --git a/arch/linux/common/.svn/format b/arch/linux/common/.svn/format deleted file mode 100644 index b8626c4c..00000000 --- a/arch/linux/common/.svn/format +++ /dev/null @@ -1 +0,0 @@ -4 diff --git a/arch/linux/common/.svn/prop-base/alsa.h.svn-base b/arch/linux/common/.svn/prop-base/alsa.h.svn-base deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/common/.svn/prop-base/alsa.h.svn-base +++ /dev/null diff --git a/arch/linux/common/.svn/prop-base/filesystem.h.svn-base b/arch/linux/common/.svn/prop-base/filesystem.h.svn-base deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/common/.svn/prop-base/filesystem.h.svn-base +++ /dev/null diff --git a/arch/linux/common/.svn/prop-base/inputdevices.h.svn-base b/arch/linux/common/.svn/prop-base/inputdevices.h.svn-base deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/common/.svn/prop-base/inputdevices.h.svn-base +++ /dev/null diff --git a/arch/linux/common/.svn/prop-base/loadavg.h.svn-base b/arch/linux/common/.svn/prop-base/loadavg.h.svn-base deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/common/.svn/prop-base/loadavg.h.svn-base +++ /dev/null diff --git a/arch/linux/common/.svn/prop-base/memory.h.svn-base b/arch/linux/common/.svn/prop-base/memory.h.svn-base deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/common/.svn/prop-base/memory.h.svn-base +++ /dev/null diff --git a/arch/linux/common/.svn/prop-base/modules.h.svn-base b/arch/linux/common/.svn/prop-base/modules.h.svn-base deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/common/.svn/prop-base/modules.h.svn-base +++ /dev/null diff --git a/arch/linux/common/.svn/prop-base/net.h.svn-base b/arch/linux/common/.svn/prop-base/net.h.svn-base deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/common/.svn/prop-base/net.h.svn-base +++ /dev/null diff --git a/arch/linux/common/.svn/prop-base/os.h.svn-base b/arch/linux/common/.svn/prop-base/os.h.svn-base deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/common/.svn/prop-base/os.h.svn-base +++ /dev/null diff --git a/arch/linux/common/.svn/prop-base/pci.h.svn-base b/arch/linux/common/.svn/prop-base/pci.h.svn-base deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/common/.svn/prop-base/pci.h.svn-base +++ /dev/null diff --git a/arch/linux/common/.svn/prop-base/samba.h.svn-base b/arch/linux/common/.svn/prop-base/samba.h.svn-base deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/common/.svn/prop-base/samba.h.svn-base +++ /dev/null diff --git a/arch/linux/common/.svn/prop-base/sensors.h.svn-base b/arch/linux/common/.svn/prop-base/sensors.h.svn-base deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/common/.svn/prop-base/sensors.h.svn-base +++ /dev/null diff --git a/arch/linux/common/.svn/prop-base/storage.h.svn-base b/arch/linux/common/.svn/prop-base/storage.h.svn-base deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/common/.svn/prop-base/storage.h.svn-base +++ /dev/null diff --git a/arch/linux/common/.svn/prop-base/uptime.h.svn-base b/arch/linux/common/.svn/prop-base/uptime.h.svn-base deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/common/.svn/prop-base/uptime.h.svn-base +++ /dev/null diff --git a/arch/linux/common/.svn/prop-base/usb.h.svn-base b/arch/linux/common/.svn/prop-base/usb.h.svn-base deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/common/.svn/prop-base/usb.h.svn-base +++ /dev/null diff --git a/arch/linux/common/.svn/props/alsa.h.svn-work b/arch/linux/common/.svn/props/alsa.h.svn-work deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/common/.svn/props/alsa.h.svn-work +++ /dev/null diff --git a/arch/linux/common/.svn/props/filesystem.h.svn-work b/arch/linux/common/.svn/props/filesystem.h.svn-work deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/common/.svn/props/filesystem.h.svn-work +++ /dev/null diff --git a/arch/linux/common/.svn/props/inputdevices.h.svn-work b/arch/linux/common/.svn/props/inputdevices.h.svn-work deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/common/.svn/props/inputdevices.h.svn-work +++ /dev/null diff --git a/arch/linux/common/.svn/props/loadavg.h.svn-work b/arch/linux/common/.svn/props/loadavg.h.svn-work deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/common/.svn/props/loadavg.h.svn-work +++ /dev/null diff --git a/arch/linux/common/.svn/props/memory.h.svn-work b/arch/linux/common/.svn/props/memory.h.svn-work deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/common/.svn/props/memory.h.svn-work +++ /dev/null diff --git a/arch/linux/common/.svn/props/modules.h.svn-work b/arch/linux/common/.svn/props/modules.h.svn-work deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/common/.svn/props/modules.h.svn-work +++ /dev/null diff --git a/arch/linux/common/.svn/props/net.h.svn-work b/arch/linux/common/.svn/props/net.h.svn-work deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/common/.svn/props/net.h.svn-work +++ /dev/null diff --git a/arch/linux/common/.svn/props/os.h.svn-work b/arch/linux/common/.svn/props/os.h.svn-work deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/common/.svn/props/os.h.svn-work +++ /dev/null diff --git a/arch/linux/common/.svn/props/pci.h.svn-work b/arch/linux/common/.svn/props/pci.h.svn-work deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/common/.svn/props/pci.h.svn-work +++ /dev/null diff --git a/arch/linux/common/.svn/props/samba.h.svn-work b/arch/linux/common/.svn/props/samba.h.svn-work deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/common/.svn/props/samba.h.svn-work +++ /dev/null diff --git a/arch/linux/common/.svn/props/sensors.h.svn-work b/arch/linux/common/.svn/props/sensors.h.svn-work deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/common/.svn/props/sensors.h.svn-work +++ /dev/null diff --git a/arch/linux/common/.svn/props/storage.h.svn-work b/arch/linux/common/.svn/props/storage.h.svn-work deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/common/.svn/props/storage.h.svn-work +++ /dev/null diff --git a/arch/linux/common/.svn/props/uptime.h.svn-work b/arch/linux/common/.svn/props/uptime.h.svn-work deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/common/.svn/props/uptime.h.svn-work +++ /dev/null diff --git a/arch/linux/common/.svn/props/usb.h.svn-work b/arch/linux/common/.svn/props/usb.h.svn-work deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/common/.svn/props/usb.h.svn-work +++ /dev/null diff --git a/arch/linux/common/.svn/text-base/alsa.h.svn-base b/arch/linux/common/.svn/text-base/alsa.h.svn-base deleted file mode 100644 index 0c0744ae..00000000 --- a/arch/linux/common/.svn/text-base/alsa.h.svn-base +++ /dev/null @@ -1,69 +0,0 @@ -/* - * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, version 2. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -gchar * -computer_get_alsacards(Computer * computer) -{ - GSList *p; - gchar *tmp = ""; - gint n = 0; - - if (computer->alsa) { - for (p = computer->alsa->cards; p; p = p->next) { - AlsaCard *ac = (AlsaCard *) p->data; - - tmp = - g_strdup_printf("Audio Adapter#%d=%s\n%s", ++n, - ac->friendly_name, tmp); - } - } - - return tmp; -} - -static AlsaInfo * -computer_get_alsainfo(void) -{ - AlsaInfo *ai; - AlsaCard *ac; - FILE *cards; - gchar buffer[128]; - - cards = fopen("/proc/asound/cards", "r"); - if (!cards) - return NULL; - - ai = g_new0(AlsaInfo, 1); - - while (fgets(buffer, 128, cards)) { - gchar **tmp; - - ac = g_new0(AlsaCard, 1); - - tmp = g_strsplit(buffer, ":", 0); - - ac->friendly_name = g_strdup(tmp[1]); - ai->cards = g_slist_append(ai->cards, ac); - - g_strfreev(tmp); - fgets(buffer, 128, cards); /* skip next line */ - } - fclose(cards); - - return ai; -} diff --git a/arch/linux/common/.svn/text-base/filesystem.h.svn-base b/arch/linux/common/.svn/text-base/filesystem.h.svn-base deleted file mode 100644 index 79784c8f..00000000 --- a/arch/linux/common/.svn/text-base/filesystem.h.svn-base +++ /dev/null @@ -1,102 +0,0 @@ -/* - * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, version 2. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Some code from xfce4-mount-plugin, version 0.4.3 - * Copyright (C) 2005 Jean-Baptiste jb_dul@yahoo.com - * Distributed under the terms of GNU GPL 2. - */ -#include <sys/vfs.h> -#define KB 1024 -#define MB 1048576 -#define GB 1073741824 - -static gchar *fs_list = NULL; - -static gchar * -fs_human_readable(gfloat size) -{ - if (size < KB) - return g_strdup_printf("%.1f B", size); - if (size < MB) - return g_strdup_printf("%.1f KiB", size / KB); - if (size < GB) - return g_strdup_printf("%.1f MiB", size / MB); - - return g_strdup_printf("%.1f GiB", size / GB); -} - -static void -scan_filesystems(void) -{ - FILE *mtab; - gchar buf[1024]; - struct statfs sfs; - - g_free(fs_list); - fs_list = g_strdup(""); - - mtab = fopen("/etc/mtab", "r"); - if (!mtab) - return; - - while (fgets(buf, 1024, mtab)) { - gfloat size, used, avail; - gchar **tmp; - - tmp = g_strsplit(buf, " ", 0); - if (!statfs(tmp[1], &sfs)) { - size = (float) sfs.f_bsize * (float) sfs.f_blocks; - avail = (float) sfs.f_bsize * (float) sfs.f_bavail; - used = size - avail; - - gchar *strsize = fs_human_readable(size), - *stravail = fs_human_readable(avail), - *strused = fs_human_readable(used); - - gchar *strhash; - if ((strhash = g_hash_table_lookup(moreinfo, tmp[0]))) { - g_hash_table_remove(moreinfo, tmp[0]); - g_free(strhash); - } - - strhash = g_strdup_printf("[%s]\n" - "Filesystem=%s\n" - "Mounted As=%s\n" - "Mount Point=%s\n" - "Size=%s\n" - "Used=%s\n" - "Available=%s\n", - tmp[0], - tmp[2], - strstr(tmp[3], "rw") ? "Read-Write" : - "Read-Only", tmp[1], strsize, strused, - stravail); - g_hash_table_insert(moreinfo, g_strdup(tmp[0]), strhash); - - fs_list = g_strdup_printf("%s$%s$%s=%s total, %s free\n", - fs_list, - tmp[0], tmp[0], strsize, stravail); - - g_free(strsize); - g_free(stravail); - g_free(strused); - } - g_strfreev(tmp); - } - - fclose(mtab); -} diff --git a/arch/linux/common/.svn/text-base/inputdevices.h.svn-base b/arch/linux/common/.svn/text-base/inputdevices.h.svn-base deleted file mode 100644 index 44a109ca..00000000 --- a/arch/linux/common/.svn/text-base/inputdevices.h.svn-base +++ /dev/null @@ -1,122 +0,0 @@ -/* - * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, version 2. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -static gchar *input_icons = NULL; - -static gboolean -remove_input_devices(gpointer key, gpointer value, gpointer data) -{ - if (!strncmp((gchar *) key, "INP", 3)) { - g_free((gchar *) key); - g_free((GtkTreeIter *) value); - return TRUE; - } - - return FALSE; -} - -static struct { - char *name; - char *icon; -} input_devices[] = { - { "Keyboard", "keyboard.png" }, - { "Joystick", "joystick.png" }, - { "Mouse", "mouse.png" }, - { "Speaker", "audio.png" }, - { "Unknown", "module.png" }, -}; - -void -scan_inputdevices(void) -{ - FILE *dev; - gchar buffer[128]; - gchar *tmp, *name = NULL, *phys = NULL; - gint bus, vendor, product, version; - int d = 0, n = 0; - - dev = fopen("/proc/bus/input/devices", "r"); - if (!dev) - return; - - if (input_list) { - g_hash_table_foreach_remove(devices, remove_input_devices, NULL); - g_free(input_list); - g_free(input_icons); - } - input_list = g_strdup(""); - input_icons = g_strdup(""); - - while (fgets(buffer, 128, dev)) { - tmp = buffer; - - switch (*tmp) { - case 'N': - name = g_strdup(tmp + strlen("N: Name=")); - remove_quotes(name); - break; - case 'P': - phys = g_strdup(tmp + strlen("P: Phys=")); - break; - case 'I': - sscanf(tmp, "I: Bus=%x Vendor=%x Product=%x Version=%x", - &bus, &vendor, &product, &version); - break; - case 'H': - if (strstr(tmp, "kbd")) - d = 0; //INPUT_KEYBOARD; - else if (strstr(tmp, "js")) - d = 1; //INPUT_JOYSTICK; - else if (strstr(tmp, "mouse")) - d = 2; //INPUT_MOUSE; - else - d = 4; //INPUT_UNKNOWN; - break; - case '\n': - if (strstr(name, "PC Speaker")) { - d = 3; // INPUT_PCSPKR - } - - tmp = g_strdup_printf("INP%d", ++n); - input_list = g_strdup_printf("%s$%s$%s=\n", - input_list, - tmp, name); - input_icons = g_strdup_printf("%sIcon$%s$%s=%s\n", - input_icons, - tmp, name, - input_devices[d].icon); - gchar *strhash = g_strdup_printf("[Device Information]\n" - "Name=%s\n" - "Type=%s\n" - "Bus=0x%x\n" - "Vendor=0x%x\n" - "Product=0x%x\n" - "Version=0x%x\n" - "Connected to=%s\n", - name, input_devices[d].name, - bus, vendor, product, - version, phys); - g_hash_table_insert(devices, tmp, strhash); - - g_free(phys); - g_free(name); - } - } - - fclose(dev); -} diff --git a/arch/linux/common/.svn/text-base/memory.h.svn-base b/arch/linux/common/.svn/text-base/memory.h.svn-base deleted file mode 100644 index def4cc1d..00000000 --- a/arch/linux/common/.svn/text-base/memory.h.svn-base +++ /dev/null @@ -1,56 +0,0 @@ -/* - * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, version 2. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -static MemoryInfo * -computer_get_memory(void) -{ - MemoryInfo *mi; - FILE *procmem; - gchar buffer[128]; - - procmem = fopen("/proc/meminfo", "r"); - if (!procmem) - return NULL; - mi = g_new0(MemoryInfo, 1); - - while (fgets(buffer, 128, procmem)) { - gchar **tmp = g_strsplit(buffer, ":", 2); - - tmp[0] = g_strstrip(tmp[0]); - tmp[1] = g_strstrip(tmp[1]); - - get_int("MemTotal", mi->total); - get_int("MemFree", mi->free); - get_int("Cached", mi->cached); - - g_strfreev(tmp); - } - fclose(procmem); - - mi->used = mi->total - mi->free; - - mi->total /= 1000; - mi->cached /= 1000; - mi->used /= 1000; - mi->free /= 1000; - - mi->used -= mi->cached; - mi->ratio = 1 - (gdouble) mi->used / mi->total; - - return mi; -} diff --git a/arch/linux/common/.svn/text-base/modules.h.svn-base b/arch/linux/common/.svn/text-base/modules.h.svn-base deleted file mode 100644 index 69f7ebd6..00000000 --- a/arch/linux/common/.svn/text-base/modules.h.svn-base +++ /dev/null @@ -1,129 +0,0 @@ -/* - * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, version 2. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -void -scan_modules(void) -{ - FILE *lsmod; - gchar buffer[1024]; - - lsmod = popen("/sbin/lsmod", "r"); - if (!lsmod) - return; - - fgets(buffer, 1024, lsmod); /* Discards the first line */ - - while (fgets(buffer, 1024, lsmod)) { - gchar *buf, *strmodule, *hashkey; - gchar *author = NULL, - *description = NULL, - *license = NULL, - *deps = NULL, *vermagic = NULL, *filename = NULL, modname[64]; - FILE *modi; - glong memory; - - shell_status_pulse(); - - buf = buffer; - - sscanf(buf, "%s %ld", modname, &memory); - - hashkey = g_strdup_printf("MOD%s", modname); - buf = g_strdup_printf("/sbin/modinfo %s", modname); - - modi = popen(buf, "r"); - while (fgets(buffer, 1024, modi)) { - gchar **tmp = g_strsplit(buffer, ":", 2); - - GET_STR("author", author); - GET_STR("description", description); - GET_STR("license", license); - GET_STR("depends", deps); - GET_STR("vermagic", vermagic); - GET_STR("filename", filename); - - g_strfreev(tmp); - } - pclose(modi); - g_free(buf); - - /* old modutils includes quotes in some strings; strip them */ - /*remove_quotes(modname); - remove_quotes(description); - remove_quotes(vermagic); - remove_quotes(author); - remove_quotes(license); */ - - /* old modutils displays <none> when there's no value for a - given field; this is not desirable in the module name - display, so change it to an empty string */ - if (description && !strcmp(description, "<none>")) { - g_free(description); - description = g_strdup(""); - } - - /* append this module to the list of modules */ - module_list = g_strdup_printf("%s$%s$%s=%s\n", - module_list, - hashkey, - modname, - description ? description : ""); - -#define NONE_IF_NULL(var) (var) ? (var) : "N/A" - - /* create the module information string */ - strmodule = g_strdup_printf("[Module Information]\n" - "Path=%s\n" - "Used Memory=%.2fKiB\n" - "[Description]\n" - "Name=%s\n" - "Description=%s\n" - "Version Magic=%s\n" - "[Copyright]\n" - "Author=%s\n" - "License=%s\n", - NONE_IF_NULL(filename), - memory / 1024.0, - NONE_IF_NULL(modname), - NONE_IF_NULL(description), - NONE_IF_NULL(vermagic), - NONE_IF_NULL(author), - NONE_IF_NULL(license)); - - /* if there are dependencies, append them to that string */ - if (deps && strlen(deps)) { - gchar **tmp = g_strsplit(deps, ",", 0); - - strmodule = g_strconcat(strmodule, - "\n[Dependencies]\n", - g_strjoinv("=\n", tmp), - "=\n", NULL); - g_strfreev(tmp); - g_free(deps); - } - - g_hash_table_insert(devices, hashkey, strmodule); - - g_free(license); - g_free(description); - g_free(author); - g_free(vermagic); - g_free(filename); - } - pclose(lsmod); -} diff --git a/arch/linux/common/.svn/text-base/net.h.svn-base b/arch/linux/common/.svn/text-base/net.h.svn-base deleted file mode 100644 index 87e7e59b..00000000 --- a/arch/linux/common/.svn/text-base/net.h.svn-base +++ /dev/null @@ -1,203 +0,0 @@ -/* - * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, version 2. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -static gchar *network_interfaces = NULL; - -#include <sys/ioctl.h> -#include <net/if.h> -#include <netinet/in.h> -#include <linux/sockios.h> -#include <sys/socket.h> - -typedef struct _NetInfo NetInfo; -struct _NetInfo { - char name[16]; - int mtu; - unsigned char mac[8]; -}; - - -void get_net_info(char *if_name, NetInfo *netinfo) -{ - struct ifreq ifr; - int fd; - - fd = socket(PF_INET, SOCK_DGRAM, IPPROTO_IP); - - strcpy(ifr.ifr_name, if_name); - strcpy(netinfo->name, if_name); - - if (ioctl(fd, SIOCGIFMTU, &ifr) < 0) { - netinfo->mtu = 0; - } else { - netinfo->mtu = ifr.ifr_mtu; - } - - strcpy(ifr.ifr_name, if_name); - if (ioctl(fd, SIOCGIFHWADDR, &ifr) < 0) { - memset(netinfo->mac, 0, 8); - } else { - memcpy(netinfo->mac, ifr.ifr_ifru.ifru_hwaddr.sa_data, 8); - } - - shutdown(fd, 0); -} - -static struct { - char *type; - char *label; -} netdev2type[] = { - { "eth", "Ethernet" }, - { "lo", "Loopback" }, - { "ppp", "Point-to-Point" }, - { "ath", "Wireless" }, - { "wlan", "Wireless" }, - { "tun", "Virtual Point-to-Point (TUN)" }, - { "tap", "Ethernet (TAP)" }, - { "plip", "Parallel Line Internet Protocol" }, - { "irlan", "Infrared" }, - { "slip", "Serial Line Internet Protocol" }, - { "isdn", "Integrated Services Digital Network" }, - { "sit", "IPv6-over-IPv4 Tunnel" }, - { "vmnet8", "VMWare Virtual Network Interface (NAT)" }, - { "vmnet", "VMWare Virtual Network Interface" }, - { NULL, "Unknown" }, -}; - -static const gchar * -net_get_iface_type(gchar *name) -{ - int i; - - for (i = 0; netdev2type[i].type; i++) { - if (g_str_has_prefix(name, netdev2type[i].type)) - break; - } - - return netdev2type[i].label; -} - -static gboolean -remove_net_devices(gpointer key, gpointer value, gpointer data) -{ - if (!strncmp((gchar *) key, "NET", 4)) { - g_free((gchar *) key); - g_free((GtkTreeIter *) value); - return TRUE; - } - return FALSE; -} - -static void -scan_net_interfaces_24(void) -{ - FILE *proc_net; - NetInfo ni; - gchar buffer[256]; - gchar *devid, *detailed; - gulong recv_bytes; - gulong recv_errors; - gulong recv_packets; - - gulong trans_bytes; - gulong trans_errors; - gulong trans_packets; - - if (!g_file_test("/proc/net/dev", G_FILE_TEST_EXISTS)) { - if (network_interfaces) { - g_free(network_interfaces); - network_interfaces = g_strdup("[Network Interfaces]\n" - "None found=\n"); - } - - return; - } - - if (network_interfaces) { - g_free(network_interfaces); - } - - network_interfaces = g_strdup("[Network Interfaces]\n"); - - proc_net = fopen("/proc/net/dev", "r"); - while (fgets(buffer, 256, proc_net)) { - if (strchr(buffer, ':')) { - gint trash; - gchar ifacename[16]; - gchar *buf = buffer; - gint i; - - buf = g_strstrip(buf); - - memset(ifacename, 0, 16); - - for (i = 0; buffer[i] != ':' && i < 16; i++) { - ifacename[i] = buffer[i]; - } - - buf = strchr(buf, ':') + 1; - - /* iface: bytes packets errs drop fifo frame compressed multicast */ - sscanf(buf, "%ld %ld %ld %d %d %d %d %d %ld %ld %ld", - &recv_bytes, &recv_packets, - &recv_errors, &trash, &trash, &trash, &trash, - &trash, &trans_bytes, &trans_packets, - &trans_errors); - - gfloat recv_mb = recv_bytes / 1048576.0; - gfloat trans_mb = trans_bytes / 1048576.0; - - devid = g_strdup_printf("NET%s", ifacename); - network_interfaces = g_strdup_printf("%s$%s$%s=Sent %.2fMiB, received %.2fMiB\n", - network_interfaces, - devid, - ifacename, - trans_mb, - recv_mb); - - get_net_info(ifacename, &ni); - detailed = g_strdup_printf("[Network Adapter Properties]\n" - "Interface Type=%s\n" - "Hardware Address=%02x:%02x:%02x:%02x:%02x:%02x\n" - "MTU=%d\n" - "Bytes Sent=%ld (%.2fMiB)\n" - "Bytes Received=%ld (%.2fMiB)\n", - net_get_iface_type(ifacename), - ni.mac[0], ni.mac[1], - ni.mac[2], ni.mac[3], - ni.mac[4], ni.mac[5], - ni.mtu, - recv_bytes, recv_mb, - trans_bytes, trans_mb); - g_hash_table_insert(moreinfo, devid, detailed); - } - } - fclose(proc_net); -} - -static void -scan_net_interfaces(void) -{ - /* FIXME: See if we're running Linux 2.6 and if /sys is mounted, then use - that instead of /proc/net/dev */ - - /* remove old devices from global device table */ - g_hash_table_foreach_remove(moreinfo, remove_net_devices, NULL); - - scan_net_interfaces_24(); -} diff --git a/arch/linux/common/.svn/text-base/nfs.h.svn-base b/arch/linux/common/.svn/text-base/nfs.h.svn-base deleted file mode 100644 index 5ae22797..00000000 --- a/arch/linux/common/.svn/text-base/nfs.h.svn-base +++ /dev/null @@ -1,29 +0,0 @@ -static gchar *nfs_shares_list = NULL; -void -scan_nfs_shared_directories(void) -{ - FILE *exports; - gchar buf[512]; - - if (nfs_shares_list) { - g_free(nfs_shares_list); - } - - nfs_shares_list = g_strdup(""); - - exports = fopen("/etc/exports", "r"); - if (!exports) - return; - - while (fgets(buf, 512, exports)) { - if (buf[0] != '/') - continue; - - strend(buf, ' '); - strend(buf, '\t'); - - nfs_shares_list = g_strconcat(nfs_shares_list, buf, "=\n", NULL); - } - fclose(exports); -} - diff --git a/arch/linux/common/.svn/text-base/os.h.svn-base b/arch/linux/common/.svn/text-base/os.h.svn-base deleted file mode 100644 index 0f7b59e3..00000000 --- a/arch/linux/common/.svn/text-base/os.h.svn-base +++ /dev/null @@ -1,203 +0,0 @@ -/* - * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, version 2. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -static gchar * -get_libc_version(void) -{ - FILE *libc; - gchar buf[256], *tmp, *p; - - libc = popen("/lib/libc.so.6", "r"); - if (!libc) goto err; - - fgets(buf, 256, libc); - if (pclose(libc)) goto err; - - tmp = strstr(buf, "version "); - if (!tmp) goto err; - - p = strchr(tmp, ','); - if (p) *p = '\0'; - else goto err; - - return g_strdup_printf("GNU C Library version %s (%sstable)", - strchr(tmp, ' ') + 1, - strstr(buf, " stable ") ? "" : "un"); - err: - return g_strdup("Unknown"); -} - -static gchar * -get_os_compiled_date(void) -{ - FILE *procversion; - gchar buf[512]; - - procversion = fopen("/proc/sys/kernel/version", "r"); - if (!procversion) - return g_strdup("Unknown"); - - fgets(buf, 512, procversion); - fclose(procversion); - - return g_strdup(buf); -} - - -#include <gdk/gdkx.h> - -void -detect_desktop_environment(OperatingSystem * os) -{ - const gchar *tmp = g_getenv("GNOME_DESKTOP_SESSION_ID"); - FILE *version; - int maj, min; - - if (tmp) { - /* FIXME: this might not be true, as the gnome-panel in path - may not be the one that's running. - see where the user's running panel is and run *that* to - obtain the version. */ - version = popen("gnome-panel --version", "r"); - if (version) { - fscanf(version, "Gnome gnome-panel %d.%d", &maj, &min); - if (pclose(version)) - goto unknown; - } else { - goto unknown; - } - - os->desktop = - g_strdup_printf("GNOME %d.%d (session name: %s)", maj, min, - tmp); - } else if (g_getenv("KDE_FULL_SESSION")) { - version = popen("kcontrol --version", "r"); - if (version) { - char buf[32]; - - fgets(buf, 32, version); - - fscanf(version, "KDE: %d.%d", &maj, &min); - if (pclose(version)) - goto unknown; - } else { - goto unknown; - } - - os->desktop = g_strdup_printf("KDE %d.%d", maj, min); - } else { - unknown: - if (!g_getenv("DISPLAY")) { - os->desktop = g_strdup("Terminal"); - } else { - const gchar *windowman; - GdkScreen *screen = gdk_screen_get_default(); - - windowman = gdk_x11_screen_get_window_manager_name(screen); - - if (g_str_equal(windowman, "Xfwm4")) { - /* FIXME: check if xprop -root | grep XFCE_DESKTOP_WINDOW - is defined */ - os->desktop = g_strdup("XFCE 4"); - } else { - os->desktop = g_strdup_printf("Unknown (Window Manager: %s)", - windowman); - } - } - } -} - -static OperatingSystem * -computer_get_os(void) -{ - struct utsname utsbuf; - OperatingSystem *os; - int i; - - os = g_new0(OperatingSystem, 1); - - os->compiled_date = get_os_compiled_date(); - - /* Attempt to get the Distribution name; try using /etc/lsb-release first, - then doing the legacy method (checking for /etc/$DISTRO-release files) */ - if (g_file_test("/etc/lsb-release", G_FILE_TEST_EXISTS)) { - FILE *release; - gchar buffer[128]; - - release = popen("lsb_release -d", "r"); - fgets(buffer, 128, release); - pclose(release); - - os->distro = buffer; - os->distro = g_strdup(os->distro + strlen("Description:\t")); - } - - for (i = 0;; i++) { - if (distro_db[i].file == NULL) { - os->distrocode = g_strdup("unk"); - os->distro = g_strdup("Unknown distribution"); - break; - } - - if (g_file_test(distro_db[i].file, G_FILE_TEST_EXISTS)) { - - - FILE *distro_ver; - char buf[128]; - - distro_ver = fopen(distro_db[i].file, "r"); - fgets(buf, 128, distro_ver); - fclose(distro_ver); - - buf[strlen(buf) - 1] = 0; - - if (!os->distro) { - /* - * HACK: Some Debian systems doesn't include - * the distribuition name in /etc/debian_release, - * so add them here. - */ - if (!strncmp(distro_db[i].codename, "deb", 3) && - ((buf[0] >= '0' && buf[0] <= '9') || buf[0] != 'D')) { - os->distro = g_strdup_printf - ("Debian GNU/Linux %s", buf); - } else { - os->distro = g_strdup(buf); - } - } - os->distrocode = g_strdup(distro_db[i].codename); - - break; - } - } - - /* Kernel and hostname info */ - uname(&utsbuf); - os->kernel = g_strdup_printf("%s %s (%s)", utsbuf.sysname, - utsbuf.release, utsbuf.machine); - os->hostname = g_strdup(utsbuf.nodename); - os->language = g_strdup(g_getenv("LC_MESSAGES")); - os->homedir = g_strdup(g_get_home_dir()); - os->username = g_strdup_printf("%s (%s)", - g_get_user_name(), g_get_real_name()); - os->libc = get_libc_version(); - scan_languages(os); - detect_desktop_environment(os); - - return os; -} diff --git a/arch/linux/common/.svn/text-base/pci.h.svn-base b/arch/linux/common/.svn/text-base/pci.h.svn-base deleted file mode 100644 index f8c9d319..00000000 --- a/arch/linux/common/.svn/text-base/pci.h.svn-base +++ /dev/null @@ -1,190 +0,0 @@ -/* - * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, version 2. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -void -scan_pci(void) -{ - FILE *lspci; - gchar buffer[256], *buf, *strhash = NULL, *strdevice = NULL; - gchar *category = NULL, *name = NULL; - gint n = 0; - - //if (g_file_test("/usr/bin/gksudo", G_FILE_TEST_EXISTS)) { - // lspci = popen("gksudo '/bin/lspci -v'", "r"); - //} else { - lspci = popen(LSPCI, "r"); - //} - - if (!lspci) { - return; - } - - gchar *icon; - - int x = 0; /* unique Memory, Capability and I/O port */ - while (fgets(buffer, 256, lspci)) { - buf = g_strstrip(buffer); - - if (!strncmp(buf, "Flags", 5)) { - gint irq = 0, freq = 0, latency = 0, i; - gchar **list; - gboolean bus_master; - - buf += 7; - - bus_master = FALSE; - - list = g_strsplit(buf, ", ", 10); - for (i = 0; i <= 10; i++) { - if (!list[i]) - break; - - if (!strncmp(list[i], "IRQ", 3)) - sscanf(list[i], "IRQ %d", &irq); - else if (strstr(list[i], "Mhz")) - sscanf(list[i], "%dMhz", &freq); - else if (!strncmp(list[i], "bus master", 10)) - bus_master = TRUE; - else if (!strncmp(list[i], "latency", 7)) - sscanf(list[i], "latency %d", &latency); - } - g_strfreev(list); - - if (irq) - strdevice = g_strdup_printf("%sIRQ=%d\n", strdevice, irq); - if (freq) - strdevice = - g_strdup_printf("%sFrequency=%dMHz\n", strdevice, - freq); - if (latency) - strdevice = - g_strdup_printf("%sLatency=%d\n", strdevice, latency); - - strdevice = - g_strdup_printf("%sBus Master=%s\n", strdevice, - bus_master ? "Yes" : "No"); - } else if (!strncmp(buf, "Subsystem", 9)) { - WALK_UNTIL(' '); - buf++; - strdevice = - g_strdup_printf("%sOEM Vendor=%s\n", strdevice, buf); - } else if (!strncmp(buf, "Capabilities", 12) - && !strstr(buf, "only to root") && - !strstr(buf, "access denied")) { - WALK_UNTIL(' '); - WALK_UNTIL(']'); - buf++; - strdevice = - g_strdup_printf("%sCapability#%d=%s\n", strdevice, ++x, - buf); - } else if (!strncmp(buf, "Memory at", 9) && strstr(buf, "[size=")) { - gint mem; - gchar unit; - gboolean prefetch; - gboolean _32bit; - - prefetch = strstr(buf, "non-prefetchable") ? FALSE : TRUE; - _32bit = strstr(buf, "32-bit") ? TRUE : FALSE; - - WALK_UNTIL('['); - sscanf(buf, "[size=%d%c", &mem, &unit); - - strdevice = g_strdup_printf("%sMemory#%d=%d%cB (%s%s)\n", - strdevice, ++x, - mem, - (unit == ']') ? ' ' : unit, - _32bit ? "32-bit, " : "", - prefetch ? "prefetchable" : - "non-prefetchable"); - - } else if (!strncmp(buf, "I/O", 3)) { - guint io_addr, io_size; - - sscanf(buf, "I/O ports at %x [size=%d]", &io_addr, &io_size); - - strdevice = - g_strdup_printf("%sI/O ports at#%d=0x%x - 0x%x\n", - strdevice, ++x, io_addr, - io_addr + io_size); - } else if ((buf[0] >= '0' && buf[0] <= '9') && (buf[4] == ':' || buf[2] == ':')) { - gint bus, device, function, domain; - gpointer start, end; - - if (strdevice != NULL && strhash != NULL) { - g_hash_table_insert(devices, strhash, strdevice); - g_free(category); - g_free(name); - } - - if (buf[4] == ':') { - sscanf(buf, "%x:%x:%x.%d", &domain, &bus, &device, &function); - } else { - /* lspci without domain field */ - sscanf(buf, "%x:%x.%x", &bus, &device, &function); - domain = 0; - } - - WALK_UNTIL(' '); - - start = buf; - - WALK_UNTIL(':'); - end = buf + 1; - *buf = 0; - - buf = start + 1; - category = g_strdup(buf); - - buf = end; - start = buf; - WALK_UNTIL('('); - *buf = 0; - buf = start + 1; - - if (strstr(category, "RAM memory")) icon = "mem"; - else if (strstr(category, "Multimedia")) icon = "media"; - else if (strstr(category, "USB")) icon = "usb"; - else icon = "pci"; - - name = g_strdup(buf); - - strhash = g_strdup_printf("PCI%d", n); - strdevice = g_strdup_printf("[Device Information]\n" - "Name=%s\n" - "Class=%s\n" - "Domain=%d\n" - "Bus, device, function=%d, %d, %d\n", - name, category, domain, bus, - device, function); - pci_list = g_strdup_printf("%s$PCI%d$%s=%s\n", pci_list, n, category, - name); - - n++; - } - } - - if (pclose(lspci)) { - /* error (no pci, perhaps?) */ - pci_list = g_strconcat(pci_list, "No PCI devices found=\n", NULL); - } else if (strhash) { - /* insert the last device */ - g_hash_table_insert(devices, strhash, strdevice); - g_free(category); - g_free(name); - } -} diff --git a/arch/linux/common/.svn/text-base/samba.h.svn-base b/arch/linux/common/.svn/text-base/samba.h.svn-base deleted file mode 100644 index 5f5ecbe5..00000000 --- a/arch/linux/common/.svn/text-base/samba.h.svn-base +++ /dev/null @@ -1,80 +0,0 @@ -/* - * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, version 2. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -static gchar *smb_shares_list = NULL; -void -scan_samba_shared_directories(void) -{ - GKeyFile *keyfile; - GError *error = NULL; - gchar **groups; - gchar *smbconf; - gsize length; - gint i = 0; - - if (smb_shares_list) { - g_free(smb_shares_list); - } - - keyfile = g_key_file_new(); - - if (!g_file_get_contents("/etc/samba/smb.conf", &smbconf, &length, &error)) { - smb_shares_list = g_strdup("Cannot open /etc/samba/smb.conf=\n"); - g_error_free(error); - goto cleanup; - } - - gchar *_smbconf = smbconf; - for (; *_smbconf; _smbconf++) - if (*_smbconf == ';') *_smbconf = '\0'; - - if (!g_key_file_load_from_data(keyfile, smbconf, length, 0, &error)) { - smb_shares_list = g_strdup("Cannot parse smb.conf=\n"); - g_error_free(error); - goto cleanup; - } - - smb_shares_list = g_strdup(""); - - groups = g_key_file_get_groups(keyfile, NULL); - while (groups[i]) { - if (g_key_file_has_key(keyfile, groups[i], "path", NULL) && - g_key_file_has_key(keyfile, groups[i], "available", NULL)) { - - gchar *available = g_key_file_get_string(keyfile, groups[i], "available", NULL); - - if (g_str_equal(available, "yes")) { - gchar *path = g_key_file_get_string(keyfile, groups[i], "path", NULL); - smb_shares_list = g_strconcat(smb_shares_list, groups[i], "=", - path, "\n", NULL); - g_free(path); - } - - g_free(available); - } - - i++; - } - - g_strfreev(groups); - - cleanup: - g_key_file_free(keyfile); - g_free(smbconf); -} - diff --git a/arch/linux/common/.svn/text-base/sensors.h.svn-base b/arch/linux/common/.svn/text-base/sensors.h.svn-base deleted file mode 100644 index ef834de2..00000000 --- a/arch/linux/common/.svn/text-base/sensors.h.svn-base +++ /dev/null @@ -1,237 +0,0 @@ -/* - * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, version 2. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -static gchar *sensors = NULL; -static GHashTable *sensor_labels = NULL; -static GHashTable *sensor_compute = NULL; - -static void -read_sensor_labels(gchar *driver) -{ - FILE *conf; - gchar buf[256], *line, *p; - gboolean lock = FALSE; - gint i; - - sensor_labels = g_hash_table_new_full(g_str_hash, g_str_equal, - g_free, g_free); - sensor_compute = g_hash_table_new(g_str_hash, g_str_equal); - - conf = fopen("/etc/sensors.conf", "r"); - if (!conf) - return; - - while (fgets(buf, 256, conf)) { - line = buf; - - remove_linefeed(line); - strend(line, '#'); - - if (*line == '\0') { - continue; - } else if (lock && strstr(line, "label")) { /* label lines */ - gchar **names = g_strsplit(strstr(line, "label") + 5, " ", 0); - gchar *name = NULL, *value = NULL; - - for (i = 0; names[i]; i++) { - if (names[i][0] == '\0') - continue; - - if (!name) name = g_strdup(names[i]); - else if (!value) value = g_strdup(names[i]); - else value = g_strconcat(value, " ", names[i], NULL); - } - - remove_quotes(value); - g_hash_table_insert(sensor_labels, name, value); - - g_strfreev(names); - } else if (lock && strstr(line, "ignore")) { /* ignore lines */ - p = strstr(line, "ignore") + 6; - if (!strchr(p, ' ')) - continue; - - while (*p == ' ') p++; - g_hash_table_insert(sensor_labels, g_strdup(p), "ignore"); - } else if (lock && strstr(line, "compute")) { /* compute lines */ - gchar **formulas = g_strsplit(strstr(line, "compute") + 7, " ", 0); - gchar *name = NULL, *formula = NULL; - - for (i = 0; formulas[i]; i++) { - if (formulas[i][0] == '\0') - continue; - if (formulas[i][0] == ',') - break; - - if (!name) name = g_strdup(formulas[i]); - else if (!formula) formula = g_strdup(formulas[i]); - else formula = g_strconcat(formula, formulas[i], NULL); - } - - g_strfreev(formulas); - g_hash_table_insert(sensor_compute, name, math_string_to_postfix(formula)); - } else if (g_str_has_prefix(line, "chip")) { /* chip lines (delimiter) */ - if (lock == FALSE) { - gchar **chips = g_strsplit(line, " ", 0); - - for (i = 1; chips[i]; i++) { - strend(chips[i], '*'); - - if (g_str_has_prefix(driver, chips[i] + 1)) { - lock = TRUE; - break; - } - } - - g_strfreev(chips); - } else { - break; - } - } - } - - fclose(conf); -} - -static gchar * -get_sensor_label(gchar *sensor) -{ - gchar *ret; - - ret = g_hash_table_lookup(sensor_labels, sensor); - if (!ret) ret = g_strdup(sensor); - else ret = g_strdup(ret); - - return ret; -} - -static float -adjust_sensor(gchar *name, float value) -{ - GSList *postfix; - - postfix = g_hash_table_lookup(sensor_compute, name); - if (!postfix) return value; - - return math_postfix_eval(postfix, value); -} - -static void -read_sensors(void) -{ - gchar *path_hwmon, *path_sensor, *tmp, *driver, *name, *mon; - int hwmon, count; - - if (sensors) - g_free(sensors); - - hwmon = 0; - sensors = g_strdup(""); - - path_hwmon = g_strdup_printf("/sys/class/hwmon/hwmon%d/device/", hwmon); - while (g_file_test(path_hwmon, G_FILE_TEST_EXISTS)) { - tmp = g_strdup_printf("%sdriver", path_hwmon); - driver = g_file_read_link(tmp, NULL); - g_free(tmp); - - tmp = g_path_get_basename(driver); - g_free(driver); - driver = tmp; - - if (!sensor_labels) { - read_sensor_labels(driver); - } - - sensors = g_strdup_printf("%s[Driver Info]\n" - "Name=%s\n", sensors, driver); - - sensors = g_strconcat(sensors, "[Cooling Fans]\n", NULL); - for (count = 1; ; count++) { - path_sensor = g_strdup_printf("%sfan%d_input", path_hwmon, count); - if (!g_file_get_contents(path_sensor, &tmp, NULL, NULL)) { - g_free(path_sensor); - break; - } - - mon = g_strdup_printf("fan%d", count); - name = get_sensor_label(mon); - if (!g_str_equal(name, "ignore")) { - sensors = g_strdup_printf("%s%s=%.0fRPM\n", - sensors, name, - adjust_sensor(mon, atof(tmp))); - } - - g_free(name); - g_free(mon); - g_free(tmp); - g_free(path_sensor); - } - - sensors = g_strconcat(sensors, "[Temperatures]\n", NULL); - for (count = 1; ; count++) { - path_sensor = g_strdup_printf("%stemp%d_input", path_hwmon, count); - if (!g_file_get_contents(path_sensor, &tmp, NULL, NULL)) { - g_free(path_sensor); - break; - } - - mon = g_strdup_printf("temp%d", count); - name = get_sensor_label(mon); - if (!g_str_equal(name, "ignore")) { - sensors = g_strdup_printf("%s%s=%.2f\302\260C\n", - sensors, name, - adjust_sensor(mon, atof(tmp) / 1000.0)); - } - - g_free(tmp); - g_free(name); - g_free(path_sensor); - g_free(mon); - } - - sensors = g_strconcat(sensors, "[Voltage Values]\n", NULL); - for (count = 0; ; count++) { - path_sensor = g_strdup_printf("%sin%d_input", path_hwmon, count); - if (!g_file_get_contents(path_sensor, &tmp, NULL, NULL)) { - g_free(path_sensor); - break; - } - - - mon = g_strdup_printf("in%d", count); - name = get_sensor_label(mon); - if (!g_str_equal(name, "ignore")) { - sensors = g_strdup_printf("%s%s=%.3fV\n", - sensors, name, - adjust_sensor(mon, atof(tmp) / 1000.0)); - } - - g_free(tmp); - g_free(mon); - g_free(name); - g_free(path_sensor); - } - - g_free(path_hwmon); - g_free(driver); - path_hwmon = g_strdup_printf("/sys/class/hwmon/hwmon%d/device/", ++hwmon); - } - - g_free(path_hwmon); -} - diff --git a/arch/linux/common/.svn/text-base/storage.h.svn-base b/arch/linux/common/.svn/text-base/storage.h.svn-base deleted file mode 100644 index 4fb682a9..00000000 --- a/arch/linux/common/.svn/text-base/storage.h.svn-base +++ /dev/null @@ -1,268 +0,0 @@ -/* - * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, version 2. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -static gchar *storage_icons = ""; - -static gboolean -remove_scsi_devices(gpointer key, gpointer value, gpointer data) -{ - if (!strncmp((gchar *) key, "SCSI", 4)) { - g_free((gchar *) key); - g_free((GtkTreeIter *) value); - return TRUE; - } - return FALSE; -} - -/* SCSI support by Pascal F.Martin <pascalmartin@earthlink.net> */ -void -scan_scsi(void) -{ - FILE *proc_scsi; - gchar buffer[256], *buf; - gint n = 0; - gint scsi_controller; - gint scsi_channel; - gint scsi_id; - gint scsi_lun; - gchar *vendor = NULL, *revision = NULL, *model = NULL; - - /* remove old devices from global device table */ - g_hash_table_foreach_remove(devices, remove_scsi_devices, NULL); - - if (!g_file_test("/proc/scsi/scsi", G_FILE_TEST_EXISTS)) - return; - - storage_list = g_strconcat(storage_list, "\n[SCSI Disks]\n", NULL); - - proc_scsi = fopen("/proc/scsi/scsi", "r"); - while (fgets(buffer, 256, proc_scsi)) { - buf = g_strstrip(buffer); - if (!strncmp(buf, "Host: scsi", 10)) { - sscanf(buf, - "Host: scsi%d Channel: %d Id: %d Lun: %d", - &scsi_controller, &scsi_channel, &scsi_id, &scsi_lun); - - n++; - } else if (!strncmp(buf, "Vendor: ", 8)) { - char *p; - char *rev = strstr(buf, "Rev: "); - - model = strstr(buf, "Model: "); - - if (model == NULL) { - model = buf + strlen(buf); - } - p = model; - while (*(--p) == ' '); - *(++p) = 0; - vendor = g_strdup(buf + 8); - - if (rev != NULL) { - revision = g_strdup(rev + 5); - } else { - rev = model + strlen(model); - } - p = rev; - while (*(--p) == ' '); - *(++p) = 0; - model = g_strdup_printf("%s %s", vendor, model + 7); - - } else if (!strncmp(buf, "Type: ", 8)) { - char *p = strstr(buf, "ANSI SCSI revi"); - gchar *type = NULL, *icon = NULL; - - if (p != NULL) { - while (*(--p) == ' '); - *(++p) = 0; - - static struct { - char *type; - char *label; - char *icon; - } type2icon[] = { - { "Direct-Access", "Disk", "hdd"}, - { "Sequential-Access", "Tape", "tape"}, - { "Printer", "Printer", "lpr"}, - { "WORM", "CD-ROM", "cd"}, - { "CD-ROM", "CD-ROM", "cd"}, - { "Scanner", "Scanner", "scanner"}, - { NULL, "Generic", "scsi"} - }; - int i; - - for (i = 0; type2icon[i].type != NULL; i++) - if (!strcmp(buf + 8, type2icon[i].type)) - break; - - type = type2icon[i].label; - icon = type2icon[i].icon; - } - - gchar *devid = g_strdup_printf("SCSI%d", n); - storage_list = g_strdup_printf("%s$%s$%s=\n", storage_list, devid, model); - storage_icons = g_strdup_printf("%sIcon$%s$%s=%s.png\n", storage_icons, devid, model, icon); - - gchar *strhash = g_strdup_printf("[Device Information]\n" - "Model=%s\n" - "Type=%s\n" - "Revision=%s\n" - "[SCSI Controller]\n" - "Controller=scsi%d\n" - "Channel=%d\n" - "ID=%d\n" "LUN=%d\n", - model, - type, - revision, - scsi_controller, - scsi_channel, - scsi_id, - scsi_lun); - g_hash_table_insert(devices, devid, strhash); - - g_free(model); - g_free(revision); - g_free(vendor); - } - } - fclose(proc_scsi); -} - -static gboolean -remove_ide_devices(gpointer key, gpointer value, gpointer data) -{ - if (!strncmp((gchar *) key, "IDE", 3)) { - g_free((gchar *) key); - g_free((gchar *) value); - - return TRUE; - } - return FALSE; -} - - -void -scan_ide(void) -{ - FILE *proc_ide; - gchar *device, iface, *model, *media, *pgeometry = NULL, *lgeometry = - NULL; - gint n = 0, i = 0, cache; - - /* remove old devices from global device table */ - g_hash_table_foreach_remove(devices, remove_ide_devices, NULL); - - storage_list = g_strdup_printf("%s\n[IDE Disks]\n", storage_list); - - iface = 'a'; - for (i = 0; i <= 16; i++) { - device = g_strdup_printf("/proc/ide/hd%c/model", iface); - if (g_file_test(device, G_FILE_TEST_EXISTS)) { - gchar buf[64]; - - cache = 0; - - proc_ide = fopen(device, "r"); - fgets(buf, 64, proc_ide); - fclose(proc_ide); - - buf[strlen(buf) - 1] = 0; - - model = g_strdup(buf); - - g_free(device); - - device = g_strdup_printf("/proc/ide/hd%c/media", iface); - proc_ide = fopen(device, "r"); - fgets(buf, 64, proc_ide); - fclose(proc_ide); - buf[strlen(buf) - 1] = 0; - - media = g_strdup(buf); - - g_free(device); - - device = g_strdup_printf("/proc/ide/hd%c/cache", iface); - if (g_file_test(device, G_FILE_TEST_EXISTS)) { - proc_ide = fopen(device, "r"); - fscanf(proc_ide, "%d", &cache); - fclose(proc_ide); - } - g_free(device); - - device = g_strdup_printf("/proc/ide/hd%c/geometry", iface); - if (g_file_test(device, G_FILE_TEST_EXISTS)) { - gchar *tmp; - - proc_ide = fopen(device, "r"); - - fgets(buf, 64, proc_ide); - for (tmp = buf; *tmp; tmp++) { - if (*tmp >= '0' && *tmp <= '9') - break; - } - - pgeometry = g_strdup(g_strstrip(tmp)); - - fgets(buf, 64, proc_ide); - for (tmp = buf; *tmp; tmp++) { - if (*tmp >= '0' && *tmp <= '9') - break; - } - lgeometry = g_strdup(g_strstrip(tmp)); - - fclose(proc_ide); - } - g_free(device); - - n++; - - gchar *devid = g_strdup_printf("IDE%d", n); - - storage_list = g_strdup_printf("%s$%s$%s=\n", storage_list, - devid, model); - storage_icons = g_strdup_printf("%sIcon$%s$%s=%s.png\n", storage_icons, devid, - model, g_str_equal(media, "cdrom") ? \ - "cdrom" : "hdd"); - - gchar *strhash = g_strdup_printf("[Device Information]\n" - "Model=%s\n" - "Device Name=hd%c\n" - "Media=%s\n" "Cache=%dkb\n", - model, iface, media, cache); - if (pgeometry && lgeometry) - strhash = g_strdup_printf("%s[Geometry]\n" - "Physical=%s\n" - "Logical=%s\n", - strhash, pgeometry, lgeometry); - - g_hash_table_insert(devices, devid, strhash); - - g_free(model); - model = ""; - - g_free(pgeometry); - pgeometry = NULL; - g_free(lgeometry); - lgeometry = NULL; - } else - g_free(device); - - iface++; - } -} diff --git a/arch/linux/common/.svn/text-base/uptime.h.svn-base b/arch/linux/common/.svn/text-base/uptime.h.svn-base deleted file mode 100644 index cf339bf3..00000000 --- a/arch/linux/common/.svn/text-base/uptime.h.svn-base +++ /dev/null @@ -1,75 +0,0 @@ -/* - * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, version 2. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -static UptimeInfo * -computer_get_uptime(void) -{ - UptimeInfo *ui = g_new0(UptimeInfo, 1); - FILE *procuptime; - gulong minutes; - - if ((procuptime = fopen("/proc/uptime", "r")) != NULL) { - fscanf(procuptime, "%lu", &minutes); - ui->minutes = minutes / 60; - fclose(procuptime); - } else { - return NULL; - } - - ui->hours = ui->minutes / 60; - ui->minutes %= 60; - ui->days = ui->hours / 24; - ui->hours %= 24; - - return ui; -} - -static gchar * -computer_get_formatted_uptime() -{ - UptimeInfo *ui; - gchar *tmp; - - ui = computer_get_uptime(); - - /* FIXME: Use ngettext */ -#define plural(x) ((x > 1) ? "s" : "") - - - if (ui->days < 1) { - if (ui->hours < 1) { - tmp = - g_strdup_printf("%d minute%s", ui->minutes, - plural(ui->minutes)); - } else { - tmp = - g_strdup_printf("%d hour%s, %d minute%s", ui->hours, - plural(ui->hours), ui->minutes, - plural(ui->minutes)); - } - } else { - tmp = - g_strdup_printf("%d day%s, %d hour%s and %d minute%s", - ui->days, plural(ui->days), ui->hours, - plural(ui->hours), ui->minutes, - plural(ui->minutes)); - } - - g_free(ui); - return tmp; -} diff --git a/arch/linux/common/.svn/text-base/usb.h.svn-base b/arch/linux/common/.svn/text-base/usb.h.svn-base deleted file mode 100644 index a52be2cb..00000000 --- a/arch/linux/common/.svn/text-base/usb.h.svn-base +++ /dev/null @@ -1,132 +0,0 @@ -/* - * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, version 2. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -static gboolean -remove_usb_devices(gpointer key, gpointer value, gpointer data) -{ - if (!strncmp((gchar *) key, "USB", 3)) { - GtkTreeIter *iter = (GtkTreeIter *) data; - - g_free((gchar *) value); - g_free(iter); - - return TRUE; - } - return FALSE; -} - -static gchar *usb_list = NULL; -void -scan_usb(void) -{ - FILE *dev; - gchar buffer[128]; - gchar *tmp, *manuf = NULL, *product = NULL, *mxpwr; - gint bus, level, port, classid, trash; - gint vendor, prodid; - gfloat ver, rev, speed; - int n = 0; - - dev = fopen("/proc/bus/usb/devices", "r"); - if (!dev) - return; - - if (usb_list) { - g_hash_table_foreach_remove(devices, remove_usb_devices, NULL); - g_free(usb_list); - } - usb_list = g_strdup(""); - - while (fgets(buffer, 128, dev)) { - tmp = buffer; - - switch (*tmp) { - case 'T': - sscanf(tmp, - "T: Bus=%d Lev=%d Prnt=%d Port=%d Cnt=%d Dev#=%d Spd=%f", - &bus, &level, &trash, &port, &trash, &trash, &speed); - break; - case 'D': - sscanf(tmp, "D: Ver=%f Cls=%x", &ver, &classid); - break; - case 'P': - sscanf(tmp, "P: Vendor=%x ProdID=%x Rev=%f", - &vendor, &prodid, &rev); - break; - case 'S': - if (strstr(tmp, "Manufacturer=")) { - manuf = g_strdup(strchr(tmp, '=') + 1); - remove_linefeed(manuf); - } else if (strstr(tmp, "Product=")) { - product = g_strdup(strchr(tmp, '=') + 1); - remove_linefeed(product); - } - break; - case 'C': - mxpwr = strstr(buffer, "MxPwr=") + 6; - - tmp = g_strdup_printf("USB%d", ++n); - - if (*product == '\0') { - g_free(product); - if (classid == 9) { - product = g_strdup_printf("USB %.2f Hub", ver); - } else { - product = g_strdup_printf("Unknown USB %.2f Device (class %d)", - ver, classid); - } - } - - - if (classid == 9) { /* hub */ - usb_list = g_strdup_printf("%s[%s#%d]\n", - usb_list, product, n); - } else { /* everything else */ - usb_list = g_strdup_printf("%s$%s$%s=\n", - usb_list, tmp, product); - - gchar *strhash = g_strdup_printf("[Device Information]\n" - "Product=%s\n" - "Manufacturer=%s\n" - "[Port #%d]\n" - "Speed=%.2fMbit/s\n" - "Max Current=%s\n" - "[Misc]\n" - "USB Version=%.2f\n" - "Revision=%.2f\n" - "Class=0x%x\n" - "Vendor=0x%x\n" - "Product ID=0x%x\n" - "Bus=%d\n" "Level=%d\n", - product, manuf, - port, speed, mxpwr, - ver, rev, classid, - vendor, prodid, bus, level); - - g_hash_table_insert(devices, tmp, strhash); - } - - g_free(manuf); - g_free(product); - manuf = g_strdup(""); - product = g_strdup(""); - } - } - - fclose(dev); -} diff --git a/arch/linux/common/battery.h b/arch/linux/common/battery.h new file mode 100644 index 00000000..20979e48 --- /dev/null +++ b/arch/linux/common/battery.h @@ -0,0 +1,212 @@ +/* + * HardInfo - Displays System Information + * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, version 2. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <time.h> + +static void +__scan_battery_acpi(void) +{ + gchar *acpi_path; + + gchar *present = NULL; + gchar *capacity = NULL; + gchar *technology = NULL; + gchar *voltage = NULL; + gchar *model = NULL, *serial = NULL, *type = NULL; + gchar *state = NULL, *rate = NULL; + gchar *remaining = NULL; + + if (battery_list) { + g_free(battery_list); + } + battery_list = g_strdup(""); + + acpi_path = g_strdup("/proc/acpi/battery"); + if (g_file_test(acpi_path, G_FILE_TEST_EXISTS)) { + GDir *acpi; + + if ((acpi = g_dir_open(acpi_path, 0, NULL))) { + const gchar *entry; + + while ((entry = g_dir_read_name(acpi))) { + gchar *path = g_strdup_printf("%s/%s/info", acpi_path, entry); + FILE *f; + gchar buffer[256]; + gdouble charge_rate = 1.0; + + f = fopen(path, "r"); + g_free(path); + + if (!f) + goto cleanup; + + while (fgets(buffer, 256, f)) { + gchar **tmp = g_strsplit(buffer, ":", 2); + + GET_STR("present", present); + GET_STR("design capacity", capacity); + GET_STR("battery technology", technology); + GET_STR("design voltage", voltage); + GET_STR("model number", model); + GET_STR("serial number", serial); + GET_STR("battery type", type); + + g_strfreev(tmp); + } + fclose(f); + + path = g_strdup_printf("%s/%s/state", acpi_path, entry); + f = fopen(path, "r"); + g_free(path); + + if (!f) + goto cleanup; + + while (fgets(buffer, 256, f)) { + gchar **tmp = g_strsplit(buffer, ":", 2); + + GET_STR("charging state", state); + GET_STR("present rate", rate); + GET_STR("remaining capacity", remaining); + + g_strfreev(tmp); + } + + fclose(f); + + if (g_str_equal(present, "yes")) { + charge_rate = atof(remaining) / atof(capacity); + + battery_list = g_strdup_printf("%s\n[Battery: %s]\n" + "State=%s (load: %s)\n" + "Capacity=%s / %s (%.2f%%)\n" + "Battery Technology=%s (%s)\n" + "Model Number=%s\n" + "Serial Number=%s\n", + battery_list, + entry, + state, rate, + remaining, capacity, charge_rate * 100.0, + technology, type, + model, + serial); + } + + cleanup: + g_free(present); + g_free(capacity); + g_free(technology); + g_free(type); + g_free(model); + g_free(serial); + g_free(state); + g_free(remaining); + g_free(rate); + + present = capacity = technology = type = \ + model = serial = state = remaining = rate = NULL; + } + + g_dir_close(acpi); + } + } + + g_free(acpi_path); +} + +static void +__scan_battery_apm(void) +{ + FILE *procapm; + static char *sremaining = NULL, *stotal = NULL; + static unsigned int last_time = 0; + static int percentage = 0; + const char *ac_status[] = { "Battery", + "AC Power", + "Charging" }; + int ac_bat; + char apm_bios_ver[16], apm_drv_ver[16]; + char trash[10]; + + if ((procapm = fopen("/proc/apm", "r"))) { + int old_percentage = percentage; + + fscanf(procapm, "%s %s %s 0x%x %s %s %d%%", + apm_drv_ver, apm_bios_ver, trash, + &ac_bat, trash, trash, &percentage); + fclose(procapm); + + if (last_time == 0) { + last_time = time(NULL); + sremaining = stotal = NULL; + } + + if (old_percentage - percentage > 0) { + if (sremaining && stotal) { + g_free(sremaining); + g_free(stotal); + } + + int secs_remaining = (time(NULL) - last_time) * percentage / + (old_percentage - percentage); + sremaining = seconds_to_string(secs_remaining); + stotal = seconds_to_string((secs_remaining * 100) / percentage); + + last_time = time(NULL); + } + } else { + return; + } + + if (stotal && sremaining) { + battery_list = g_strdup_printf("%s\n[Battery (APM)]\n" + "Charge=%d%%\n" + "Remaining Charge=%s of %s\n" + "Using=%s\n" + "APM driver version=%s\n" + "APM BIOS version=%s\n", + battery_list, + percentage, + sremaining, stotal, + ac_status[ac_bat], + apm_drv_ver, apm_bios_ver); + } else { + battery_list = g_strdup_printf("%s\n[Battery (APM)]\n" + "Charge=%d%%\n" + "Using=%s\n" + "APM driver version=%s\n" + "APM BIOS version=%s\n", + battery_list, + percentage, + ac_status[ac_bat], + apm_drv_ver, apm_bios_ver); + + } +} + +static void +__scan_battery(void) +{ + if (battery_list) { + g_free(battery_list); + } + battery_list = g_strdup(""); + + __scan_battery_acpi(); + __scan_battery_apm(); +} diff --git a/arch/linux/common/boots.h b/arch/linux/common/boots.h new file mode 100644 index 00000000..c95ba321 --- /dev/null +++ b/arch/linux/common/boots.h @@ -0,0 +1,61 @@ +/* + * HardInfo - Displays System Information + * Copyright (C) 2003-2007 Leandro A. F. Pereira <leandro@linuxmag.com.br> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, version 2. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +void +scan_boots_real(void) +{ + FILE *last; + char buffer[256]; + + scan_os(FALSE); + + if (!computer->os->boots) + computer->os->boots = "[Boots]\n"; + else + return; + + last = popen("last", "r"); + if (last) { + while (fgets(buffer, 256, last)) { + if (strstr(buffer, "system boot")) { + gchar **tmp, *buf = buffer; + + strend(buffer, '\n'); + + while (*buf) { + if (*buf == ' ' && *(buf + 1) == ' ') { + strcpy(buf, buf + 1); + + buf--; + } else { + buf++; + } + } + + tmp = g_strsplit(buffer, " ", 5); + computer->os->boots = g_strdup_printf("%s\n%s=Kernel %s", + computer->os->boots, + tmp[4], + tmp[3]); + g_strfreev(tmp); + } + } + + pclose(last); + } +} diff --git a/arch/linux/common/devmemory.h b/arch/linux/common/devmemory.h new file mode 100644 index 00000000..780ab12f --- /dev/null +++ b/arch/linux/common/devmemory.h @@ -0,0 +1,99 @@ +/* + * HardInfo - Displays System Information + * Copyright (C) 2003-2007 Leandro A. F. Pereira <leandro@linuxmag.com.br> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, version 2. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +static GHashTable *memlabels; + +static void __scan_memory() +{ + gchar **keys, *tmp; + static gint offset = -1; + gint i; + + if (offset == -1) { + /* gah. linux 2.4 adds three lines of data we don't need in + /proc/meminfo */ + offset = strstr(idle_free(module_call_method("computer::getOSKernel")), + "Linux 2.4") ? 3 : 0; + } + + g_file_get_contents("/proc/meminfo", &meminfo, NULL, NULL); + + keys = g_strsplit(meminfo, "\n", 0); + + g_free(meminfo); + g_free(lginterval); + + meminfo = g_strdup(""); + lginterval = g_strdup(""); + + for (i = offset; keys[i]; i++) { + gchar **newkeys = g_strsplit(keys[i], ":", 0); + + if (!newkeys[0]) { + g_strfreev(newkeys); + break; + } + + g_strstrip(newkeys[1]); + + if ((tmp = g_hash_table_lookup(memlabels, newkeys[0]))) { + g_free(newkeys[0]); + newkeys[0] = g_strdup(tmp); + } + + g_hash_table_replace(moreinfo, g_strdup(newkeys[0]), g_strdup(newkeys[1])); + + tmp = g_strconcat(meminfo, newkeys[0], "=", newkeys[1], "\n", NULL); + g_free(meminfo); + meminfo = tmp; + + tmp = g_strconcat(lginterval, + "UpdateInterval$", newkeys[0], "=1000\n", NULL); + g_free(lginterval); + lginterval = tmp; + + g_strfreev(newkeys); + } + g_strfreev(keys); +} + +static void __init_memory_labels(void) +{ + static struct { + char *proc_label; + char *real_label; + } proc2real[] = { + { "MemTotal", "Total Memory" }, + { "MemFree", "Free Memory" }, + { "SwapCached", "Cached Swap" }, + { "HighTotal", "High Memory" }, + { "HighFree", "Free High Memory" }, + { "LowTotal", "Low Memory" }, + { "LowFree", "Free Low Memory" }, + { "SwapTotal", "Virtual Memory" }, + { "SwapFree", "Free Virtual Memory" }, + { NULL }, + }; + gint i; + + memlabels = g_hash_table_new(g_str_hash, g_str_equal); + + for (i = 0; proc2real[i].proc_label; i++) { + g_hash_table_insert(memlabels, proc2real[i].proc_label, proc2real[i].real_label); + } +} diff --git a/arch/linux/common/filesystem.h b/arch/linux/common/filesystem.h index 79784c8f..8300f278 100644 --- a/arch/linux/common/filesystem.h +++ b/arch/linux/common/filesystem.h @@ -20,25 +20,9 @@ * Distributed under the terms of GNU GPL 2. */ #include <sys/vfs.h> -#define KB 1024 -#define MB 1048576 -#define GB 1073741824 static gchar *fs_list = NULL; -static gchar * -fs_human_readable(gfloat size) -{ - if (size < KB) - return g_strdup_printf("%.1f B", size); - if (size < MB) - return g_strdup_printf("%.1f KiB", size / KB); - if (size < GB) - return g_strdup_printf("%.1f MiB", size / MB); - - return g_strdup_printf("%.1f GiB", size / GB); -} - static void scan_filesystems(void) { @@ -63,16 +47,18 @@ scan_filesystems(void) avail = (float) sfs.f_bsize * (float) sfs.f_bavail; used = size - avail; - gchar *strsize = fs_human_readable(size), - *stravail = fs_human_readable(avail), - *strused = fs_human_readable(used); + gchar *strsize = size_human_readable(size), + *stravail = size_human_readable(avail), + *strused = size_human_readable(used); gchar *strhash; if ((strhash = g_hash_table_lookup(moreinfo, tmp[0]))) { g_hash_table_remove(moreinfo, tmp[0]); g_free(strhash); } - + + strreplace(tmp[0], "#", '_'); + strhash = g_strdup_printf("[%s]\n" "Filesystem=%s\n" "Mounted As=%s\n" diff --git a/arch/linux/common/inputdevices.h b/arch/linux/common/inputdevices.h index 44a109ca..1a5baff8 100644 --- a/arch/linux/common/inputdevices.h +++ b/arch/linux/common/inputdevices.h @@ -22,8 +22,6 @@ static gboolean remove_input_devices(gpointer key, gpointer value, gpointer data) { if (!strncmp((gchar *) key, "INP", 3)) { - g_free((gchar *) key); - g_free((GtkTreeIter *) value); return TRUE; } @@ -42,7 +40,7 @@ static struct { }; void -scan_inputdevices(void) +__scan_input_devices(void) { FILE *dev; gchar buffer[128]; @@ -55,7 +53,7 @@ scan_inputdevices(void) return; if (input_list) { - g_hash_table_foreach_remove(devices, remove_input_devices, NULL); + g_hash_table_foreach_remove(moreinfo, remove_input_devices, NULL); g_free(input_list); g_free(input_icons); } @@ -103,15 +101,31 @@ scan_inputdevices(void) gchar *strhash = g_strdup_printf("[Device Information]\n" "Name=%s\n" "Type=%s\n" - "Bus=0x%x\n" - "Vendor=0x%x\n" - "Product=0x%x\n" - "Version=0x%x\n" - "Connected to=%s\n", - name, input_devices[d].name, - bus, vendor, product, - version, phys); - g_hash_table_insert(devices, tmp, strhash); + "Bus=0x%x\n", + name, + input_devices[d].name, + bus); + + const gchar *url = vendor_get_url(name); + if (url) { + strhash = g_strdup_printf("%s" + "Vendor=%s (%s)\n", + strhash, + vendor_get_name(name), + url); + } else { + strhash = g_strdup_printf("%s" + "Vendor=%x\n", + strhash, + vendor); + } + + strhash = g_strdup_printf("%s" + "Product=0x%x\n" + "Version=0x%x\n" + "Connected to=%s\n", + strhash, product, version, phys); + g_hash_table_insert(moreinfo, tmp, strhash); g_free(phys); g_free(name); diff --git a/arch/linux/common/modules.h b/arch/linux/common/modules.h index 69f7ebd6..9b895ee8 100644 --- a/arch/linux/common/modules.h +++ b/arch/linux/common/modules.h @@ -16,12 +16,37 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -void -scan_modules(void) +#define GET_STR(field_name,ptr) \ + if (!ptr && strstr(tmp[0], field_name)) { \ + ptr = g_markup_escape_text(g_strstrip(tmp[1]), strlen(tmp[1])); \ + g_strfreev(tmp); \ + continue; \ + } + +static gboolean +remove_module_devices(gpointer key, gpointer value, gpointer data) +{ + if (!strncmp((gchar *) key, "MOD", 3)) { + g_free((gchar *) key); + g_free((GtkTreeIter *) value); + return TRUE; + } + return FALSE; +} + +static void +scan_modules_do(void) { FILE *lsmod; gchar buffer[1024]; + if (module_list) { + g_free(module_list); + module_list = NULL; + } + + g_hash_table_foreach_remove(moreinfo, remove_module_devices, NULL); + lsmod = popen("/sbin/lsmod", "r"); if (!lsmod) return; @@ -44,7 +69,7 @@ scan_modules(void) sscanf(buf, "%s %ld", modname, &memory); hashkey = g_strdup_printf("MOD%s", modname); - buf = g_strdup_printf("/sbin/modinfo %s", modname); + buf = g_strdup_printf("/sbin/modinfo %s 2>/dev/null", modname); modi = popen(buf, "r"); while (fgets(buffer, 1024, modi)) { @@ -72,14 +97,14 @@ scan_modules(void) /* old modutils displays <none> when there's no value for a given field; this is not desirable in the module name display, so change it to an empty string */ - if (description && !strcmp(description, "<none>")) { + if (description && g_str_equal(description, "<none>")) { g_free(description); description = g_strdup(""); } /* append this module to the list of modules */ module_list = g_strdup_printf("%s$%s$%s=%s\n", - module_list, + module_list ? module_list : "", hashkey, modname, description ? description : ""); @@ -117,7 +142,7 @@ scan_modules(void) g_free(deps); } - g_hash_table_insert(devices, hashkey, strmodule); + g_hash_table_insert(moreinfo, hashkey, strmodule); g_free(license); g_free(description); diff --git a/arch/linux/common/net.h b/arch/linux/common/net.h index 87e7e59b..cd8b8706 100644 --- a/arch/linux/common/net.h +++ b/arch/linux/common/net.h @@ -24,14 +24,25 @@ static gchar *network_interfaces = NULL; #include <linux/sockios.h> #include <sys/socket.h> +#include <stdio.h> +#include <unistd.h> +#include <string.h> /* for strncpy */ +#include <sys/types.h> +#include <sys/socket.h> +#include <netinet/in.h> +#include <arpa/inet.h> + + typedef struct _NetInfo NetInfo; struct _NetInfo { - char name[16]; - int mtu; - unsigned char mac[8]; + char name[16]; + int mtu; + unsigned char mac[8]; + char ip[16]; + char mask[16]; + char broadcast[16]; }; - void get_net_info(char *if_name, NetInfo *netinfo) { struct ifreq ifr; @@ -39,21 +50,49 @@ void get_net_info(char *if_name, NetInfo *netinfo) fd = socket(PF_INET, SOCK_DGRAM, IPPROTO_IP); - strcpy(ifr.ifr_name, if_name); + /* IPv4 */ + ifr.ifr_addr.sa_family = AF_INET; strcpy(netinfo->name, if_name); + /* MTU */ + strcpy(ifr.ifr_name, if_name); if (ioctl(fd, SIOCGIFMTU, &ifr) < 0) { netinfo->mtu = 0; } else { netinfo->mtu = ifr.ifr_mtu; } - + + /* HW Address */ strcpy(ifr.ifr_name, if_name); if (ioctl(fd, SIOCGIFHWADDR, &ifr) < 0) { memset(netinfo->mac, 0, 8); } else { memcpy(netinfo->mac, ifr.ifr_ifru.ifru_hwaddr.sa_data, 8); } + + /* IP Address */ + strcpy(ifr.ifr_name, if_name); + if (ioctl(fd, SIOCGIFADDR, &ifr) < 0) { + netinfo->ip[0] = 0; + } else { + sprintf(netinfo->ip, "%s", inet_ntoa(((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr)); + } + + /* Mask Address */ + strcpy(ifr.ifr_name, if_name); + if (ioctl(fd, SIOCGIFNETMASK, &ifr) < 0) { + netinfo->mask[0] = 0; + } else { + sprintf(netinfo->mask, "%s", inet_ntoa(((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr)); + } + + /* Broadcast Address */ + strcpy(ifr.ifr_name, if_name); + if (ioctl(fd, SIOCGIFBRDADDR, &ifr) < 0) { + netinfo->broadcast[0] = 0; + } else { + sprintf(netinfo->broadcast, "%s", inet_ntoa(((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr)); + } shutdown(fd, 0); } @@ -162,21 +201,25 @@ scan_net_interfaces_24(void) gfloat recv_mb = recv_bytes / 1048576.0; gfloat trans_mb = trans_bytes / 1048576.0; + get_net_info(ifacename, &ni); + devid = g_strdup_printf("NET%s", ifacename); - network_interfaces = g_strdup_printf("%s$%s$%s=Sent %.2fMiB, received %.2fMiB\n", + network_interfaces = g_strdup_printf("%s$%s$%s=Sent %.2fMiB, received %.2fMiB%s\n", network_interfaces, devid, ifacename, trans_mb, - recv_mb); + recv_mb, + ni.ip[0] ? + (gchar*)idle_free(g_strdup_printf(" (%s)", ni.ip)) : ""); - get_net_info(ifacename, &ni); detailed = g_strdup_printf("[Network Adapter Properties]\n" "Interface Type=%s\n" - "Hardware Address=%02x:%02x:%02x:%02x:%02x:%02x\n" + "Hardware Address (MAC)=%02x:%02x:%02x:%02x:%02x:%02x\n" "MTU=%d\n" - "Bytes Sent=%ld (%.2fMiB)\n" - "Bytes Received=%ld (%.2fMiB)\n", + "[Transfer Details]\n" + "Bytes Received=%ld (%.2fMiB)\n" + "Bytes Sent=%ld (%.2fMiB)\n", net_get_iface_type(ifacename), ni.mac[0], ni.mac[1], ni.mac[2], ni.mac[3], @@ -184,6 +227,19 @@ scan_net_interfaces_24(void) ni.mtu, recv_bytes, recv_mb, trans_bytes, trans_mb); + + if (ni.ip[0] || ni.mask[0] || ni.broadcast[0]) { + detailed = g_strdup_printf("%s\n" + "[Internet Protocol (IPv4)]\n" + "IP Address=%s\n" + "Mask=%s\n" + "Broadcast Address=%s\n", + detailed, + ni.ip[0] ? ni.ip : "Not set", + ni.mask[0] ? ni.mask : "Not set", + ni.broadcast[0] ? ni.broadcast : "Not set"); + } + g_hash_table_insert(moreinfo, devid, detailed); } } diff --git a/arch/linux/common/os.h b/arch/linux/common/os.h index 0f7b59e3..d30146ef 100644 --- a/arch/linux/common/os.h +++ b/arch/linux/common/os.h @@ -75,7 +75,9 @@ detect_desktop_environment(OperatingSystem * os) obtain the version. */ version = popen("gnome-panel --version", "r"); if (version) { - fscanf(version, "Gnome gnome-panel %d.%d", &maj, &min); + char gnome[10]; + + fscanf(version, "%s gnome-panel %d.%d", gnome, &maj, &min); if (pclose(version)) goto unknown; } else { @@ -105,18 +107,23 @@ detect_desktop_environment(OperatingSystem * os) if (!g_getenv("DISPLAY")) { os->desktop = g_strdup("Terminal"); } else { - const gchar *windowman; GdkScreen *screen = gdk_screen_get_default(); - - windowman = gdk_x11_screen_get_window_manager_name(screen); - if (g_str_equal(windowman, "Xfwm4")) { - /* FIXME: check if xprop -root | grep XFCE_DESKTOP_WINDOW - is defined */ - os->desktop = g_strdup("XFCE 4"); + if (screen && GDK_IS_SCREEN(screen)) { + const gchar *windowman; + + windowman = gdk_x11_screen_get_window_manager_name(screen); + + if (g_str_equal(windowman, "Xfwm4")) { + /* FIXME: check if xprop -root | grep XFCE_DESKTOP_WINDOW + is defined */ + os->desktop = g_strdup("XFCE 4"); + } else { + os->desktop = g_strdup_printf("Unknown (Window Manager: %s)", + windowman); + } } else { - os->desktop = g_strdup_printf("Unknown (Window Manager: %s)", - windowman); + os->desktop = g_strdup("Unknown"); } } } diff --git a/arch/linux/common/pci.h b/arch/linux/common/pci.h index f8c9d319..e50691d0 100644 --- a/arch/linux/common/pci.h +++ b/arch/linux/common/pci.h @@ -17,7 +17,7 @@ */ void -scan_pci(void) +__scan_pci(void) { FILE *lspci; gchar buffer[256], *buf, *strhash = NULL, *strdevice = NULL; @@ -126,7 +126,7 @@ scan_pci(void) gpointer start, end; if (strdevice != NULL && strhash != NULL) { - g_hash_table_insert(devices, strhash, strdevice); + g_hash_table_insert(moreinfo, strhash, strdevice); g_free(category); g_free(name); } @@ -171,6 +171,17 @@ scan_pci(void) "Bus, device, function=%d, %d, %d\n", name, category, domain, bus, device, function); + + const gchar *url = vendor_get_url(name); + if (url) { + strdevice = g_strdup_printf("%s" + "Vendor=%s (%s)\n", + strdevice, + vendor_get_name(name), + url); + } + + pci_list = g_strdup_printf("%s$PCI%d$%s=%s\n", pci_list, n, category, name); @@ -183,7 +194,7 @@ scan_pci(void) pci_list = g_strconcat(pci_list, "No PCI devices found=\n", NULL); } else if (strhash) { /* insert the last device */ - g_hash_table_insert(devices, strhash, strdevice); + g_hash_table_insert(moreinfo, strhash, strdevice); g_free(category); g_free(name); } diff --git a/arch/linux/common/samba.h b/arch/linux/common/samba.h index 5f5ecbe5..7c7d8bb7 100644 --- a/arch/linux/common/samba.h +++ b/arch/linux/common/samba.h @@ -24,7 +24,7 @@ scan_samba_shared_directories(void) GError *error = NULL; gchar **groups; gchar *smbconf; - gsize length; + gsize length = -1; gint i = 0; if (smb_shares_list) { @@ -33,9 +33,10 @@ scan_samba_shared_directories(void) keyfile = g_key_file_new(); - if (!g_file_get_contents("/etc/samba/smb.conf", &smbconf, &length, &error)) { + if (!g_file_get_contents("/etc/samba/smb.conf", &smbconf, &length, &error) || length == 0) { smb_shares_list = g_strdup("Cannot open /etc/samba/smb.conf=\n"); - g_error_free(error); + if (error) + g_error_free(error); goto cleanup; } @@ -45,7 +46,8 @@ scan_samba_shared_directories(void) if (!g_key_file_load_from_data(keyfile, smbconf, length, 0, &error)) { smb_shares_list = g_strdup("Cannot parse smb.conf=\n"); - g_error_free(error); + if (error) + g_error_free(error); goto cleanup; } diff --git a/arch/linux/common/sensors.h b/arch/linux/common/sensors.h index ef834de2..3303d5d2 100644 --- a/arch/linux/common/sensors.h +++ b/arch/linux/common/sensors.h @@ -20,218 +20,352 @@ static gchar *sensors = NULL; static GHashTable *sensor_labels = NULL; static GHashTable *sensor_compute = NULL; -static void -read_sensor_labels(gchar *driver) +static void read_sensor_labels(gchar * driver) { FILE *conf; gchar buf[256], *line, *p; gboolean lock = FALSE; gint i; - + sensor_labels = g_hash_table_new_full(g_str_hash, g_str_equal, - g_free, g_free); + g_free, g_free); sensor_compute = g_hash_table_new(g_str_hash, g_str_equal); - + conf = fopen("/etc/sensors.conf", "r"); if (!conf) - return; - + return; + while (fgets(buf, 256, conf)) { - line = buf; - - remove_linefeed(line); - strend(line, '#'); - - if (*line == '\0') { - continue; - } else if (lock && strstr(line, "label")) { /* label lines */ - gchar **names = g_strsplit(strstr(line, "label") + 5, " ", 0); - gchar *name = NULL, *value = NULL; - - for (i = 0; names[i]; i++) { - if (names[i][0] == '\0') - continue; - - if (!name) name = g_strdup(names[i]); - else if (!value) value = g_strdup(names[i]); - else value = g_strconcat(value, " ", names[i], NULL); - } - - remove_quotes(value); - g_hash_table_insert(sensor_labels, name, value); - - g_strfreev(names); - } else if (lock && strstr(line, "ignore")) { /* ignore lines */ - p = strstr(line, "ignore") + 6; - if (!strchr(p, ' ')) - continue; - - while (*p == ' ') p++; - g_hash_table_insert(sensor_labels, g_strdup(p), "ignore"); - } else if (lock && strstr(line, "compute")) { /* compute lines */ - gchar **formulas = g_strsplit(strstr(line, "compute") + 7, " ", 0); - gchar *name = NULL, *formula = NULL; - - for (i = 0; formulas[i]; i++) { - if (formulas[i][0] == '\0') - continue; - if (formulas[i][0] == ',') - break; - - if (!name) name = g_strdup(formulas[i]); - else if (!formula) formula = g_strdup(formulas[i]); - else formula = g_strconcat(formula, formulas[i], NULL); - } - - g_strfreev(formulas); - g_hash_table_insert(sensor_compute, name, math_string_to_postfix(formula)); - } else if (g_str_has_prefix(line, "chip")) { /* chip lines (delimiter) */ - if (lock == FALSE) { - gchar **chips = g_strsplit(line, " ", 0); - - for (i = 1; chips[i]; i++) { - strend(chips[i], '*'); - - if (g_str_has_prefix(driver, chips[i] + 1)) { - lock = TRUE; - break; - } - } - - g_strfreev(chips); - } else { - break; - } - } + line = buf; + + remove_linefeed(line); + strend(line, '#'); + + if (*line == '\0') { + continue; + } else if (lock && strstr(line, "label")) { /* label lines */ + gchar **names = g_strsplit(strstr(line, "label") + 5, " ", 0); + gchar *name = NULL, *value = NULL; + + for (i = 0; names[i]; i++) { + if (names[i][0] == '\0') + continue; + + if (!name) + name = g_strdup(names[i]); + else if (!value) + value = g_strdup(names[i]); + else + value = g_strconcat(value, " ", names[i], NULL); + } + + remove_quotes(value); + g_hash_table_insert(sensor_labels, name, value); + + g_strfreev(names); + } else if (lock && strstr(line, "ignore")) { /* ignore lines */ + p = strstr(line, "ignore") + 6; + if (!strchr(p, ' ')) + continue; + + while (*p == ' ') + p++; + g_hash_table_insert(sensor_labels, g_strdup(p), "ignore"); + } else if (lock && strstr(line, "compute")) { /* compute lines */ + gchar **formulas = + g_strsplit(strstr(line, "compute") + 7, " ", 0); + gchar *name = NULL, *formula = NULL; + + for (i = 0; formulas[i]; i++) { + if (formulas[i][0] == '\0') + continue; + if (formulas[i][0] == ',') + break; + + if (!name) + name = g_strdup(formulas[i]); + else if (!formula) + formula = g_strdup(formulas[i]); + else + formula = g_strconcat(formula, formulas[i], NULL); + } + + g_strfreev(formulas); + g_hash_table_insert(sensor_compute, name, + math_string_to_postfix(formula)); + } else if (g_str_has_prefix(line, "chip")) { /* chip lines (delimiter) */ + if (lock == FALSE) { + gchar **chips = g_strsplit(line, " ", 0); + + for (i = 1; chips[i]; i++) { + strend(chips[i], '*'); + + if (g_str_has_prefix(driver, chips[i] + 1)) { + lock = TRUE; + break; + } + } + + g_strfreev(chips); + } else { + break; + } + } } - + fclose(conf); } -static gchar * -get_sensor_label(gchar *sensor) +static gchar *get_sensor_label(gchar * sensor) { gchar *ret; - + ret = g_hash_table_lookup(sensor_labels, sensor); - if (!ret) ret = g_strdup(sensor); - else ret = g_strdup(ret); + if (!ret) + ret = g_strdup(sensor); + else + ret = g_strdup(ret); return ret; } -static float -adjust_sensor(gchar *name, float value) +static float adjust_sensor(gchar * name, float value) { GSList *postfix; - + postfix = g_hash_table_lookup(sensor_compute, name); - if (!postfix) return value; - + if (!postfix) + return value; + return math_postfix_eval(postfix, value); } -static void -read_sensors(void) + +static void read_sensors_hwmon(void) { - gchar *path_hwmon, *path_sensor, *tmp, *driver, *name, *mon; int hwmon, count; - - if (sensors) - g_free(sensors); - + gchar *path_hwmon, *path_sensor, *tmp, *driver, *name, *mon; hwmon = 0; - sensors = g_strdup(""); - - path_hwmon = g_strdup_printf("/sys/class/hwmon/hwmon%d/device/", hwmon); + + path_hwmon = + g_strdup_printf("/sys/class/hwmon/hwmon%d/device/", hwmon); while (g_file_test(path_hwmon, G_FILE_TEST_EXISTS)) { - tmp = g_strdup_printf("%sdriver", path_hwmon); - driver = g_file_read_link(tmp, NULL); - g_free(tmp); - - tmp = g_path_get_basename(driver); - g_free(driver); - driver = tmp; - - if (!sensor_labels) { - read_sensor_labels(driver); - } - - sensors = g_strdup_printf("%s[Driver Info]\n" - "Name=%s\n", sensors, driver); - - sensors = g_strconcat(sensors, "[Cooling Fans]\n", NULL); - for (count = 1; ; count++) { - path_sensor = g_strdup_printf("%sfan%d_input", path_hwmon, count); - if (!g_file_get_contents(path_sensor, &tmp, NULL, NULL)) { - g_free(path_sensor); - break; - } - - mon = g_strdup_printf("fan%d", count); - name = get_sensor_label(mon); - if (!g_str_equal(name, "ignore")) { - sensors = g_strdup_printf("%s%s=%.0fRPM\n", - sensors, name, - adjust_sensor(mon, atof(tmp))); - } - - g_free(name); - g_free(mon); - g_free(tmp); - g_free(path_sensor); - } - - sensors = g_strconcat(sensors, "[Temperatures]\n", NULL); - for (count = 1; ; count++) { - path_sensor = g_strdup_printf("%stemp%d_input", path_hwmon, count); - if (!g_file_get_contents(path_sensor, &tmp, NULL, NULL)) { - g_free(path_sensor); - break; - } - - mon = g_strdup_printf("temp%d", count); - name = get_sensor_label(mon); - if (!g_str_equal(name, "ignore")) { - sensors = g_strdup_printf("%s%s=%.2f\302\260C\n", - sensors, name, - adjust_sensor(mon, atof(tmp) / 1000.0)); - } - - g_free(tmp); - g_free(name); - g_free(path_sensor); - g_free(mon); - } - - sensors = g_strconcat(sensors, "[Voltage Values]\n", NULL); - for (count = 0; ; count++) { - path_sensor = g_strdup_printf("%sin%d_input", path_hwmon, count); - if (!g_file_get_contents(path_sensor, &tmp, NULL, NULL)) { - g_free(path_sensor); - break; - } - - - mon = g_strdup_printf("in%d", count); - name = get_sensor_label(mon); - if (!g_str_equal(name, "ignore")) { - sensors = g_strdup_printf("%s%s=%.3fV\n", - sensors, name, - adjust_sensor(mon, atof(tmp) / 1000.0)); - } - - g_free(tmp); - g_free(mon); - g_free(name); - g_free(path_sensor); - } - - g_free(path_hwmon); - g_free(driver); - path_hwmon = g_strdup_printf("/sys/class/hwmon/hwmon%d/device/", ++hwmon); + tmp = g_strdup_printf("%sdriver", path_hwmon); + driver = g_file_read_link(tmp, NULL); + g_free(tmp); + + tmp = g_path_get_basename(driver); + g_free(driver); + driver = tmp; + + if (!sensor_labels) { + read_sensor_labels(driver); + } + + sensors = g_strdup_printf("%s[Driver Info]\n" + "Name=%s\n", sensors, driver); + + sensors = g_strconcat(sensors, "[Cooling Fans]\n", NULL); + for (count = 1;; count++) { + path_sensor = + g_strdup_printf("%sfan%d_input", path_hwmon, count); + if (!g_file_get_contents(path_sensor, &tmp, NULL, NULL)) { + g_free(path_sensor); + break; + } + + mon = g_strdup_printf("fan%d", count); + name = get_sensor_label(mon); + if (!g_str_equal(name, "ignore")) { + sensors = g_strdup_printf("%s%s=%.0fRPM\n", + sensors, name, + adjust_sensor(mon, atof(tmp))); + } + + g_free(name); + g_free(mon); + g_free(tmp); + g_free(path_sensor); + } + + sensors = g_strconcat(sensors, "[Temperatures]\n", NULL); + for (count = 1;; count++) { + path_sensor = + g_strdup_printf("%stemp%d_input", path_hwmon, count); + if (!g_file_get_contents(path_sensor, &tmp, NULL, NULL)) { + g_free(path_sensor); + break; + } + + mon = g_strdup_printf("temp%d", count); + name = get_sensor_label(mon); + if (!g_str_equal(name, "ignore")) { + sensors = g_strdup_printf("%s%s=%.2f\302\260C\n", + sensors, name, + adjust_sensor(mon, + atof(tmp) / + 1000.0)); + } + + g_free(tmp); + g_free(name); + g_free(path_sensor); + g_free(mon); + } + + sensors = g_strconcat(sensors, "[Voltage Values]\n", NULL); + for (count = 0;; count++) { + path_sensor = + g_strdup_printf("%sin%d_input", path_hwmon, count); + if (!g_file_get_contents(path_sensor, &tmp, NULL, NULL)) { + g_free(path_sensor); + break; + } + + + mon = g_strdup_printf("in%d", count); + name = get_sensor_label(mon); + if (!g_str_equal(name, "ignore")) { + sensors = g_strdup_printf("%s%s=%.3fV\n", + sensors, name, + adjust_sensor(mon, + atof(tmp) / + 1000.0)); + } + + g_free(tmp); + g_free(mon); + g_free(name); + g_free(path_sensor); + } + + g_free(path_hwmon); + g_free(driver); + path_hwmon = + g_strdup_printf("/sys/class/hwmon/hwmon%d/device/", ++hwmon); } - - g_free(path_hwmon); + + g_free(path_hwmon); + } +static void read_sensors_acpi(void) +{ + const gchar *path_tz = "/proc/acpi/thermal_zone"; + + if (g_file_test(path_tz, G_FILE_TEST_EXISTS)) { + GDir *tz; + + if ((tz = g_dir_open(path_tz, 0, NULL))) { + const gchar *entry; + + sensors = + g_strdup_printf("%s\n[ACPI Thermal Zone]\n", sensors); + + while ((entry = g_dir_read_name(tz))) { + gchar *path = + g_strdup_printf("%s/%s/temperature", path_tz, entry); + gchar *contents; + + if (g_file_get_contents(path, &contents, NULL, NULL)) { + int temperature; + + sscanf(contents, "temperature: %d C", &temperature); + + sensors = g_strdup_printf("%s\n%s=%d\302\260C\n", + sensors, entry, temperature); + + g_free(contents); + } + } + + g_dir_close(tz); + } + } + +} + +static void read_sensors_omnibook(void) +{ + const gchar *path_ob = "/proc/omnibook/temperature"; + gchar *contents; + + if (g_file_get_contents(path_ob, &contents, NULL, NULL)) { + int temperature; + + sscanf(contents, "CPU temperature: %d C", &temperature); + + sensors = g_strdup_printf("%s\n[Omnibook]\n" + "CPU temperature=%d\302\260C\n", + sensors, temperature); + + g_free(contents); + } +} + +static void read_sensors_hddtemp(void) +{ + Socket *s; + static gchar *old = NULL; + gchar buffer[1024]; + gint len = 0; + + if ((s = sock_connect("127.0.0.1", 7634))) { + while (!len) + len = sock_read(s, buffer, sizeof(buffer)); + sock_close(s); + + if (len > 2 && buffer[0] == '|' && buffer[1] == '/') { + gchar **disks; + int i; + + if (old) + g_free(old); + + old = g_strdup("[Hard Disk Temperature]\n"); + + disks = g_strsplit(buffer, "\n", 0); + for (i = 0; disks[i]; i++) { + gchar **fields = g_strsplit(disks[i] + 1, "|", 5); + + /* + * 0 -> /dev/hda + * 1 -> FUJITSU MHV2080AH + * 2 -> 41 + * 3 -> C + */ + old = g_strdup_printf("%s\n" + "%s (%s)=%s\302\260%s\n", + old, + fields[1], fields[0], + fields[2], fields[3]); + + g_strfreev(fields); + } + + g_strfreev(disks); + } + } else { + g_free(old); + old = NULL; + } + + if (old) { + sensors = g_strconcat(sensors, "\n", old, NULL); + } +} + +static void __scan_sensors(void) +{ + if (sensors) + g_free(sensors); + + sensors = g_strdup(""); + + read_sensors_hwmon(); + read_sensors_acpi(); + read_sensors_omnibook(); + read_sensors_hddtemp(); + + /* FIXME: Add support for ibm acpi and more sensors */ +} diff --git a/arch/linux/common/storage.h b/arch/linux/common/storage.h index 4fb682a9..836ba7ea 100644 --- a/arch/linux/common/storage.h +++ b/arch/linux/common/storage.h @@ -22,8 +22,6 @@ static gboolean remove_scsi_devices(gpointer key, gpointer value, gpointer data) { if (!strncmp((gchar *) key, "SCSI", 4)) { - g_free((gchar *) key); - g_free((GtkTreeIter *) value); return TRUE; } return FALSE; @@ -31,7 +29,7 @@ remove_scsi_devices(gpointer key, gpointer value, gpointer data) /* SCSI support by Pascal F.Martin <pascalmartin@earthlink.net> */ void -scan_scsi(void) +__scan_scsi_devices(void) { FILE *proc_scsi; gchar buffer[256], *buf; @@ -43,7 +41,7 @@ scan_scsi(void) gchar *vendor = NULL, *revision = NULL, *model = NULL; /* remove old devices from global device table */ - g_hash_table_foreach_remove(devices, remove_scsi_devices, NULL); + g_hash_table_foreach_remove(moreinfo, remove_scsi_devices, NULL); if (!g_file_test("/proc/scsi/scsi", G_FILE_TEST_EXISTS)) return; @@ -107,7 +105,7 @@ scan_scsi(void) int i; for (i = 0; type2icon[i].type != NULL; i++) - if (!strcmp(buf + 8, type2icon[i].type)) + if (g_str_equal(buf + 8, type2icon[i].type)) break; type = type2icon[i].label; @@ -120,6 +118,7 @@ scan_scsi(void) gchar *strhash = g_strdup_printf("[Device Information]\n" "Model=%s\n" + "Vendor=%s (%s)\n" "Type=%s\n" "Revision=%s\n" "[SCSI Controller]\n" @@ -127,13 +126,15 @@ scan_scsi(void) "Channel=%d\n" "ID=%d\n" "LUN=%d\n", model, + vendor_get_name(model), + vendor_get_url(model), type, revision, scsi_controller, scsi_channel, scsi_id, scsi_lun); - g_hash_table_insert(devices, devid, strhash); + g_hash_table_insert(moreinfo, devid, strhash); g_free(model); g_free(revision); @@ -147,25 +148,22 @@ static gboolean remove_ide_devices(gpointer key, gpointer value, gpointer data) { if (!strncmp((gchar *) key, "IDE", 3)) { - g_free((gchar *) key); - g_free((gchar *) value); - return TRUE; } return FALSE; } - void -scan_ide(void) +__scan_ide_devices(void) { FILE *proc_ide; gchar *device, iface, *model, *media, *pgeometry = NULL, *lgeometry = NULL; - gint n = 0, i = 0, cache; + gint n = 0, i = 0, cache, nn = 0; + gchar *capab = NULL, *speed = NULL, *driver = NULL; /* remove old devices from global device table */ - g_hash_table_foreach_remove(devices, remove_ide_devices, NULL); + g_hash_table_foreach_remove(moreinfo, remove_ide_devices, NULL); storage_list = g_strdup_printf("%s\n[IDE Disks]\n", storage_list); @@ -173,12 +171,12 @@ scan_ide(void) for (i = 0; i <= 16; i++) { device = g_strdup_printf("/proc/ide/hd%c/model", iface); if (g_file_test(device, G_FILE_TEST_EXISTS)) { - gchar buf[64]; + gchar buf[128]; cache = 0; proc_ide = fopen(device, "r"); - fgets(buf, 64, proc_ide); + fgets(buf, 128, proc_ide); fclose(proc_ide); buf[strlen(buf) - 1] = 0; @@ -189,11 +187,67 @@ scan_ide(void) device = g_strdup_printf("/proc/ide/hd%c/media", iface); proc_ide = fopen(device, "r"); - fgets(buf, 64, proc_ide); + fgets(buf, 128, proc_ide); fclose(proc_ide); buf[strlen(buf) - 1] = 0; media = g_strdup(buf); + if (g_str_equal(media, "cdrom")) { + /* obtain cd-rom drive information from cdrecord */ + GTimer *timer; + gchar *tmp = g_strdup_printf("cdrecord dev=/dev/hd%c -prcap 2>/dev/stdout", iface); + FILE *prcap; + + if ((prcap = popen(tmp, "r"))) { + /* we need a timeout so cdrecord does not try to get information on cd drives + with inserted media, which is not possible currently. half second should be + enough. */ + timer = g_timer_new(); + g_timer_start(timer); + + while (fgets(buf, 128, prcap) && g_timer_elapsed(timer, NULL) < 0.5) { + if (g_str_has_prefix(buf, " Does")) { + if (g_str_has_suffix(buf, "media\n") && !strstr(buf, "speed")) { + gchar *media_type = g_strstrip(strstr(buf, "Does ")); + gchar **ttmp = g_strsplit(media_type, " ", 0); + + capab = g_strdup_printf("%s\nCan %s#%d=%s\n", + capab ? capab : "", + ttmp[1], ++nn, ttmp[2]); + + g_strfreev(ttmp); + } else if (strstr(buf, "Buffer-Underrun-Free")) { + capab = g_strdup_printf("%s\nSupports BurnProof=%s\n", + capab ? capab : "", + strstr(buf, "Does not") ? "No" : "Yes"); + } else if (strstr(buf, "multi-session")) { + capab = g_strdup_printf("%s\nCan read multi-session CDs=%s\n", + capab ? capab : "", + strstr(buf, "Does not") ? "No" : "Yes"); + } else if (strstr(buf, "audio CDs")) { + capab = g_strdup_printf("%s\nCan play audio CDs=%s\n", + capab ? capab : "", + strstr(buf, "Does not") ? "No" : "Yes"); + } else if (strstr(buf, "PREVENT/ALLOW")) { + capab = g_strdup_printf("%s\nCan lock media=%s\n", + capab ? capab : "", + strstr(buf, "Does not") ? "No" : "Yes"); + } + } else if ((strstr(buf, "read") || strstr(buf, "write")) && strstr(buf, "kB/s")) { + speed = g_strconcat(speed ? speed : "", + strreplace(g_strstrip(buf), ":", '='), + "\n", NULL); + } else if (strstr(buf, "Device seems to be")) { + driver = g_strdup_printf("Driver=%s\n", strchr(buf, ':') + 1); + } + } + + pclose(prcap); + g_timer_destroy(timer); + } + + g_free(tmp); + } g_free(device); @@ -242,24 +296,53 @@ scan_ide(void) gchar *strhash = g_strdup_printf("[Device Information]\n" "Model=%s\n" + "Vendor=%s (%s)\n" "Device Name=hd%c\n" - "Media=%s\n" "Cache=%dkb\n", - model, iface, media, cache); - if (pgeometry && lgeometry) + "Media=%s\n" + "Cache=%dkb\n", + model, + vendor_get_name(model), + vendor_get_url(model), + iface, + media, + cache); + if (driver) { + strhash = g_strdup_printf("%s%s\n", strhash, driver); + + g_free(driver); + driver = NULL; + } + + if (pgeometry && lgeometry) { strhash = g_strdup_printf("%s[Geometry]\n" "Physical=%s\n" "Logical=%s\n", strhash, pgeometry, lgeometry); + + g_free(pgeometry); + pgeometry = NULL; + g_free(lgeometry); + lgeometry = NULL; + } + + if (capab) { + strhash = g_strdup_printf("%s[Capabilities]\n%s", strhash, capab); + + g_free(capab); + capab = NULL; + } - g_hash_table_insert(devices, devid, strhash); + if (speed) { + strhash = g_strdup_printf("%s[Speeds]\n%s", strhash, speed); + + g_free(speed); + speed = NULL; + } + + g_hash_table_insert(moreinfo, devid, strhash); g_free(model); model = ""; - - g_free(pgeometry); - pgeometry = NULL; - g_free(lgeometry); - lgeometry = NULL; } else g_free(device); diff --git a/arch/linux/common/uptime.h b/arch/linux/common/uptime.h index cf339bf3..9225c85c 100644 --- a/arch/linux/common/uptime.h +++ b/arch/linux/common/uptime.h @@ -50,7 +50,6 @@ computer_get_formatted_uptime() /* FIXME: Use ngettext */ #define plural(x) ((x > 1) ? "s" : "") - if (ui->days < 1) { if (ui->hours < 1) { tmp = diff --git a/arch/linux/common/usb.h b/arch/linux/common/usb.h index a52be2cb..d59f5f01 100644 --- a/arch/linux/common/usb.h +++ b/arch/linux/common/usb.h @@ -20,11 +20,6 @@ static gboolean remove_usb_devices(gpointer key, gpointer value, gpointer data) { if (!strncmp((gchar *) key, "USB", 3)) { - GtkTreeIter *iter = (GtkTreeIter *) data; - - g_free((gchar *) value); - g_free(iter); - return TRUE; } return FALSE; @@ -32,7 +27,7 @@ remove_usb_devices(gpointer key, gpointer value, gpointer data) static gchar *usb_list = NULL; void -scan_usb(void) +__scan_usb(void) { FILE *dev; gchar buffer[128]; @@ -47,7 +42,7 @@ scan_usb(void) return; if (usb_list) { - g_hash_table_foreach_remove(devices, remove_usb_devices, NULL); + g_hash_table_foreach_remove(moreinfo, remove_usb_devices, NULL); g_free(usb_list); } usb_list = g_strdup(""); @@ -100,6 +95,13 @@ scan_usb(void) usb_list = g_strdup_printf("%s$%s$%s=\n", usb_list, tmp, product); + const gchar *url = vendor_get_url(manuf); + if (url) { + gchar *tmp = g_strdup_printf("%s (%s)", manuf, url); + g_free(manuf); + manuf = tmp; + } + gchar *strhash = g_strdup_printf("[Device Information]\n" "Product=%s\n" "Manufacturer=%s\n" @@ -118,7 +120,7 @@ scan_usb(void) ver, rev, classid, vendor, prodid, bus, level); - g_hash_table_insert(devices, tmp, strhash); + g_hash_table_insert(moreinfo, tmp, strhash); } g_free(manuf); diff --git a/arch/linux/ia64/alsa.h b/arch/linux/ia64/alsa.h new file mode 120000 index 00000000..ede8a364 --- /dev/null +++ b/arch/linux/ia64/alsa.h @@ -0,0 +1 @@ +../../../arch/linux/common/alsa.h
\ No newline at end of file diff --git a/arch/linux/ia64/boots.h b/arch/linux/ia64/boots.h new file mode 120000 index 00000000..97384500 --- /dev/null +++ b/arch/linux/ia64/boots.h @@ -0,0 +1 @@ +../../../arch/linux/common/boots.h
\ No newline at end of file diff --git a/arch/linux/ia64/devmemory.h b/arch/linux/ia64/devmemory.h new file mode 120000 index 00000000..f8a833e7 --- /dev/null +++ b/arch/linux/ia64/devmemory.h @@ -0,0 +1 @@ +../../../arch/linux/common/devmemory.h
\ No newline at end of file diff --git a/arch/linux/ia64/filesystem.h b/arch/linux/ia64/filesystem.h new file mode 120000 index 00000000..d884bcd0 --- /dev/null +++ b/arch/linux/ia64/filesystem.h @@ -0,0 +1 @@ +../../../arch/linux/common/filesystem.h
\ No newline at end of file diff --git a/arch/linux/ia64/inputdevices.h b/arch/linux/ia64/inputdevices.h new file mode 120000 index 00000000..0f594231 --- /dev/null +++ b/arch/linux/ia64/inputdevices.h @@ -0,0 +1 @@ +../../../arch/linux/common/inputdevices.h
\ No newline at end of file diff --git a/arch/linux/ia64/loadavg.h b/arch/linux/ia64/loadavg.h new file mode 120000 index 00000000..1f64e107 --- /dev/null +++ b/arch/linux/ia64/loadavg.h @@ -0,0 +1 @@ +../../../arch/linux/common/loadavg.h
\ No newline at end of file diff --git a/arch/linux/ia64/memory.h b/arch/linux/ia64/memory.h new file mode 120000 index 00000000..64c6e0ed --- /dev/null +++ b/arch/linux/ia64/memory.h @@ -0,0 +1 @@ +../../../arch/linux/common/memory.h
\ No newline at end of file diff --git a/arch/linux/ia64/modules.h b/arch/linux/ia64/modules.h new file mode 120000 index 00000000..d21c9a20 --- /dev/null +++ b/arch/linux/ia64/modules.h @@ -0,0 +1 @@ +../../../arch/linux/common/modules.h
\ No newline at end of file diff --git a/arch/linux/ia64/net.h b/arch/linux/ia64/net.h new file mode 120000 index 00000000..488b5ae3 --- /dev/null +++ b/arch/linux/ia64/net.h @@ -0,0 +1 @@ +../../../arch/linux/common/net.h
\ No newline at end of file diff --git a/arch/linux/ia64/nfs.h b/arch/linux/ia64/nfs.h new file mode 120000 index 00000000..73e0b8c9 --- /dev/null +++ b/arch/linux/ia64/nfs.h @@ -0,0 +1 @@ +../../../arch/linux/common/nfs.h
\ No newline at end of file diff --git a/arch/linux/ia64/os.h b/arch/linux/ia64/os.h new file mode 120000 index 00000000..44051626 --- /dev/null +++ b/arch/linux/ia64/os.h @@ -0,0 +1 @@ +../../../arch/linux/common/os.h
\ No newline at end of file diff --git a/arch/linux/ia64/pci.h b/arch/linux/ia64/pci.h new file mode 120000 index 00000000..8df04a0e --- /dev/null +++ b/arch/linux/ia64/pci.h @@ -0,0 +1 @@ +../../../arch/linux/common/pci.h
\ No newline at end of file diff --git a/arch/linux/mips/.svn/text-base/processor.h.svn-base b/arch/linux/ia64/processor.h index 8be922f9..bc1d7f08 100644 --- a/arch/linux/mips/.svn/text-base/processor.h.svn-base +++ b/arch/linux/ia64/processor.h @@ -16,8 +16,15 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -static Processor * -computer_get_processor(void) +struct _Processor { + gchar *model_name; + gchar *vendor_id; + gfloat bogomips; + gchar *strmodel; +}; + +static GSList * +__scan_processors(void) { Processor *processor; FILE *cpuinfo; @@ -35,36 +42,39 @@ computer_get_processor(void) tmp[0] = g_strstrip(tmp[0]); tmp[1] = g_strstrip(tmp[1]); - get_str("system type", processor->model_name); - get_str("cpu model", processor->vendor_id); - get_float("cpu MHz", processor->cpu_mhz); + get_str("vendor", processor->model_name); + get_str("arch", processor->vendor_id); + get_str("family", processor->strmodel); get_float("BogoMIPS", processor->bogomips); + } g_strfreev(tmp); } - + fclose(cpuinfo); - return processor; + return g_slist_append(NULL, processor); } static gchar * -processor_get_info(Processor *processor) +processor_get_info(GSList *processors) { + Processor *processor = (Processor *)processors->data; + return g_strdup_printf("[Processor]\n" - "System Type=%s\n" - "CPU Model=%s\n" - "Frequency=%.2fMHz\n" - "BogoMIPS=%.2f\n" - "Byte Order=%s\n", + "Model=%s\n" + "Architecture=%s\n" + "Family=%sMHz\n" + "BogoMIPS=%s\n" + "Byte Order=%s\n", processor->model_name, processor->vendor_id, - processor->cpu_mhz, + processor->strmodel, processor->bogomips, #if G_BYTE_ORDER == G_LITTLE_ENDIAN "Little Endian" #else "Big Endian" #endif - ); + ); } diff --git a/arch/linux/ia64/samba.h b/arch/linux/ia64/samba.h new file mode 120000 index 00000000..ebab9b11 --- /dev/null +++ b/arch/linux/ia64/samba.h @@ -0,0 +1 @@ +../../../arch/linux/common/samba.h
\ No newline at end of file diff --git a/arch/linux/ia64/sensors.h b/arch/linux/ia64/sensors.h new file mode 120000 index 00000000..3b799377 --- /dev/null +++ b/arch/linux/ia64/sensors.h @@ -0,0 +1 @@ +../../../arch/linux/common/sensors.h
\ No newline at end of file diff --git a/arch/linux/ia64/storage.h b/arch/linux/ia64/storage.h new file mode 120000 index 00000000..3ea886ce --- /dev/null +++ b/arch/linux/ia64/storage.h @@ -0,0 +1 @@ +../../../arch/linux/common/storage.h
\ No newline at end of file diff --git a/arch/linux/ia64/uptime.h b/arch/linux/ia64/uptime.h new file mode 120000 index 00000000..a5bac980 --- /dev/null +++ b/arch/linux/ia64/uptime.h @@ -0,0 +1 @@ +../../../arch/linux/common/uptime.h
\ No newline at end of file diff --git a/arch/linux/ia64/usb.h b/arch/linux/ia64/usb.h new file mode 120000 index 00000000..aee3046c --- /dev/null +++ b/arch/linux/ia64/usb.h @@ -0,0 +1 @@ +../../../arch/linux/common/usb.h
\ No newline at end of file diff --git a/arch/linux/m68k/.svn/README.txt b/arch/linux/m68k/.svn/README.txt deleted file mode 100644 index 271a8ce9..00000000 --- a/arch/linux/m68k/.svn/README.txt +++ /dev/null @@ -1,2 +0,0 @@ -This is a Subversion working copy administrative directory. -Visit http://subversion.tigris.org/ for more information. diff --git a/arch/linux/m68k/.svn/empty-file b/arch/linux/m68k/.svn/empty-file deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/m68k/.svn/empty-file +++ /dev/null diff --git a/arch/linux/m68k/.svn/entries b/arch/linux/m68k/.svn/entries deleted file mode 100644 index 878516e0..00000000 --- a/arch/linux/m68k/.svn/entries +++ /dev/null @@ -1,159 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<wc-entries - xmlns="svn:"> -<entry - committed-rev="4" - name="" - committed-date="2006-01-31T23:35:06.244169Z" - url="svn+ssh://lafp@svn.berlios.de/svnroot/repos/hardinfo/trunk/hardinfo2/arch/linux/m68k" - last-author="lafp" - kind="dir" - uuid="03931a0e-0c0b-0410-87e6-c9e79dddb921" - repos="svn+ssh://lafp@svn.berlios.de/svnroot/repos/hardinfo" - revision="9"/> -<entry - committed-rev="4" - name="usb.h" - text-time="2006-05-20T14:29:22.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="0ed17ec7082ecf81bc512f4d2add7bec" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:20.000000Z"/> -<entry - committed-rev="4" - name="sensors.h" - text-time="2006-05-20T14:29:22.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="ba83966be8f142e8f9fbed44bfc77b7a" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:20.000000Z"/> -<entry - committed-rev="4" - name="inputdevices.h" - text-time="2006-05-20T14:29:22.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="1307b7aff245fa7fba84aa91f08d27fc" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:22.000000Z"/> -<entry - committed-rev="4" - name="uptime.h" - text-time="2006-05-20T14:29:22.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="760f1adef4fbcec7d74200abc3a4f6eb" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:22.000000Z"/> -<entry - committed-rev="4" - name="storage.h" - text-time="2006-05-20T14:29:22.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="602ef4aa9053cd983170660f53334cef" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:22.000000Z"/> -<entry - committed-rev="4" - name="modules.h" - text-time="2006-05-20T14:29:22.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="45dfbaaabb31981ac06e021773429228" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:22.000000Z"/> -<entry - committed-rev="4" - name="memory.h" - text-time="2006-05-20T14:29:22.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="765f1eed8d98b9bbb06c4c034ce9fa32" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:22.000000Z"/> -<entry - committed-rev="4" - name="pci.h" - text-time="2006-05-20T14:29:22.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="cab1a2936974aed489c107f3643b3484" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:20.000000Z"/> -<entry - committed-rev="4" - name="loadavg.h" - text-time="2006-05-20T14:29:22.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="1c83a008e883018ff1092781358ec2da" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:20.000000Z"/> -<entry - committed-rev="4" - name="processor.h" - text-time="2006-05-20T14:29:22.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="b0be8780283e94e9eb694153c9b19d8a" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:20.000000Z"/> -<entry - committed-rev="4" - name="alsa.h" - text-time="2006-05-20T14:29:22.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="dc249687377b2de88793ee09bf54f1f1" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:20.000000Z"/> -<entry - committed-rev="4" - name="os.h" - text-time="2006-05-20T14:29:22.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="048c3f4b338d765be4f10b5067d8b50e" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:22.000000Z"/> -<entry - committed-rev="4" - name="samba.h" - text-time="2006-05-20T14:29:22.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="b541109072721d735717a33724ce9127" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:22.000000Z"/> -<entry - committed-rev="4" - name="filesystem.h" - text-time="2006-05-20T14:29:22.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="7f23b37be4cf5009414843bfe5c4e450" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:22.000000Z"/> -<entry - committed-rev="4" - name="net.h" - text-time="2006-05-20T14:29:22.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="22e5b201692010dee02e9562ce6cba1b" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:22.000000Z"/> -<entry - committed-rev="13" - name="nfs.h" - text-time="2006-05-22T12:07:13.000000Z" - committed-date="2006-05-22T12:11:05.185078Z" - checksum="382976a6eab28131079a346dd16edcd7" - last-author="lafp" - kind="file" - prop-time="2006-05-22T12:07:36.000000Z" - revision="13"/> -</wc-entries> diff --git a/arch/linux/m68k/.svn/format b/arch/linux/m68k/.svn/format deleted file mode 100644 index b8626c4c..00000000 --- a/arch/linux/m68k/.svn/format +++ /dev/null @@ -1 +0,0 @@ -4 diff --git a/arch/linux/m68k/.svn/prop-base/alsa.h.svn-base b/arch/linux/m68k/.svn/prop-base/alsa.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/m68k/.svn/prop-base/alsa.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/m68k/.svn/prop-base/filesystem.h.svn-base b/arch/linux/m68k/.svn/prop-base/filesystem.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/m68k/.svn/prop-base/filesystem.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/m68k/.svn/prop-base/inputdevices.h.svn-base b/arch/linux/m68k/.svn/prop-base/inputdevices.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/m68k/.svn/prop-base/inputdevices.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/m68k/.svn/prop-base/loadavg.h.svn-base b/arch/linux/m68k/.svn/prop-base/loadavg.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/m68k/.svn/prop-base/loadavg.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/m68k/.svn/prop-base/memory.h.svn-base b/arch/linux/m68k/.svn/prop-base/memory.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/m68k/.svn/prop-base/memory.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/m68k/.svn/prop-base/modules.h.svn-base b/arch/linux/m68k/.svn/prop-base/modules.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/m68k/.svn/prop-base/modules.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/m68k/.svn/prop-base/net.h.svn-base b/arch/linux/m68k/.svn/prop-base/net.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/m68k/.svn/prop-base/net.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/m68k/.svn/prop-base/nfs.h.svn-base b/arch/linux/m68k/.svn/prop-base/nfs.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/m68k/.svn/prop-base/nfs.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/m68k/.svn/prop-base/os.h.svn-base b/arch/linux/m68k/.svn/prop-base/os.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/m68k/.svn/prop-base/os.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/m68k/.svn/prop-base/pci.h.svn-base b/arch/linux/m68k/.svn/prop-base/pci.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/m68k/.svn/prop-base/pci.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/m68k/.svn/prop-base/processor.h.svn-base b/arch/linux/m68k/.svn/prop-base/processor.h.svn-base deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/m68k/.svn/prop-base/processor.h.svn-base +++ /dev/null diff --git a/arch/linux/m68k/.svn/prop-base/samba.h.svn-base b/arch/linux/m68k/.svn/prop-base/samba.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/m68k/.svn/prop-base/samba.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/m68k/.svn/prop-base/sensors.h.svn-base b/arch/linux/m68k/.svn/prop-base/sensors.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/m68k/.svn/prop-base/sensors.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/m68k/.svn/prop-base/storage.h.svn-base b/arch/linux/m68k/.svn/prop-base/storage.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/m68k/.svn/prop-base/storage.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/m68k/.svn/prop-base/uptime.h.svn-base b/arch/linux/m68k/.svn/prop-base/uptime.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/m68k/.svn/prop-base/uptime.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/m68k/.svn/prop-base/usb.h.svn-base b/arch/linux/m68k/.svn/prop-base/usb.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/m68k/.svn/prop-base/usb.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/m68k/.svn/props/alsa.h.svn-work b/arch/linux/m68k/.svn/props/alsa.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/m68k/.svn/props/alsa.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/m68k/.svn/props/filesystem.h.svn-work b/arch/linux/m68k/.svn/props/filesystem.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/m68k/.svn/props/filesystem.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/m68k/.svn/props/inputdevices.h.svn-work b/arch/linux/m68k/.svn/props/inputdevices.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/m68k/.svn/props/inputdevices.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/m68k/.svn/props/loadavg.h.svn-work b/arch/linux/m68k/.svn/props/loadavg.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/m68k/.svn/props/loadavg.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/m68k/.svn/props/memory.h.svn-work b/arch/linux/m68k/.svn/props/memory.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/m68k/.svn/props/memory.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/m68k/.svn/props/modules.h.svn-work b/arch/linux/m68k/.svn/props/modules.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/m68k/.svn/props/modules.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/m68k/.svn/props/net.h.svn-work b/arch/linux/m68k/.svn/props/net.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/m68k/.svn/props/net.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/m68k/.svn/props/nfs.h.svn-work b/arch/linux/m68k/.svn/props/nfs.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/m68k/.svn/props/nfs.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/m68k/.svn/props/os.h.svn-work b/arch/linux/m68k/.svn/props/os.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/m68k/.svn/props/os.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/m68k/.svn/props/pci.h.svn-work b/arch/linux/m68k/.svn/props/pci.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/m68k/.svn/props/pci.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/m68k/.svn/props/processor.h.svn-work b/arch/linux/m68k/.svn/props/processor.h.svn-work deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/m68k/.svn/props/processor.h.svn-work +++ /dev/null diff --git a/arch/linux/m68k/.svn/props/samba.h.svn-work b/arch/linux/m68k/.svn/props/samba.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/m68k/.svn/props/samba.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/m68k/.svn/props/sensors.h.svn-work b/arch/linux/m68k/.svn/props/sensors.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/m68k/.svn/props/sensors.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/m68k/.svn/props/storage.h.svn-work b/arch/linux/m68k/.svn/props/storage.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/m68k/.svn/props/storage.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/m68k/.svn/props/uptime.h.svn-work b/arch/linux/m68k/.svn/props/uptime.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/m68k/.svn/props/uptime.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/m68k/.svn/props/usb.h.svn-work b/arch/linux/m68k/.svn/props/usb.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/m68k/.svn/props/usb.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/m68k/.svn/text-base/alsa.h.svn-base b/arch/linux/m68k/.svn/text-base/alsa.h.svn-base deleted file mode 100644 index e17b92c3..00000000 --- a/arch/linux/m68k/.svn/text-base/alsa.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/alsa.h
\ No newline at end of file diff --git a/arch/linux/m68k/.svn/text-base/filesystem.h.svn-base b/arch/linux/m68k/.svn/text-base/filesystem.h.svn-base deleted file mode 100644 index 0d23c803..00000000 --- a/arch/linux/m68k/.svn/text-base/filesystem.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/filesystem.h
\ No newline at end of file diff --git a/arch/linux/m68k/.svn/text-base/inputdevices.h.svn-base b/arch/linux/m68k/.svn/text-base/inputdevices.h.svn-base deleted file mode 100644 index 58695156..00000000 --- a/arch/linux/m68k/.svn/text-base/inputdevices.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/inputdevices.h
\ No newline at end of file diff --git a/arch/linux/m68k/.svn/text-base/loadavg.h.svn-base b/arch/linux/m68k/.svn/text-base/loadavg.h.svn-base deleted file mode 100644 index 354f872f..00000000 --- a/arch/linux/m68k/.svn/text-base/loadavg.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/loadavg.h
\ No newline at end of file diff --git a/arch/linux/m68k/.svn/text-base/memory.h.svn-base b/arch/linux/m68k/.svn/text-base/memory.h.svn-base deleted file mode 100644 index 2b2ad528..00000000 --- a/arch/linux/m68k/.svn/text-base/memory.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/memory.h
\ No newline at end of file diff --git a/arch/linux/m68k/.svn/text-base/modules.h.svn-base b/arch/linux/m68k/.svn/text-base/modules.h.svn-base deleted file mode 100644 index d80f7d7a..00000000 --- a/arch/linux/m68k/.svn/text-base/modules.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/modules.h
\ No newline at end of file diff --git a/arch/linux/m68k/.svn/text-base/net.h.svn-base b/arch/linux/m68k/.svn/text-base/net.h.svn-base deleted file mode 100644 index 2b4ac97a..00000000 --- a/arch/linux/m68k/.svn/text-base/net.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/net.h
\ No newline at end of file diff --git a/arch/linux/m68k/.svn/text-base/nfs.h.svn-base b/arch/linux/m68k/.svn/text-base/nfs.h.svn-base deleted file mode 100644 index c10bd829..00000000 --- a/arch/linux/m68k/.svn/text-base/nfs.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/nfs.h
\ No newline at end of file diff --git a/arch/linux/m68k/.svn/text-base/os.h.svn-base b/arch/linux/m68k/.svn/text-base/os.h.svn-base deleted file mode 100644 index 49613b1f..00000000 --- a/arch/linux/m68k/.svn/text-base/os.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/os.h
\ No newline at end of file diff --git a/arch/linux/m68k/.svn/text-base/pci.h.svn-base b/arch/linux/m68k/.svn/text-base/pci.h.svn-base deleted file mode 100644 index 2386d2ad..00000000 --- a/arch/linux/m68k/.svn/text-base/pci.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/pci.h
\ No newline at end of file diff --git a/arch/linux/m68k/.svn/text-base/samba.h.svn-base b/arch/linux/m68k/.svn/text-base/samba.h.svn-base deleted file mode 100644 index 246e9ed0..00000000 --- a/arch/linux/m68k/.svn/text-base/samba.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/samba.h
\ No newline at end of file diff --git a/arch/linux/m68k/.svn/text-base/sensors.h.svn-base b/arch/linux/m68k/.svn/text-base/sensors.h.svn-base deleted file mode 100644 index 822de7b7..00000000 --- a/arch/linux/m68k/.svn/text-base/sensors.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/sensors.h
\ No newline at end of file diff --git a/arch/linux/m68k/.svn/text-base/storage.h.svn-base b/arch/linux/m68k/.svn/text-base/storage.h.svn-base deleted file mode 100644 index 24568f89..00000000 --- a/arch/linux/m68k/.svn/text-base/storage.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/storage.h
\ No newline at end of file diff --git a/arch/linux/m68k/.svn/text-base/uptime.h.svn-base b/arch/linux/m68k/.svn/text-base/uptime.h.svn-base deleted file mode 100644 index 25cc41e9..00000000 --- a/arch/linux/m68k/.svn/text-base/uptime.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/uptime.h
\ No newline at end of file diff --git a/arch/linux/m68k/.svn/text-base/usb.h.svn-base b/arch/linux/m68k/.svn/text-base/usb.h.svn-base deleted file mode 100644 index 8aece87f..00000000 --- a/arch/linux/m68k/.svn/text-base/usb.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/usb.h
\ No newline at end of file diff --git a/arch/linux/m68k/battery.h b/arch/linux/m68k/battery.h new file mode 120000 index 00000000..e4c794f2 --- /dev/null +++ b/arch/linux/m68k/battery.h @@ -0,0 +1 @@ +../../linux/common/battery.h
\ No newline at end of file diff --git a/arch/linux/m68k/boots.h b/arch/linux/m68k/boots.h new file mode 120000 index 00000000..97384500 --- /dev/null +++ b/arch/linux/m68k/boots.h @@ -0,0 +1 @@ +../../../arch/linux/common/boots.h
\ No newline at end of file diff --git a/arch/linux/m68k/devmemory.h b/arch/linux/m68k/devmemory.h new file mode 120000 index 00000000..f8a833e7 --- /dev/null +++ b/arch/linux/m68k/devmemory.h @@ -0,0 +1 @@ +../../../arch/linux/common/devmemory.h
\ No newline at end of file diff --git a/arch/linux/m68k/processor.h b/arch/linux/m68k/processor.h index 0a1bab62..0fb59d24 100644 --- a/arch/linux/m68k/processor.h +++ b/arch/linux/m68k/processor.h @@ -16,8 +16,15 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -static Processor * -computer_get_processor(void) +struct _Processor { + gchar *model_name; + gfloat bogomips, cpu_mhz; + + gchar *has_fpu; +}; + +static GSList * +__scan_processors(void) { Processor *processor; FILE *cpuinfo; @@ -51,12 +58,14 @@ computer_get_processor(void) fclose(cpuinfo); - return processor; + return g_slist_append(NULL, processor); } static gchar * -processor_get_info(Processor *processor) +processor_get_info(GSList *processors) { + Processor *processor = (Processor *)processors->data; + return g_strdup_printf("[Processor]\n" "Name=%s\n" "Frequency=%.2fMHz\n" diff --git a/arch/linux/mips/.svn/README.txt b/arch/linux/mips/.svn/README.txt deleted file mode 100644 index 271a8ce9..00000000 --- a/arch/linux/mips/.svn/README.txt +++ /dev/null @@ -1,2 +0,0 @@ -This is a Subversion working copy administrative directory. -Visit http://subversion.tigris.org/ for more information. diff --git a/arch/linux/mips/.svn/empty-file b/arch/linux/mips/.svn/empty-file deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/mips/.svn/empty-file +++ /dev/null diff --git a/arch/linux/mips/.svn/entries b/arch/linux/mips/.svn/entries deleted file mode 100644 index ff41e403..00000000 --- a/arch/linux/mips/.svn/entries +++ /dev/null @@ -1,159 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<wc-entries - xmlns="svn:"> -<entry - committed-rev="4" - name="" - committed-date="2006-01-31T23:35:06.244169Z" - url="svn+ssh://lafp@svn.berlios.de/svnroot/repos/hardinfo/trunk/hardinfo2/arch/linux/mips" - last-author="lafp" - kind="dir" - uuid="03931a0e-0c0b-0410-87e6-c9e79dddb921" - repos="svn+ssh://lafp@svn.berlios.de/svnroot/repos/hardinfo" - revision="9"/> -<entry - committed-rev="4" - name="usb.h" - text-time="2006-05-20T14:29:27.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="0ed17ec7082ecf81bc512f4d2add7bec" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:25.000000Z"/> -<entry - committed-rev="4" - name="sensors.h" - text-time="2006-05-20T14:29:27.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="ba83966be8f142e8f9fbed44bfc77b7a" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:25.000000Z"/> -<entry - committed-rev="4" - name="inputdevices.h" - text-time="2006-05-20T14:29:27.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="1307b7aff245fa7fba84aa91f08d27fc" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:27.000000Z"/> -<entry - committed-rev="4" - name="uptime.h" - text-time="2006-05-20T14:29:27.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="760f1adef4fbcec7d74200abc3a4f6eb" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:27.000000Z"/> -<entry - committed-rev="4" - name="storage.h" - text-time="2006-05-20T14:29:27.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="602ef4aa9053cd983170660f53334cef" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:27.000000Z"/> -<entry - committed-rev="4" - name="modules.h" - text-time="2006-05-20T14:29:27.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="45dfbaaabb31981ac06e021773429228" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:27.000000Z"/> -<entry - committed-rev="4" - name="memory.h" - text-time="2006-05-20T14:29:27.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="765f1eed8d98b9bbb06c4c034ce9fa32" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:27.000000Z"/> -<entry - committed-rev="4" - name="pci.h" - text-time="2006-05-20T14:29:27.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="cab1a2936974aed489c107f3643b3484" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:25.000000Z"/> -<entry - committed-rev="4" - name="loadavg.h" - text-time="2006-05-20T14:29:27.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="1c83a008e883018ff1092781358ec2da" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:25.000000Z"/> -<entry - committed-rev="4" - name="processor.h" - text-time="2006-05-20T14:29:27.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="2cfddc7b7aa4eb98ba1b6cfa30b03f28" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:27.000000Z"/> -<entry - committed-rev="4" - name="alsa.h" - text-time="2006-05-20T14:29:27.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="dc249687377b2de88793ee09bf54f1f1" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:27.000000Z"/> -<entry - committed-rev="4" - name="os.h" - text-time="2006-05-20T14:29:27.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="048c3f4b338d765be4f10b5067d8b50e" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:27.000000Z"/> -<entry - committed-rev="4" - name="samba.h" - text-time="2006-05-20T14:29:27.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="b541109072721d735717a33724ce9127" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:27.000000Z"/> -<entry - committed-rev="4" - name="filesystem.h" - text-time="2006-05-20T14:29:27.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="7f23b37be4cf5009414843bfe5c4e450" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:27.000000Z"/> -<entry - committed-rev="4" - name="net.h" - text-time="2006-05-20T14:29:27.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="22e5b201692010dee02e9562ce6cba1b" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:27.000000Z"/> -<entry - committed-rev="13" - name="nfs.h" - text-time="2006-05-22T12:07:16.000000Z" - committed-date="2006-05-22T12:11:05.185078Z" - checksum="382976a6eab28131079a346dd16edcd7" - last-author="lafp" - kind="file" - prop-time="2006-05-22T12:07:36.000000Z" - revision="13"/> -</wc-entries> diff --git a/arch/linux/mips/.svn/format b/arch/linux/mips/.svn/format deleted file mode 100644 index b8626c4c..00000000 --- a/arch/linux/mips/.svn/format +++ /dev/null @@ -1 +0,0 @@ -4 diff --git a/arch/linux/mips/.svn/prop-base/alsa.h.svn-base b/arch/linux/mips/.svn/prop-base/alsa.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/mips/.svn/prop-base/alsa.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/mips/.svn/prop-base/filesystem.h.svn-base b/arch/linux/mips/.svn/prop-base/filesystem.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/mips/.svn/prop-base/filesystem.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/mips/.svn/prop-base/inputdevices.h.svn-base b/arch/linux/mips/.svn/prop-base/inputdevices.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/mips/.svn/prop-base/inputdevices.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/mips/.svn/prop-base/loadavg.h.svn-base b/arch/linux/mips/.svn/prop-base/loadavg.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/mips/.svn/prop-base/loadavg.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/mips/.svn/prop-base/memory.h.svn-base b/arch/linux/mips/.svn/prop-base/memory.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/mips/.svn/prop-base/memory.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/mips/.svn/prop-base/modules.h.svn-base b/arch/linux/mips/.svn/prop-base/modules.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/mips/.svn/prop-base/modules.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/mips/.svn/prop-base/net.h.svn-base b/arch/linux/mips/.svn/prop-base/net.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/mips/.svn/prop-base/net.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/mips/.svn/prop-base/nfs.h.svn-base b/arch/linux/mips/.svn/prop-base/nfs.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/mips/.svn/prop-base/nfs.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/mips/.svn/prop-base/os.h.svn-base b/arch/linux/mips/.svn/prop-base/os.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/mips/.svn/prop-base/os.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/mips/.svn/prop-base/pci.h.svn-base b/arch/linux/mips/.svn/prop-base/pci.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/mips/.svn/prop-base/pci.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/mips/.svn/prop-base/processor.h.svn-base b/arch/linux/mips/.svn/prop-base/processor.h.svn-base deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/mips/.svn/prop-base/processor.h.svn-base +++ /dev/null diff --git a/arch/linux/mips/.svn/prop-base/samba.h.svn-base b/arch/linux/mips/.svn/prop-base/samba.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/mips/.svn/prop-base/samba.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/mips/.svn/prop-base/sensors.h.svn-base b/arch/linux/mips/.svn/prop-base/sensors.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/mips/.svn/prop-base/sensors.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/mips/.svn/prop-base/storage.h.svn-base b/arch/linux/mips/.svn/prop-base/storage.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/mips/.svn/prop-base/storage.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/mips/.svn/prop-base/uptime.h.svn-base b/arch/linux/mips/.svn/prop-base/uptime.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/mips/.svn/prop-base/uptime.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/mips/.svn/prop-base/usb.h.svn-base b/arch/linux/mips/.svn/prop-base/usb.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/mips/.svn/prop-base/usb.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/mips/.svn/props/alsa.h.svn-work b/arch/linux/mips/.svn/props/alsa.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/mips/.svn/props/alsa.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/mips/.svn/props/filesystem.h.svn-work b/arch/linux/mips/.svn/props/filesystem.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/mips/.svn/props/filesystem.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/mips/.svn/props/inputdevices.h.svn-work b/arch/linux/mips/.svn/props/inputdevices.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/mips/.svn/props/inputdevices.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/mips/.svn/props/loadavg.h.svn-work b/arch/linux/mips/.svn/props/loadavg.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/mips/.svn/props/loadavg.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/mips/.svn/props/memory.h.svn-work b/arch/linux/mips/.svn/props/memory.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/mips/.svn/props/memory.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/mips/.svn/props/modules.h.svn-work b/arch/linux/mips/.svn/props/modules.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/mips/.svn/props/modules.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/mips/.svn/props/net.h.svn-work b/arch/linux/mips/.svn/props/net.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/mips/.svn/props/net.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/mips/.svn/props/nfs.h.svn-work b/arch/linux/mips/.svn/props/nfs.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/mips/.svn/props/nfs.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/mips/.svn/props/os.h.svn-work b/arch/linux/mips/.svn/props/os.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/mips/.svn/props/os.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/mips/.svn/props/pci.h.svn-work b/arch/linux/mips/.svn/props/pci.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/mips/.svn/props/pci.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/mips/.svn/props/processor.h.svn-work b/arch/linux/mips/.svn/props/processor.h.svn-work deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/mips/.svn/props/processor.h.svn-work +++ /dev/null diff --git a/arch/linux/mips/.svn/props/samba.h.svn-work b/arch/linux/mips/.svn/props/samba.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/mips/.svn/props/samba.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/mips/.svn/props/sensors.h.svn-work b/arch/linux/mips/.svn/props/sensors.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/mips/.svn/props/sensors.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/mips/.svn/props/storage.h.svn-work b/arch/linux/mips/.svn/props/storage.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/mips/.svn/props/storage.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/mips/.svn/props/uptime.h.svn-work b/arch/linux/mips/.svn/props/uptime.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/mips/.svn/props/uptime.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/mips/.svn/props/usb.h.svn-work b/arch/linux/mips/.svn/props/usb.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/mips/.svn/props/usb.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/mips/.svn/text-base/alsa.h.svn-base b/arch/linux/mips/.svn/text-base/alsa.h.svn-base deleted file mode 100644 index e17b92c3..00000000 --- a/arch/linux/mips/.svn/text-base/alsa.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/alsa.h
\ No newline at end of file diff --git a/arch/linux/mips/.svn/text-base/filesystem.h.svn-base b/arch/linux/mips/.svn/text-base/filesystem.h.svn-base deleted file mode 100644 index 0d23c803..00000000 --- a/arch/linux/mips/.svn/text-base/filesystem.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/filesystem.h
\ No newline at end of file diff --git a/arch/linux/mips/.svn/text-base/inputdevices.h.svn-base b/arch/linux/mips/.svn/text-base/inputdevices.h.svn-base deleted file mode 100644 index 58695156..00000000 --- a/arch/linux/mips/.svn/text-base/inputdevices.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/inputdevices.h
\ No newline at end of file diff --git a/arch/linux/mips/.svn/text-base/loadavg.h.svn-base b/arch/linux/mips/.svn/text-base/loadavg.h.svn-base deleted file mode 100644 index 354f872f..00000000 --- a/arch/linux/mips/.svn/text-base/loadavg.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/loadavg.h
\ No newline at end of file diff --git a/arch/linux/mips/.svn/text-base/memory.h.svn-base b/arch/linux/mips/.svn/text-base/memory.h.svn-base deleted file mode 100644 index 2b2ad528..00000000 --- a/arch/linux/mips/.svn/text-base/memory.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/memory.h
\ No newline at end of file diff --git a/arch/linux/mips/.svn/text-base/modules.h.svn-base b/arch/linux/mips/.svn/text-base/modules.h.svn-base deleted file mode 100644 index d80f7d7a..00000000 --- a/arch/linux/mips/.svn/text-base/modules.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/modules.h
\ No newline at end of file diff --git a/arch/linux/mips/.svn/text-base/net.h.svn-base b/arch/linux/mips/.svn/text-base/net.h.svn-base deleted file mode 100644 index 2b4ac97a..00000000 --- a/arch/linux/mips/.svn/text-base/net.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/net.h
\ No newline at end of file diff --git a/arch/linux/mips/.svn/text-base/nfs.h.svn-base b/arch/linux/mips/.svn/text-base/nfs.h.svn-base deleted file mode 100644 index c10bd829..00000000 --- a/arch/linux/mips/.svn/text-base/nfs.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/nfs.h
\ No newline at end of file diff --git a/arch/linux/mips/.svn/text-base/os.h.svn-base b/arch/linux/mips/.svn/text-base/os.h.svn-base deleted file mode 100644 index 49613b1f..00000000 --- a/arch/linux/mips/.svn/text-base/os.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/os.h
\ No newline at end of file diff --git a/arch/linux/mips/.svn/text-base/pci.h.svn-base b/arch/linux/mips/.svn/text-base/pci.h.svn-base deleted file mode 100644 index 2386d2ad..00000000 --- a/arch/linux/mips/.svn/text-base/pci.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/pci.h
\ No newline at end of file diff --git a/arch/linux/mips/.svn/text-base/samba.h.svn-base b/arch/linux/mips/.svn/text-base/samba.h.svn-base deleted file mode 100644 index 246e9ed0..00000000 --- a/arch/linux/mips/.svn/text-base/samba.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/samba.h
\ No newline at end of file diff --git a/arch/linux/mips/.svn/text-base/sensors.h.svn-base b/arch/linux/mips/.svn/text-base/sensors.h.svn-base deleted file mode 100644 index 822de7b7..00000000 --- a/arch/linux/mips/.svn/text-base/sensors.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/sensors.h
\ No newline at end of file diff --git a/arch/linux/mips/.svn/text-base/storage.h.svn-base b/arch/linux/mips/.svn/text-base/storage.h.svn-base deleted file mode 100644 index 24568f89..00000000 --- a/arch/linux/mips/.svn/text-base/storage.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/storage.h
\ No newline at end of file diff --git a/arch/linux/mips/.svn/text-base/uptime.h.svn-base b/arch/linux/mips/.svn/text-base/uptime.h.svn-base deleted file mode 100644 index 25cc41e9..00000000 --- a/arch/linux/mips/.svn/text-base/uptime.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/uptime.h
\ No newline at end of file diff --git a/arch/linux/mips/.svn/text-base/usb.h.svn-base b/arch/linux/mips/.svn/text-base/usb.h.svn-base deleted file mode 100644 index 8aece87f..00000000 --- a/arch/linux/mips/.svn/text-base/usb.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/usb.h
\ No newline at end of file diff --git a/arch/linux/mips/battery.h b/arch/linux/mips/battery.h new file mode 120000 index 00000000..e4c794f2 --- /dev/null +++ b/arch/linux/mips/battery.h @@ -0,0 +1 @@ +../../linux/common/battery.h
\ No newline at end of file diff --git a/arch/linux/mips/boots.h b/arch/linux/mips/boots.h new file mode 120000 index 00000000..97384500 --- /dev/null +++ b/arch/linux/mips/boots.h @@ -0,0 +1 @@ +../../../arch/linux/common/boots.h
\ No newline at end of file diff --git a/arch/linux/mips/devmemory.h b/arch/linux/mips/devmemory.h new file mode 120000 index 00000000..f8a833e7 --- /dev/null +++ b/arch/linux/mips/devmemory.h @@ -0,0 +1 @@ +../../../arch/linux/common/devmemory.h
\ No newline at end of file diff --git a/arch/linux/mips/processor.h b/arch/linux/mips/processor.h index 8be922f9..1aa7794d 100644 --- a/arch/linux/mips/processor.h +++ b/arch/linux/mips/processor.h @@ -16,8 +16,14 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -static Processor * -computer_get_processor(void) +struct _Processor { + gchar *model_name; + gchar *vendor_id; + gfloat bogomips, cpu_mhz; +}; + +static GSList * +__scan_processors(void) { Processor *processor; FILE *cpuinfo; @@ -45,12 +51,14 @@ computer_get_processor(void) fclose(cpuinfo); - return processor; + return g_slist_append(NULL, processor); } static gchar * -processor_get_info(Processor *processor) +processor_get_info(GSList *processors) { + Processor *processor = (Processor *)processors->data; + return g_strdup_printf("[Processor]\n" "System Type=%s\n" "CPU Model=%s\n" diff --git a/arch/linux/parisc/.svn/README.txt b/arch/linux/parisc/.svn/README.txt deleted file mode 100644 index 271a8ce9..00000000 --- a/arch/linux/parisc/.svn/README.txt +++ /dev/null @@ -1,2 +0,0 @@ -This is a Subversion working copy administrative directory. -Visit http://subversion.tigris.org/ for more information. diff --git a/arch/linux/parisc/.svn/empty-file b/arch/linux/parisc/.svn/empty-file deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/parisc/.svn/empty-file +++ /dev/null diff --git a/arch/linux/parisc/.svn/entries b/arch/linux/parisc/.svn/entries deleted file mode 100644 index 3d021fea..00000000 --- a/arch/linux/parisc/.svn/entries +++ /dev/null @@ -1,159 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<wc-entries - xmlns="svn:"> -<entry - committed-rev="4" - name="" - committed-date="2006-01-31T23:35:06.244169Z" - url="svn+ssh://lafp@svn.berlios.de/svnroot/repos/hardinfo/trunk/hardinfo2/arch/linux/parisc" - last-author="lafp" - kind="dir" - uuid="03931a0e-0c0b-0410-87e6-c9e79dddb921" - repos="svn+ssh://lafp@svn.berlios.de/svnroot/repos/hardinfo" - revision="9"/> -<entry - committed-rev="4" - name="usb.h" - text-time="2006-05-20T14:29:19.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="0ed17ec7082ecf81bc512f4d2add7bec" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:18.000000Z"/> -<entry - committed-rev="4" - name="sensors.h" - text-time="2006-05-20T14:29:19.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="ba83966be8f142e8f9fbed44bfc77b7a" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:18.000000Z"/> -<entry - committed-rev="4" - name="inputdevices.h" - text-time="2006-05-20T14:29:19.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="1307b7aff245fa7fba84aa91f08d27fc" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:18.000000Z"/> -<entry - committed-rev="4" - name="uptime.h" - text-time="2006-05-20T14:29:19.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="760f1adef4fbcec7d74200abc3a4f6eb" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:19.000000Z"/> -<entry - committed-rev="4" - name="storage.h" - text-time="2006-05-20T14:29:19.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="602ef4aa9053cd983170660f53334cef" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:19.000000Z"/> -<entry - committed-rev="4" - name="modules.h" - text-time="2006-05-20T14:29:19.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="45dfbaaabb31981ac06e021773429228" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:19.000000Z"/> -<entry - committed-rev="4" - name="memory.h" - text-time="2006-05-20T14:29:19.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="765f1eed8d98b9bbb06c4c034ce9fa32" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:19.000000Z"/> -<entry - committed-rev="4" - name="pci.h" - text-time="2006-05-20T14:29:19.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="cab1a2936974aed489c107f3643b3484" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:18.000000Z"/> -<entry - committed-rev="4" - name="loadavg.h" - text-time="2006-05-20T14:29:19.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="1c83a008e883018ff1092781358ec2da" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:18.000000Z"/> -<entry - committed-rev="4" - name="processor.h" - text-time="2006-05-20T14:29:19.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="81c73d87c453b53e5016fcb0a627665c" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:18.000000Z"/> -<entry - committed-rev="4" - name="alsa.h" - text-time="2006-05-20T14:29:19.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="dc249687377b2de88793ee09bf54f1f1" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:18.000000Z"/> -<entry - committed-rev="4" - name="os.h" - text-time="2006-05-20T14:29:19.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="048c3f4b338d765be4f10b5067d8b50e" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:18.000000Z"/> -<entry - committed-rev="4" - name="samba.h" - text-time="2006-05-20T14:29:19.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="b541109072721d735717a33724ce9127" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:19.000000Z"/> -<entry - committed-rev="4" - name="filesystem.h" - text-time="2006-05-20T14:29:19.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="7f23b37be4cf5009414843bfe5c4e450" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:19.000000Z"/> -<entry - committed-rev="4" - name="net.h" - text-time="2006-05-20T14:29:19.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="22e5b201692010dee02e9562ce6cba1b" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:19.000000Z"/> -<entry - committed-rev="13" - name="nfs.h" - text-time="2006-05-22T12:07:19.000000Z" - committed-date="2006-05-22T12:11:05.185078Z" - checksum="382976a6eab28131079a346dd16edcd7" - last-author="lafp" - kind="file" - prop-time="2006-05-22T12:07:36.000000Z" - revision="13"/> -</wc-entries> diff --git a/arch/linux/parisc/.svn/format b/arch/linux/parisc/.svn/format deleted file mode 100644 index b8626c4c..00000000 --- a/arch/linux/parisc/.svn/format +++ /dev/null @@ -1 +0,0 @@ -4 diff --git a/arch/linux/parisc/.svn/prop-base/alsa.h.svn-base b/arch/linux/parisc/.svn/prop-base/alsa.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/parisc/.svn/prop-base/alsa.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/parisc/.svn/prop-base/filesystem.h.svn-base b/arch/linux/parisc/.svn/prop-base/filesystem.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/parisc/.svn/prop-base/filesystem.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/parisc/.svn/prop-base/inputdevices.h.svn-base b/arch/linux/parisc/.svn/prop-base/inputdevices.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/parisc/.svn/prop-base/inputdevices.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/parisc/.svn/prop-base/loadavg.h.svn-base b/arch/linux/parisc/.svn/prop-base/loadavg.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/parisc/.svn/prop-base/loadavg.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/parisc/.svn/prop-base/memory.h.svn-base b/arch/linux/parisc/.svn/prop-base/memory.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/parisc/.svn/prop-base/memory.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/parisc/.svn/prop-base/modules.h.svn-base b/arch/linux/parisc/.svn/prop-base/modules.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/parisc/.svn/prop-base/modules.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/parisc/.svn/prop-base/net.h.svn-base b/arch/linux/parisc/.svn/prop-base/net.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/parisc/.svn/prop-base/net.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/parisc/.svn/prop-base/nfs.h.svn-base b/arch/linux/parisc/.svn/prop-base/nfs.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/parisc/.svn/prop-base/nfs.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/parisc/.svn/prop-base/os.h.svn-base b/arch/linux/parisc/.svn/prop-base/os.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/parisc/.svn/prop-base/os.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/parisc/.svn/prop-base/pci.h.svn-base b/arch/linux/parisc/.svn/prop-base/pci.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/parisc/.svn/prop-base/pci.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/parisc/.svn/prop-base/processor.h.svn-base b/arch/linux/parisc/.svn/prop-base/processor.h.svn-base deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/parisc/.svn/prop-base/processor.h.svn-base +++ /dev/null diff --git a/arch/linux/parisc/.svn/prop-base/samba.h.svn-base b/arch/linux/parisc/.svn/prop-base/samba.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/parisc/.svn/prop-base/samba.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/parisc/.svn/prop-base/sensors.h.svn-base b/arch/linux/parisc/.svn/prop-base/sensors.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/parisc/.svn/prop-base/sensors.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/parisc/.svn/prop-base/storage.h.svn-base b/arch/linux/parisc/.svn/prop-base/storage.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/parisc/.svn/prop-base/storage.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/parisc/.svn/prop-base/uptime.h.svn-base b/arch/linux/parisc/.svn/prop-base/uptime.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/parisc/.svn/prop-base/uptime.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/parisc/.svn/prop-base/usb.h.svn-base b/arch/linux/parisc/.svn/prop-base/usb.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/parisc/.svn/prop-base/usb.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/parisc/.svn/props/alsa.h.svn-work b/arch/linux/parisc/.svn/props/alsa.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/parisc/.svn/props/alsa.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/parisc/.svn/props/filesystem.h.svn-work b/arch/linux/parisc/.svn/props/filesystem.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/parisc/.svn/props/filesystem.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/parisc/.svn/props/inputdevices.h.svn-work b/arch/linux/parisc/.svn/props/inputdevices.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/parisc/.svn/props/inputdevices.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/parisc/.svn/props/loadavg.h.svn-work b/arch/linux/parisc/.svn/props/loadavg.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/parisc/.svn/props/loadavg.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/parisc/.svn/props/memory.h.svn-work b/arch/linux/parisc/.svn/props/memory.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/parisc/.svn/props/memory.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/parisc/.svn/props/modules.h.svn-work b/arch/linux/parisc/.svn/props/modules.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/parisc/.svn/props/modules.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/parisc/.svn/props/net.h.svn-work b/arch/linux/parisc/.svn/props/net.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/parisc/.svn/props/net.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/parisc/.svn/props/nfs.h.svn-work b/arch/linux/parisc/.svn/props/nfs.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/parisc/.svn/props/nfs.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/parisc/.svn/props/os.h.svn-work b/arch/linux/parisc/.svn/props/os.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/parisc/.svn/props/os.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/parisc/.svn/props/pci.h.svn-work b/arch/linux/parisc/.svn/props/pci.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/parisc/.svn/props/pci.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/parisc/.svn/props/processor.h.svn-work b/arch/linux/parisc/.svn/props/processor.h.svn-work deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/parisc/.svn/props/processor.h.svn-work +++ /dev/null diff --git a/arch/linux/parisc/.svn/props/samba.h.svn-work b/arch/linux/parisc/.svn/props/samba.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/parisc/.svn/props/samba.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/parisc/.svn/props/sensors.h.svn-work b/arch/linux/parisc/.svn/props/sensors.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/parisc/.svn/props/sensors.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/parisc/.svn/props/storage.h.svn-work b/arch/linux/parisc/.svn/props/storage.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/parisc/.svn/props/storage.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/parisc/.svn/props/uptime.h.svn-work b/arch/linux/parisc/.svn/props/uptime.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/parisc/.svn/props/uptime.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/parisc/.svn/props/usb.h.svn-work b/arch/linux/parisc/.svn/props/usb.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/parisc/.svn/props/usb.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/parisc/.svn/text-base/alsa.h.svn-base b/arch/linux/parisc/.svn/text-base/alsa.h.svn-base deleted file mode 100644 index e17b92c3..00000000 --- a/arch/linux/parisc/.svn/text-base/alsa.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/alsa.h
\ No newline at end of file diff --git a/arch/linux/parisc/.svn/text-base/filesystem.h.svn-base b/arch/linux/parisc/.svn/text-base/filesystem.h.svn-base deleted file mode 100644 index 0d23c803..00000000 --- a/arch/linux/parisc/.svn/text-base/filesystem.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/filesystem.h
\ No newline at end of file diff --git a/arch/linux/parisc/.svn/text-base/inputdevices.h.svn-base b/arch/linux/parisc/.svn/text-base/inputdevices.h.svn-base deleted file mode 100644 index 58695156..00000000 --- a/arch/linux/parisc/.svn/text-base/inputdevices.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/inputdevices.h
\ No newline at end of file diff --git a/arch/linux/parisc/.svn/text-base/loadavg.h.svn-base b/arch/linux/parisc/.svn/text-base/loadavg.h.svn-base deleted file mode 100644 index 354f872f..00000000 --- a/arch/linux/parisc/.svn/text-base/loadavg.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/loadavg.h
\ No newline at end of file diff --git a/arch/linux/parisc/.svn/text-base/memory.h.svn-base b/arch/linux/parisc/.svn/text-base/memory.h.svn-base deleted file mode 100644 index 2b2ad528..00000000 --- a/arch/linux/parisc/.svn/text-base/memory.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/memory.h
\ No newline at end of file diff --git a/arch/linux/parisc/.svn/text-base/modules.h.svn-base b/arch/linux/parisc/.svn/text-base/modules.h.svn-base deleted file mode 100644 index d80f7d7a..00000000 --- a/arch/linux/parisc/.svn/text-base/modules.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/modules.h
\ No newline at end of file diff --git a/arch/linux/parisc/.svn/text-base/net.h.svn-base b/arch/linux/parisc/.svn/text-base/net.h.svn-base deleted file mode 100644 index 2b4ac97a..00000000 --- a/arch/linux/parisc/.svn/text-base/net.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/net.h
\ No newline at end of file diff --git a/arch/linux/parisc/.svn/text-base/nfs.h.svn-base b/arch/linux/parisc/.svn/text-base/nfs.h.svn-base deleted file mode 100644 index c10bd829..00000000 --- a/arch/linux/parisc/.svn/text-base/nfs.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/nfs.h
\ No newline at end of file diff --git a/arch/linux/parisc/.svn/text-base/os.h.svn-base b/arch/linux/parisc/.svn/text-base/os.h.svn-base deleted file mode 100644 index 49613b1f..00000000 --- a/arch/linux/parisc/.svn/text-base/os.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/os.h
\ No newline at end of file diff --git a/arch/linux/parisc/.svn/text-base/pci.h.svn-base b/arch/linux/parisc/.svn/text-base/pci.h.svn-base deleted file mode 100644 index 2386d2ad..00000000 --- a/arch/linux/parisc/.svn/text-base/pci.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/pci.h
\ No newline at end of file diff --git a/arch/linux/parisc/.svn/text-base/processor.h.svn-base b/arch/linux/parisc/.svn/text-base/processor.h.svn-base deleted file mode 100644 index 41b628f4..00000000 --- a/arch/linux/parisc/.svn/text-base/processor.h.svn-base +++ /dev/null @@ -1,82 +0,0 @@ -/* - * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, version 2. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -static Processor * -computer_get_processor(void) -{ - Processor *processor; - FILE *cpuinfo; - gchar buffer[128]; - - cpuinfo = fopen("/proc/cpuinfo", "r"); - if (!cpuinfo) - return NULL; - - processor = g_new0(Processor, 1); - while (fgets(buffer, 128, cpuinfo)) { - gchar **tmp = g_strsplit(buffer, ":", 2); - - if (tmp[0] && tmp[1]) { - tmp[0] = g_strstrip(tmp[0]); - tmp[1] = g_strstrip(tmp[1]); - - get_str("cpu family", processor->model_name); - get_str("cpu", processor->vendor_id); - get_float("cpu MHz", processor->cpu_mhz); - get_float("bogomips", processor->bogomips); - - get_str("model name", processor->strmodel); - - get_int("I-cache", processor->has_fpu); - get_int("D-cache", processor->flags); - - } - g_strfreev(tmp); - } - - fclose(cpuinfo); - - return processor; -} - -static gchar * -processor_get_info(Processor *processor) -{ - return g_strdup_printf("[Processor]\n" - "CPU Family=%s\n" - "CPU=%s\n" - "Frequency=%.2fMHz\n" - "Bogomips=%.2f\n" - "Model Name=%s\n" - "Byte Order=%s\n" - "[Cache]\n" - "I-Cache=%s\n" - "D-Cache=%s\n", - processor->model_name, - processor->vendor_id, - processor->cpu_mhz, - processor->bogomips, - processor->strmodel, -#if G_BYTE_ORDER == G_LITTLE_ENDIAN - "Little Endian", -#else - "Big Endian", -#endif - processor->has_fpu, - processor->flags); -} diff --git a/arch/linux/parisc/.svn/text-base/samba.h.svn-base b/arch/linux/parisc/.svn/text-base/samba.h.svn-base deleted file mode 100644 index 246e9ed0..00000000 --- a/arch/linux/parisc/.svn/text-base/samba.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/samba.h
\ No newline at end of file diff --git a/arch/linux/parisc/.svn/text-base/sensors.h.svn-base b/arch/linux/parisc/.svn/text-base/sensors.h.svn-base deleted file mode 100644 index 822de7b7..00000000 --- a/arch/linux/parisc/.svn/text-base/sensors.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/sensors.h
\ No newline at end of file diff --git a/arch/linux/parisc/.svn/text-base/storage.h.svn-base b/arch/linux/parisc/.svn/text-base/storage.h.svn-base deleted file mode 100644 index 24568f89..00000000 --- a/arch/linux/parisc/.svn/text-base/storage.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/storage.h
\ No newline at end of file diff --git a/arch/linux/parisc/.svn/text-base/uptime.h.svn-base b/arch/linux/parisc/.svn/text-base/uptime.h.svn-base deleted file mode 100644 index 25cc41e9..00000000 --- a/arch/linux/parisc/.svn/text-base/uptime.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/uptime.h
\ No newline at end of file diff --git a/arch/linux/parisc/.svn/text-base/usb.h.svn-base b/arch/linux/parisc/.svn/text-base/usb.h.svn-base deleted file mode 100644 index 8aece87f..00000000 --- a/arch/linux/parisc/.svn/text-base/usb.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/usb.h
\ No newline at end of file diff --git a/arch/linux/parisc/battery.h b/arch/linux/parisc/battery.h new file mode 120000 index 00000000..e4c794f2 --- /dev/null +++ b/arch/linux/parisc/battery.h @@ -0,0 +1 @@ +../../linux/common/battery.h
\ No newline at end of file diff --git a/arch/linux/parisc/boots.h b/arch/linux/parisc/boots.h new file mode 120000 index 00000000..97384500 --- /dev/null +++ b/arch/linux/parisc/boots.h @@ -0,0 +1 @@ +../../../arch/linux/common/boots.h
\ No newline at end of file diff --git a/arch/linux/parisc/devmemory.h b/arch/linux/parisc/devmemory.h new file mode 120000 index 00000000..f8a833e7 --- /dev/null +++ b/arch/linux/parisc/devmemory.h @@ -0,0 +1 @@ +../../../arch/linux/common/devmemory.h
\ No newline at end of file diff --git a/arch/linux/parisc/processor.h b/arch/linux/parisc/processor.h index 41b628f4..357f4d83 100644 --- a/arch/linux/parisc/processor.h +++ b/arch/linux/parisc/processor.h @@ -16,8 +16,19 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -static Processor * -computer_get_processor(void) +struct _Processor { + gchar *model_name; + gchar *vendor_id; + gchar *flags; + gfloat bogomips, cpu_mhz; + + gchar *has_fpu; + + gchar *strmodel; +}; + +static GSList * +__scan_processors(void) { Processor *processor; FILE *cpuinfo; @@ -51,12 +62,14 @@ computer_get_processor(void) fclose(cpuinfo); - return processor; + return g_slist_append(NULL, processor); } static gchar * -processor_get_info(Processor *processor) +processor_get_info(GSList *processors) { + Processor *processor = (Processor *)processors->data; + return g_strdup_printf("[Processor]\n" "CPU Family=%s\n" "CPU=%s\n" diff --git a/arch/linux/ppc/.svn/README.txt b/arch/linux/ppc/.svn/README.txt deleted file mode 100644 index 271a8ce9..00000000 --- a/arch/linux/ppc/.svn/README.txt +++ /dev/null @@ -1,2 +0,0 @@ -This is a Subversion working copy administrative directory. -Visit http://subversion.tigris.org/ for more information. diff --git a/arch/linux/ppc/.svn/empty-file b/arch/linux/ppc/.svn/empty-file deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/ppc/.svn/empty-file +++ /dev/null diff --git a/arch/linux/ppc/.svn/entries b/arch/linux/ppc/.svn/entries deleted file mode 100644 index 15f4d581..00000000 --- a/arch/linux/ppc/.svn/entries +++ /dev/null @@ -1,159 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<wc-entries - xmlns="svn:"> -<entry - committed-rev="4" - name="" - committed-date="2006-01-31T23:35:06.244169Z" - url="svn+ssh://lafp@svn.berlios.de/svnroot/repos/hardinfo/trunk/hardinfo2/arch/linux/ppc" - last-author="lafp" - kind="dir" - uuid="03931a0e-0c0b-0410-87e6-c9e79dddb921" - repos="svn+ssh://lafp@svn.berlios.de/svnroot/repos/hardinfo" - revision="9"/> -<entry - committed-rev="4" - name="usb.h" - text-time="2006-05-20T14:29:20.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="0ed17ec7082ecf81bc512f4d2add7bec" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:19.000000Z"/> -<entry - committed-rev="4" - name="sensors.h" - text-time="2006-05-20T14:29:20.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="ba83966be8f142e8f9fbed44bfc77b7a" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:19.000000Z"/> -<entry - committed-rev="4" - name="inputdevices.h" - text-time="2006-05-20T14:29:20.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="1307b7aff245fa7fba84aa91f08d27fc" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:20.000000Z"/> -<entry - committed-rev="4" - name="uptime.h" - text-time="2006-05-20T14:29:20.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="760f1adef4fbcec7d74200abc3a4f6eb" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:20.000000Z"/> -<entry - committed-rev="4" - name="storage.h" - text-time="2006-05-20T14:29:20.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="602ef4aa9053cd983170660f53334cef" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:20.000000Z"/> -<entry - committed-rev="4" - name="modules.h" - text-time="2006-05-20T14:29:20.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="45dfbaaabb31981ac06e021773429228" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:20.000000Z"/> -<entry - committed-rev="4" - name="memory.h" - text-time="2006-05-20T14:29:20.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="765f1eed8d98b9bbb06c4c034ce9fa32" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:20.000000Z"/> -<entry - committed-rev="4" - name="pci.h" - text-time="2006-05-20T14:29:20.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="cab1a2936974aed489c107f3643b3484" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:19.000000Z"/> -<entry - committed-rev="4" - name="loadavg.h" - text-time="2006-05-20T14:29:20.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="1c83a008e883018ff1092781358ec2da" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:20.000000Z"/> -<entry - committed-rev="4" - name="processor.h" - text-time="2006-05-20T14:29:20.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="dbc927e55d8803ea8a133a2b837dac06" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:20.000000Z"/> -<entry - committed-rev="4" - name="alsa.h" - text-time="2006-05-20T14:29:20.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="dc249687377b2de88793ee09bf54f1f1" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:20.000000Z"/> -<entry - committed-rev="4" - name="os.h" - text-time="2006-05-20T14:29:20.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="048c3f4b338d765be4f10b5067d8b50e" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:20.000000Z"/> -<entry - committed-rev="4" - name="samba.h" - text-time="2006-05-20T14:29:20.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="b541109072721d735717a33724ce9127" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:20.000000Z"/> -<entry - committed-rev="4" - name="filesystem.h" - text-time="2006-05-20T14:29:20.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="7f23b37be4cf5009414843bfe5c4e450" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:20.000000Z"/> -<entry - committed-rev="4" - name="net.h" - text-time="2006-05-20T14:29:20.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="22e5b201692010dee02e9562ce6cba1b" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:20.000000Z"/> -<entry - committed-rev="13" - name="nfs.h" - text-time="2006-05-22T12:07:23.000000Z" - committed-date="2006-05-22T12:11:05.185078Z" - checksum="382976a6eab28131079a346dd16edcd7" - last-author="lafp" - kind="file" - prop-time="2006-05-22T12:07:36.000000Z" - revision="13"/> -</wc-entries> diff --git a/arch/linux/ppc/.svn/format b/arch/linux/ppc/.svn/format deleted file mode 100644 index b8626c4c..00000000 --- a/arch/linux/ppc/.svn/format +++ /dev/null @@ -1 +0,0 @@ -4 diff --git a/arch/linux/ppc/.svn/prop-base/alsa.h.svn-base b/arch/linux/ppc/.svn/prop-base/alsa.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/ppc/.svn/prop-base/alsa.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/ppc/.svn/prop-base/filesystem.h.svn-base b/arch/linux/ppc/.svn/prop-base/filesystem.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/ppc/.svn/prop-base/filesystem.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/ppc/.svn/prop-base/inputdevices.h.svn-base b/arch/linux/ppc/.svn/prop-base/inputdevices.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/ppc/.svn/prop-base/inputdevices.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/ppc/.svn/prop-base/loadavg.h.svn-base b/arch/linux/ppc/.svn/prop-base/loadavg.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/ppc/.svn/prop-base/loadavg.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/ppc/.svn/prop-base/memory.h.svn-base b/arch/linux/ppc/.svn/prop-base/memory.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/ppc/.svn/prop-base/memory.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/ppc/.svn/prop-base/modules.h.svn-base b/arch/linux/ppc/.svn/prop-base/modules.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/ppc/.svn/prop-base/modules.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/ppc/.svn/prop-base/net.h.svn-base b/arch/linux/ppc/.svn/prop-base/net.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/ppc/.svn/prop-base/net.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/ppc/.svn/prop-base/nfs.h.svn-base b/arch/linux/ppc/.svn/prop-base/nfs.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/ppc/.svn/prop-base/nfs.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/ppc/.svn/prop-base/os.h.svn-base b/arch/linux/ppc/.svn/prop-base/os.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/ppc/.svn/prop-base/os.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/ppc/.svn/prop-base/pci.h.svn-base b/arch/linux/ppc/.svn/prop-base/pci.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/ppc/.svn/prop-base/pci.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/ppc/.svn/prop-base/processor.h.svn-base b/arch/linux/ppc/.svn/prop-base/processor.h.svn-base deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/ppc/.svn/prop-base/processor.h.svn-base +++ /dev/null diff --git a/arch/linux/ppc/.svn/prop-base/samba.h.svn-base b/arch/linux/ppc/.svn/prop-base/samba.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/ppc/.svn/prop-base/samba.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/ppc/.svn/prop-base/sensors.h.svn-base b/arch/linux/ppc/.svn/prop-base/sensors.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/ppc/.svn/prop-base/sensors.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/ppc/.svn/prop-base/storage.h.svn-base b/arch/linux/ppc/.svn/prop-base/storage.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/ppc/.svn/prop-base/storage.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/ppc/.svn/prop-base/uptime.h.svn-base b/arch/linux/ppc/.svn/prop-base/uptime.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/ppc/.svn/prop-base/uptime.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/ppc/.svn/prop-base/usb.h.svn-base b/arch/linux/ppc/.svn/prop-base/usb.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/ppc/.svn/prop-base/usb.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/ppc/.svn/props/alsa.h.svn-work b/arch/linux/ppc/.svn/props/alsa.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/ppc/.svn/props/alsa.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/ppc/.svn/props/filesystem.h.svn-work b/arch/linux/ppc/.svn/props/filesystem.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/ppc/.svn/props/filesystem.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/ppc/.svn/props/inputdevices.h.svn-work b/arch/linux/ppc/.svn/props/inputdevices.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/ppc/.svn/props/inputdevices.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/ppc/.svn/props/loadavg.h.svn-work b/arch/linux/ppc/.svn/props/loadavg.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/ppc/.svn/props/loadavg.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/ppc/.svn/props/memory.h.svn-work b/arch/linux/ppc/.svn/props/memory.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/ppc/.svn/props/memory.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/ppc/.svn/props/modules.h.svn-work b/arch/linux/ppc/.svn/props/modules.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/ppc/.svn/props/modules.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/ppc/.svn/props/net.h.svn-work b/arch/linux/ppc/.svn/props/net.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/ppc/.svn/props/net.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/ppc/.svn/props/nfs.h.svn-work b/arch/linux/ppc/.svn/props/nfs.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/ppc/.svn/props/nfs.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/ppc/.svn/props/os.h.svn-work b/arch/linux/ppc/.svn/props/os.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/ppc/.svn/props/os.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/ppc/.svn/props/pci.h.svn-work b/arch/linux/ppc/.svn/props/pci.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/ppc/.svn/props/pci.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/ppc/.svn/props/processor.h.svn-work b/arch/linux/ppc/.svn/props/processor.h.svn-work deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/ppc/.svn/props/processor.h.svn-work +++ /dev/null diff --git a/arch/linux/ppc/.svn/props/samba.h.svn-work b/arch/linux/ppc/.svn/props/samba.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/ppc/.svn/props/samba.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/ppc/.svn/props/sensors.h.svn-work b/arch/linux/ppc/.svn/props/sensors.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/ppc/.svn/props/sensors.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/ppc/.svn/props/storage.h.svn-work b/arch/linux/ppc/.svn/props/storage.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/ppc/.svn/props/storage.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/ppc/.svn/props/uptime.h.svn-work b/arch/linux/ppc/.svn/props/uptime.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/ppc/.svn/props/uptime.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/ppc/.svn/props/usb.h.svn-work b/arch/linux/ppc/.svn/props/usb.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/ppc/.svn/props/usb.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/ppc/.svn/text-base/alsa.h.svn-base b/arch/linux/ppc/.svn/text-base/alsa.h.svn-base deleted file mode 100644 index e17b92c3..00000000 --- a/arch/linux/ppc/.svn/text-base/alsa.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/alsa.h
\ No newline at end of file diff --git a/arch/linux/ppc/.svn/text-base/filesystem.h.svn-base b/arch/linux/ppc/.svn/text-base/filesystem.h.svn-base deleted file mode 100644 index 0d23c803..00000000 --- a/arch/linux/ppc/.svn/text-base/filesystem.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/filesystem.h
\ No newline at end of file diff --git a/arch/linux/ppc/.svn/text-base/inputdevices.h.svn-base b/arch/linux/ppc/.svn/text-base/inputdevices.h.svn-base deleted file mode 100644 index 58695156..00000000 --- a/arch/linux/ppc/.svn/text-base/inputdevices.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/inputdevices.h
\ No newline at end of file diff --git a/arch/linux/ppc/.svn/text-base/loadavg.h.svn-base b/arch/linux/ppc/.svn/text-base/loadavg.h.svn-base deleted file mode 100644 index 354f872f..00000000 --- a/arch/linux/ppc/.svn/text-base/loadavg.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/loadavg.h
\ No newline at end of file diff --git a/arch/linux/ppc/.svn/text-base/memory.h.svn-base b/arch/linux/ppc/.svn/text-base/memory.h.svn-base deleted file mode 100644 index 2b2ad528..00000000 --- a/arch/linux/ppc/.svn/text-base/memory.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/memory.h
\ No newline at end of file diff --git a/arch/linux/ppc/.svn/text-base/modules.h.svn-base b/arch/linux/ppc/.svn/text-base/modules.h.svn-base deleted file mode 100644 index d80f7d7a..00000000 --- a/arch/linux/ppc/.svn/text-base/modules.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/modules.h
\ No newline at end of file diff --git a/arch/linux/ppc/.svn/text-base/net.h.svn-base b/arch/linux/ppc/.svn/text-base/net.h.svn-base deleted file mode 100644 index 2b4ac97a..00000000 --- a/arch/linux/ppc/.svn/text-base/net.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/net.h
\ No newline at end of file diff --git a/arch/linux/ppc/.svn/text-base/nfs.h.svn-base b/arch/linux/ppc/.svn/text-base/nfs.h.svn-base deleted file mode 100644 index c10bd829..00000000 --- a/arch/linux/ppc/.svn/text-base/nfs.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/nfs.h
\ No newline at end of file diff --git a/arch/linux/ppc/.svn/text-base/os.h.svn-base b/arch/linux/ppc/.svn/text-base/os.h.svn-base deleted file mode 100644 index 49613b1f..00000000 --- a/arch/linux/ppc/.svn/text-base/os.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/os.h
\ No newline at end of file diff --git a/arch/linux/ppc/.svn/text-base/pci.h.svn-base b/arch/linux/ppc/.svn/text-base/pci.h.svn-base deleted file mode 100644 index 2386d2ad..00000000 --- a/arch/linux/ppc/.svn/text-base/pci.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/pci.h
\ No newline at end of file diff --git a/arch/linux/ppc/.svn/text-base/samba.h.svn-base b/arch/linux/ppc/.svn/text-base/samba.h.svn-base deleted file mode 100644 index 246e9ed0..00000000 --- a/arch/linux/ppc/.svn/text-base/samba.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/samba.h
\ No newline at end of file diff --git a/arch/linux/ppc/.svn/text-base/sensors.h.svn-base b/arch/linux/ppc/.svn/text-base/sensors.h.svn-base deleted file mode 100644 index 822de7b7..00000000 --- a/arch/linux/ppc/.svn/text-base/sensors.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/sensors.h
\ No newline at end of file diff --git a/arch/linux/ppc/.svn/text-base/storage.h.svn-base b/arch/linux/ppc/.svn/text-base/storage.h.svn-base deleted file mode 100644 index 24568f89..00000000 --- a/arch/linux/ppc/.svn/text-base/storage.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/storage.h
\ No newline at end of file diff --git a/arch/linux/ppc/.svn/text-base/uptime.h.svn-base b/arch/linux/ppc/.svn/text-base/uptime.h.svn-base deleted file mode 100644 index 25cc41e9..00000000 --- a/arch/linux/ppc/.svn/text-base/uptime.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/uptime.h
\ No newline at end of file diff --git a/arch/linux/ppc/.svn/text-base/usb.h.svn-base b/arch/linux/ppc/.svn/text-base/usb.h.svn-base deleted file mode 100644 index 8aece87f..00000000 --- a/arch/linux/ppc/.svn/text-base/usb.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/usb.h
\ No newline at end of file diff --git a/arch/linux/ppc/battery.h b/arch/linux/ppc/battery.h new file mode 120000 index 00000000..e4c794f2 --- /dev/null +++ b/arch/linux/ppc/battery.h @@ -0,0 +1 @@ +../../linux/common/battery.h
\ No newline at end of file diff --git a/arch/linux/ppc/boots.h b/arch/linux/ppc/boots.h new file mode 120000 index 00000000..97384500 --- /dev/null +++ b/arch/linux/ppc/boots.h @@ -0,0 +1 @@ +../../../arch/linux/common/boots.h
\ No newline at end of file diff --git a/arch/linux/ppc/devmemory.h b/arch/linux/ppc/devmemory.h new file mode 120000 index 00000000..f8a833e7 --- /dev/null +++ b/arch/linux/ppc/devmemory.h @@ -0,0 +1 @@ +../../../arch/linux/common/devmemory.h
\ No newline at end of file diff --git a/arch/linux/ppc/processor.h b/arch/linux/ppc/processor.h index f4ff5b0e..6aa0f4ef 100644 --- a/arch/linux/ppc/processor.h +++ b/arch/linux/ppc/processor.h @@ -16,8 +16,15 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -static Processor * -computer_get_processor(void) +struct _Processor { + gchar *model_name; + gchar *vendor_id; + gint cache_size; + gfloat bogomips, cpu_mhz; +}; + +static GSList * +__scan_processors(void) { Processor *processor; FILE *cpuinfo; @@ -45,24 +52,28 @@ computer_get_processor(void) g_strfreev(tmp); } - gchar *tmp = g_strconcat("PowerPC ", processor->model_name, NULL); + gchar *tmp = g_strdup_printf("PowerPC %s (%.2fMHz)", + processor->model_name, + processor->cpu_mhz); g_free(processor->model_name); processor->model_name = tmp; fclose(cpuinfo); - return processor; + return g_slist_append(NULL, processor); } static gchar * -processor_get_info(Processor *processor) +processor_get_info(GSList *processors) { + Processor *processor = (Processor *)processors->data; + return g_strdup_printf("[Processor]\n" "Machine=%s\n" "CPU=%s\n" - "L2 Cache=%.2f\n" + "L2 Cache=%dkB\n" "Frequency=%.2fMHz\n" - "BogoMips=%.2f" + "BogoMips=%.2f\n" "Byte Order=%s\n", processor->vendor_id, processor->model_name, diff --git a/arch/linux/s390/alsa.h b/arch/linux/s390/alsa.h new file mode 120000 index 00000000..ede8a364 --- /dev/null +++ b/arch/linux/s390/alsa.h @@ -0,0 +1 @@ +../../../arch/linux/common/alsa.h
\ No newline at end of file diff --git a/arch/linux/s390/boots.h b/arch/linux/s390/boots.h new file mode 120000 index 00000000..97384500 --- /dev/null +++ b/arch/linux/s390/boots.h @@ -0,0 +1 @@ +../../../arch/linux/common/boots.h
\ No newline at end of file diff --git a/arch/linux/s390/devmemory.h b/arch/linux/s390/devmemory.h new file mode 120000 index 00000000..f8a833e7 --- /dev/null +++ b/arch/linux/s390/devmemory.h @@ -0,0 +1 @@ +../../../arch/linux/common/devmemory.h
\ No newline at end of file diff --git a/arch/linux/s390/filesystem.h b/arch/linux/s390/filesystem.h new file mode 120000 index 00000000..d884bcd0 --- /dev/null +++ b/arch/linux/s390/filesystem.h @@ -0,0 +1 @@ +../../../arch/linux/common/filesystem.h
\ No newline at end of file diff --git a/arch/linux/s390/inputdevices.h b/arch/linux/s390/inputdevices.h new file mode 120000 index 00000000..0f594231 --- /dev/null +++ b/arch/linux/s390/inputdevices.h @@ -0,0 +1 @@ +../../../arch/linux/common/inputdevices.h
\ No newline at end of file diff --git a/arch/linux/s390/loadavg.h b/arch/linux/s390/loadavg.h new file mode 120000 index 00000000..1f64e107 --- /dev/null +++ b/arch/linux/s390/loadavg.h @@ -0,0 +1 @@ +../../../arch/linux/common/loadavg.h
\ No newline at end of file diff --git a/arch/linux/s390/memory.h b/arch/linux/s390/memory.h new file mode 120000 index 00000000..64c6e0ed --- /dev/null +++ b/arch/linux/s390/memory.h @@ -0,0 +1 @@ +../../../arch/linux/common/memory.h
\ No newline at end of file diff --git a/arch/linux/s390/modules.h b/arch/linux/s390/modules.h new file mode 120000 index 00000000..d21c9a20 --- /dev/null +++ b/arch/linux/s390/modules.h @@ -0,0 +1 @@ +../../../arch/linux/common/modules.h
\ No newline at end of file diff --git a/arch/linux/s390/net.h b/arch/linux/s390/net.h new file mode 120000 index 00000000..488b5ae3 --- /dev/null +++ b/arch/linux/s390/net.h @@ -0,0 +1 @@ +../../../arch/linux/common/net.h
\ No newline at end of file diff --git a/arch/linux/s390/nfs.h b/arch/linux/s390/nfs.h new file mode 120000 index 00000000..73e0b8c9 --- /dev/null +++ b/arch/linux/s390/nfs.h @@ -0,0 +1 @@ +../../../arch/linux/common/nfs.h
\ No newline at end of file diff --git a/arch/linux/s390/os.h b/arch/linux/s390/os.h new file mode 120000 index 00000000..44051626 --- /dev/null +++ b/arch/linux/s390/os.h @@ -0,0 +1 @@ +../../../arch/linux/common/os.h
\ No newline at end of file diff --git a/arch/linux/s390/pci.h b/arch/linux/s390/pci.h new file mode 120000 index 00000000..8df04a0e --- /dev/null +++ b/arch/linux/s390/pci.h @@ -0,0 +1 @@ +../../../arch/linux/common/pci.h
\ No newline at end of file diff --git a/arch/linux/m68k/.svn/text-base/processor.h.svn-base b/arch/linux/s390/processor.h index 0a1bab62..ee72b029 100644 --- a/arch/linux/m68k/.svn/text-base/processor.h.svn-base +++ b/arch/linux/s390/processor.h @@ -16,8 +16,14 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -static Processor * -computer_get_processor(void) +struct _Processor { + gchar *vendor_id, *model_name; + gint cache_size; + gfloat bogomips; +}; + +static GSList * +__scan_processors(void) { Processor *processor; FILE *cpuinfo; @@ -35,40 +41,39 @@ computer_get_processor(void) tmp[0] = g_strstrip(tmp[0]); tmp[1] = g_strstrip(tmp[1]); - get_str("CPU", processor->model_name); - get_float("Clocking", processor->cpu_mhz); - get_float("bogomips", processor->bogomips); + get_str("vendor_id", processor->vendor_id); + get_float("# processors", processor->cache_size); + get_int("bogomips per cpu", processor->bogomips); - get_str("FPU", processor->has_fpu); } g_strfreev(tmp); } - gchar *tmp; - tmp = g_strconcat("Motorola ", processor->model_name, NULL); - g_free(processor->model_name); - processor->model_name = tmp; - + processor->model_name = g_strconcat("S390 ", processor->vendor_id, NULL); + g_free(processor->vendor_id); + fclose(cpuinfo); - return processor; + return g_slist_append(NULL, processor); } static gchar * -processor_get_info(Processor *processor) +processor_get_info(GSList *processors) { + Processor *processor = (Processor *)processors->data; + return g_strdup_printf("[Processor]\n" - "Name=%s\n" - "Frequency=%.2fMHz\n" - "BogoMips=%.2f\n" - "Byte Order=%s\n", + "Model=%s\n" + "Processors=%d\n" + "BogoMips per CPU=%.2f" + "Byte Order=%s\n", processor->model_name, - processor->cpu_mhz, + processor->cache_size, processor->bogomips, #if G_BYTE_ORDER == G_LITTLE_ENDIAN "Little Endian" #else "Big Endian" #endif - ); + ); } diff --git a/arch/linux/s390/samba.h b/arch/linux/s390/samba.h new file mode 120000 index 00000000..ebab9b11 --- /dev/null +++ b/arch/linux/s390/samba.h @@ -0,0 +1 @@ +../../../arch/linux/common/samba.h
\ No newline at end of file diff --git a/arch/linux/s390/sensors.h b/arch/linux/s390/sensors.h new file mode 120000 index 00000000..3b799377 --- /dev/null +++ b/arch/linux/s390/sensors.h @@ -0,0 +1 @@ +../../../arch/linux/common/sensors.h
\ No newline at end of file diff --git a/arch/linux/s390/storage.h b/arch/linux/s390/storage.h new file mode 120000 index 00000000..3ea886ce --- /dev/null +++ b/arch/linux/s390/storage.h @@ -0,0 +1 @@ +../../../arch/linux/common/storage.h
\ No newline at end of file diff --git a/arch/linux/s390/uptime.h b/arch/linux/s390/uptime.h new file mode 120000 index 00000000..a5bac980 --- /dev/null +++ b/arch/linux/s390/uptime.h @@ -0,0 +1 @@ +../../../arch/linux/common/uptime.h
\ No newline at end of file diff --git a/arch/linux/s390/usb.h b/arch/linux/s390/usb.h new file mode 120000 index 00000000..aee3046c --- /dev/null +++ b/arch/linux/s390/usb.h @@ -0,0 +1 @@ +../../../arch/linux/common/usb.h
\ No newline at end of file diff --git a/arch/linux/sparc/.svn/README.txt b/arch/linux/sparc/.svn/README.txt deleted file mode 100644 index 271a8ce9..00000000 --- a/arch/linux/sparc/.svn/README.txt +++ /dev/null @@ -1,2 +0,0 @@ -This is a Subversion working copy administrative directory. -Visit http://subversion.tigris.org/ for more information. diff --git a/arch/linux/sparc/.svn/empty-file b/arch/linux/sparc/.svn/empty-file deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/sparc/.svn/empty-file +++ /dev/null diff --git a/arch/linux/sparc/.svn/entries b/arch/linux/sparc/.svn/entries deleted file mode 100644 index d52d0e04..00000000 --- a/arch/linux/sparc/.svn/entries +++ /dev/null @@ -1,159 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<wc-entries - xmlns="svn:"> -<entry - committed-rev="4" - name="" - committed-date="2006-01-31T23:35:06.244169Z" - url="svn+ssh://lafp@svn.berlios.de/svnroot/repos/hardinfo/trunk/hardinfo2/arch/linux/sparc" - last-author="lafp" - kind="dir" - uuid="03931a0e-0c0b-0410-87e6-c9e79dddb921" - repos="svn+ssh://lafp@svn.berlios.de/svnroot/repos/hardinfo" - revision="9"/> -<entry - committed-rev="4" - name="usb.h" - text-time="2006-05-20T14:29:28.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="0ed17ec7082ecf81bc512f4d2add7bec" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:27.000000Z"/> -<entry - committed-rev="4" - name="sensors.h" - text-time="2006-05-20T14:29:28.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="ba83966be8f142e8f9fbed44bfc77b7a" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:27.000000Z"/> -<entry - committed-rev="4" - name="inputdevices.h" - text-time="2006-05-20T14:29:28.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="1307b7aff245fa7fba84aa91f08d27fc" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:28.000000Z"/> -<entry - committed-rev="4" - name="uptime.h" - text-time="2006-05-20T14:29:28.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="760f1adef4fbcec7d74200abc3a4f6eb" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:28.000000Z"/> -<entry - committed-rev="4" - name="storage.h" - text-time="2006-05-20T14:29:28.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="602ef4aa9053cd983170660f53334cef" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:28.000000Z"/> -<entry - committed-rev="4" - name="modules.h" - text-time="2006-05-20T14:29:28.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="45dfbaaabb31981ac06e021773429228" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:28.000000Z"/> -<entry - committed-rev="4" - name="memory.h" - text-time="2006-05-20T14:29:28.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="765f1eed8d98b9bbb06c4c034ce9fa32" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:28.000000Z"/> -<entry - committed-rev="4" - name="pci.h" - text-time="2006-05-20T14:29:28.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="cab1a2936974aed489c107f3643b3484" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:27.000000Z"/> -<entry - committed-rev="4" - name="loadavg.h" - text-time="2006-05-20T14:29:28.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="1c83a008e883018ff1092781358ec2da" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:27.000000Z"/> -<entry - committed-rev="4" - name="processor.h" - text-time="2006-05-20T14:29:28.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="0e4fd7cef17e29f7ec00899e4ecef751" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:27.000000Z"/> -<entry - committed-rev="4" - name="alsa.h" - text-time="2006-05-20T14:29:28.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="dc249687377b2de88793ee09bf54f1f1" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:27.000000Z"/> -<entry - committed-rev="4" - name="os.h" - text-time="2006-05-20T14:29:28.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="048c3f4b338d765be4f10b5067d8b50e" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:27.000000Z"/> -<entry - committed-rev="4" - name="samba.h" - text-time="2006-05-20T14:29:28.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="b541109072721d735717a33724ce9127" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:28.000000Z"/> -<entry - committed-rev="4" - name="filesystem.h" - text-time="2006-05-20T14:29:28.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="7f23b37be4cf5009414843bfe5c4e450" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:28.000000Z"/> -<entry - committed-rev="4" - name="net.h" - text-time="2006-05-20T14:29:28.000000Z" - committed-date="2006-01-31T23:35:06.244169Z" - checksum="22e5b201692010dee02e9562ce6cba1b" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:28.000000Z"/> -<entry - committed-rev="13" - name="nfs.h" - text-time="2006-05-22T12:07:28.000000Z" - committed-date="2006-05-22T12:11:05.185078Z" - checksum="382976a6eab28131079a346dd16edcd7" - last-author="lafp" - kind="file" - prop-time="2006-05-22T12:07:36.000000Z" - revision="13"/> -</wc-entries> diff --git a/arch/linux/sparc/.svn/format b/arch/linux/sparc/.svn/format deleted file mode 100644 index b8626c4c..00000000 --- a/arch/linux/sparc/.svn/format +++ /dev/null @@ -1 +0,0 @@ -4 diff --git a/arch/linux/sparc/.svn/prop-base/alsa.h.svn-base b/arch/linux/sparc/.svn/prop-base/alsa.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/sparc/.svn/prop-base/alsa.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/sparc/.svn/prop-base/filesystem.h.svn-base b/arch/linux/sparc/.svn/prop-base/filesystem.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/sparc/.svn/prop-base/filesystem.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/sparc/.svn/prop-base/inputdevices.h.svn-base b/arch/linux/sparc/.svn/prop-base/inputdevices.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/sparc/.svn/prop-base/inputdevices.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/sparc/.svn/prop-base/loadavg.h.svn-base b/arch/linux/sparc/.svn/prop-base/loadavg.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/sparc/.svn/prop-base/loadavg.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/sparc/.svn/prop-base/memory.h.svn-base b/arch/linux/sparc/.svn/prop-base/memory.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/sparc/.svn/prop-base/memory.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/sparc/.svn/prop-base/modules.h.svn-base b/arch/linux/sparc/.svn/prop-base/modules.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/sparc/.svn/prop-base/modules.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/sparc/.svn/prop-base/net.h.svn-base b/arch/linux/sparc/.svn/prop-base/net.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/sparc/.svn/prop-base/net.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/sparc/.svn/prop-base/nfs.h.svn-base b/arch/linux/sparc/.svn/prop-base/nfs.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/sparc/.svn/prop-base/nfs.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/sparc/.svn/prop-base/os.h.svn-base b/arch/linux/sparc/.svn/prop-base/os.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/sparc/.svn/prop-base/os.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/sparc/.svn/prop-base/pci.h.svn-base b/arch/linux/sparc/.svn/prop-base/pci.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/sparc/.svn/prop-base/pci.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/sparc/.svn/prop-base/processor.h.svn-base b/arch/linux/sparc/.svn/prop-base/processor.h.svn-base deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/sparc/.svn/prop-base/processor.h.svn-base +++ /dev/null diff --git a/arch/linux/sparc/.svn/prop-base/samba.h.svn-base b/arch/linux/sparc/.svn/prop-base/samba.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/sparc/.svn/prop-base/samba.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/sparc/.svn/prop-base/sensors.h.svn-base b/arch/linux/sparc/.svn/prop-base/sensors.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/sparc/.svn/prop-base/sensors.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/sparc/.svn/prop-base/storage.h.svn-base b/arch/linux/sparc/.svn/prop-base/storage.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/sparc/.svn/prop-base/storage.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/sparc/.svn/prop-base/uptime.h.svn-base b/arch/linux/sparc/.svn/prop-base/uptime.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/sparc/.svn/prop-base/uptime.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/sparc/.svn/prop-base/usb.h.svn-base b/arch/linux/sparc/.svn/prop-base/usb.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/sparc/.svn/prop-base/usb.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/sparc/.svn/props/alsa.h.svn-work b/arch/linux/sparc/.svn/props/alsa.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/sparc/.svn/props/alsa.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/sparc/.svn/props/filesystem.h.svn-work b/arch/linux/sparc/.svn/props/filesystem.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/sparc/.svn/props/filesystem.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/sparc/.svn/props/inputdevices.h.svn-work b/arch/linux/sparc/.svn/props/inputdevices.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/sparc/.svn/props/inputdevices.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/sparc/.svn/props/loadavg.h.svn-work b/arch/linux/sparc/.svn/props/loadavg.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/sparc/.svn/props/loadavg.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/sparc/.svn/props/memory.h.svn-work b/arch/linux/sparc/.svn/props/memory.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/sparc/.svn/props/memory.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/sparc/.svn/props/modules.h.svn-work b/arch/linux/sparc/.svn/props/modules.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/sparc/.svn/props/modules.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/sparc/.svn/props/net.h.svn-work b/arch/linux/sparc/.svn/props/net.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/sparc/.svn/props/net.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/sparc/.svn/props/nfs.h.svn-work b/arch/linux/sparc/.svn/props/nfs.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/sparc/.svn/props/nfs.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/sparc/.svn/props/os.h.svn-work b/arch/linux/sparc/.svn/props/os.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/sparc/.svn/props/os.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/sparc/.svn/props/pci.h.svn-work b/arch/linux/sparc/.svn/props/pci.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/sparc/.svn/props/pci.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/sparc/.svn/props/processor.h.svn-work b/arch/linux/sparc/.svn/props/processor.h.svn-work deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/sparc/.svn/props/processor.h.svn-work +++ /dev/null diff --git a/arch/linux/sparc/.svn/props/samba.h.svn-work b/arch/linux/sparc/.svn/props/samba.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/sparc/.svn/props/samba.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/sparc/.svn/props/sensors.h.svn-work b/arch/linux/sparc/.svn/props/sensors.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/sparc/.svn/props/sensors.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/sparc/.svn/props/storage.h.svn-work b/arch/linux/sparc/.svn/props/storage.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/sparc/.svn/props/storage.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/sparc/.svn/props/uptime.h.svn-work b/arch/linux/sparc/.svn/props/uptime.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/sparc/.svn/props/uptime.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/sparc/.svn/props/usb.h.svn-work b/arch/linux/sparc/.svn/props/usb.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/sparc/.svn/props/usb.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/sparc/.svn/text-base/alsa.h.svn-base b/arch/linux/sparc/.svn/text-base/alsa.h.svn-base deleted file mode 100644 index e17b92c3..00000000 --- a/arch/linux/sparc/.svn/text-base/alsa.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/alsa.h
\ No newline at end of file diff --git a/arch/linux/sparc/.svn/text-base/filesystem.h.svn-base b/arch/linux/sparc/.svn/text-base/filesystem.h.svn-base deleted file mode 100644 index 0d23c803..00000000 --- a/arch/linux/sparc/.svn/text-base/filesystem.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/filesystem.h
\ No newline at end of file diff --git a/arch/linux/sparc/.svn/text-base/inputdevices.h.svn-base b/arch/linux/sparc/.svn/text-base/inputdevices.h.svn-base deleted file mode 100644 index 58695156..00000000 --- a/arch/linux/sparc/.svn/text-base/inputdevices.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/inputdevices.h
\ No newline at end of file diff --git a/arch/linux/sparc/.svn/text-base/loadavg.h.svn-base b/arch/linux/sparc/.svn/text-base/loadavg.h.svn-base deleted file mode 100644 index 354f872f..00000000 --- a/arch/linux/sparc/.svn/text-base/loadavg.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/loadavg.h
\ No newline at end of file diff --git a/arch/linux/sparc/.svn/text-base/memory.h.svn-base b/arch/linux/sparc/.svn/text-base/memory.h.svn-base deleted file mode 100644 index 2b2ad528..00000000 --- a/arch/linux/sparc/.svn/text-base/memory.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/memory.h
\ No newline at end of file diff --git a/arch/linux/sparc/.svn/text-base/modules.h.svn-base b/arch/linux/sparc/.svn/text-base/modules.h.svn-base deleted file mode 100644 index d80f7d7a..00000000 --- a/arch/linux/sparc/.svn/text-base/modules.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/modules.h
\ No newline at end of file diff --git a/arch/linux/sparc/.svn/text-base/net.h.svn-base b/arch/linux/sparc/.svn/text-base/net.h.svn-base deleted file mode 100644 index 2b4ac97a..00000000 --- a/arch/linux/sparc/.svn/text-base/net.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/net.h
\ No newline at end of file diff --git a/arch/linux/sparc/.svn/text-base/nfs.h.svn-base b/arch/linux/sparc/.svn/text-base/nfs.h.svn-base deleted file mode 100644 index c10bd829..00000000 --- a/arch/linux/sparc/.svn/text-base/nfs.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/nfs.h
\ No newline at end of file diff --git a/arch/linux/sparc/.svn/text-base/os.h.svn-base b/arch/linux/sparc/.svn/text-base/os.h.svn-base deleted file mode 100644 index 49613b1f..00000000 --- a/arch/linux/sparc/.svn/text-base/os.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/os.h
\ No newline at end of file diff --git a/arch/linux/sparc/.svn/text-base/pci.h.svn-base b/arch/linux/sparc/.svn/text-base/pci.h.svn-base deleted file mode 100644 index 2386d2ad..00000000 --- a/arch/linux/sparc/.svn/text-base/pci.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/pci.h
\ No newline at end of file diff --git a/arch/linux/sparc/.svn/text-base/processor.h.svn-base b/arch/linux/sparc/.svn/text-base/processor.h.svn-base deleted file mode 100644 index 211ea56b..00000000 --- a/arch/linux/sparc/.svn/text-base/processor.h.svn-base +++ /dev/null @@ -1,59 +0,0 @@ -/* - * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, version 2. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -static Processor * -computer_get_processor(void) -{ - Processor *processor; - FILE *cpuinfo; - gchar buffer[128]; - - cpuinfo = fopen("/proc/cpuinfo", "r"); - if (!cpuinfo) - return NULL; - - processor = g_new0(Processor, 1); - while (fgets(buffer, 128, cpuinfo)) { - gchar **tmp = g_strsplit(buffer, ":", 2); - - if (tmp[0] && tmp[1]) { - tmp[0] = g_strstrip(tmp[0]); - tmp[1] = g_strstrip(tmp[1]); - - get_str("cpu", processor->model_name); - get_str("fpu", processor->has_fpu); - } - g_strfreev(tmp); - } - - get_processor_strfamily(processor); - - fclose(cpuinfo); - - return processor; -} - -static gchar * -processor_get_info(Processor *processor) -{ - return g_strdup_printf("[Processor]\n" - "CPU=%s\n" - "FPU=%s\n", - processor->model_name, - processor->has_fpu); -} diff --git a/arch/linux/sparc/.svn/text-base/samba.h.svn-base b/arch/linux/sparc/.svn/text-base/samba.h.svn-base deleted file mode 100644 index 246e9ed0..00000000 --- a/arch/linux/sparc/.svn/text-base/samba.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/samba.h
\ No newline at end of file diff --git a/arch/linux/sparc/.svn/text-base/sensors.h.svn-base b/arch/linux/sparc/.svn/text-base/sensors.h.svn-base deleted file mode 100644 index 822de7b7..00000000 --- a/arch/linux/sparc/.svn/text-base/sensors.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/sensors.h
\ No newline at end of file diff --git a/arch/linux/sparc/.svn/text-base/storage.h.svn-base b/arch/linux/sparc/.svn/text-base/storage.h.svn-base deleted file mode 100644 index 24568f89..00000000 --- a/arch/linux/sparc/.svn/text-base/storage.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/storage.h
\ No newline at end of file diff --git a/arch/linux/sparc/.svn/text-base/uptime.h.svn-base b/arch/linux/sparc/.svn/text-base/uptime.h.svn-base deleted file mode 100644 index 25cc41e9..00000000 --- a/arch/linux/sparc/.svn/text-base/uptime.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/uptime.h
\ No newline at end of file diff --git a/arch/linux/sparc/.svn/text-base/usb.h.svn-base b/arch/linux/sparc/.svn/text-base/usb.h.svn-base deleted file mode 100644 index 8aece87f..00000000 --- a/arch/linux/sparc/.svn/text-base/usb.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/usb.h
\ No newline at end of file diff --git a/arch/linux/sparc/battery.h b/arch/linux/sparc/battery.h new file mode 120000 index 00000000..e4c794f2 --- /dev/null +++ b/arch/linux/sparc/battery.h @@ -0,0 +1 @@ +../../linux/common/battery.h
\ No newline at end of file diff --git a/arch/linux/sparc/boots.h b/arch/linux/sparc/boots.h new file mode 120000 index 00000000..97384500 --- /dev/null +++ b/arch/linux/sparc/boots.h @@ -0,0 +1 @@ +../../../arch/linux/common/boots.h
\ No newline at end of file diff --git a/arch/linux/sparc/devmemory.h b/arch/linux/sparc/devmemory.h new file mode 120000 index 00000000..f8a833e7 --- /dev/null +++ b/arch/linux/sparc/devmemory.h @@ -0,0 +1 @@ +../../../arch/linux/common/devmemory.h
\ No newline at end of file diff --git a/arch/linux/sparc/processor.h b/arch/linux/sparc/processor.h index 211ea56b..04e38c33 100644 --- a/arch/linux/sparc/processor.h +++ b/arch/linux/sparc/processor.h @@ -16,8 +16,13 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -static Processor * -computer_get_processor(void) +struct _Processor { + gchar *model_name; + gchar *has_fpu; +}; + +static GSList * +__scan_processors(void) { Processor *processor; FILE *cpuinfo; @@ -41,16 +46,16 @@ computer_get_processor(void) g_strfreev(tmp); } - get_processor_strfamily(processor); - fclose(cpuinfo); - return processor; + return g_slist_append(NULL, processor); } static gchar * -processor_get_info(Processor *processor) +processor_get_info(GSList *processors) { + Processor *processor = (Processor *)processors->data; + return g_strdup_printf("[Processor]\n" "CPU=%s\n" "FPU=%s\n", diff --git a/arch/linux/x86/.svn/README.txt b/arch/linux/x86/.svn/README.txt deleted file mode 100644 index 271a8ce9..00000000 --- a/arch/linux/x86/.svn/README.txt +++ /dev/null @@ -1,2 +0,0 @@ -This is a Subversion working copy administrative directory. -Visit http://subversion.tigris.org/ for more information. diff --git a/arch/linux/x86/.svn/empty-file b/arch/linux/x86/.svn/empty-file deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/x86/.svn/empty-file +++ /dev/null diff --git a/arch/linux/x86/.svn/entries b/arch/linux/x86/.svn/entries deleted file mode 100644 index 098b3a34..00000000 --- a/arch/linux/x86/.svn/entries +++ /dev/null @@ -1,160 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<wc-entries - xmlns="svn:"> -<entry - committed-rev="4" - name="" - committed-date="2006-01-31T23:35:06.244169Z" - url="svn+ssh://lafp@svn.berlios.de/svnroot/repos/hardinfo/trunk/hardinfo2/arch/linux/x86" - last-author="lafp" - kind="dir" - uuid="03931a0e-0c0b-0410-87e6-c9e79dddb921" - repos="svn+ssh://lafp@svn.berlios.de/svnroot/repos/hardinfo" - revision="9"/> -<entry - committed-rev="1" - name="usb.h" - text-time="2006-05-20T14:29:23.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="0ed17ec7082ecf81bc512f4d2add7bec" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:23.000000Z"/> -<entry - committed-rev="1" - name="sensors.h" - text-time="2006-05-20T14:29:23.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="ba83966be8f142e8f9fbed44bfc77b7a" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:23.000000Z"/> -<entry - committed-rev="1" - name="inputdevices.h" - text-time="2006-05-20T14:29:23.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="1307b7aff245fa7fba84aa91f08d27fc" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:23.000000Z"/> -<entry - committed-rev="1" - name="uptime.h" - text-time="2006-05-20T14:29:23.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="760f1adef4fbcec7d74200abc3a4f6eb" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:23.000000Z"/> -<entry - committed-rev="1" - name="storage.h" - text-time="2006-05-20T14:29:23.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="602ef4aa9053cd983170660f53334cef" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:23.000000Z"/> -<entry - committed-rev="1" - name="memory.h" - text-time="2006-05-20T14:29:23.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="765f1eed8d98b9bbb06c4c034ce9fa32" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:23.000000Z"/> -<entry - committed-rev="1" - name="modules.h" - text-time="2006-05-20T14:29:23.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="45dfbaaabb31981ac06e021773429228" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:23.000000Z"/> -<entry - committed-rev="1" - name="pci.h" - text-time="2006-05-20T14:29:23.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="cab1a2936974aed489c107f3643b3484" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:23.000000Z"/> -<entry - committed-rev="1" - name="loadavg.h" - text-time="2006-05-20T14:29:23.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="1c83a008e883018ff1092781358ec2da" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:23.000000Z"/> -<entry - committed-rev="18" - name="processor.h" - text-time="2006-06-15T14:36:55.000000Z" - committed-date="2006-06-16T14:09:52.687901Z" - checksum="d9e2705aa2ed9d80913de5d5b4a025b0" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:23.000000Z" - revision="18"/> -<entry - committed-rev="1" - name="alsa.h" - text-time="2006-05-20T14:29:23.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="dc249687377b2de88793ee09bf54f1f1" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:23.000000Z"/> -<entry - committed-rev="1" - name="os.h" - text-time="2006-05-20T14:29:23.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="048c3f4b338d765be4f10b5067d8b50e" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:23.000000Z"/> -<entry - committed-rev="1" - name="samba.h" - text-time="2006-05-20T14:29:23.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="b541109072721d735717a33724ce9127" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:23.000000Z"/> -<entry - committed-rev="1" - name="filesystem.h" - text-time="2006-05-20T14:29:23.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="7f23b37be4cf5009414843bfe5c4e450" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:23.000000Z"/> -<entry - committed-rev="3" - name="net.h" - text-time="2006-05-20T14:29:23.000000Z" - committed-date="2006-01-26T19:39:15.288417Z" - checksum="22e5b201692010dee02e9562ce6cba1b" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:23.000000Z"/> -<entry - committed-rev="13" - name="nfs.h" - text-time="2006-05-22T12:06:58.000000Z" - committed-date="2006-05-22T12:11:05.185078Z" - checksum="382976a6eab28131079a346dd16edcd7" - last-author="lafp" - kind="file" - prop-time="2006-05-22T12:07:36.000000Z" - revision="13"/> -</wc-entries> diff --git a/arch/linux/x86/.svn/format b/arch/linux/x86/.svn/format deleted file mode 100644 index b8626c4c..00000000 --- a/arch/linux/x86/.svn/format +++ /dev/null @@ -1 +0,0 @@ -4 diff --git a/arch/linux/x86/.svn/prop-base/alsa.h.svn-base b/arch/linux/x86/.svn/prop-base/alsa.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/x86/.svn/prop-base/alsa.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/x86/.svn/prop-base/filesystem.h.svn-base b/arch/linux/x86/.svn/prop-base/filesystem.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/x86/.svn/prop-base/filesystem.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/x86/.svn/prop-base/inputdevices.h.svn-base b/arch/linux/x86/.svn/prop-base/inputdevices.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/x86/.svn/prop-base/inputdevices.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/x86/.svn/prop-base/loadavg.h.svn-base b/arch/linux/x86/.svn/prop-base/loadavg.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/x86/.svn/prop-base/loadavg.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/x86/.svn/prop-base/memory.h.svn-base b/arch/linux/x86/.svn/prop-base/memory.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/x86/.svn/prop-base/memory.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/x86/.svn/prop-base/modules.h.svn-base b/arch/linux/x86/.svn/prop-base/modules.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/x86/.svn/prop-base/modules.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/x86/.svn/prop-base/net.h.svn-base b/arch/linux/x86/.svn/prop-base/net.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/x86/.svn/prop-base/net.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/x86/.svn/prop-base/nfs.h.svn-base b/arch/linux/x86/.svn/prop-base/nfs.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/x86/.svn/prop-base/nfs.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/x86/.svn/prop-base/os.h.svn-base b/arch/linux/x86/.svn/prop-base/os.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/x86/.svn/prop-base/os.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/x86/.svn/prop-base/pci.h.svn-base b/arch/linux/x86/.svn/prop-base/pci.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/x86/.svn/prop-base/pci.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/x86/.svn/prop-base/processor.h.svn-base b/arch/linux/x86/.svn/prop-base/processor.h.svn-base deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/x86/.svn/prop-base/processor.h.svn-base +++ /dev/null diff --git a/arch/linux/x86/.svn/prop-base/samba.h.svn-base b/arch/linux/x86/.svn/prop-base/samba.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/x86/.svn/prop-base/samba.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/x86/.svn/prop-base/sensors.h.svn-base b/arch/linux/x86/.svn/prop-base/sensors.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/x86/.svn/prop-base/sensors.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/x86/.svn/prop-base/storage.h.svn-base b/arch/linux/x86/.svn/prop-base/storage.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/x86/.svn/prop-base/storage.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/x86/.svn/prop-base/uptime.h.svn-base b/arch/linux/x86/.svn/prop-base/uptime.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/x86/.svn/prop-base/uptime.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/x86/.svn/prop-base/usb.h.svn-base b/arch/linux/x86/.svn/prop-base/usb.h.svn-base deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/x86/.svn/prop-base/usb.h.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/x86/.svn/props/alsa.h.svn-work b/arch/linux/x86/.svn/props/alsa.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/x86/.svn/props/alsa.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/x86/.svn/props/filesystem.h.svn-work b/arch/linux/x86/.svn/props/filesystem.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/x86/.svn/props/filesystem.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/x86/.svn/props/inputdevices.h.svn-work b/arch/linux/x86/.svn/props/inputdevices.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/x86/.svn/props/inputdevices.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/x86/.svn/props/loadavg.h.svn-work b/arch/linux/x86/.svn/props/loadavg.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/x86/.svn/props/loadavg.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/x86/.svn/props/memory.h.svn-work b/arch/linux/x86/.svn/props/memory.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/x86/.svn/props/memory.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/x86/.svn/props/modules.h.svn-work b/arch/linux/x86/.svn/props/modules.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/x86/.svn/props/modules.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/x86/.svn/props/net.h.svn-work b/arch/linux/x86/.svn/props/net.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/x86/.svn/props/net.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/x86/.svn/props/nfs.h.svn-work b/arch/linux/x86/.svn/props/nfs.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/x86/.svn/props/nfs.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/x86/.svn/props/os.h.svn-work b/arch/linux/x86/.svn/props/os.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/x86/.svn/props/os.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/x86/.svn/props/pci.h.svn-work b/arch/linux/x86/.svn/props/pci.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/x86/.svn/props/pci.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/x86/.svn/props/processor.h.svn-work b/arch/linux/x86/.svn/props/processor.h.svn-work deleted file mode 100644 index e69de29b..00000000 --- a/arch/linux/x86/.svn/props/processor.h.svn-work +++ /dev/null diff --git a/arch/linux/x86/.svn/props/samba.h.svn-work b/arch/linux/x86/.svn/props/samba.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/x86/.svn/props/samba.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/x86/.svn/props/sensors.h.svn-work b/arch/linux/x86/.svn/props/sensors.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/x86/.svn/props/sensors.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/x86/.svn/props/storage.h.svn-work b/arch/linux/x86/.svn/props/storage.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/x86/.svn/props/storage.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/x86/.svn/props/uptime.h.svn-work b/arch/linux/x86/.svn/props/uptime.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/x86/.svn/props/uptime.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/x86/.svn/props/usb.h.svn-work b/arch/linux/x86/.svn/props/usb.h.svn-work deleted file mode 100644 index d2224698..00000000 --- a/arch/linux/x86/.svn/props/usb.h.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 11 -svn:special -V 1 -* -END diff --git a/arch/linux/x86/.svn/text-base/alsa.h.svn-base b/arch/linux/x86/.svn/text-base/alsa.h.svn-base deleted file mode 100644 index e17b92c3..00000000 --- a/arch/linux/x86/.svn/text-base/alsa.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/alsa.h
\ No newline at end of file diff --git a/arch/linux/x86/.svn/text-base/filesystem.h.svn-base b/arch/linux/x86/.svn/text-base/filesystem.h.svn-base deleted file mode 100644 index 0d23c803..00000000 --- a/arch/linux/x86/.svn/text-base/filesystem.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/filesystem.h
\ No newline at end of file diff --git a/arch/linux/x86/.svn/text-base/inputdevices.h.svn-base b/arch/linux/x86/.svn/text-base/inputdevices.h.svn-base deleted file mode 100644 index 58695156..00000000 --- a/arch/linux/x86/.svn/text-base/inputdevices.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/inputdevices.h
\ No newline at end of file diff --git a/arch/linux/x86/.svn/text-base/loadavg.h.svn-base b/arch/linux/x86/.svn/text-base/loadavg.h.svn-base deleted file mode 100644 index 354f872f..00000000 --- a/arch/linux/x86/.svn/text-base/loadavg.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/loadavg.h
\ No newline at end of file diff --git a/arch/linux/x86/.svn/text-base/memory.h.svn-base b/arch/linux/x86/.svn/text-base/memory.h.svn-base deleted file mode 100644 index 2b2ad528..00000000 --- a/arch/linux/x86/.svn/text-base/memory.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/memory.h
\ No newline at end of file diff --git a/arch/linux/x86/.svn/text-base/modules.h.svn-base b/arch/linux/x86/.svn/text-base/modules.h.svn-base deleted file mode 100644 index d80f7d7a..00000000 --- a/arch/linux/x86/.svn/text-base/modules.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/modules.h
\ No newline at end of file diff --git a/arch/linux/x86/.svn/text-base/net.h.svn-base b/arch/linux/x86/.svn/text-base/net.h.svn-base deleted file mode 100644 index 2b4ac97a..00000000 --- a/arch/linux/x86/.svn/text-base/net.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/net.h
\ No newline at end of file diff --git a/arch/linux/x86/.svn/text-base/nfs.h.svn-base b/arch/linux/x86/.svn/text-base/nfs.h.svn-base deleted file mode 100644 index c10bd829..00000000 --- a/arch/linux/x86/.svn/text-base/nfs.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/nfs.h
\ No newline at end of file diff --git a/arch/linux/x86/.svn/text-base/os.h.svn-base b/arch/linux/x86/.svn/text-base/os.h.svn-base deleted file mode 100644 index 49613b1f..00000000 --- a/arch/linux/x86/.svn/text-base/os.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/os.h
\ No newline at end of file diff --git a/arch/linux/x86/.svn/text-base/pci.h.svn-base b/arch/linux/x86/.svn/text-base/pci.h.svn-base deleted file mode 100644 index 2386d2ad..00000000 --- a/arch/linux/x86/.svn/text-base/pci.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/pci.h
\ No newline at end of file diff --git a/arch/linux/x86/.svn/text-base/processor.h.svn-base b/arch/linux/x86/.svn/text-base/processor.h.svn-base deleted file mode 100644 index aba623bf..00000000 --- a/arch/linux/x86/.svn/text-base/processor.h.svn-base +++ /dev/null @@ -1,303 +0,0 @@ -/* - * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, version 2. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -/* - * This function is partly based on x86cpucaps - * by Osamu Kayasono <jacobi@jcom.home.ne.jp> - */ -static void -get_processor_strfamily(Processor *processor) -{ - gint family = processor->family; - gint model = processor->model; - - if (g_str_equal(processor->vendor_id, "GenuineIntel")) { - if (family == 4) { - processor->strmodel = g_strdup("i486 series"); - } else if (family == 5) { - if (model < 4) { - processor->strmodel = g_strdup("Pentium Classic"); - } else { - processor->strmodel = g_strdup("Pentium MMX"); - } - } else if (family == 6) { - if (model <= 1) { - processor->strmodel = g_strdup("Pentium Pro"); - } else if (model < 7) { - processor->strmodel = g_strdup("Pentium II/Pentium II Xeon/Celeron"); - } else if (model == 9) { - processor->strmodel = g_strdup("Pentium M"); - } else { - processor->strmodel = g_strdup("Pentium III/Pentium III Xeon/Celeron"); - } - } else if (family > 6) { - processor->strmodel = g_strdup("Pentium 4"); - } else { - processor->strmodel = g_strdup("i386 class"); - } - } else if (g_str_equal(processor->vendor_id, "AuthenticAMD")) { - if (family == 4) { - if (model <= 9) { - processor->strmodel = g_strdup("AMD i80486 series"); - } else { - processor->strmodel = g_strdup("AMD 5x86"); - } - } else if (family == 5) { - if (model <= 3) { - processor->strmodel = g_strdup("AMD K5"); - } else if (model <= 7) { - processor->strmodel = g_strdup("AMD K6"); - } else if (model == 8) { - processor->strmodel = g_strdup("AMD K6-2"); - } else if (model == 9) { - processor->strmodel = g_strdup("AMD K6-III"); - } else { - processor->strmodel = g_strdup("AMD K6-2+/III+"); - } - } else if (family == 6) { - if (model == 1) { - processor->strmodel = g_strdup("AMD Athlon (K7"); - } else if (model == 2) { - processor->strmodel = g_strdup("AMD Athlon (K75)"); - } else if (model == 3) { - processor->strmodel = g_strdup("AMD Duron (Spitfire)"); - } else if (model == 4) { - processor->strmodel = g_strdup("AMD Athlon (Thunderbird)"); - } else if (model == 6) { - processor->strmodel = g_strdup("AMD Athlon XP/MP/4 (Palomino)"); - } else if (model == 7) { - processor->strmodel = g_strdup("AMD Duron (Morgan)"); - } else if (model == 8) { - processor->strmodel = g_strdup("AMD Athlon XP/MP (Thoroughbred)"); - } else if (model == 10) { - processor->strmodel = g_strdup("AMD Athlon XP/MP (Barton)"); - } else { - processor->strmodel = g_strdup("AMD Athlon (unknown)"); - } - } else if (family > 6) { - processor->strmodel = g_strdup("AMD Opteron/Athlon64/FX"); - } else { - processor->strmodel = g_strdup("AMD i386 class"); - } - } else if (g_str_equal(processor->vendor_id, "CyrixInstead")) { - if (family == 4) { - processor->strmodel = g_strdup("Cyrix 5x86"); - } else if (family == 5) { - processor->strmodel = g_strdup("Cyrix M1 (6x86)"); - } else if (family == 6) { - if (model == 0) { - processor->strmodel = g_strdup("Cyrix M2 (6x86MX)"); - } else if (model <= 5) { - processor->strmodel = g_strdup("VIA Cyrix III (M2 core)"); - } else if (model == 6) { - processor->strmodel = g_strdup("VIA Cyrix III (WinChip C5A)"); - } else if (model == 7) { - processor->strmodel = g_strdup("VIA Cyrix III (WinChip C5B/C)"); - } else { - processor->strmodel = g_strdup("VIA Cyrix III (WinChip C5C-T)"); - } - } else { - processor->strmodel = g_strdup("Cyrix i386 class"); - } - } else if (g_str_equal(processor->vendor_id, "CentaurHauls")) { - if (family == 5) { - if (model <= 4) { - processor->strmodel = g_strdup("Centaur WinChip C6"); - } else if (model <= 8) { - processor->strmodel = g_strdup("Centaur WinChip 2"); - } else { - processor->strmodel = g_strdup("Centaur WinChip 2A"); - } - } else { - processor->strmodel = g_strdup("Centaur i386 class"); - } - } else if (g_str_equal(processor->vendor_id, "GenuineTMx86")) { - processor->strmodel = g_strdup("Transmeta Crusoe TM3x00/5x00"); - } else { - processor->strmodel = g_strdup("Unknown"); - } -} - -static Processor * -computer_get_processor(void) -{ - Processor *processor; - FILE *cpuinfo; - gchar buffer[128]; - - cpuinfo = fopen("/proc/cpuinfo", "r"); - if (!cpuinfo) - return NULL; - - processor = g_new0(Processor, 1); - while (fgets(buffer, 128, cpuinfo)) { - gchar **tmp = g_strsplit(buffer, ":", 2); - - if (tmp[0] && tmp[1]) { - tmp[0] = g_strstrip(tmp[0]); - tmp[1] = g_strstrip(tmp[1]); - - get_str("model name", processor->model_name); - get_str("vendor_id", processor->vendor_id); - get_str("flags", processor->flags); - get_int("cache size", processor->cache_size); - get_float("cpu MHz", processor->cpu_mhz); - get_float("bogomips", processor->bogomips); - - get_str("fpu", processor->has_fpu); - - get_str("fdiv_bug", processor->bug_fdiv); - get_str("hlt_bug", processor->bug_hlt); - get_str("f00f_bug", processor->bug_f00f); - get_str("coma_bug", processor->bug_coma); - - get_int("model", processor->model); - get_int("cpu family", processor->family); - get_int("stepping", processor->stepping); - } - g_strfreev(tmp); - } - - get_processor_strfamily(processor); - - fclose(cpuinfo); - - return processor; -} - -static struct { - char *name, *meaning; -} flag_meaning[] = { - { "3dnow", "3DNow! Technology" }, - { "3dnowext", "Extended 3DNow! Technology" }, - { "fpu", "Floating Point Unit" }, - { "vme", "Virtual 86 Mode Extension" }, - { "de", "Debug Extensions - I/O breakpoints" }, - { "pse", "Page Size Extensions (4MB pages)" }, - { "tsc", "Time Stamp Counter and RDTSC instruction" }, - { "msr", "Model Specific Registers" }, - { "pae", "Physical Address Extensions (36-bit address, 2MB pages)" }, - { "mce", "Machine Check Architeture" }, - { "cx8", "CMPXCHG8 instruction" }, - { "apic", "Advanced Programmable Interrupt Controller" }, - { "sep", "Fast System Call (SYSENTER/SYSEXIT instructions)" }, - { "mtrr", "Memory Type Range Registers" }, - { "pge", "Page Global Enable" }, - { "mca", "Machine Check Architecture" }, - { "cmov", "Conditional Move instruction" }, - { "pat", "Page Attribute Table" }, - { "pse36", "36bit Page Size Extensions" }, - { "psn", "96 bit Processor Serial Number" }, - { "mmx", "MMX technology" }, - { "mmxext", "Extended MMX Technology" }, - { "cflush", "Cache Flush" }, - { "dtes", "Debug Trace Store" }, - { "fxsr", "FXSAVE and FXRSTOR instructions" }, - { "kni", "Streaming SIMD instructions" }, - { "xmm", "Streaming SIMD instructions" }, - { "ht", "HyperThreading" }, - { "mp", "Multiprocessing Capable" }, - { "sse", "SSE instructions" }, - { "sse2", "SSE2 (WNI) instructions" }, - { "acc", "Automatic Clock Control" }, - { "ia64", "IA64 Instructions" }, - { "syscall", "SYSCALL and SYSEXIT instructions" }, - { "nx", "No-execute Page Protection" }, - { "xd", "Execute Disable" }, - { "clflush", "Cache Line Flush instruction" }, - { "acpi", "Thermal Monitor and Software Controlled Clock Facilities" }, - { "dts", "Debug Store" }, - { "ss", "Self Snoop" }, - { "tm", "Thermal Monitor" }, - { "pbe", "Pending Break Enable" }, - { "pb", "Pending Break Enable" }, - { NULL, NULL} -}; - -gchar * -processor_get_capabilities_from_flags(gchar * strflags) -{ - /* FIXME: * Separate between processor capabilities, additional instructions and whatnot. */ - gchar **flags, **old; - gchar *tmp = ""; - gint i, j = 0; - - flags = g_strsplit(strflags, " ", 0); - old = flags; - - while (flags[j]) { - gchar *meaning = ""; - for (i = 0; flag_meaning[i].name != NULL; i++) { - if (!strcmp(flags[j], flag_meaning[i].name)) { - meaning = flag_meaning[i].meaning; - break; - } - } - - tmp = g_strdup_printf("%s%s=%s\n", tmp, flags[j], meaning); - j++; - } - - g_strfreev(old); - return tmp; -} - -static gchar * -processor_get_info(Processor *processor) -{ - gchar *tmp = processor_get_capabilities_from_flags(processor-> - flags); - gchar *ret = g_strdup_printf("[Processor]\n" - "Name=%s\n" - "Specification=%s\n" - "Family, model, stepping=%d, %d, %d\n" - "Vendor=%s\n" - "Cache Size=%dkb\n" - "Frequency=%.2fMHz\n" - "BogoMips=%.2f\n" - "Byte Order=%s\n" - "[Features]\n" - "FDIV Bug=%s\n" - "HLT Bug=%s\n" - "F00F Bug=%s\n" - "Coma Bug=%s\n" - "Has FPU=%s\n" - "[Capabilities]\n" "%s", - processor->strmodel, - processor->model_name, - processor->family, - processor->model, - processor->stepping, - processor->vendor_id, - processor->cache_size, - processor->cpu_mhz, - processor->bogomips, -#if G_BYTE_ORDER == G_LITTLE_ENDIAN - "Little Endian", -#else - "Big Endian", -#endif - processor->bug_fdiv, - processor->bug_hlt, - processor->bug_f00f, - processor->bug_coma, - processor->has_fpu, - tmp); - g_free(tmp); - return ret; -} diff --git a/arch/linux/x86/.svn/text-base/samba.h.svn-base b/arch/linux/x86/.svn/text-base/samba.h.svn-base deleted file mode 100644 index 246e9ed0..00000000 --- a/arch/linux/x86/.svn/text-base/samba.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/samba.h
\ No newline at end of file diff --git a/arch/linux/x86/.svn/text-base/sensors.h.svn-base b/arch/linux/x86/.svn/text-base/sensors.h.svn-base deleted file mode 100644 index 822de7b7..00000000 --- a/arch/linux/x86/.svn/text-base/sensors.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/sensors.h
\ No newline at end of file diff --git a/arch/linux/x86/.svn/text-base/storage.h.svn-base b/arch/linux/x86/.svn/text-base/storage.h.svn-base deleted file mode 100644 index 24568f89..00000000 --- a/arch/linux/x86/.svn/text-base/storage.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/storage.h
\ No newline at end of file diff --git a/arch/linux/x86/.svn/text-base/uptime.h.svn-base b/arch/linux/x86/.svn/text-base/uptime.h.svn-base deleted file mode 100644 index 25cc41e9..00000000 --- a/arch/linux/x86/.svn/text-base/uptime.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/uptime.h
\ No newline at end of file diff --git a/arch/linux/x86/.svn/text-base/usb.h.svn-base b/arch/linux/x86/.svn/text-base/usb.h.svn-base deleted file mode 100644 index 8aece87f..00000000 --- a/arch/linux/x86/.svn/text-base/usb.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -link ../../linux/common/usb.h
\ No newline at end of file diff --git a/arch/linux/x86/battery.h b/arch/linux/x86/battery.h new file mode 120000 index 00000000..e4c794f2 --- /dev/null +++ b/arch/linux/x86/battery.h @@ -0,0 +1 @@ +../../linux/common/battery.h
\ No newline at end of file diff --git a/arch/linux/x86/boots.h b/arch/linux/x86/boots.h new file mode 120000 index 00000000..97384500 --- /dev/null +++ b/arch/linux/x86/boots.h @@ -0,0 +1 @@ +../../../arch/linux/common/boots.h
\ No newline at end of file diff --git a/arch/linux/x86/devmemory.h b/arch/linux/x86/devmemory.h new file mode 120000 index 00000000..f8a833e7 --- /dev/null +++ b/arch/linux/x86/devmemory.h @@ -0,0 +1 @@ +../../../arch/linux/common/devmemory.h
\ No newline at end of file diff --git a/arch/linux/x86/net.h b/arch/linux/x86/net.h index 72d77b26..488b5ae3 120000 --- a/arch/linux/x86/net.h +++ b/arch/linux/x86/net.h @@ -1 +1 @@ -../../linux/common/net.h
\ No newline at end of file +../../../arch/linux/common/net.h
\ No newline at end of file diff --git a/arch/linux/x86/processor.h b/arch/linux/x86/processor.h index aba623bf..918bac7c 100644 --- a/arch/linux/x86/processor.h +++ b/arch/linux/x86/processor.h @@ -16,138 +16,161 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +struct _Processor { + gchar *model_name; + gchar *vendor_id; + gchar *flags; + gint cache_size; + gfloat bogomips, cpu_mhz; + + gchar *has_fpu; + gchar *bug_fdiv, *bug_hlt, *bug_f00f, *bug_coma; + + gint model, family, stepping; + gchar *strmodel; + + gint id; +}; + /* * This function is partly based on x86cpucaps * by Osamu Kayasono <jacobi@jcom.home.ne.jp> - */ -static void -get_processor_strfamily(Processor *processor) + */ +static void get_processor_strfamily(Processor * processor) { gint family = processor->family; gint model = processor->model; if (g_str_equal(processor->vendor_id, "GenuineIntel")) { - if (family == 4) { - processor->strmodel = g_strdup("i486 series"); - } else if (family == 5) { - if (model < 4) { - processor->strmodel = g_strdup("Pentium Classic"); - } else { - processor->strmodel = g_strdup("Pentium MMX"); - } - } else if (family == 6) { - if (model <= 1) { - processor->strmodel = g_strdup("Pentium Pro"); - } else if (model < 7) { - processor->strmodel = g_strdup("Pentium II/Pentium II Xeon/Celeron"); - } else if (model == 9) { - processor->strmodel = g_strdup("Pentium M"); - } else { - processor->strmodel = g_strdup("Pentium III/Pentium III Xeon/Celeron"); - } - } else if (family > 6) { - processor->strmodel = g_strdup("Pentium 4"); - } else { - processor->strmodel = g_strdup("i386 class"); - } + if (family == 4) { + processor->strmodel = g_strdup("i486 series"); + } else if (family == 5) { + if (model < 4) { + processor->strmodel = g_strdup("Pentium Classic"); + } else { + processor->strmodel = g_strdup("Pentium MMX"); + } + } else if (family == 6) { + if (model <= 1) { + processor->strmodel = g_strdup("Pentium Pro"); + } else if (model < 7) { + processor->strmodel = g_strdup("Pentium II/Pentium II Xeon/Celeron"); + } else if (model == 9) { + processor->strmodel = g_strdup("Pentium M"); + } else { + processor->strmodel = g_strdup("Pentium III/Pentium III Xeon/Celeron"); + } + } else if (family > 6) { + processor->strmodel = g_strdup("Pentium 4"); + } else { + processor->strmodel = g_strdup("i386 class"); + } } else if (g_str_equal(processor->vendor_id, "AuthenticAMD")) { - if (family == 4) { - if (model <= 9) { - processor->strmodel = g_strdup("AMD i80486 series"); - } else { - processor->strmodel = g_strdup("AMD 5x86"); - } - } else if (family == 5) { - if (model <= 3) { - processor->strmodel = g_strdup("AMD K5"); - } else if (model <= 7) { - processor->strmodel = g_strdup("AMD K6"); - } else if (model == 8) { - processor->strmodel = g_strdup("AMD K6-2"); - } else if (model == 9) { - processor->strmodel = g_strdup("AMD K6-III"); - } else { - processor->strmodel = g_strdup("AMD K6-2+/III+"); - } - } else if (family == 6) { - if (model == 1) { - processor->strmodel = g_strdup("AMD Athlon (K7"); - } else if (model == 2) { - processor->strmodel = g_strdup("AMD Athlon (K75)"); - } else if (model == 3) { - processor->strmodel = g_strdup("AMD Duron (Spitfire)"); - } else if (model == 4) { - processor->strmodel = g_strdup("AMD Athlon (Thunderbird)"); - } else if (model == 6) { - processor->strmodel = g_strdup("AMD Athlon XP/MP/4 (Palomino)"); - } else if (model == 7) { - processor->strmodel = g_strdup("AMD Duron (Morgan)"); - } else if (model == 8) { - processor->strmodel = g_strdup("AMD Athlon XP/MP (Thoroughbred)"); - } else if (model == 10) { - processor->strmodel = g_strdup("AMD Athlon XP/MP (Barton)"); - } else { - processor->strmodel = g_strdup("AMD Athlon (unknown)"); - } - } else if (family > 6) { - processor->strmodel = g_strdup("AMD Opteron/Athlon64/FX"); - } else { - processor->strmodel = g_strdup("AMD i386 class"); - } + if (family == 4) { + if (model <= 9) { + processor->strmodel = g_strdup("AMD i80486 series"); + } else { + processor->strmodel = g_strdup("AMD 5x86"); + } + } else if (family == 5) { + if (model <= 3) { + processor->strmodel = g_strdup("AMD K5"); + } else if (model <= 7) { + processor->strmodel = g_strdup("AMD K6"); + } else if (model == 8) { + processor->strmodel = g_strdup("AMD K6-2"); + } else if (model == 9) { + processor->strmodel = g_strdup("AMD K6-III"); + } else { + processor->strmodel = g_strdup("AMD K6-2+/III+"); + } + } else if (family == 6) { + if (model == 1) { + processor->strmodel = g_strdup("AMD Athlon (K7)"); + } else if (model == 2) { + processor->strmodel = g_strdup("AMD Athlon (K75)"); + } else if (model == 3) { + processor->strmodel = g_strdup("AMD Duron (Spitfire)"); + } else if (model == 4) { + processor->strmodel = g_strdup("AMD Athlon (Thunderbird)"); + } else if (model == 6) { + processor->strmodel = g_strdup("AMD Athlon XP/MP/4 (Palomino)"); + } else if (model == 7) { + processor->strmodel = g_strdup("AMD Duron (Morgan)"); + } else if (model == 8) { + processor->strmodel = g_strdup("AMD Athlon XP/MP (Thoroughbred)"); + } else if (model == 10) { + processor->strmodel = g_strdup("AMD Athlon XP/MP (Barton)"); + } else { + processor->strmodel = g_strdup("AMD Athlon (unknown)"); + } + } else if (family > 6) { + processor->strmodel = g_strdup("AMD Opteron/Athlon64/FX"); + } else { + processor->strmodel = g_strdup("AMD i386 class"); + } } else if (g_str_equal(processor->vendor_id, "CyrixInstead")) { - if (family == 4) { - processor->strmodel = g_strdup("Cyrix 5x86"); - } else if (family == 5) { - processor->strmodel = g_strdup("Cyrix M1 (6x86)"); - } else if (family == 6) { - if (model == 0) { - processor->strmodel = g_strdup("Cyrix M2 (6x86MX)"); - } else if (model <= 5) { - processor->strmodel = g_strdup("VIA Cyrix III (M2 core)"); - } else if (model == 6) { - processor->strmodel = g_strdup("VIA Cyrix III (WinChip C5A)"); - } else if (model == 7) { - processor->strmodel = g_strdup("VIA Cyrix III (WinChip C5B/C)"); - } else { - processor->strmodel = g_strdup("VIA Cyrix III (WinChip C5C-T)"); - } - } else { - processor->strmodel = g_strdup("Cyrix i386 class"); - } + if (family == 4) { + processor->strmodel = g_strdup("Cyrix 5x86"); + } else if (family == 5) { + processor->strmodel = g_strdup("Cyrix M1 (6x86)"); + } else if (family == 6) { + if (model == 0) { + processor->strmodel = g_strdup("Cyrix M2 (6x86MX)"); + } else if (model <= 5) { + processor->strmodel = g_strdup("VIA Cyrix III (M2 core)"); + } else if (model == 6) { + processor->strmodel = g_strdup("VIA Cyrix III (WinChip C5A)"); + } else if (model == 7) { + processor->strmodel = g_strdup("VIA Cyrix III (WinChip C5B/C)"); + } else { + processor->strmodel = g_strdup("VIA Cyrix III (WinChip C5C-T)"); + } + } else { + processor->strmodel = g_strdup("Cyrix i386 class"); + } } else if (g_str_equal(processor->vendor_id, "CentaurHauls")) { - if (family == 5) { - if (model <= 4) { - processor->strmodel = g_strdup("Centaur WinChip C6"); - } else if (model <= 8) { - processor->strmodel = g_strdup("Centaur WinChip 2"); - } else { - processor->strmodel = g_strdup("Centaur WinChip 2A"); - } - } else { - processor->strmodel = g_strdup("Centaur i386 class"); - } + if (family == 5) { + if (model <= 4) { + processor->strmodel = g_strdup("Centaur WinChip C6"); + } else if (model <= 8) { + processor->strmodel = g_strdup("Centaur WinChip 2"); + } else { + processor->strmodel = g_strdup("Centaur WinChip 2A"); + } + } else { + processor->strmodel = g_strdup("Centaur i386 class"); + } } else if (g_str_equal(processor->vendor_id, "GenuineTMx86")) { - processor->strmodel = g_strdup("Transmeta Crusoe TM3x00/5x00"); + processor->strmodel = g_strdup("Transmeta Crusoe TM3x00/5x00"); } else { - processor->strmodel = g_strdup("Unknown"); + processor->strmodel = g_strdup("Unknown"); } } -static Processor * -computer_get_processor(void) +static GSList *__scan_processors(void) { - Processor *processor; + GSList *procs = NULL; + Processor *processor = NULL; FILE *cpuinfo; - gchar buffer[128]; + gchar buffer[256]; cpuinfo = fopen("/proc/cpuinfo", "r"); if (!cpuinfo) return NULL; - processor = g_new0(Processor, 1); - while (fgets(buffer, 128, cpuinfo)) { + while (fgets(buffer, 256, cpuinfo)) { gchar **tmp = g_strsplit(buffer, ":", 2); + if (g_str_has_prefix(tmp[0], "processor")) { + if (processor) { + get_processor_strfamily(processor); + procs = g_slist_append(procs, processor); + } + + processor = g_new0(Processor, 1); + } + if (tmp[0] && tmp[1]) { tmp[0] = g_strstrip(tmp[0]); tmp[1] = g_strstrip(tmp[1]); @@ -165,74 +188,81 @@ computer_get_processor(void) get_str("hlt_bug", processor->bug_hlt); get_str("f00f_bug", processor->bug_f00f); get_str("coma_bug", processor->bug_coma); - + get_int("model", processor->model); get_int("cpu family", processor->family); get_int("stepping", processor->stepping); + + get_int("processor", processor->id); } g_strfreev(tmp); } - get_processor_strfamily(processor); + if (processor) { + get_processor_strfamily(processor); + procs = g_slist_append(procs, processor); + } fclose(cpuinfo); - return processor; + return procs; } static struct { char *name, *meaning; } flag_meaning[] = { - { "3dnow", "3DNow! Technology" }, - { "3dnowext", "Extended 3DNow! Technology" }, - { "fpu", "Floating Point Unit" }, - { "vme", "Virtual 86 Mode Extension" }, - { "de", "Debug Extensions - I/O breakpoints" }, - { "pse", "Page Size Extensions (4MB pages)" }, - { "tsc", "Time Stamp Counter and RDTSC instruction" }, - { "msr", "Model Specific Registers" }, - { "pae", "Physical Address Extensions (36-bit address, 2MB pages)" }, - { "mce", "Machine Check Architeture" }, - { "cx8", "CMPXCHG8 instruction" }, - { "apic", "Advanced Programmable Interrupt Controller" }, - { "sep", "Fast System Call (SYSENTER/SYSEXIT instructions)" }, - { "mtrr", "Memory Type Range Registers" }, - { "pge", "Page Global Enable" }, - { "mca", "Machine Check Architecture" }, - { "cmov", "Conditional Move instruction" }, - { "pat", "Page Attribute Table" }, - { "pse36", "36bit Page Size Extensions" }, - { "psn", "96 bit Processor Serial Number" }, - { "mmx", "MMX technology" }, - { "mmxext", "Extended MMX Technology" }, - { "cflush", "Cache Flush" }, - { "dtes", "Debug Trace Store" }, - { "fxsr", "FXSAVE and FXRSTOR instructions" }, - { "kni", "Streaming SIMD instructions" }, - { "xmm", "Streaming SIMD instructions" }, - { "ht", "HyperThreading" }, - { "mp", "Multiprocessing Capable" }, - { "sse", "SSE instructions" }, - { "sse2", "SSE2 (WNI) instructions" }, - { "acc", "Automatic Clock Control" }, - { "ia64", "IA64 Instructions" }, - { "syscall", "SYSCALL and SYSEXIT instructions" }, - { "nx", "No-execute Page Protection" }, - { "xd", "Execute Disable" }, - { "clflush", "Cache Line Flush instruction" }, - { "acpi", "Thermal Monitor and Software Controlled Clock Facilities" }, - { "dts", "Debug Store" }, - { "ss", "Self Snoop" }, - { "tm", "Thermal Monitor" }, - { "pbe", "Pending Break Enable" }, - { "pb", "Pending Break Enable" }, - { NULL, NULL} + { "3dnow", "3DNow! Technology" }, + { "3dnowext", "Extended 3DNow! Technology" }, + { "fpu", "Floating Point Unit" }, + { "vme", "Virtual 86 Mode Extension" }, + { "de", "Debug Extensions - I/O breakpoints" }, + { "pse", "Page Size Extensions (4MB pages)" }, + { "tsc", "Time Stamp Counter and RDTSC instruction" }, + { "msr", "Model Specific Registers" }, + { "pae", "Physical Address Extensions" }, + { "mce", "Machine Check Architeture" }, + { "cx8", "CMPXCHG8 instruction" }, + { "apic", "Advanced Programmable Interrupt Controller" }, + { "sep", "Fast System Call (SYSENTER/SYSEXIT)" }, + { "mtrr", "Memory Type Range Registers" }, + { "pge", "Page Global Enable" }, + { "mca", "Machine Check Architecture" }, + { "cmov", "Conditional Move instruction" }, + { "pat", "Page Attribute Table" }, + { "pse36", "36bit Page Size Extensions" }, + { "psn", "96 bit Processor Serial Number" }, + { "mmx", "MMX technology" }, + { "mmxext", "Extended MMX Technology" }, + { "cflush", "Cache Flush" }, + { "dtes", "Debug Trace Store" }, + { "fxsr", "FXSAVE and FXRSTOR instructions" }, + { "kni", "Streaming SIMD instructions" }, + { "xmm", "Streaming SIMD instructions" }, + { "ht", "HyperThreading" }, + { "mp", "Multiprocessing Capable" }, + { "sse", "SSE instructions" }, + { "sse2", "SSE2 (WNI) instructions" }, + { "acc", "Automatic Clock Control" }, + { "ia64", "IA64 Instructions" }, + { "syscall", "SYSCALL and SYSEXIT instructions" }, + { "nx", "No-execute Page Protection" }, + { "xd", "Execute Disable" }, + { "clflush", "Cache Line Flush instruction" }, + { "acpi", "Thermal Monitor and Software Controlled Clock" }, + { "dts", "Debug Store" }, + { "ss", "Self Snoop" }, + { "tm", "Thermal Monitor" }, + { "pbe", "Pending Break Enable" }, + { "pb", "Pending Break Enable" }, + { NULL, NULL }, }; -gchar * -processor_get_capabilities_from_flags(gchar * strflags) +gchar *processor_get_capabilities_from_flags(gchar * strflags) { - /* FIXME: * Separate between processor capabilities, additional instructions and whatnot. */ + /* FIXME: + * - Separate between processor capabilities, additional instructions and whatnot. + * - Use binary search or something faster than this O(n) cruft + */ gchar **flags, **old; gchar *tmp = ""; gint i, j = 0; @@ -243,7 +273,7 @@ processor_get_capabilities_from_flags(gchar * strflags) while (flags[j]) { gchar *meaning = ""; for (i = 0; flag_meaning[i].name != NULL; i++) { - if (!strcmp(flags[j], flag_meaning[i].name)) { + if (g_str_equal(flags[j], flag_meaning[i].name)) { meaning = flag_meaning[i].meaning; break; } @@ -257,47 +287,84 @@ processor_get_capabilities_from_flags(gchar * strflags) return tmp; } -static gchar * -processor_get_info(Processor *processor) +static gchar *processor_get_detailed_info(Processor * processor) { - gchar *tmp = processor_get_capabilities_from_flags(processor-> - flags); - gchar *ret = g_strdup_printf("[Processor]\n" - "Name=%s\n" - "Specification=%s\n" - "Family, model, stepping=%d, %d, %d\n" - "Vendor=%s\n" - "Cache Size=%dkb\n" - "Frequency=%.2fMHz\n" - "BogoMips=%.2f\n" - "Byte Order=%s\n" - "[Features]\n" - "FDIV Bug=%s\n" - "HLT Bug=%s\n" - "F00F Bug=%s\n" - "Coma Bug=%s\n" - "Has FPU=%s\n" - "[Capabilities]\n" "%s", - processor->strmodel, - processor->model_name, - processor->family, - processor->model, - processor->stepping, - processor->vendor_id, - processor->cache_size, - processor->cpu_mhz, - processor->bogomips, + gchar *tmp, *ret; + + tmp = processor_get_capabilities_from_flags(processor->flags); + ret = g_strdup_printf("[Processor]\n" + "Name=%s\n" + "Family, model, stepping=%d, %d, %d (%s)\n" + "Vendor=%s\n" + "[Configuration]\n" + "Cache Size=%dkb\n" + "Frequency=%.2fMHz\n" + "BogoMIPS=%.2f\n" + "Byte Order=%s\n" + "[Features]\n" + "FDIV Bug=%s\n" + "HLT Bug=%s\n" + "F00F Bug=%s\n" + "Coma Bug=%s\n" + "Has FPU=%s\n" + "[Capabilities]\n" + "%s", + processor->model_name, + processor->family, + processor->model, + processor->stepping, + processor->strmodel, + vendor_get_name(processor->vendor_id), + processor->cache_size, + processor->cpu_mhz, processor->bogomips, #if G_BYTE_ORDER == G_LITTLE_ENDIAN - "Little Endian", + "Little Endian", #else - "Big Endian", + "Big Endian", #endif - processor->bug_fdiv, - processor->bug_hlt, - processor->bug_f00f, - processor->bug_coma, - processor->has_fpu, - tmp); - g_free(tmp); - return ret; + processor->bug_fdiv ? processor->bug_fdiv : "yes", + processor->bug_hlt ? processor->bug_hlt : "yes", + processor->bug_f00f ? processor->bug_f00f : "yes", + processor->bug_coma ? processor->bug_coma : "yes", + processor->has_fpu ? processor->has_fpu : "no", + tmp); + g_free(tmp); + return ret; + +} + +static gchar *processor_get_info(GSList * processors) +{ + Processor *processor; + + if (g_slist_length(processors) > 1) { + gchar *ret, *tmp, *hashkey; + GSList *l; + + tmp = g_strdup(""); + + for (l = processors; l; l = l->next) { + processor = (Processor *) l->data; + + tmp = g_strdup_printf("%s$CPU%d$%s=%.2fMHz\n", + tmp, processor->id, + processor->model_name, + processor->cpu_mhz); + + hashkey = g_strdup_printf("CPU%d", processor->id); + g_hash_table_insert(moreinfo, hashkey, + processor_get_detailed_info(processor)); + } + + ret = g_strdup_printf("[$ShellParam$]\n" + "ViewType=1\n" + "[Processors]\n" + "%s", tmp); + g_free(tmp); + + return ret; + } + + processor = (Processor *) processors->data; + return processor_get_detailed_info(processor); } diff --git a/autopackage/default.apspec b/autopackage/default.apspec new file mode 100644 index 00000000..f12960c1 --- /dev/null +++ b/autopackage/default.apspec @@ -0,0 +1,54 @@ +# -*- shell-script -*- +# Generated by mkapspec 0.2 +[Meta] +ShortName: hardinfo +SoftwareVersion: 0.4.2.1 +DisplayName: HardInfo $SOFTWAREVERSION +RootName: @tia.mat.br/hardinfo:$SOFTWAREVERSION +Summary: System profiler and benchmark tool +Maintainer: Leandro A. F. Pereira <leandro@linuxmag.com.br> +Packager: Leandro A. F. Pereira <leandro@linuxmag.com.br> +PackageVersion: 1 +CPUArchitectures: x86 +AutopackageTarget: 1.2 +Type: Application +License: GPL + +[BuildPrepare] +# If you're using autotools, the default should be enough. +# prepareBuild will set up apbuild and run configure for you. If you +# need to pass arguments to configure, just add them to prepareBuild: +# prepareBuild --enable-foo --disable-bar +export APBUILD_INCLUDE="/usr/local/gtk-headers/2.6" +prepareBuild + +[BuildUnprepare] +# If you're using prepareBuild above, there is no need to change this! +unprepareBuild + +[Globals] + +[Prepare] +require '@gtk.org/gtk' 2.6 + +[Imports] +# This command will tell makeinstaller what to include in the package. +# The selection comes from the files created by 'make install' or equivalent. +# Usually, you can leave this at the default +cd ../ +echo '*' | import + +[Install] +# See http://www.autopackage.org/api/ for details +installExe bin/* +installData share/* +copyFile lib/hardinfo/modules/benchmark.so $PREFIX/lib/hardinfo/modules/benchmark.so +copyFile lib/hardinfo/modules/computer.so $PREFIX/lib/hardinfo/modules/computer.so +copyFile lib/hardinfo/modules/devices.so $PREFIX/lib/hardinfo/modules/devices.so +installMenuItem "System" share/applications/hardinfo.desktop + +[Uninstall] +# Leaving this at the default is safe unless you use custom commands in +# "Install" to create files. By default, all autopackage API functions are +# logged. +uninstallFromLog diff --git a/benchmark.c b/benchmark.c index d66d0b8c..7f5025de 100644 --- a/benchmark.c +++ b/benchmark.c @@ -1,6 +1,6 @@ /* * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> + * Copyright (C) 2003-2007 Leandro A. F. Pereira <leandro@linuxmag.com.br> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,148 +20,280 @@ #include <iconcache.h> #include <shell.h> #include <config.h> -#include <binreloc.h> +#include <syncmanager.h> enum { BENCHMARK_ZLIB, BENCHMARK_FIB, BENCHMARK_MD5, BENCHMARK_SHA1, - BENCHMARK_BLOWFISH + BENCHMARK_BLOWFISH, + BENCHMARK_RAYTRACE, + BENCHMARK_N_ENTRIES } Entries; -static ModuleEntry hi_entries[] = { - {"CPU ZLib", "compress.png"}, - {"CPU Fibonacci", "module.png"}, - {"CPU MD5", "module.png"}, - {"CPU SHA1", "module.png"}, - {"CPU Blowfish", "blowfish.png"} +void scan_zlib(gboolean reload); +void scan_raytr(gboolean reload); +void scan_bfsh(gboolean reload); +void scan_md5(gboolean reload); +void scan_fib(gboolean reload); +void scan_sha1(gboolean reload); + +gchar *callback_zlib(); +gchar *callback_raytr(); +gchar *callback_bfsh(); +gchar *callback_md5(); +gchar *callback_fib(); +gchar *callback_sha1(); + +static ModuleEntry entries[] = { + {"CPU ZLib", "compress.png", callback_zlib, scan_zlib}, + {"CPU Fibonacci", "module.png", callback_fib, scan_fib}, + {"CPU MD5", "module.png", callback_md5, scan_md5}, + {"CPU SHA1", "module.png", callback_sha1, scan_sha1}, + {"CPU Blowfish", "blowfish.png", callback_bfsh, scan_bfsh}, + {"FPU Raytracing", "raytrace.png", callback_raytr, scan_raytr}, + { NULL } }; -static gchar * -benchmark_include_results(gchar *results, const gchar *benchmark) +static gchar *__benchmark_include_results(gdouble result, + const gchar * benchmark, + ShellOrderType order_type) { GKeyFile *conf; - gchar **machines, *bconf_path; + gchar **machines; + gchar *path, *results = ""; int i; - + conf = g_key_file_new(); - bconf_path = g_strdup_printf("%s/hardinfo/benchmark.conf", - gbr_find_data_dir(PREFIX)); - g_key_file_load_from_file(conf, bconf_path, 0, NULL); + path = g_build_filename(g_get_home_dir(), ".hardinfo", "benchmark.conf", NULL); + if (!g_file_test(path, G_FILE_TEST_EXISTS)) { + DEBUG("local benchmark.conf not found, trying system-wide"); + g_free(path); + path = g_build_filename(params.path_data, "benchmark.conf", NULL); + } + + g_key_file_load_from_file(conf, path, 0, NULL); + machines = g_key_file_get_keys(conf, benchmark, NULL, NULL); for (i = 0; machines && machines[i]; i++) { - gchar *value = g_key_file_get_value(conf, benchmark, machines[i], NULL); - results = g_strconcat(results, machines[i], "=", value, "\n", NULL); - g_free(value); + gchar *value = g_key_file_get_value(conf, benchmark, machines[i], NULL); + results = g_strconcat(results, machines[i], "=", value, "\n", NULL); + g_free(value); } - + g_strfreev(machines); + g_free(path); g_key_file_free(conf); - g_free(bconf_path); - - return g_strconcat(results, "[$ShellParam$]\n" - "Zebra=1\n", NULL); + + DEBUG("results = %s", results); + + return g_strdup_printf("[$ShellParam$]\n" + "Zebra=1\n" + "OrderType=%d\n" + "ViewType=3\n" + "[%s]\n" + "<i>This Machine</i>=%.3f\n" + "%s", order_type, benchmark, result, results); +} + +static gchar *benchmark_include_results_reverse(gdouble result, + const gchar * benchmark) +{ + return __benchmark_include_results(result, benchmark, + SHELL_ORDER_DESCENDING); } +static gchar *benchmark_include_results(gdouble result, + const gchar * benchmark) +{ + return __benchmark_include_results(result, benchmark, + SHELL_ORDER_ASCENDING); +} + +static gdouble bench_results[BENCHMARK_N_ENTRIES]; + #include <arch/common/fib.h> #include <arch/common/zlib.h> #include <arch/common/md5.h> #include <arch/common/sha1.h> #include <arch/common/blowfish.h> +#include <arch/common/raytrace.h> -static gchar *bench_zlib = NULL, - *bench_fib = NULL, - *bench_md5 = NULL, - *bench_sha1 = NULL, - *bench_fish = NULL; +gchar *callback_zlib() +{ + return benchmark_include_results_reverse(bench_results[BENCHMARK_ZLIB], "CPU ZLib"); +} -gchar * -hi_info(gint entry) +gchar *callback_raytr() { - switch (entry) { - case BENCHMARK_ZLIB: - if (bench_zlib) - return g_strdup(bench_zlib); - - bench_zlib = benchmark_zlib(); - return g_strdup(bench_zlib); - - case BENCHMARK_BLOWFISH: - if (bench_fish) - return g_strdup(bench_fish); - - bench_fish = benchmark_fish(); - return g_strdup(bench_fish); - - case BENCHMARK_MD5: - if (bench_md5) - return g_strdup(bench_md5); - - bench_md5 = benchmark_md5(); - return g_strdup(bench_md5); - - case BENCHMARK_FIB: - if (bench_fib) - return g_strdup(bench_fib); - - bench_fib = benchmark_fib(); - return g_strdup(bench_fib); - - case BENCHMARK_SHA1: - if (bench_sha1) - return g_strdup(bench_sha1); - - bench_sha1 = benchmark_sha1(); - return g_strdup(bench_sha1); - - default: - return g_strdup("[Empty]\n"); - } + return benchmark_include_results(bench_results[BENCHMARK_RAYTRACE], "FPU Raytracing"); } -void -hi_reload(gint entry) +gchar *callback_bfsh() +{ + return benchmark_include_results(bench_results[BENCHMARK_BLOWFISH], "CPU Blowfish"); +} + +gchar *callback_md5() +{ + return benchmark_include_results_reverse(bench_results[BENCHMARK_MD5], "CPU MD5"); +} + +gchar *callback_fib() +{ + return benchmark_include_results(bench_results[BENCHMARK_FIB], "CPU Fibonacci"); +} + +gchar *callback_sha1() +{ + return benchmark_include_results_reverse(bench_results[BENCHMARK_SHA1], "CPU SHA1"); +} + +void scan_zlib(gboolean reload) +{ + SCAN_START(); + benchmark_zlib(); + SCAN_END(); +} + +void scan_raytr(gboolean reload) +{ + SCAN_START(); + benchmark_raytrace(); + SCAN_END(); +} + +void scan_bfsh(gboolean reload) +{ + SCAN_START(); + benchmark_fish(); + SCAN_END(); +} + +void scan_md5(gboolean reload) +{ + SCAN_START(); + benchmark_md5(); + SCAN_END(); +} + +void scan_fib(gboolean reload) +{ + SCAN_START(); + benchmark_fib(); + SCAN_END(); +} + +void scan_sha1(gboolean reload) +{ + SCAN_START(); + benchmark_sha1(); + SCAN_END(); +} + +const gchar *hi_note_func(gint entry) { switch (entry) { - case BENCHMARK_ZLIB: - if (bench_zlib) g_free(bench_zlib); - bench_zlib = benchmark_zlib(); - break; - case BENCHMARK_BLOWFISH: - if (bench_fish) g_free(bench_fish); - bench_fish = benchmark_fish(); - break; - case BENCHMARK_MD5: - if (bench_md5) g_free(bench_md5); - bench_md5 = benchmark_md5(); - break; - case BENCHMARK_FIB: - if (bench_fib) g_free(bench_fib); - bench_fib = benchmark_fib(); - break; - case BENCHMARK_SHA1: - if (bench_sha1) g_free(bench_sha1); - bench_sha1 = benchmark_sha1(); - break; + case BENCHMARK_ZLIB: + return "Results in KiB/second. Higher is better."; + + case BENCHMARK_MD5: + case BENCHMARK_SHA1: + return "Results in MiB/second. Higher is better."; + + case BENCHMARK_RAYTRACE: + case BENCHMARK_BLOWFISH: + case BENCHMARK_FIB: + return "Results in seconds. Lower is better."; } + + return NULL; } -gint -hi_n_entries(void) +gchar *hi_module_get_name(void) { - return G_N_ELEMENTS(hi_entries) - 1; + return g_strdup("Benchmarks"); } -GdkPixbuf * -hi_icon(gint entry) +guchar hi_module_get_weight(void) { - return icon_cache_get_pixbuf(hi_entries[entry].icon); + return 240; } -gchar * -hi_name(gint entry) +ModuleEntry *hi_module_get_entries(void) { - return hi_entries[entry].name; + return entries; } + +ModuleAbout * +hi_module_get_about(void) +{ + static ModuleAbout ma[] = { + { + .author = "Leandro A. F. Pereira", + .description = "Perform tasks and compare with other systems", + .version = VERSION, + .license = "GNU GPL version 2" + } + }; + + return ma; +} + +static gchar *get_benchmark_results() +{ + void (*scan_callback)(gboolean rescan); + + gint i = G_N_ELEMENTS(entries) - 1; + gchar *machine = module_call_method("devices::getProcessorName"); + gchar *param = g_strdup_printf("[param]\n" + "machine=%s\n" + "nbenchmarks=%d\n", + machine, i); + gchar *result = param; + + for (; i >= 0; i--) { + if ((scan_callback = entries[i].scan_callback)) { + scan_callback(FALSE); + + result = g_strdup_printf("%s\n" + "[bench%d]\n" + "name=%s\n" + "value=%f\n", + result, + i, + entries[i].name, + bench_results[i]); + } + } + + g_free(machine); + g_free(param); + + return result; +} + +void +hi_module_init(void) +{ + static SyncEntry se[] = { + { + .fancy_name = "Send Benchmark Results", + .name = "SendBenchmarkResults", + .save_to = NULL, + .get_data = get_benchmark_results + }, + { + .fancy_name = "Receive Benchmark Results", + .name = "RecvBenchmarkResults", + .save_to = "benchmark.conf", + .get_data = NULL + } + }; + + sync_manager_add_entry(&se[0]); + sync_manager_add_entry(&se[1]); +} + diff --git a/benchmark.conf b/benchmark.conf index 2db3f3b8..3b7c6bcd 100644 --- a/benchmark.conf +++ b/benchmark.conf @@ -1,38 +1,18 @@ -[ZLib] -# RAM:1024,Board:GA-7NNXP,OS:Linux 2.6.15 -AMD Athlon XP 3200+=4.33 -# RAM:512,Board:Toshiba M45-S165,OS:Linux 2.6.15,Compiler:GCC 3.3.5 -Intel Celeron M 1.5GHz=5.63 -AMD Athlon XP 2200+=7.38 -# RAM:128,Board:XingLing,OS:Linux 2.4.20 -Intel Pentium 200MHz=117.79 -# RAM:1024,Board:GA-7NNXP,OS:Linux 2.6.15 -Valgrind/AMD Athlon XP 3200+=155.91 -# RAM:32,Board:Toshiba Libretto 50CT,OS:Linux 2.4.20 -Intel Pentium 75MHz=173.06 - -[Fibonacci] -# RAM:1024,Board:GA-7NNXP,OS:Linux 2.6.15 -AMD Athlon XP 3200+=6.64 -#AMD Athlon XP 2200+=3.54 -# RAM:512,Board:Toshiba M45-S165,OS:Linux 2.6.15,Compiler:GCC 3.3.5 -Intel Celeron M 1.5GHz=11.10 -# RAM:128,Board:XingLing,OS:Linux 2.4.20 -#Intel Pentium 200MHz=35.02 -# RAM:32,Board:Toshiba Libretto 50CT,OS:Linux 2.4.20 -#Intel Pentium 75MHz=110.20 -# RAM:1024,Board:GA-7NNXP,OS:Linux 2.6.15 -#Valgrind/AMD Athlon XP 3200+=164.92 - - -[MD5] -# RAM:512,Board:Toshiba M45-S165,OS:Linux 2.6.15,Compiler:GCC 3.3.5 -Intel Celeron M 1.5GHz=3.42 -# RAM:1024,Board:GA-7NNXP,OS:Linux 2.6.15 -AMD Athlon XP 3200+=5.04 - -[SHA1] -# RAM:1024,Board:GA-7NNXP,OS:Linux 2.6.15 -AMD Athlon XP 3200+=4.88 -# RAM:512,Board:Toshiba M45-S165,OS:Linux 2.6.15,Compiler:GCC 3.3.5 -Intel Celeron M 1.5GHz=5.50 +[CPU ZLib] +PowerPC 740/750 (280.00MHz)=2150.597408 +Intel(R) Celeron(R) M processor 1.50GHz=8761.604561 +[CPU Fibonacci] +Intel(R) Celeron(R) M processor 1.50GHz=8.1375674 +PowerPC 740/750 (280.00MHz)=58.07682 +[CPU MD5] +PowerPC 740/750 (280.00MHz)=7.115258 +Intel(R) Celeron(R) M processor 1.50GHz=38.6607998 +[CPU SHA1] +PowerPC 740/750 (280.00MHz)=6.761451 +Intel(R) Celeron(R) M processor 1.50GHz=49.6752776 +[CPU Blowfish] +Intel(R) Celeron(R) M processor 1.50GHz=26.1876862 +PowerPC 740/750 (280.00MHz)=172.816713 +[FPU Raytracing] +Intel(R) Celeron(R) M processor 1.50GHz=40.8816714 +PowerPC 740/750 (280.00MHz)=161.312647 diff --git a/callbacks.c b/callbacks.c index fd862984..ac47d089 100644 --- a/callbacks.c +++ b/callbacks.c @@ -1,6 +1,6 @@ /* * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> + * Copyright (C) 2003-2007 Leandro A. F. Pereira <leandro@linuxmag.com.br> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,19 +19,103 @@ #include <stdlib.h> #include <gtk/gtk.h> +#include <hardinfo.h> #include <callbacks.h> #include <iconcache.h> #include <shell.h> #include <report.h> +#include <syncmanager.h> #include <config.h> +void cb_sync_manager() +{ + sync_manager_show(); +} + +void cb_save_graphic() +{ + Shell *shell = shell_get_main_shell(); + GtkWidget *dialog; + gchar *filename; + + /* save the pixbuf to a png file */ + dialog = gtk_file_chooser_dialog_new("Save Image", + NULL, + GTK_FILE_CHOOSER_ACTION_SAVE, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, + NULL); + + filename = g_strconcat(shell->selected->name, ".png", NULL); + gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(dialog), filename); + g_free(filename); + + if (gtk_dialog_run(GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) { + filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); + gtk_widget_destroy(dialog); + + shell_status_update("Saving image..."); + + tree_view_save_image(filename); + + shell_status_update("Done."); + g_free(filename); + + return; + } + + gtk_widget_destroy(dialog); +} + +void cb_open_web_page() +{ + open_url("http://hardinfo.berlios.de"); +} + +void cb_open_online_docs() +{ + open_url("http://hardinfo.berlios.de/web/Documentation"); +} + +void cb_report_bug() +{ + open_url("http://hardinfo.berlios.de/web/BugReports"); +} + +void cb_donate() +{ + open_url("http://hardinfo.berlios.de/web/Donate"); +} + void cb_refresh() { shell_do_reload(); } +void cb_copy_to_clipboard() +{ + ShellModuleEntry *entry = shell_get_main_shell()->selected; + + if (entry) { + gchar *data = module_entry_function(entry); + GtkClipboard *clip = gtk_clipboard_get(gdk_atom_intern("CLIPBOARD", FALSE)); + ReportContext *ctx = report_context_text_new(NULL); + + ctx->entry = entry; + + report_header(ctx); + report_table(ctx, data); + report_footer(ctx); + + gtk_clipboard_set_text(clip, ctx->output, -1); + + g_free(data); + report_context_free(ctx); + } +} + void cb_side_pane() { gboolean visible; @@ -48,15 +132,74 @@ void cb_toolbar() shell_ui_manager_set_visible("/MainMenuBarAction", visible); } +void cb_about_module(GtkAction *action) +{ + Shell *shell = shell_get_main_shell(); + GSList *modules = shell->tree->modules; + ModuleAbout *ma; + gchar *name; + + g_object_get(G_OBJECT(action), "tooltip", &name, NULL); + + for (; modules; modules = modules->next) { + ShellModule *sm = (ShellModule *)modules->data; + + if (!g_str_equal(sm->name, name)) + continue; + + if ((ma = module_get_about(sm))) { + GtkWidget *about; + + about = gtk_about_dialog_new(); + gtk_about_dialog_set_name(GTK_ABOUT_DIALOG(about), + idle_free(g_strdup_printf("%s Module", sm->name))); + gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(about), ma->version); + gtk_about_dialog_set_copyright(GTK_ABOUT_DIALOG(about), + idle_free(g_strdup_printf("Written by %s\n" + "Licensed under %s", + ma->author, + ma->license))); + + if (ma->description) + gtk_about_dialog_set_comments(GTK_ABOUT_DIALOG(about), + ma->description); + + gtk_about_dialog_set_logo(GTK_ABOUT_DIALOG(about), sm->icon); + gtk_dialog_run(GTK_DIALOG(about)); + gtk_widget_destroy(about); + } else { + g_warning("No about information is associated with the %s module.", name); + } + + break; + } + + g_free(name); +} + void cb_about() { GtkWidget *about; const gchar *authors[] = { + "Author:", "Leandro A. F. Pereira", + "", + "Contributors:", + "Agney Lopes Roth Ferraz", "SCSI support by Pascal F. Martin", - "MD5 implementation by Colin Plumb", - "SHA1 implementation by Steve Raid", - "Blowfish implementation by Paul Kocher", + "", + "Based on work by:", + "MD5 implementation by Colin Plumb (see md5.c for details)", + "SHA1 implementation by Steve Raid (see sha1.c for details)", + "Blowfish implementation by Paul Kocher (see blowfich.c for details)", + "Raytracing benchmark by John Walker (see fbench.c for details)", + "Some code partly based on x86cpucaps by Osamu Kayasono", + "Vendor list based on GtkSysInfo by Pissens Sebastien", + NULL + }; + const gchar *artists[] = { + "The GNOME Project", + "Tango Project", NULL }; @@ -64,7 +207,7 @@ void cb_about() gtk_about_dialog_set_name(GTK_ABOUT_DIALOG(about), "HardInfo"); gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(about), VERSION); gtk_about_dialog_set_copyright(GTK_ABOUT_DIALOG(about), - "Copyright \302\251 2003-2006 " + "Copyright \302\251 2003-2007 " "Leandro A. F. Pereira"); gtk_about_dialog_set_comments(GTK_ABOUT_DIALOG(about), "System information and benchmark tool"); @@ -87,6 +230,7 @@ void cb_about() #endif gtk_about_dialog_set_authors(GTK_ABOUT_DIALOG(about), authors); + gtk_about_dialog_set_artists(GTK_ABOUT_DIALOG(about), artists); gtk_dialog_run(GTK_DIALOG(about)); gtk_widget_destroy(about); @@ -95,12 +239,18 @@ void cb_about() void cb_generate_report() { Shell *shell = shell_get_main_shell(); + gboolean btn_refresh = shell_action_get_enabled("RefreshAction"); + gboolean btn_copy = shell_action_get_enabled("CopyAction"); report_dialog_show(shell->tree->model, shell->window); + + shell_action_set_enabled("RefreshAction", btn_refresh); + shell_action_set_enabled("CopyAction", btn_copy); } void cb_quit(void) { - gtk_main_quit(); - exit(0); + do { + gtk_main_quit(); + } while (gtk_main_level() > 1); } diff --git a/callbacks.h b/callbacks.h index da1b3a65..0387df05 100644 --- a/callbacks.h +++ b/callbacks.h @@ -1,6 +1,6 @@ /* * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> + * Copyright (C) 2003-2007 Leandro A. F. Pereira <leandro@linuxmag.com.br> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,11 +19,21 @@ #ifndef __CALLBACKS_H__ #define __CALLBACKS_H__ +#include <gtk/gtk.h> + void cb_about(); +void cb_about_module(GtkAction *action); void cb_generate_report(); +void cb_save_graphic(); void cb_quit(); void cb_refresh(); +void cb_copy_to_clipboard(); void cb_side_pane(); void cb_toolbar(); +void cb_open_web_page(); +void cb_open_online_docs(); +void cb_sync_manager(); +void cb_report_bug(); +void cb_donate(); #endif /* __CALLBACKS_H__ */ @@ -1,6 +1,6 @@ /* * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> + * Copyright (C) 2003-2007 Leandro A. F. Pereira <leandro@linuxmag.com.br> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -29,14 +29,14 @@ #include <iconcache.h> #include <shell.h> -#include <expr.h> +#include <vendor.h> enum { COMPUTER_SUMMARY, - COMPUTER_PROCESSORS, COMPUTER_OPERATING_SYSTEM, + COMPUTER_KERNEL_MODULES, + COMPUTER_BOOTS, COMPUTER_LANGUAGE, - COMPUTER_SENSORS, COMPUTER_FILESYSTEMS, COMPUTER_SHARES, COMPUTER_DISPLAY, @@ -44,298 +44,382 @@ enum { COMPUTER_USERS, } Entries; -static ModuleEntry hi_entries[] = { - {"Summary", "summary.png"}, - {"Processor", "processor.png"}, - {"Operating System", "os.png"}, - {"Languages", "language.png"}, - {"Sensors", "therm.png"}, - {"Filesystems", "dev_removable.png"}, - {"Shared Directories", "shares.png"}, - {"Display", "monitor.png"}, - {"Network Interfaces", "network.png"}, - {"Users", "users.png"}, +/* Callbacks */ +gchar *callback_summary(); +gchar *callback_os(); +gchar *callback_modules(); +gchar *callback_boots(); +gchar *callback_locales(); +gchar *callback_fs(); +gchar *callback_shares(); +gchar *callback_display(); +gchar *callback_network(); +gchar *callback_users(); + +/* Scan callbacks */ +void scan_summary(gboolean reload); +void scan_os(gboolean reload); +void scan_modules(gboolean reload); +void scan_boots(gboolean reload); +void scan_locales(gboolean reload); +void scan_fs(gboolean reload); +void scan_shares(gboolean reload); +void scan_display(gboolean reload); +void scan_network(gboolean reload); +void scan_users(gboolean reload); + +static ModuleEntry entries[] = { + { "Summary", "summary.png", callback_summary, scan_summary }, + { "Operating System", "os.png", callback_os, scan_os }, + { "Kernel Modules", "module.png", callback_modules, scan_modules }, + { "Boots", "boot.png", callback_boots, scan_boots }, + { "Languages", "language.png", callback_locales, scan_locales }, + { "Filesystems", "dev_removable.png", callback_fs, scan_fs }, + { "Shared Directories", "shares.png", callback_shares, scan_shares }, + { "Display", "monitor.png", callback_display, scan_display }, + { "Network Interfaces", "network.png", callback_network, scan_network }, + { "Users", "users.png", callback_users, scan_users }, + { NULL }, }; #include "computer.h" static GHashTable *moreinfo = NULL; +static gchar *module_list = NULL; +static Computer *computer = NULL; +#include <arch/this/modules.h> #include <arch/common/languages.h> #include <arch/this/alsa.h> #include <arch/common/display.h> #include <arch/this/loadavg.h> #include <arch/this/memory.h> #include <arch/this/uptime.h> -#include <arch/this/processor.h> #include <arch/this/os.h> #include <arch/this/filesystem.h> #include <arch/this/samba.h> #include <arch/this/nfs.h> -#include <arch/this/sensors.h> #include <arch/this/net.h> #include <arch/common/users.h> +#include <arch/this/boots.h> -static Computer * -computer_get_info(void) +gchar * +hi_more_info(gchar * entry) { - Computer *computer; + gchar *info = (gchar *) g_hash_table_lookup(moreinfo, entry); - computer = g_new0(Computer, 1); - - if (moreinfo) { -#ifdef g_hash_table_unref - g_hash_table_unref(moreinfo); -#else - g_free(moreinfo); -#endif - } + if (info) + return g_strdup(info); - moreinfo = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); + return g_strdup_printf("[%s]", entry); +} - shell_status_update("Getting processor information..."); - computer->processor = computer_get_processor(); +gchar * +hi_get_field(gchar * field) +{ + gchar *tmp; - shell_status_update("Getting memory information..."); - computer->memory = computer_get_memory(); + if (g_str_equal(field, "Memory")) { + MemoryInfo *mi = idle_free(computer_get_memory()); + tmp = g_strdup_printf("%dMB (%dMB used)", mi->total, mi->used); + } else if (g_str_equal(field, "Uptime")) { + tmp = computer_get_formatted_uptime(); + } else if (g_str_equal(field, "Date/Time")) { + time_t t = time(NULL); - shell_status_update("Getting operating system information..."); - computer->os = computer_get_os(); + tmp = g_new0(gchar, 64); + strftime(tmp, 64, "%c", localtime(&t)); + } else if (g_str_equal(field, "Load Average")) { + tmp = computer_get_formatted_loadavg(); + } else { + tmp = g_strdup(""); + } - shell_status_update("Getting display information..."); - computer->display = computer_get_display(); + return tmp; +} - shell_status_update("Getting sound card information..."); +void scan_summary(gboolean reload) +{ + SCAN_START(); + module_entry_scan_all_except(entries, COMPUTER_SUMMARY); computer->alsa = computer_get_alsainfo(); + SCAN_END(); +} + +void scan_os(gboolean reload) +{ + SCAN_START(); + computer->os = computer_get_os(); + SCAN_END(); +} + +void scan_modules(gboolean reload) +{ + SCAN_START(); + scan_modules_do(); + SCAN_END(); +} + +void scan_boots(gboolean reload) +{ + SCAN_START(); + scan_boots_real(); + SCAN_END(); +} + +void scan_locales(gboolean reload) +{ + SCAN_START(); + scan_os(FALSE); + scan_languages(computer->os); + SCAN_END(); +} - shell_status_update("Getting mounted file system information..."); +void scan_fs(gboolean reload) +{ + SCAN_START(); scan_filesystems(); + SCAN_END(); +} - shell_status_update("Getting shared directories..."); +void scan_shares(gboolean reload) +{ + SCAN_START(); scan_samba_shared_directories(); scan_nfs_shared_directories(); - - shell_status_update("Reading sensors..."); - read_sensors(); + SCAN_END(); +} - shell_status_update("Obtaining network information..."); +void scan_display(gboolean reload) +{ + SCAN_START(); + computer->display = computer_get_display(); + SCAN_END(); +} + +void scan_network(gboolean reload) +{ + SCAN_START(); scan_net_interfaces(); + SCAN_END(); +} - shell_status_update("Obtaining users information..."); - scan_users(); +void scan_users(gboolean reload) +{ + SCAN_START(); + scan_users_do(); + SCAN_END(); +} - computer->date_time = "..."; - return computer; +gchar *callback_summary() +{ + return g_strdup_printf("[$ShellParam$]\n" + "UpdateInterval$Memory=1000\n" + "UpdateInterval$Date/Time=1000\n" + "#ReloadInterval=5000\n" + "[Computer]\n" + "Processor=%s\n" + "Memory=...\n" + "Operating System=%s\n" + "User Name=%s\n" + "Date/Time=...\n" + "[Display]\n" + "Resolution=%dx%d pixels\n" + "OpenGL Renderer=%s\n" + "X11 Vendor=%s\n" + "[Multimedia]\n" + "\n%s\n" + "[Input Devices]\n%s\n" + "\n%s\n" + "\n%s\n", + (gchar*)idle_free(module_call_method("devices::getProcessorName")), + computer->os->distro, + computer->os->username, + computer->display->width, + computer->display->height, + computer->display->ogl_renderer, + computer->display->vendor, + (gchar*)idle_free(computer_get_alsacards(computer)), + (gchar*)idle_free(module_call_method("devices::getInputDevices")), + (gchar*)idle_free(module_call_method("devices::getPrinters")), + (gchar*)idle_free(module_call_method("devices::getStorageDevices"))); } -void -hi_reload(gint entry) +gchar *callback_os() { - switch (entry) { - case COMPUTER_FILESYSTEMS: - scan_filesystems(); - break; - case COMPUTER_NETWORK: - scan_net_interfaces(); - break; - case COMPUTER_SENSORS: - read_sensors(); - break; - case COMPUTER_USERS: - scan_users(); - break; - } + return g_strdup_printf("[$ShellParam$]\n" + "UpdateInterval$Uptime=10000\n" + "UpdateInterval$Load Average=1000\n" + "[Version]\n" + "Kernel=%s\n" + "Compiled=%s\n" + "C Library=%s\n" + "Distribution=%s\n" + "[Current Session]\n" + "Computer Name=%s\n" + "User Name=%s\n" + "#Language=%s\n" + "Home Directory=%s\n" + "Desktop Environment=%s\n" + "[Misc]\n" + "Uptime=...\n" + "Load Average=...", + computer->os->kernel, + computer->os->compiled_date, + computer->os->libc, + computer->os->distro, + computer->os->hostname, + computer->os->username, + computer->os->language, + computer->os->homedir, + computer->os->desktop); } -gchar * -hi_more_info(gchar * entry) +gchar *callback_modules() { - gchar *info = (gchar *) g_hash_table_lookup(moreinfo, entry); + return g_strdup_printf("[Loaded Modules]\n" + "%s" + "[$ShellParam$]\n" + "ViewType=1", + module_list); +} - if (info) - return g_strdup(info); +gchar *callback_boots() +{ + return g_strdup(computer->os->boots); +} - return g_strdup_printf("[Empty %s]", entry); +gchar *callback_locales() +{ + return g_strdup_printf("[$ShellParam$]\n" + "ViewType=1\n" + "[Available Languages]\n" + "%s", computer->os->languages); } -gchar * -hi_get_field(gchar * field) +gchar *callback_fs() { - gchar *tmp; + return g_strdup_printf("[$ShellParam$]\n" + "ViewType=1\n" + "ReloadInterval=5000\n" + "[Mounted File Systems]\n%s\n", fs_list); +} - if (!strcmp(field, "Memory")) { - MemoryInfo *mi; +gchar *callback_shares() +{ + return g_strdup_printf("[SAMBA]\n" + "%s\n" + "[NFS]\n" + "%s", smb_shares_list, nfs_shares_list); +} - mi = computer_get_memory(); - tmp = g_strdup_printf("%dMB (%dMB used)", mi->total, mi->used); +gchar *callback_display() +{ + return g_strdup_printf("[Display]\n" + "Resolution=%dx%d pixels\n" + "Vendor=%s\n" + "Version=%s\n" + "[Monitors]\n" + "%s" + "[Extensions]\n" + "%s" + "[OpenGL]\n" + "Vendor=%s\n" + "Renderer=%s\n" + "Version=%s\n" + "Direct Rendering=%s\n", + computer->display->width, + computer->display->height, + computer->display->vendor, + computer->display->version, + computer->display->monitors, + computer->display->extensions, + computer->display->ogl_vendor, + computer->display->ogl_renderer, + computer->display->ogl_version, + computer->display->dri ? "Yes" : "No"); +} - g_free(mi); - } else if (!strcmp(field, "Uptime")) { - tmp = computer_get_formatted_uptime(); - } else if (!strcmp(field, "Date/Time")) { - time_t t = time(NULL); +gchar *callback_network() +{ + return g_strdup_printf("[$ShellParam$]\n" + "ReloadInterval=3000\n" + "ViewType=1\n" + "%s", network_interfaces); +} - tmp = g_new0(gchar, 32); - strftime(tmp, 32, "%D / %R", localtime(&t)); - } else if (!strcmp(field, "Load Average")) { - tmp = computer_get_formatted_loadavg(); - } else { - tmp = g_strdup(""); - } +gchar *callback_users() +{ + return g_strdup_printf("[$ShellParam$]\n" + "ReloadInterval=10000\n" + "ViewType=1\n" + "[Human Users]\n" + "%s\n" + "[System Users]\n" + "%s\n", human_users, sys_users); +} - return tmp; +gchar *get_os_kernel(void) +{ + scan_os(FALSE); + return computer->os->kernel; } -gchar * -hi_info(gint entry) +ShellModuleMethod* +hi_exported_methods(void) { - static Computer *computer = NULL; - static gchar *tmp = NULL; + static ShellModuleMethod m[] = { + { "getOSKernel", get_os_kernel }, + { NULL } + }; + + return m; +} - /*if (tmp != NULL) { - g_free(tmp); - tmp = NULL; - } */ +ModuleEntry * +hi_module_get_entries(void) +{ + return entries; +} - if (!computer) { - computer = computer_get_info(); - } +gchar * +hi_module_get_name(void) +{ + return g_strdup("Computer"); +} - switch (entry) { - case COMPUTER_NETWORK: - return g_strdup_printf("[$ShellParam$]\n" - "ReloadInterval=3000\n" - "ViewType=1\n" - "%s", network_interfaces); - case COMPUTER_USERS: - return g_strdup_printf("[$ShellParam$]\n" - "ReloadInterval=10000\n" - "ViewType=1\n" - "[Human Users]\n" - "%s\n" - "[System Users]\n" - "%s\n", human_users, sys_users); - case COMPUTER_SENSORS: - return g_strdup_printf("[$ShellParam$]\n" - "ReloadInterval=3000\n" - "%s", sensors); - case COMPUTER_SHARES: - return g_strdup_printf("[SAMBA]\n" - "%s\n" - "[NFS]\n" - "%s", smb_shares_list, nfs_shares_list); - case COMPUTER_FILESYSTEMS: - return g_strdup_printf("[$ShellParam$]\n" - "ViewType=1\n" - "ReloadInterval=5000\n" - "[Mounted File Systems]\n%s\n", fs_list); - case COMPUTER_SUMMARY: - tmp = computer_get_alsacards(computer); - return g_strdup_printf("[$ShellParam$]\n" - "UpdateInterval$Memory=1000\n" - "UpdateInterval$Date/Time=1000\n" - "[Computer]\n" - "Processor=%s\n" - "Memory=...\n" - "Operating System=%s\n" - "User Name=%s\n" - "Date/Time=%s\n" - "[Display]\n" - "Resolution=%dx%d pixels\n" - "OpenGL Renderer=%s\n" - "X11 Vendor=%s\n" - "[Multimedia]\n" - "%s\n" - "#[Storage]\n" - "#IDE Controller=\n" - "#SCSI Controller=\n" - "#Floppy Drive=\n" - "#Disk Drive=\n", - computer->processor->model_name, - computer->os->distro, - computer->os->username, - computer->date_time, - computer->display->width, - computer->display->height, - computer->display->ogl_renderer, - computer->display->vendor, - tmp); - case COMPUTER_DISPLAY: - return g_strdup_printf("[Display]\n" - "Resolution=%dx%d pixels\n" - "Vendor=%s\n" - "Version=%s\n" - "[Monitors]\n" - "%s" - "[Extensions]\n" - "%s" - "[OpenGL]\n" - "Vendor=%s\n" - "Renderer=%s\n" - "Version=%s\n", - computer->display->width, - computer->display->height, - computer->display->vendor, - computer->display->version, - computer->display->monitors, - computer->display->extensions, - computer->display->ogl_vendor, - computer->display->ogl_renderer, - computer->display->ogl_version); - case COMPUTER_OPERATING_SYSTEM: - tmp = computer_get_formatted_uptime(); - return g_strdup_printf("[$ShellParam$]\n" - "UpdateInterval$Uptime=10000\n" - "UpdateInterval$Load Average=1000\n" - "[Version]\n" - "Kernel=%s\n" - "Compiled=%s\n" - "C Library=%s\n" - "Distribution=%s\n" - "[Current Session]\n" - "Computer Name=%s\n" - "User Name=%s\n" - "#Language=%s\n" - "Home Directory=%s\n" - "Desktop Environment=%s\n" - "[Misc]\n" - "Uptime=%s\n" - "Load Average=...", - computer->os->kernel, - computer->os->compiled_date, - computer->os->libc, - computer->os->distro, - computer->os->hostname, - computer->os->username, - computer->os->language, - computer->os->homedir, - computer->os->desktop, tmp); - case COMPUTER_LANGUAGE: - return g_strdup_printf("[$ShellParam$]\n" - "ViewType=1\n" - "[Available Languages]\n" - "%s", computer->os->languages); - case COMPUTER_PROCESSORS: - return processor_get_info(computer->processor); - default: - return g_strdup("[Empty]\nNo info available="); - } +guchar +hi_module_get_weight(void) +{ + return 80; } -gint -hi_n_entries(void) +gchar ** +hi_module_get_dependencies(void) { - return G_N_ELEMENTS(hi_entries) - 1; + static gchar *deps[] = { "devices.so", NULL }; + + return deps; } -GdkPixbuf * -hi_icon(gint entry) +void +hi_module_init(void) { - return icon_cache_get_pixbuf(hi_entries[entry].icon); + computer = g_new0(Computer, 1); + moreinfo = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); } -gchar * -hi_name(gint entry) +ModuleAbout * +hi_module_get_about(void) { - return hi_entries[entry].name; + static ModuleAbout ma[] = { + { + .author = "Leandro A. F. Pereira", + .description = "Gathers high-level computer information", + .version = VERSION, + .license = "GNU GPL version 2" + } + }; + + return ma; } @@ -1,6 +1,6 @@ /* * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> + * Copyright (C) 2003-2007 Leandro A. F. Pereira <leandro@linuxmag.com.br> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -33,6 +33,7 @@ static struct { { DB_PREFIX "yellowdog-release", "yd" }, { DB_PREFIX "SuSE-release", "suse" }, { DB_PREFIX "sun-release", "sun" }, + { DB_PREFIX "zenwalk-version", "zen" }, /* * RedHat must be the *last* one to be checked, since * some distros (like Mandrake) includes a redhat-relase @@ -43,7 +44,6 @@ static struct { }; typedef struct _Computer Computer; -typedef struct _Processor Processor; typedef struct _OperatingSystem OperatingSystem; typedef struct _MemoryInfo MemoryInfo; typedef struct _UptimeInfo UptimeInfo; @@ -81,6 +81,8 @@ struct _AlsaInfo { struct _DisplayInfo { gchar *ogl_vendor, *ogl_renderer, *ogl_version; + gboolean dri; + gchar *display_name, *vendor, *version; gchar *extensions; gchar *monitors; @@ -97,7 +99,6 @@ struct _UptimeInfo { }; struct _Computer { - Processor *processor; MemoryInfo *memory; OperatingSystem *os; DisplayInfo *display; @@ -118,6 +119,8 @@ struct _Processor { gint model, family, stepping; gchar *strmodel; + + gint id; }; struct _OperatingSystem { @@ -133,6 +136,8 @@ struct _OperatingSystem { gchar *desktop; gchar *username; + + gchar *boots; }; struct _MemoryInfo { @@ -24,7 +24,7 @@ PACKAGE=`basename ${PWD} | cut -d"-" -f1`; VERSION=`basename ${PWD} | cut -d"-" -f2`; if [ "$PACKAGE" == "$VERSION" ]; then - VERSION=$(printf "SVN_%d" $(svn -R info|grep Revision|cut -d: -f2|sort -n|tail -n1)) + VERSION=$(printf "SVN_%d" $(LC_ALL=C svn -R info|grep Revision|cut -d: -f2|sort -n|tail -n1)) RELEASE=0 else RELEASE=1 @@ -40,7 +40,7 @@ case $OS in Linux) ;; *) - echo " (not supported, yet!)" + echo "$OS (not supported, yet!)" exit ;; esac @@ -64,21 +64,21 @@ case $PROC in sparc*) ln -sf linux/sparc arch/this ARCH="ARCH_SPARC" ;; - armv4l) + armv*) ln -sf linux/armv4l arch/this ARCH="ARCH_ARMV4L" ;; - *) - # uname -m on m68k doesn't return anything useful :/ - grep "680?0" /proc/cpuinfo > /dev/null - if [ "$?" == "0" ]; then - ln -sf linux/m68k arch/this - ARCH="ARCH_m68k" - else - echo "Architeture \"$ARCH\" not supported." - exit - fi - - ;; + ia64) + ln -sf linux/ia64 arch/this + ARCH="ARCH_IA64" ;; + alpha) + ln -sf linux/alpha arch/this + ARCH="ARCH_ALPHA" ;; + s390) + ln -sf linux/s390 arch/this + ARCH="ARCH_S390" ;; + m68k) + ln -sf linux/m68k arch/this + ARCH="ARCH_m68k" ;; esac if [ "x$ARCH" == "x" ]; then @@ -120,14 +120,15 @@ GTK2=-1 MIN_VERSION="2.6.0" echo -n "Checking for GTK version >= ${MIN_VERSION}... " for i in `which pkg-config`; do - pkg-config --errors-to-stdout gtk+-2.0 \ + $i --errors-to-stdout gtk+-2.0 \ --atleast-version=$MIN_VERSION > /dev/null case $? in 0) GTK_FLAGS=`pkg-config gtk+-2.0 --cflags` GTK_LIBS=`pkg-config gtk+-2.0 --libs` echo "found `pkg-config gtk+-2.0 --modversion`" - GTK2=1 ;; + GTK2=1 + break ;; *) echo "not found." ;; esac @@ -138,9 +139,39 @@ done if [ $GTK2 -eq -1 ]; then echo -e "\nYou need the GTK libraries, including the development stuff." echo "If you're using Debian, running the command as root:" - echo -e "\n\tapt-get install libgtk2.0-dev\n" + echo -e "\n\taptitude install libgtk2.0-dev\n" echo "Will do the trick." - exit + exit 1 +fi + +# --------------------------------------------------------------------------- + +SOUP=-1 +MIN_VERSION="2.2.7" +echo -n "Checking for libsoup version >= ${MIN_VERSION}... " +for i in `which pkg-config`; do + $i --errors-to-stdout libsoup-2.2 \ + --atleast-version=$MIN_VERSION > /dev/null + case $? in + 0) + SOUP_FLAGS=`pkg-config libsoup-2.2 --cflags` + SOUP_LIBS=`pkg-config libsoup-2.2 --libs` + echo "found `pkg-config libsoup-2.2 --modversion`" + SOUP=1 + break ;; + *) + echo "not found." ;; + esac +done + +# -------------------------------------------------------------------------- + +if [ $SOUP -eq -1 ]; then + echo -e "\nYou need the libsoup library, including the development stuff." + echo "If you're using Debian, running the command as root:" + echo -e "\n\taptitude install libsoup2.2-dev\n" + echo "Will do the trick." + exit 1 fi # -------------------------------------------------------------------------- @@ -153,6 +184,7 @@ echo "#define VERSION \"$VERSION\"" >> config.h echo "#define LSPCI \"$LSPCI -v\"" >> config.h echo "#define $ARCH" >> config.h +echo "#define ARCH \"$ARCH\"" >> config.h echo "#define PLATFORM \"`uname`\"" >> config.h echo "#define KERNEL \"`uname -r`\"" >> config.h @@ -160,8 +192,16 @@ echo "#define HOSTNAME \"`hostname`\"" >> config.h echo "#define PREFIX \"/usr/share/hardinfo/\"" >> config.h echo "#define LIBPREFIX \"/usr/lib/hardinfo/\"" >> config.h -echo "#define DEBUG 1" >> config.h -echo "#define ENABLE_BINRELOC" >> config.h + +if [ "$RELEASE" == "1" ]; then + echo "#define DEBUG(...)" >> config.h +else + echo '#define DEBUG(msg,...) fprintf(stderr, "*** %s:%d (%s) *** " msg "\n", \' >> config.h + echo ' __FILE__, __LINE__, __FUNCTION__, ##__VA_ARGS__)' >> config.h +fi + +echo "#define ENABLE_BINRELOC 1" >> config.h +echo "#define RELEASE $RELEASE" >> config.h echo -e "\n#endif /* __CONFIG_H__ */" >> config.h @@ -170,8 +210,8 @@ rm -f Makefile echo "GTK_LIBS = ${GTK_LIBS}" > Makefile echo "GTK_CFLAGS = ${GTK_FLAGS}" >> Makefile -echo "GLADE_LIBS = ${GLADE_LIBS}" >> Makefile -echo "GLADE_CFLAGS = ${GLADE_FLAGS}" >> Makefile +echo "SOUP_LIBS = ${SOUP_LIBS}" >> Makefile +echo "SOUP_CFLAGS = ${SOUP_FLAGS}" >> Makefile echo "PACKAGE = `basename ${PWD}`" >> Makefile echo "ARCHOPTS = " >> Makefile @@ -193,6 +233,6 @@ else cat << EOF If you get errors, probably you don't have the right libraries, includes or utilities. However, if you're sure this is a bug in my -code, please send a patch (use \"diff -u\") to <leandro@linuxmag.com.br>. +code, please send a patch (use "diff -u") to <leandro@linuxmag.com.br>. EOF fi @@ -1,6 +1,6 @@ /* * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> + * Copyright (C) 2003-2007 Leandro A. F. Pereira <leandro@linuxmag.com.br> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -24,170 +24,386 @@ #include <shell.h> #include <iconcache.h> +#include <expr.h> +#include <socket.h> + enum { - DEVICES_KERNEL_MODULES, + DEVICES_PROCESSORS, + DEVICES_MEMORY, DEVICES_PCI, DEVICES_USB, DEVICES_PRINTERS, + DEVICES_BATTERY, + DEVICES_SENSORS, DEVICES_INPUT, DEVICES_STORAGE, } Entries; -static ModuleEntry hi_entries[] = { - {"Kernel Modules", "module.png"}, - {"PCI Devices", "devices.png"}, - {"USB Devices", "usb.png"}, - {"Printers", "printer.png"}, - {"Input Devices", "keyboard.png"}, - {"Storage", "hdd.png"}, +gchar *callback_processors(); +gchar *callback_memory(); +gchar *callback_battery(); +gchar *callback_pci(); +gchar *callback_sensors(); +gchar *callback_printers(); +gchar *callback_storage(); +gchar *callback_input(); +gchar *callback_usb(); + +void scan_processors(gboolean reload); +void scan_memory(gboolean reload); +void scan_battery(gboolean reload); +void scan_pci(gboolean reload); +void scan_sensors(gboolean reload); +void scan_printers(gboolean reload); +void scan_storage(gboolean reload); +void scan_input(gboolean reload); +void scan_usb(gboolean reload); + +static ModuleEntry entries[] = { + {"Processor", "processor.png", callback_processors, scan_processors}, + {"Memory", "memory.png", callback_memory, scan_memory}, + {"PCI Devices", "devices.png", callback_pci, scan_pci}, + {"USB Devices", "usb.png", callback_usb, scan_usb}, + {"Printers", "printer.png", callback_printers, scan_printers,}, + {"Battery", "battery.png", callback_battery, scan_battery}, + {"Sensors", "therm.png", callback_sensors, scan_sensors}, + {"Input Devices", "inputdevices.png", callback_input, scan_input}, + {"Storage", "hdd.png", callback_storage, scan_storage}, + { NULL } }; -static GHashTable *devices = NULL; -static gchar *module_list = ""; +static GHashTable *moreinfo = NULL; +static GSList *processors = NULL; static gchar *printer_list = NULL; static gchar *pci_list = ""; static gchar *input_list = NULL; -static gchar *storage_list = ""; +static gchar *storage_list = NULL; +static gchar *battery_list = NULL; +static gchar *meminfo = NULL, *lginterval = NULL; #define WALK_UNTIL(x) while((*buf != '\0') && (*buf != x)) buf++ -#define GET_STR(field_name,ptr) \ - if (strstr(tmp[0], field_name)) { \ - ptr = g_markup_escape_text(g_strstrip(tmp[1]), strlen(tmp[1])); \ - g_strfreev(tmp); \ - continue; \ +#define GET_STR(field_name,ptr) \ + if (!ptr && strstr(tmp[0], field_name)) { \ + ptr = g_markup_escape_text(g_strstrip(tmp[1]), strlen(tmp[1])); \ + g_strfreev(tmp); \ + continue; \ + } + +#define get_str(field_name,ptr) \ + if (g_str_has_prefix(tmp[0], field_name)) { \ + ptr = g_strdup(tmp[1]); \ + g_strfreev(tmp); \ + continue; \ + } +#define get_int(field_name,ptr) \ + if (g_str_has_prefix(tmp[0], field_name)) { \ + ptr = atoi(tmp[1]); \ + g_strfreev(tmp); \ + continue; \ + } +#define get_float(field_name,ptr) \ + if (g_str_has_prefix(tmp[0], field_name)) { \ + ptr = atof(tmp[1]); \ + g_strfreev(tmp); \ + continue; \ } +#include <vendor.h> + +typedef struct _Processor Processor; + +#include <arch/this/processor.h> #include <arch/this/pci.h> -#include <arch/this/modules.h> #include <arch/common/printers.h> #include <arch/this/inputdevices.h> #include <arch/this/usb.h> #include <arch/this/storage.h> +#include <arch/this/battery.h> +#include <arch/this/sensors.h> +#include <arch/this/devmemory.h> -static void -detect_devices(void) +gchar * +get_processor_name(void) { - devices = g_hash_table_new(g_str_hash, g_str_equal); + scan_processors(FALSE); + + Processor *p = (Processor *) processors->data; - shell_status_update("Getting loaded modules information..."); - scan_modules(); + if (g_slist_length(processors) > 1) { + return idle_free(g_strdup_printf("%dx %s", + g_slist_length(processors), + p->model_name)); + } else { + return p->model_name; + } +} - shell_status_update("Scanning PCI devices..."); - scan_pci(); +gchar * +get_storage_devices(void) +{ + scan_storage(FALSE); + + return storage_list; +} - shell_status_update("Searching for printers..."); - scan_printers(); +gchar * +get_printers(void) +{ + scan_printers(FALSE); + + return printer_list; +} - shell_status_update("Scanning input devices..."); - scan_inputdevices(); +gchar * +get_input_devices(void) +{ + scan_input(FALSE); + + return input_list; +} - shell_status_update("Scanning USB devices..."); - scan_usb(); +ShellModuleMethod* +hi_exported_methods(void) +{ + static ShellModuleMethod m[] = { + { "getProcessorName", get_processor_name }, + { "getStorageDevices", get_storage_devices }, + { "getPrinters", get_printers }, + { "getInputDevices", get_input_devices }, + { NULL } + }; + + return m; +} - shell_status_update("Scanning IDE devices..."); - scan_ide(); +gchar * +hi_more_info(gchar * entry) +{ + gchar *info = (gchar *) g_hash_table_lookup(moreinfo, entry); - shell_status_update("Scanning SCSI devices..."); - scan_scsi(); + if (info) + return g_strdup(info); + + return g_strdup("?"); } gchar * -hi_more_info(gchar * entry) +hi_get_field(gchar * field) { - gchar *info = (gchar *) g_hash_table_lookup(devices, entry); + gchar *info = (gchar *) g_hash_table_lookup(moreinfo, field); if (info) return g_strdup(info); - return g_strdup("[Empty]"); + + return g_strdup(field); } void -hi_reload(gint entry) -{ - switch (entry) { - case DEVICES_INPUT: - scan_inputdevices(); - break; - case DEVICES_PRINTERS: - scan_printers(); - break; - case DEVICES_USB: - scan_usb(); - break; - case DEVICES_STORAGE: - if (storage_list) { - g_free(storage_list); - g_free(storage_icons); - storage_list = g_strdup(""); - storage_icons = g_strdup(""); - } - scan_ide(); - scan_scsi(); - break; - } +scan_processors(gboolean reload) +{ + SCAN_START(); + if (!processors) + processors = __scan_processors(); + SCAN_END(); +} + +void +scan_memory(gboolean reload) +{ + SCAN_START(); + __scan_memory(); + SCAN_END(); +} + +void +scan_battery(gboolean reload) +{ + SCAN_START(); + __scan_battery(); + SCAN_END(); +} + +void +scan_pci(gboolean reload) +{ + SCAN_START(); + __scan_pci(); + SCAN_END(); +} + +void +scan_sensors(gboolean reload) +{ + SCAN_START(); + __scan_sensors(); + SCAN_END(); +} + +void +scan_printers(gboolean reload) +{ + SCAN_START(); + __scan_printers(); + SCAN_END(); +} + +void +scan_storage(gboolean reload) +{ + SCAN_START(); + g_free(storage_list); + storage_list = g_strdup(""); + + __scan_ide_devices(); + __scan_scsi_devices(); + SCAN_END(); +} + +void +scan_input(gboolean reload) +{ + SCAN_START(); + __scan_input_devices(); + SCAN_END(); +} + +void +scan_usb(gboolean reload) +{ + SCAN_START(); + __scan_usb(); + SCAN_END(); } gchar * -hi_info(gint entry) +callback_processors() { - if (!devices) { - detect_devices(); - } + return processor_get_info(processors); +} - switch (entry) { - case DEVICES_KERNEL_MODULES: - return g_strdup_printf("[Loaded Modules]\n" - "%s" - "[$ShellParam$]\n" - "ViewType=1", - module_list); - case DEVICES_PCI: - return g_strdup_printf("[PCI Devices]\n" - "%s" - "[$ShellParam$]\n" - "ViewType=1\n", - pci_list); - case DEVICES_PRINTERS: - return g_strdup_printf("%s\n" - "[$ShellParam$]\n" - "ReloadInterval=5000", printer_list); - case DEVICES_STORAGE: - return g_strdup_printf("%s\n" - "[$ShellParam$]\n" - "ReloadInterval=5000\n" - "ViewType=1\n%s", storage_list, storage_icons); - case DEVICES_INPUT: - return g_strdup_printf("[Input Devices]\n" - "%s" - "[$ShellParam$]\n" - "ViewType=1\n" - "ReloadInterval=5000\n%s", input_list, input_icons); - case DEVICES_USB: - return g_strdup_printf("%s" - "[$ShellParam$]\n" - "ViewType=1\n" - "ReloadInterval=5000\n", - usb_list); - default: - return g_strdup("[Empty]\nNo info available="); - } +gchar * +callback_memory() +{ + return g_strdup_printf("[Memory]\n" + "%s\n" + "[$ShellParam$]\n" + "ViewType=2\n" + "LoadGraphSuffix= kB\n" + "RescanInterval=2000\n" + "%s\n", + meminfo, + lginterval); +} + +gchar * +callback_battery() +{ + return g_strdup_printf("%s\n" + "[$ShellParam$]\n" + "ReloadInterval=4000\n", battery_list); +} + +gchar * +callback_pci() +{ + return g_strdup_printf("[PCI Devices]\n" + "%s" + "[$ShellParam$]\n" + "ViewType=1\n", + pci_list); +} + +gchar * +callback_sensors() +{ + return g_strdup_printf("[$ShellParam$]\n" + "ReloadInterval=5000\n" + "%s", sensors); } -gint -hi_n_entries(void) +gchar * +callback_printers() +{ + return g_strdup_printf("%s\n" + "[$ShellParam$]\n" + "ReloadInterval=5000", printer_list); +} + +gchar * +callback_storage() +{ + return g_strdup_printf("%s\n" + "[$ShellParam$]\n" + "ReloadInterval=5000\n" + "ViewType=1\n%s", storage_list, storage_icons); +} + +gchar * +callback_input() { - return G_N_ELEMENTS(hi_entries) - 1; + return g_strdup_printf("[Input Devices]\n" + "%s" + "[$ShellParam$]\n" + "ViewType=1\n" + "ReloadInterval=5000\n%s", input_list, input_icons); } -GdkPixbuf * -hi_icon(gint entry) +gchar * +callback_usb() { - return icon_cache_get_pixbuf(hi_entries[entry].icon); + return g_strdup_printf("%s" + "[$ShellParam$]\n" + "ViewType=1\n" + "ReloadInterval=5000\n", + usb_list); +} + +ModuleEntry * +hi_module_get_entries(void) +{ + return entries; } gchar * -hi_name(gint entry) +hi_module_get_name(void) { - return hi_entries[entry].name; + return g_strdup("Devices"); } + +guchar +hi_module_get_weight(void) +{ + return 160; +} + +void +hi_module_init(void) +{ + moreinfo = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); + __init_memory_labels(); +} + +ModuleAbout * +hi_module_get_about(void) +{ + static ModuleAbout ma[] = { + { + .author = "Leandro A. F. Pereira", + .description = "Gathers information about hardware devices", + .version = VERSION, + .license = "GNU GPL version 2" + } + }; + + return ma; +} + +gchar ** +hi_module_get_dependencies(void) +{ + static gchar *deps[] = { "computer.so", NULL }; + + return deps; +} + @@ -1,6 +1,6 @@ /* * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> + * Copyright (C) 2003-2007 Leandro A. F. Pereira <leandro@linuxmag.com.br> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1,6 +1,6 @@ /* * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> + * Copyright (C) 2003-2007 Leandro A. F. Pereira <leandro@linuxmag.com.br> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/fbench.c b/fbench.c new file mode 100644 index 00000000..2b4501d8 --- /dev/null +++ b/fbench.c @@ -0,0 +1,744 @@ +/* + + John Walker's Floating Point Benchmark, derived from... + + Marinchip Interactive Lens Design System + + John Walker December 1980 + + By John Walker + http://www.fourmilab.ch/ + + This program may be used, distributed, and modified freely as + long as the origin information is preserved. + + This is a complete optical design raytracing algorithm, + stripped of its user interface and recast into portable C. It + not only determines execution speed on an extremely floating + point (including trig function) intensive real-world + application, it checks accuracy on an algorithm that is + exquisitely sensitive to errors. The performance of this + program is typically far more sensitive to changes in the + efficiency of the trigonometric library routines than the + average floating point program. + + The benchmark may be compiled in two modes. If the symbol + INTRIG is defined, built-in trigonometric and square root + routines will be used for all calculations. Timings made with + INTRIG defined reflect the machine's basic floating point + performance for the arithmetic operators. If INTRIG is not + defined, the system library <math.h> functions are used. + Results with INTRIG not defined reflect the system's library + performance and/or floating point hardware support for trig + functions and square root. Results with INTRIG defined are a + good guide to general floating point performance, while + results with INTRIG undefined indicate the performance of an + application which is math function intensive. + + Special note regarding errors in accuracy: this program has + generated numbers identical to the last digit it formats and + checks on the following machines, floating point + architectures, and languages: + + Marinchip 9900 QBASIC IBM 370 double-precision (REAL * 8) format + + IBM PC / XT / AT Lattice C IEEE 64 bit, 80 bit temporaries + High C same, in line 80x87 code + BASICA "Double precision" + Quick BASIC IEEE double precision, software routines + + Sun 3 C IEEE 64 bit, 80 bit temporaries, + in-line 68881 code, in-line FPA code. + + MicroVAX II C Vax "G" format floating point + + Macintosh Plus MPW C SANE floating point, IEEE 64 bit format + implemented in ROM. + + Inaccuracies reported by this program should be taken VERY + SERIOUSLY INDEED, as the program has been demonstrated to be + invariant under changes in floating point format, as long as + the format is a recognised double precision format. If you + encounter errors, please remember that they are just as likely + to be in the floating point editing library or the + trigonometric libraries as in the low level operator code. + + The benchmark assumes that results are basically reliable, and + only tests the last result computed against the reference. If + you're running on a suspect system you can compile this + program with ACCURACY defined. This will generate a version + which executes as an infinite loop, performing the ray trace + and checking the results on every pass. All incorrect results + will be reported. + + Representative timings are given below. All have been + normalised as if run for 1000 iterations. + + Time in seconds Computer, Compiler, and notes + Normal INTRIG + + 3466.00 4031.00 Commodore 128, 2 Mhz 8510 with software floating + point. Abacus Software/Data-Becker Super-C 128, + version 3.00, run in fast (2 Mhz) mode. Note: + the results generated by this system differed + from the reference results in the 8th to 10th + decimal place. + + 3290.00 IBM PC/AT 6 Mhz, Microsoft/IBM BASICA version A3.00. + Run with the "/d" switch, software floating point. + + 2131.50 IBM PC/AT 6 Mhz, Lattice C version 2.14, small model. + This version of Lattice compiles subroutine + calls which either do software floating point + or use the 80x87. The machine on which I ran + this had an 80287, but the results were so bad + I wonder if it was being used. + + 1598.00 Macintosh Plus, MPW C, SANE Software floating point. + + 1582.13 Marinchip 9900 2 Mhz, QBASIC compiler with software + floating point. This was a QBASIC version of the + program which contained the identical algorithm. + + 404.00 IBM PC/AT 6 Mhz, Microsoft QuickBASIC version 2.0. + Software floating point. + + 165.15 IBM PC/AT 6 Mhz, Metaware High C version 1.3, small + model. This was compiled to call subroutines for + floating point, and the machine contained an 80287 + which was used by the subroutines. + + 143.20 Macintosh II, MPW C, SANE calls. I was unable to + determine whether SANE was using the 68881 chip or + not. + + 121.80 Sun 3/160 16 Mhz, Sun C. Compiled with -fsoft switch + which executes floating point in software. + + 78.78 110.11 IBM RT PC (Model 6150). IBM AIX 1.0 C compiler + with -O switch. + + 75.2 254.0 Microsoft Quick C 1.0, in-line 8087 instructions, + compiled with 80286 optimisation on. (Switches + were -Ol -FPi87-G2 -AS). Small memory model. + + 69.50 IBM PC/AT 6Mhz, Borland Turbo BASIC 1.0. Compiled + in "8087 required" mode to generate in-line + code for the math coprocessor. + + 66.96 IBM PC/AT 6Mhz, Microsoft QuickBASIC 4.0. This + release of QuickBASIC compiles code for the + 80287 math coprocessor. + + 66.36 206.35 IBM PC/AT 6Mhz, Metaware High C version 1.3, small + model. This was compiled with in-line code for the + 80287 math coprocessor. Trig functions still call + library routines. + + 63.07 220.43 IBM PC/AT, 6Mhz, Borland Turbo C, in-line 8087 code, + small model, word alignment, no stack checking, + 8086 code mode. + + 17.18 Apollo DN-3000, 12 Mhz 68020 with 68881, compiled + with in-line code for the 68881 coprocessor. + According to Apollo, the library routines are chosen + at runtime based on coprocessor presence. Since the + coprocessor was present, the library is supposed to + use in-line floating point code. + + 15.55 27.56 VAXstation II GPX. Compiled and executed under + VAX/VMS C. + + 15.14 37.93 Macintosh II, Unix system V. Green Hills 68020 + Unix compiler with in-line code for the 68881 + coprocessor (-O -ZI switches). + + 12.69 Sun 3/160 16 Mhz, Sun C. Compiled with -fswitch, + which calls a subroutine to select the fastest + floating point processor. This was using the 68881. + + 11.74 26.73 Compaq Deskpro 386, 16 Mhz 80386 with 16 Mhz 80387. + Metaware High C version 1.3, compiled with in-line + for the math coprocessor (but not optimised for the + 80386/80387). Trig functions still call library + routines. + + 8.43 30.49 Sun 3/160 16 Mhz, Sun C. Compiled with -f68881, + generating in-line MC68881 instructions. Trig + functions still call library routines. + + 6.29 25.17 Sun 3/260 25 Mhz, Sun C. Compiled with -f68881, + generating in-line MC68881 instructions. Trig + functions still call library routines. + + 4.57 Sun 3/260 25 Mhz, Sun FORTRAN 77. Compiled with + -O -f68881, generating in-line MC68881 instructions. + Trig functions are compiled in-line. This used + the FORTRAN 77 version of the program, FBFORT77.F. + + 4.00 14.20 Sun386i/25 Mhz model 250, Sun C compiler. + + 4.00 14.00 Sun386i/25 Mhz model 250, Metaware C. + + 3.10 12.00 Compaq 386/387 25 Mhz running SCO Xenix 2. + Compiled with Metaware HighC 386, optimized + for 386. + + 3.00 12.00 Compaq 386/387 25MHZ optimized for 386/387. + + 2.96 5.17 Sun 4/260, Sparc RISC processor. Sun C, + compiled with the -O2 switch for global + optimisation. + + 2.47 COMPAQ 486/25, secondary cache disabled, High C, + 486/387, inline f.p., small memory model. + + 2.20 3.40 Data General Motorola 88000, 16 Mhz, Gnu C. + + 1.56 COMPAQ 486/25, 128K secondary cache, High C, 486/387, + inline f.p., small memory model. + + 0.66 1.50 DEC Pmax, Mips processor. + + 0.63 0.91 Sun SparcStation 2, Sun C (SunOS 4.1.1) with + -O4 optimisation and "/usr/lib/libm.il" inline + floating point. + + 0.60 1.07 Intel 860 RISC processor, 33 Mhz, Greenhills + C compiler. + + 0.40 0.90 Dec 3MAX, MIPS 3000 processor, -O4. + + 0.31 0.90 IBM RS/6000, -O. + + 0.1129 0.2119 Dell Dimension XPS P133c, Pentium 133 MHz, + Windows 95, Microsoft Visual C 5.0. + + 0.0883 0.2166 Silicon Graphics Indigo², MIPS R4400, + 175 Mhz, "-O3". + + 0.0351 0.0561 Dell Dimension XPS R100, Pentium II 400 MHz, + Windows 98, Microsoft Visual C 5.0. + + 0.0312 0.0542 Sun Ultra 2, UltraSPARC V9, 300 MHz, Solaris + 2.5.1. + + 0.00862 0.01074 Dell Inspiron 9100, Pentium 4, 3.4 GHz, gcc -O3. + +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#ifndef INTRIG +#include <math.h> +#endif + +#define cot(x) (1.0 / tan(x)) + +#define TRUE 1 +#define FALSE 0 + +#define max_surfaces 10 + +/* Local variables */ + +/*static char tbfr[132];*/ + +static short current_surfaces; +static short paraxial; + +static double clear_aperture; + +static double aberr_lspher; +static double aberr_osc; +static double aberr_lchrom; + +static double max_lspher; +static double max_osc; +static double max_lchrom; + +static double radius_of_curvature; +static double object_distance; +static double ray_height; +static double axis_slope_angle; +static double from_index; +static double to_index; + +static double spectral_line[9]; +static double s[max_surfaces][5]; +static double od_sa[2][2]; + +/*static char outarr[8][80];*/ /* Computed output of program goes here */ + +int itercount; /* The iteration counter for the main loop + in the program is made global so that + the compiler should not be allowed to + optimise out the loop over the ray + tracing code. */ + +#ifndef ITERATIONS +#define ITERATIONS 1000 +#endif +int niter = ITERATIONS; /* Iteration counter */ + +#if 0 +static char *refarr[] = { /* Reference results. These happen to + be derived from a run on Microsoft + Quick BASIC on the IBM PC/AT. */ + + " Marginal ray 47.09479120920 0.04178472683", + " Paraxial ray 47.08372160249 0.04177864821", + "Longitudinal spherical aberration: -0.01106960671", + " (Maximum permissible): 0.05306749907", + "Offense against sine condition (coma): 0.00008954761", + " (Maximum permissible): 0.00250000000", + "Axial chromatic aberration: 0.00448229032", + " (Maximum permissible): 0.05306749907" +}; +#endif + +/* The test case used in this program is the design for a 4 inch + achromatic telescope objective used as the example in Wyld's + classic work on ray tracing by hand, given in Amateur Telescope + Making, Volume 3. */ + +static double testcase[4][4] = { + {27.05, 1.5137, 63.6, 0.52}, + {-16.68, 1, 0, 0.138}, + {-16.68, 1.6164, 36.7, 0.38}, + {-78.1, 1, 0, 0} +}; + +/* Internal trig functions (used only if INTRIG is defined). These + standard functions may be enabled to obtain timings that reflect + the machine's floating point performance rather than the speed of + its trig function evaluation. */ + +#ifdef INTRIG + +/* The following definitions should keep you from getting intro trouble + with compilers which don't let you redefine intrinsic functions. */ + +#define sin I_sin +#define cos I_cos +#define tan I_tan +#define sqrt I_sqrt +#define atan I_atan +#define atan2 I_atan2 +#define asin I_asin + +#define fabs(x) ((x < 0.0) ? -x : x) + +#define pic 3.1415926535897932 + +/* Commonly used constants */ + +static double pi = pic, + twopi = pic * 2.0, + piover4 = pic / 4.0, fouroverpi = 4.0 / pic, piover2 = pic / 2.0; + +/* Coefficients for ATAN evaluation */ + +static double atanc[] = { + 0.0, + 0.4636476090008061165, + 0.7853981633974483094, + 0.98279372324732906714, + 1.1071487177940905022, + 1.1902899496825317322, + 1.2490457723982544262, + 1.2924966677897852673, + 1.3258176636680324644 +}; + +/* aint(x) Return integer part of number. Truncates towards 0 */ + +double aint(x) +double x; +{ + long l; + + /* Note that this routine cannot handle the full floating point + number range. This function should be in the machine-dependent + floating point library! */ + + l = x; + if ((int) (-0.5) != 0 && l < 0) + l++; + x = l; + return x; +} + +/* sin(x) Return sine, x in radians */ + +static double sin(x) +double x; +{ + int sign; + double y, r, z; + + x = (((sign = (x < 0.0)) != 0) ? -x : x); + + if (x > twopi) + x -= (aint(x / twopi) * twopi); + + if (x > pi) { + x -= pi; + sign = !sign; + } + + if (x > piover2) + x = pi - x; + + if (x < piover4) { + y = x * fouroverpi; + z = y * y; + r = y * + (((((((-0.202253129293E-13 * z + 0.69481520350522E-11) * z - + 0.17572474176170806E-8) * z + + 0.313361688917325348E-6) * z - + 0.365762041821464001E-4) * z + + 0.249039457019271628E-2) * z - 0.0807455121882807815) * z + + 0.785398163397448310); + } else { + y = (piover2 - x) * fouroverpi; + z = y * y; + r = ((((((-0.38577620372E-12 * z + 0.11500497024263E-9) * z - + 0.2461136382637005E-7) * z + + 0.359086044588581953E-5) * z - + 0.325991886926687550E-3) * z + 0.0158543442438154109) * z - + 0.308425137534042452) * z + 1.0; + } + return sign ? -r : r; +} + +/* cos(x) Return cosine, x in radians, by identity */ + +static double cos(x) +double x; +{ + x = (x < 0.0) ? -x : x; + if (x > twopi) /* Do range reduction here to limit */ + x = x - (aint(x / twopi) * twopi); /* roundoff on add of PI/2 */ + return sin(x + piover2); +} + +/* tan(x) Return tangent, x in radians, by identity */ + +static double tan(x) +double x; +{ + return sin(x) / cos(x); +} + +/* sqrt(x) Return square root. Initial guess, then Newton- + Raphson refinement */ + +double sqrt(x) +double x; +{ + double c, cl, y; + int n; + + if (x == 0.0) + return 0.0; + + if (x < 0.0) { + fprintf(stderr, + "\nGood work! You tried to take the square root of %g", + x); + fprintf(stderr, + "\nunfortunately, that is too complex for me to handle.\n"); + exit(1); + } + + y = (0.154116 + 1.893872 * x) / (1.0 + 1.047988 * x); + + c = (y - x / y) / 2.0; + cl = 0.0; + for (n = 50; c != cl && n--;) { + y = y - c; + cl = c; + c = (y - x / y) / 2.0; + } + return y; +} + +/* atan(x) Return arctangent in radians, + range -pi/2 to pi/2 */ + +static double atan(x) +double x; +{ + int sign, l, y; + double a, b, z; + + x = (((sign = (x < 0.0)) != 0) ? -x : x); + l = 0; + + if (x >= 4.0) { + l = -1; + x = 1.0 / x; + y = 0; + goto atl; + } else { + if (x < 0.25) { + y = 0; + goto atl; + } + } + + y = aint(x / 0.5); + z = y * 0.5; + x = (x - z) / (x * z + 1); + + atl: + z = x * x; + b = ((((893025.0 * z + 49116375.0) * z + 425675250.0) * z + + 1277025750.0) * z + 1550674125.0) * z + 654729075.0; + a = (((13852575.0 * z + 216602100.0) * z + 891080190.0) * z + + 1332431100.0) * z + 654729075.0; + a = (a / b) * x + atanc[y]; + if (l) + a = piover2 - a; + return sign ? -a : a; +} + +/* atan2(y,x) Return arctangent in radians of y/x, + range -pi to pi */ + +static double atan2(y, x) +double y, x; +{ + double temp; + + if (x == 0.0) { + if (y == 0.0) /* Special case: atan2(0,0) = 0 */ + return 0.0; + else if (y > 0) + return piover2; + else + return -piover2; + } + temp = atan(y / x); + if (x < 0.0) { + if (y >= 0.0) + temp += pic; + else + temp -= pic; + } + return temp; +} + +/* asin(x) Return arcsine in radians of x */ + +static double asin(x) +double x; +{ + if (fabs(x) > 1.0) { + fprintf(stderr, + "\nInverse trig functions lose much of their gloss when"); + fprintf(stderr, + "\ntheir arguments are greater than 1, such as the"); + fprintf(stderr, "\nvalue %g you passed.\n", x); + exit(1); + } + return atan2(x, sqrt(1 - x * x)); +} +#endif + +/* Calculate passage through surface + + If the variable PARAXIAL is true, the trace through the + surface will be done using the paraxial approximations. + Otherwise, the normal trigonometric trace will be done. + + This routine takes the following inputs: + + RADIUS_OF_CURVATURE Radius of curvature of surface + being crossed. If 0, surface is + plane. + + OBJECT_DISTANCE Distance of object focus from + lens vertex. If 0, incoming + rays are parallel and + the following must be specified: + + RAY_HEIGHT Height of ray from axis. Only + relevant if OBJECT.DISTANCE == 0 + + AXIS_SLOPE_ANGLE Angle incoming ray makes with axis + at intercept + + FROM_INDEX Refractive index of medium being left + + TO_INDEX Refractive index of medium being + entered. + + The outputs are the following variables: + + OBJECT_DISTANCE Distance from vertex to object focus + after refraction. + + AXIS_SLOPE_ANGLE Angle incoming ray makes with axis + at intercept after refraction. + +*/ + +static void transit_surface() +{ + double iang, /* Incidence angle */ + rang, /* Refraction angle */ + iang_sin, /* Incidence angle sin */ + rang_sin, /* Refraction angle sin */ + old_axis_slope_angle, sagitta; + + if (paraxial) { + if (radius_of_curvature != 0.0) { + if (object_distance == 0.0) { + axis_slope_angle = 0.0; + iang_sin = ray_height / radius_of_curvature; + } else + iang_sin = ((object_distance - + radius_of_curvature) / radius_of_curvature) * + axis_slope_angle; + + rang_sin = (from_index / to_index) * iang_sin; + old_axis_slope_angle = axis_slope_angle; + axis_slope_angle = axis_slope_angle + iang_sin - rang_sin; + if (object_distance != 0.0) + ray_height = object_distance * old_axis_slope_angle; + object_distance = ray_height / axis_slope_angle; + return; + } + object_distance = object_distance * (to_index / from_index); + axis_slope_angle = axis_slope_angle * (from_index / to_index); + return; + } + + if (radius_of_curvature != 0.0) { + if (object_distance == 0.0) { + axis_slope_angle = 0.0; + iang_sin = ray_height / radius_of_curvature; + } else { + iang_sin = ((object_distance - + radius_of_curvature) / radius_of_curvature) * + sin(axis_slope_angle); + } + iang = asin(iang_sin); + rang_sin = (from_index / to_index) * iang_sin; + old_axis_slope_angle = axis_slope_angle; + axis_slope_angle = axis_slope_angle + iang - asin(rang_sin); + sagitta = sin((old_axis_slope_angle + iang) / 2.0); + sagitta = 2.0 * radius_of_curvature * sagitta * sagitta; + object_distance = + ((radius_of_curvature * sin(old_axis_slope_angle + iang)) * + cot(axis_slope_angle)) + sagitta; + return; + } + + rang = -asin((from_index / to_index) * sin(axis_slope_angle)); + object_distance = object_distance * ((to_index * + cos(-rang)) / (from_index * + cos + (axis_slope_angle))); + axis_slope_angle = -rang; +} + +/* Perform ray trace in specific spectral line */ + +static void trace_line(line, ray_h) +int line; +double ray_h; +{ + int i; + + object_distance = 0.0; + ray_height = ray_h; + from_index = 1.0; + + for (i = 1; i <= current_surfaces; i++) { + radius_of_curvature = s[i][1]; + to_index = s[i][2]; + if (to_index > 1.0) + to_index = to_index + ((spectral_line[4] - + spectral_line[line]) / + (spectral_line[3] - + spectral_line[6])) * ((s[i][2] - + 1.0) / s[i][3]); + transit_surface(); + from_index = to_index; + if (i < current_surfaces) + object_distance = object_distance - s[i][4]; + } +} + +/* Initialise when called the first time */ + +void fbench() +{ + int i, j; + double od_fline, od_cline; + + spectral_line[1] = 7621.0; /* A */ + spectral_line[2] = 6869.955; /* B */ + spectral_line[3] = 6562.816; /* C */ + spectral_line[4] = 5895.944; /* D */ + spectral_line[5] = 5269.557; /* E */ + spectral_line[6] = 4861.344; /* F */ + spectral_line[7] = 4340.477; /* G' */ + spectral_line[8] = 3968.494; /* H */ + + niter = 3000; + + /* Load test case into working array */ + + clear_aperture = 4.0; + current_surfaces = 4; + for (i = 0; i < current_surfaces; i++) + for (j = 0; j < 4; j++) + s[i + 1][j + 1] = testcase[i][j]; + + for (itercount = 0; itercount < niter; itercount++) { + for (paraxial = 0; paraxial <= 1; paraxial++) { + + /* Do main trace in D light */ + + trace_line(4, clear_aperture / 2.0); + od_sa[paraxial][0] = object_distance; + od_sa[paraxial][1] = axis_slope_angle; + } + paraxial = FALSE; + + /* Trace marginal ray in C */ + + trace_line(3, clear_aperture / 2.0); + od_cline = object_distance; + + /* Trace marginal ray in F */ + + trace_line(6, clear_aperture / 2.0); + od_fline = object_distance; + + aberr_lspher = od_sa[1][0] - od_sa[0][0]; + aberr_osc = 1.0 - (od_sa[1][0] * od_sa[1][1]) / + (sin(od_sa[0][1]) * od_sa[0][0]); + aberr_lchrom = od_fline - od_cline; + max_lspher = sin(od_sa[0][1]); + + /* D light */ + + max_lspher = 0.0000926 / (max_lspher * max_lspher); + max_osc = 0.0025; + max_lchrom = max_lspher; + } +} + +#ifdef __FBENCH_TEST__ +int main(void) { + fbench(); + + return 0; +} +#endif @@ -1,6 +1,6 @@ /* * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> + * Copyright (C) 2003-2007 Leandro A. F. Pereira <leandro@linuxmag.com.br> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,27 +19,121 @@ #include <config.h> #include <shell.h> +#include <report.h> +#include <hardinfo.h> #include <iconcache.h> #include <stock.h> #include <binreloc.h> +ProgramParameters params = { 0 }; + int main(int argc, char **argv) { - GError *error; + GSList *modules; + + DEBUG("HardInfo version " VERSION ". Debug version."); - gtk_init(&argc, &argv); + DEBUG("g_thread_init()"); + if (!g_thread_supported()) + g_thread_init (NULL); + + /* parse all command line parameters */ + parameters_init(&argc, &argv, ¶ms); + + /* show version information and quit */ + if (params.show_version) { + g_print("HardInfo version " VERSION "\n"); + g_print("Copyright (C) 2003-2007 Leandro A. F. Pereira. See COPYING for details.\n\n"); - if (!gbr_init(&error)) { - g_error("BinReloc cannot be initialized: %s", error->message); + g_print("Compile-time options:\n" + " Release version: %s (%s)\n" + " BinReloc enabled: %s\n" + " Data prefix: %s\n" + " Library prefix: %s\n" + " Compiled on: %s %s (%s)\n", + RELEASE ? "Yes" : "No (" VERSION ")", ARCH, + ENABLE_BINRELOC ? "Yes" : "No", + PREFIX, + LIBPREFIX, + PLATFORM, KERNEL, HOSTNAME); + + DEBUG(" Debugging is enabled."); + + /* show also available modules */ + params.list_modules = TRUE; } + + /* initialize the binreloc library, so we can load program data */ + if (!binreloc_init(FALSE)) + g_error("Failed to find runtime data.\n\n" + "\342\200\242 Is HardInfo correctly installed?\n" + "\342\200\242 See if %s and %s exists and you have read permision.", + PREFIX, LIBPREFIX); - icon_cache_init(); - stock_icons_init(); - shell_init(); + /* list all module names */ + if (params.list_modules) { + g_print("Modules:\n" + "%-20s%-15s%-12s\n", "File Name", "Name", "Version"); + + for (modules = modules_load_all(); modules; modules = modules->next) { + ShellModule *module = (ShellModule *) modules->data; + ModuleAbout *ma = module_get_about(module); + gchar *name = g_path_get_basename(g_module_name(module->dll)); + + g_print("%-20s%-15s%-12s\n", + name, module->name, ma->version); + + g_free(name); + } + + return 0; + } - gtk_main(); + if (!params.create_report) { + /* we only try to open the UI if the user didn't asked for a + report. */ + params.gui_running = ui_init(&argc, &argv); + + /* as a fallback, if GTK+ initialization failed, run in report + generation mode. */ + if (!params.gui_running) + params.create_report = TRUE; + } + + if (params.use_modules) { + /* load only selected modules */ + DEBUG("loading user-selected modules"); + modules = modules_load_selected(); + } else { + /* load all modules */ + DEBUG("loading all modules"); + modules = modules_load_all(); + } + + if (params.gui_running) { + /* initialize gui and start gtk+ main loop */ + icon_cache_init(); + stock_icons_init(); + + shell_init(modules); + + DEBUG("entering gtk+ main loop"); + gtk_main(); + } else if (params.create_report) { + /* generate report */ + gchar *report; + + DEBUG("generating report"); + + report = report_create_from_module_list_format(modules, + params.report_format); + g_print("%s", report); + + g_free(report); + } + DEBUG("finished"); return 0; } diff --git a/hardinfo.desktop b/hardinfo.desktop index 32895d6d..35c58bcd 100644 --- a/hardinfo.desktop +++ b/hardinfo.desktop @@ -1,12 +1,10 @@ [Desktop Entry] -Name=System Information (hardinfo) -Name[pt_BR]=Informações do Sistema (hardinfo) -Comment=Information on your hardware devices -Comment[pt_BR]=Informações sobre seus dispositivos de hardware +Encoding=UTF-8 +Name=System Profiler and Benchmark +Name[pt_BR]=Informações e Testes do Sistema Exec=hardinfo Icon=/usr/share/hardinfo/pixmaps/logo.png Terminal=false -MultipleArgs=false Type=Application StartupNotify=true -Categories=Application;System +Categories=System @@ -1,6 +1,6 @@ /* * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> + * Copyright (C) 2003-2007 Leandro A. F. Pereira <leandro@linuxmag.com.br> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,18 +20,96 @@ #define __HARDINFO_H__ #include <gtk/gtk.h> +#include <shell.h> -typedef struct _ModuleEntry ModuleEntry; +typedef struct _ModuleEntry ModuleEntry; +typedef struct _ModuleAbout ModuleAbout; +typedef struct _FileTypes FileTypes; +typedef struct _ProgramParameters ProgramParameters; + +struct _ProgramParameters { + gboolean create_report; + gboolean show_version; + gboolean gui_running; + gboolean list_modules; + gboolean autoload_deps; + + gint report_format; + + gchar **use_modules; + gchar *path_lib; + gchar *path_data; +}; + +struct _FileTypes { + gchar *name; + gchar *mime_type; + gchar *extension; + gpointer data; +}; struct _ModuleEntry { - gchar *name; - gchar *icon; + gchar *name; + gchar *icon; + gpointer callback; + gpointer scan_callback; }; -inline void remove_quotes(gchar *str); -inline void strend(gchar *str, gchar chr); -inline void remove_linefeed(gchar *str); - void widget_set_cursor(GtkWidget *widget, GdkCursorType cursor_type); +struct _ModuleAbout { + const gchar *description; + const gchar *author; + const gchar *version; + const gchar *license; +}; + +/* String utility functions */ +inline void remove_quotes(gchar *str); +inline void strend(gchar *str, gchar chr); +inline void remove_linefeed(gchar *str); +gchar *strreplace(gchar *string, gchar *replace, gchar new_char); + +/* Widget utility functions */ +void widget_set_cursor(GtkWidget *widget, GdkCursorType cursor_type); +gint tree_view_get_visible_height(GtkTreeView *tv); +void tree_view_save_image(gchar *filename); + +/* File Chooser utility functions */ +void file_chooser_open_expander(GtkWidget *chooser); +void file_chooser_add_filters(GtkWidget *chooser, FileTypes *filters); +gchar *file_chooser_get_extension(GtkWidget *chooser, FileTypes *filters); +gchar *file_chooser_build_filename(GtkWidget *chooser, gchar *extension); +gpointer file_types_get_data_by_name(FileTypes *file_types, gchar *name); + +/* Misc utility functions */ +gpointer idle_free(gpointer ptr); inline gchar *size_human_readable(gfloat size); +void nonblock_sleep(guint msec); +void open_url(gchar *url); +GSList *modules_load_selected(void); +GSList *modules_load_all(void); +ModuleAbout *module_get_about(ShellModule *module); +gchar *seconds_to_string(unsigned int seconds); + +void module_entry_scan_all_except(ModuleEntry *entries, gint except_entry); +void module_entry_scan_all(ModuleEntry *entries); +void module_entry_reload(ShellModuleEntry *module_entry); +void module_entry_scan(ShellModuleEntry *module_entry); +gchar *module_entry_function(ShellModuleEntry *module_entry); +const gchar *module_entry_get_note(ShellModuleEntry *module_entry); + +/* BinReloc stuff */ +gboolean binreloc_init(gboolean try_hardcoded); + +/* GTK UI stuff */ +gboolean ui_init(int *argc, char ***argv); +void parameters_init(int *argc, char ***argv, ProgramParameters *params); +extern ProgramParameters params; + +/* Module stuff */ +gchar *module_call_method(gchar *method); + + +#define SCAN_START() static gboolean scanned = FALSE; if (reload) scanned = FALSE; if (scanned) return; +#define SCAN_END() scanned = TRUE; #endif /* __HARDINFO_H__ */ diff --git a/iconcache.c b/iconcache.c index fae641d1..fbd0dd84 100644 --- a/iconcache.c +++ b/iconcache.c @@ -1,6 +1,6 @@ /* * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> + * Copyright (C) 2003-2007 Leandro A. F. Pereira <leandro@linuxmag.com.br> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,69 +17,79 @@ */ #include <iconcache.h> #include <config.h> -#include <binreloc.h> +#include <hardinfo.h> static GHashTable *cache = NULL; void icon_cache_init(void) { + DEBUG("initializing icon cache"); if (!cache) { - cache = g_hash_table_new(g_str_hash, g_str_equal); + cache = g_hash_table_new(g_str_hash, g_str_equal); } } -GdkPixbuf *icon_cache_get_pixbuf(const gchar *file) +GdkPixbuf *icon_cache_get_pixbuf(const gchar * file) { GdkPixbuf *icon; - + + if (!cache) + icon_cache_init(); + icon = g_hash_table_lookup(cache, file); if (!icon) { - gchar *tmp = g_strdup_printf("%s/hardinfo/pixmaps/%s", - gbr_find_data_dir(PREFIX), - file); - - icon = gdk_pixbuf_new_from_file(tmp, NULL); - g_hash_table_insert(cache, g_strdup(file), icon); - - g_free(tmp); + icon = + gdk_pixbuf_new_from_file(idle_free + (g_build_filename + (params.path_data, "pixmaps", file, + NULL)), NULL); + g_hash_table_insert(cache, g_strdup(file), icon); } - + + g_object_ref(icon); + return icon; } -GtkWidget *icon_cache_get_image(const gchar *file) +GtkWidget *icon_cache_get_image(const gchar * file) { GdkPixbuf *icon; - + icon = icon_cache_get_pixbuf(file); return gtk_image_new_from_pixbuf(icon); } -GdkPixbuf *icon_cache_get_pixbuf_at_size(const gchar *file, gint wid, gint hei) +GdkPixbuf *icon_cache_get_pixbuf_at_size(const gchar * file, gint wid, + gint hei) { GdkPixbuf *icon; - + + if (!cache) + icon_cache_init(); + icon = g_hash_table_lookup(cache, file); if (!icon) { - gchar *tmp = g_strdup_printf("%s/hardinfo/pixmaps/%s", - gbr_find_data_dir(PREFIX), - file); - - icon = gdk_pixbuf_new_from_file_at_size(tmp, wid, hei, NULL); - g_hash_table_insert(cache, g_strdup(file), icon); - - g_free(tmp); + icon = + gdk_pixbuf_new_from_file_at_size(idle_free + (g_build_filename + (params.path_data, "pixmaps", + file, NULL)), wid, hei, + NULL); + g_hash_table_insert(cache, g_strdup(file), icon); } - + + g_object_ref(icon); + return icon; } -GtkWidget *icon_cache_get_image_at_size(const gchar *file, gint wid, gint hei) +GtkWidget *icon_cache_get_image_at_size(const gchar * file, gint wid, + gint hei) { GdkPixbuf *icon; - + icon = icon_cache_get_pixbuf_at_size(file, wid, hei); return gtk_image_new_from_pixbuf(icon); } diff --git a/iconcache.h b/iconcache.h index e528b090..df1c0629 100644 --- a/iconcache.h +++ b/iconcache.h @@ -1,6 +1,6 @@ /* * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> + * Copyright (C) 2003-2007 Leandro A. F. Pereira <leandro@linuxmag.com.br> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/loadgraph.c b/loadgraph.c index 53fb54f7..5f61fca3 100644 --- a/loadgraph.c +++ b/loadgraph.c @@ -33,6 +33,9 @@ LoadGraph *load_graph_new(gint size) lg = g_new0(LoadGraph, 1); + size++; + + lg->suffix = g_strdup(""); lg->area = gtk_drawing_area_new(); lg->size = size; lg->data = g_new0(gint, size); @@ -42,12 +45,28 @@ LoadGraph *load_graph_new(gint size) lg->width = size * 4; lg->height = size * 2; + lg->max_value = 1; + lg->remax_count = 0; + + lg->layout = pango_layout_new(gtk_widget_get_pango_context (lg->area)); + gtk_widget_set_size_request(lg->area, lg->width, lg->height); gtk_widget_show(lg->area); return lg; } +void load_graph_set_data_suffix(LoadGraph *lg, gchar *suffix) +{ + g_free(lg->suffix); + lg->suffix = g_strdup(suffix); +} + +gchar *load_graph_get_data_suffix(LoadGraph *lg) +{ + return lg->suffix; +} + GtkWidget *load_graph_get_framed(LoadGraph *lg) { GtkWidget *align, *frame; @@ -73,6 +92,9 @@ void load_graph_clear(LoadGraph *lg) lg->data[i] = 0; lg->scale = 1.0; + lg->max_value = 1; + lg->remax_count = 0; + _draw(lg); } @@ -80,6 +102,8 @@ void load_graph_set_color(LoadGraph *lg, LoadGraphColor color) { lg->color = color; gdk_rgb_gc_set_foreground(lg->trace, lg->color); + gdk_rgb_gc_set_foreground(lg->fill, lg->color - 0x303030); + gdk_rgb_gc_set_foreground(lg->grid, lg->color - 0x404040); } void load_graph_destroy(LoadGraph *lg) @@ -89,6 +113,8 @@ void load_graph_destroy(LoadGraph *lg) gdk_pixmap_unref(lg->buf); g_object_unref(lg->trace); g_object_unref(lg->grid); + g_object_unref(lg->fill); + g_object_unref(lg->layout); g_free(lg); } @@ -116,6 +142,7 @@ void load_graph_configure_expose(LoadGraph *lg) /* create the graphic contexts */ lg->grid = gdk_gc_new(GDK_DRAWABLE(lg->buf)); lg->trace = gdk_gc_new(GDK_DRAWABLE(lg->buf)); + lg->fill = gdk_gc_new(GDK_DRAWABLE(lg->buf)); /* the default color is green */ load_graph_set_color(lg, LG_COLOR_GREEN); @@ -125,19 +152,49 @@ void load_graph_configure_expose(LoadGraph *lg) 1, GDK_LINE_ON_OFF_DASH, GDK_CAP_NOT_LAST, GDK_JOIN_ROUND); +#if 0 /* old-style grid */ gdk_rgb_gc_set_foreground(lg->grid, 0x707070); +#endif gdk_gc_set_line_attributes(lg->trace, - 2, GDK_LINE_SOLID, - GDK_CAP_NOT_LAST, + 1, GDK_LINE_SOLID, + GDK_CAP_PROJECTING, GDK_JOIN_ROUND); +#if 0 /* old-style fill */ + gdk_gc_set_line_attributes(lg->fill, + 1, GDK_LINE_SOLID, + GDK_CAP_BUTT, + GDK_JOIN_BEVEL); +#endif + /* configures the expose event */ g_signal_connect(G_OBJECT(lg->area), "expose-event", (GCallback) _expose, lg); } static void +_draw_label_and_line(LoadGraph *lg, gint position, gint value) +{ + gchar *tmp; + + /* draw lines */ + if (position > 0) + gdk_draw_line(GDK_DRAWABLE(lg->buf), lg->grid, 0, position, lg->width, position); + else + position = -1 * position; + + /* draw label */ + tmp = g_strdup_printf("<span size=\"x-small\">%d%s</span>", value, lg->suffix); + + pango_layout_set_markup(lg->layout, tmp, -1); + pango_layout_set_width(lg->layout, lg->area->allocation.width * PANGO_SCALE); + gdk_draw_layout(GDK_DRAWABLE(lg->buf), lg->trace, 2, position, lg->layout); + + g_free(tmp); +} + +static void _draw(LoadGraph *lg) { GdkDrawable *draw = GDK_DRAWABLE(lg->buf); @@ -147,45 +204,58 @@ _draw(LoadGraph *lg) gdk_draw_rectangle(draw, lg->area->style->black_gc, TRUE, 0, 0, lg->width, lg->height); - /* horizontal bars; 25%, 50% and 75% */ - d = lg->height / 4; - gdk_draw_line(draw, lg->grid, 0, d, lg->width, d); - d = lg->height / 2; - gdk_draw_line(draw, lg->grid, 0, d, lg->width, d); - d = 3 * (lg->height / 4); - gdk_draw_line(draw, lg->grid, 0, d, lg->width, d); + + /* the graph */ + GdkPoint *points = g_new0(GdkPoint, lg->size + 1); + + for (i = 0; i < lg->size; i++) { + points[i].x = i * 4; + points[i].y = lg->height - lg->data[i] * lg->scale; + } + + points[0].x = points[1].x = 0; + points[0].y = points[i].y = lg->height; + points[i].x = points[i-1].x = lg->width; + + gdk_draw_polygon(draw, lg->fill, TRUE, points, lg->size + 1); + gdk_draw_polygon(draw, lg->trace, FALSE, points, lg->size + 1); + + g_free(points); /* vertical bars */ for (i = lg->width, d = 0; i > 1; i--, d++) if ((d % 45) == 0 && d) gdk_draw_line(draw, lg->grid, i, 0, i, lg->height); - /* the graph */ + /* horizontal bars and labels; 25%, 50% and 75% */ + _draw_label_and_line(lg, -1, lg->max_value); + _draw_label_and_line(lg, lg->height / 4, 3 * (lg->max_value / 4)); + _draw_label_and_line(lg, lg->height / 2, lg->max_value / 2); + _draw_label_and_line(lg, 3 * (lg->height / 4), lg->max_value / 4); + +#if 0 /* old-style drawing */ for (i = 0; i < lg->size; i++) { gint this = lg->height - lg->data[i] * lg->scale; gint next = lg->height - lg->data[i+1] * lg->scale; + gint i4 = i * 4; - gdk_draw_line(draw, lg->trace, i * 4, this, i * 4 + 2, - (this + next) / 2); - gdk_draw_line(draw, lg->trace, i * 4 + 2, (this + next) / 2, - i * 4 + 4, next); + gdk_draw_line(draw, lg->fill, i4, this, i4, lg->height); + gdk_draw_line(draw, lg->fill, i4 + 2, this, i4 + 2, lg->height); } - - gtk_widget_queue_draw(lg->area); -} -static inline int -_max(LoadGraph *lg) -{ - gint i; - gint max = 1.0; + for (i = 0; i < lg->size; i++) { + gint this = lg->height - lg->data[i] * lg->scale; + gint next = lg->height - lg->data[i+1] * lg->scale; + gint i4 = i * 4; - for (i = 0; i < lg->size; i++) { - if (lg->data[i] > max) - max = lg->data[i]; + gdk_draw_line(draw, lg->trace, i4, this, i4 + 2, + (this + next) / 2); + gdk_draw_line(draw, lg->trace, i4 + 2, (this + next) / 2, + i4 + 4, next); } - - return max; +#endif + + gtk_widget_queue_draw(lg->area); } void @@ -196,8 +266,6 @@ load_graph_update(LoadGraph *lg, gint value) if (value < 0) return; - lg->scale = (gfloat)lg->height / (gfloat)_max(lg); - /* shift-right our data */ for (i = 0; i < lg->size; i++) { lg->data[i] = lg->data[i+1]; @@ -206,6 +274,27 @@ load_graph_update(LoadGraph *lg, gint value) /* insert the updated value */ lg->data[i] = value; + /* calculates the maximum value */ + if (lg->remax_count++ > 20) { + /* only finds the maximum amongst the data every 20 times */ + lg->remax_count = 0; + + gint max = lg->data[0]; + for (i = 1; i < lg->size; i++) { + if (lg->data[i] > max) + max = lg->data[i]; + } + + lg->max_value = max; + } else { + /* otherwise, select the maximum between the current maximum + and the supplied value */ + lg->max_value = MAX(value, lg->max_value); + } + + /* recalculates the scale; always use 90% of it */ + lg->scale = 0.90 * ((gfloat)lg->height / (gfloat)lg->max_value); + /* redraw */ _draw(lg); } @@ -242,7 +331,7 @@ int main(int argc, char **argv) window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_widget_show(window); - lg = load_graph_new(200); + lg = load_graph_new(50); gtk_container_add(GTK_CONTAINER(window), load_graph_get_framed(lg)); gtk_container_set_border_width(GTK_CONTAINER(window), 20); load_graph_configure_expose(lg); diff --git a/loadgraph.h b/loadgraph.h index fdd967f0..8adfe6b9 100644 --- a/loadgraph.h +++ b/loadgraph.h @@ -39,6 +39,7 @@ struct _LoadGraph { GdkGC *grid; GdkGC *trace; + GdkGC *fill; gint *data; gfloat scale; @@ -46,6 +47,11 @@ struct _LoadGraph { gint size; gint width, height; LoadGraphColor color; + + gint max_value, remax_count; + + PangoLayout *layout; + gchar *suffix; }; LoadGraph *load_graph_new(gint size); @@ -57,4 +63,7 @@ void load_graph_update(LoadGraph *lg, gint value); void load_graph_set_color(LoadGraph *lg, LoadGraphColor color); void load_graph_clear(LoadGraph *lg); +void load_graph_set_data_suffix(LoadGraph *lg, gchar *suffix); +gchar *load_graph_get_data_suffix(LoadGraph *lg); + #endif /* __LOADGRAPH_H__ */ @@ -1,6 +1,6 @@ /* * HardInfo - * Copyright(C) 2003-2006 Leandro A. F. Pereira. + * Copyright(C) 2003-2007 Leandro A. F. Pereira. * * menu.c is based on UI Manager tutorial by Ryan McDougall * Copyright(C) 2005 Ryan McDougall. @@ -24,29 +24,67 @@ #include <config.h> #include <stock.h> -#include <binreloc.h> #include <callbacks.h> +#include <hardinfo.h> + +#include "uidefs.h" static GtkActionEntry entries[] = { - { "FileMenuAction", NULL, "_File" }, /* name, stock id, label */ + { "InformationMenuAction", NULL, "_Information" }, /* name, stock id, label */ { "ViewMenuAction", NULL, "_View" }, { "HelpMenuAction", NULL, "_Help" }, + { "HelpMenuModulesAction", HI_STOCK_ABOUT_MODULES, "About _Modules" }, { "MainMenuBarAction", NULL, "" }, { "ReportAction", HI_STOCK_REPORT, /* name, stock id */ "Generate _Report", "<control>R", /* label, accelerator */ - "Creates a report in HTML", /* tooltip */ + NULL, /* tooltip */ G_CALLBACK(cb_generate_report) }, + { "SyncManagerAction", HI_STOCK_SYNC_MENU, + "_Network Updater...", NULL, + NULL, + G_CALLBACK(cb_sync_manager) }, + + { "CopyAction", GTK_STOCK_COPY, + "_Copy to Clipboard", "<control>C", + NULL, + G_CALLBACK(cb_copy_to_clipboard) }, + + { "SaveGraphAction", GTK_STOCK_SAVE_AS, + "_Save image as...", "<control>S", + NULL, + G_CALLBACK(cb_save_graphic) }, + { "RefreshAction", GTK_STOCK_REFRESH, "_Refresh", "F5", NULL, G_CALLBACK(cb_refresh) }, + { "OnlineDocsAction", GTK_STOCK_HELP, + "Contents (online)", "F1", + NULL, + G_CALLBACK(cb_open_online_docs) }, + + { "HomePageAction", HI_STOCK_INTERNET, + "_Open HardInfo Web Site", NULL, + NULL, + G_CALLBACK(cb_open_web_page) }, + + { "ReportBugAction", HI_STOCK_INTERNET, + "_Report bug", NULL, + NULL, + G_CALLBACK(cb_report_bug) }, + + { "DonateAction", HI_STOCK_DONATE, + "_Donate to the project", NULL, + NULL, + G_CALLBACK(cb_donate) }, + { "AboutAction", GTK_STOCK_ABOUT, - "_About\342\200\246", NULL, + "_About HardInfo", NULL, "Displays program version information", G_CALLBACK(cb_about) }, @@ -83,7 +121,7 @@ void menu_init(Shell *shell) GtkActionGroup *action_group; /* Packing group for our Actions */ GtkUIManager *menu_manager; /* The magic widget! */ GError *error; /* For reporting exceptions or errors */ - gchar *uidefs_path; + GtkAccelGroup *accel_group; /* Create our objects */ menu_box = shell->vbox; @@ -105,16 +143,18 @@ void menu_init(Shell *shell) /* Read in the UI from our XML file */ error = NULL; - uidefs_path = g_strdup_printf("%s/hardinfo/uidefs.xml", - gbr_find_data_dir(PREFIX)); - gtk_ui_manager_add_ui_from_file(menu_manager, uidefs_path, &error); - g_free(uidefs_path); + gtk_ui_manager_add_ui_from_string(menu_manager, uidefs_str, -1, &error); if (error) { - g_error("building menus failed: %s", error->message); + g_error("Building menus failed: %s", error->message); g_error_free(error); + return; } + /* Enable menu accelerators */ + accel_group = gtk_ui_manager_get_accel_group(menu_manager); + gtk_window_add_accel_group(GTK_WINDOW(shell->window), accel_group); + /* Connect up important signals */ /* This signal is necessary in order to place widgets from the UI manager * into the menu_box */ @@ -128,3 +168,4 @@ void menu_init(Shell *shell) gtk_toolbar_set_style(GTK_TOOLBAR(gtk_ui_manager_get_widget(shell->ui_manager, "/MainMenuBarAction")), GTK_TOOLBAR_BOTH_HORIZ); } + @@ -1,6 +1,6 @@ /* * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> + * Copyright (C) 2003-2007 Leandro A. F. Pereira <leandro@linuxmag.com.br> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/modules.conf b/modules.conf deleted file mode 100644 index 1dbaf07f..00000000 --- a/modules.conf +++ /dev/null @@ -1,7 +0,0 @@ -[general] -version=2 - -[categories] -Computer=computer -Devices=devices -Benchmarks=benchmark diff --git a/modules/.svn/README.txt b/modules/.svn/README.txt deleted file mode 100644 index 271a8ce9..00000000 --- a/modules/.svn/README.txt +++ /dev/null @@ -1,2 +0,0 @@ -This is a Subversion working copy administrative directory. -Visit http://subversion.tigris.org/ for more information. diff --git a/modules/.svn/empty-file b/modules/.svn/empty-file deleted file mode 100644 index e69de29b..00000000 --- a/modules/.svn/empty-file +++ /dev/null diff --git a/modules/.svn/entries b/modules/.svn/entries deleted file mode 100644 index 90d66dfe..00000000 --- a/modules/.svn/entries +++ /dev/null @@ -1,14 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<wc-entries - xmlns="svn:"> -<entry - committed-rev="1" - name="" - committed-date="2006-01-23T22:38:33.949992Z" - url="svn+ssh://lafp@svn.berlios.de/svnroot/repos/hardinfo/trunk/hardinfo2/modules" - last-author="lafp" - kind="dir" - uuid="03931a0e-0c0b-0410-87e6-c9e79dddb921" - repos="svn+ssh://lafp@svn.berlios.de/svnroot/repos/hardinfo" - revision="9"/> -</wc-entries> diff --git a/modules/.svn/format b/modules/.svn/format deleted file mode 100644 index b8626c4c..00000000 --- a/modules/.svn/format +++ /dev/null @@ -1 +0,0 @@ -4 diff --git a/pixmaps/.svn/README.txt b/pixmaps/.svn/README.txt deleted file mode 100644 index 271a8ce9..00000000 --- a/pixmaps/.svn/README.txt +++ /dev/null @@ -1,2 +0,0 @@ -This is a Subversion working copy administrative directory. -Visit http://subversion.tigris.org/ for more information. diff --git a/pixmaps/.svn/empty-file b/pixmaps/.svn/empty-file deleted file mode 100644 index e69de29b..00000000 --- a/pixmaps/.svn/empty-file +++ /dev/null diff --git a/pixmaps/.svn/entries b/pixmaps/.svn/entries deleted file mode 100644 index f0997b31..00000000 --- a/pixmaps/.svn/entries +++ /dev/null @@ -1,392 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<wc-entries - xmlns="svn:"> -<entry - committed-rev="6" - name="" - committed-date="2006-02-01T00:16:21.615454Z" - url="svn+ssh://lafp@svn.berlios.de/svnroot/repos/hardinfo/trunk/hardinfo2/pixmaps" - last-author="lafp" - kind="dir" - uuid="03931a0e-0c0b-0410-87e6-c9e79dddb921" - repos="svn+ssh://lafp@svn.berlios.de/svnroot/repos/hardinfo" - revision="9"/> -<entry - committed-rev="1" - name="summary.png" - text-time="2006-05-20T14:29:17.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="a9d6ded28f002c874e0fb79fa8949e5f" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:12.000000Z"/> -<entry - committed-rev="1" - name="logo.png" - text-time="2006-05-20T14:29:17.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="85e2abf56019567740f500a8e2b39608" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:12.000000Z"/> -<entry - committed-rev="1" - name="stock_insert-floating-frame.png" - text-time="2006-05-20T14:29:17.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="87ae84753f8a903a191e41fec6ef02ff" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:12.000000Z"/> -<entry - committed-rev="1" - name="stock_landline-phone.png" - text-time="2006-05-20T14:29:17.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="4ef6e2ef7957bdea17ac1bb50795bf77" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:12.000000Z"/> -<entry - committed-rev="1" - name="modem.png" - text-time="2006-05-20T14:29:17.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="42cbe5be11199802965e899cfb28abeb" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:13.000000Z"/> -<entry - committed-rev="1" - name="audio.png" - text-time="2006-05-20T14:29:17.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="93ab5e1e696d7362c8355f1df8f1d7cb" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:13.000000Z"/> -<entry - committed-rev="1" - name="users.png" - text-time="2006-05-20T14:29:17.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="fc33f8963339d94813d7cdbe5404f6ec" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:14.000000Z"/> -<entry - committed-rev="1" - name="gnome-devel.png" - text-time="2006-05-20T14:29:17.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="20e3e38f1d86dd671273998ad4fe63d9" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:14.000000Z"/> -<entry - committed-rev="1" - name="memory.png" - text-time="2006-05-20T14:29:17.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="9295d4f95dd498bc4c3f507565575821" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:14.000000Z"/> -<entry - committed-rev="1" - name="report.png" - text-time="2006-05-20T14:29:17.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="066eb116d563678a15b10efc0d3ccabf" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:14.000000Z"/> -<entry - committed-rev="6" - name="blowfish.png" - text-time="2006-05-20T14:29:17.000000Z" - committed-date="2006-02-01T00:16:21.615454Z" - checksum="6e3c404f98db9cdd6cd805d540ab8693" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:14.000000Z"/> -<entry - committed-rev="1" - name="therm.png" - text-time="2006-05-20T14:29:17.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="e5e4fde3f3f7982e0b7cdda193a58805" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:14.000000Z"/> -<entry - committed-rev="1" - name="2computer.png" - text-time="2006-05-20T14:29:17.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="85b582b30dffe586caac29eefe81e00e" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:15.000000Z"/> -<entry - committed-rev="1" - name="printer.png" - text-time="2006-05-20T14:29:17.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="cb9e0a5627ceac6fefd42ddcd2cf977e" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:15.000000Z"/> -<entry - committed-rev="1" - name="shares.png" - text-time="2006-05-20T14:29:17.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="f4fe4bc222ad97256f99557d6872c2d2" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:15.000000Z"/> -<entry - committed-rev="1" - name="module.png" - text-time="2006-05-20T14:29:17.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="83b4363d1cf9fdff4760037d2a59e076" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:15.000000Z"/> -<entry - committed-rev="1" - name="monitor.png" - text-time="2006-05-20T14:29:17.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="636022f4b604e02f2720aea6ddf23312" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:15.000000Z"/> -<entry - committed-rev="1" - name="mouse.png" - text-time="2006-05-20T14:29:17.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="5c765f041386a207781da07fceed8148" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:15.000000Z"/> -<entry - committed-rev="1" - name="usb.png" - text-time="2006-05-20T14:29:17.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="3d5a5e1e5c6800847846a720af2e97ce" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:15.000000Z"/> -<entry - committed-rev="1" - name="pcmcia.png" - text-time="2006-05-20T14:29:17.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="7eb8225b5f386a5ed878bc113f4b81e4" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:15.000000Z"/> -<entry - committed-rev="1" - name="computer.png" - text-time="2006-05-20T14:29:17.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="12a17e8564be0b014c6874128d4dbc36" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:15.000000Z"/> -<entry - committed-rev="1" - name="hdd.png" - text-time="2006-05-20T14:29:17.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="fffb2b30c58524803b8457b56086dd5f" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:16.000000Z"/> -<entry - committed-rev="1" - name="joystick.png" - text-time="2006-05-20T14:29:17.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="db0bea8794512479611203e45582d9cd" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:15.000000Z"/> -<entry - committed-rev="1" - name="graphics.png" - text-time="2006-05-20T14:29:17.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="1a38c3b7adc2b72dcd538dd23a36dcde" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:16.000000Z"/> -<entry - committed-rev="1" - name="keyboard.png" - text-time="2006-05-20T14:29:17.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="48ef165578c8be9e2af97b01d98b68eb" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:16.000000Z"/> -<entry - committed-rev="1" - name="cdrom.png" - text-time="2006-05-20T14:29:17.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="e77d805d434d1482412f2de8d9ef62df" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:16.000000Z"/> -<entry - committed-rev="1" - name="dev_removable.png" - text-time="2006-05-20T14:29:17.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="e4e2e82f7517445d925fd14fd0db637d" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:16.000000Z"/> -<entry - committed-rev="1" - name="stock_channel.png" - text-time="2006-05-20T14:29:17.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="d82c996e84871033efc70e4ee0d6d775" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:16.000000Z"/> -<entry - committed-rev="1" - name="gnome-terminal.png" - text-time="2006-05-20T14:29:17.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="2d9255fc2e8cefea6181dd3449524d3c" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:16.000000Z"/> -<entry - committed-rev="1" - name="processor.png" - text-time="2006-05-20T14:29:17.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="5f754a1643fbfb092ca250537f3a733c" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:16.000000Z"/> -<entry - committed-rev="1" - name="os.png" - text-time="2006-05-20T14:29:17.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="baef99d412ace692fb69a591b70d2c12" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:16.000000Z"/> -<entry - committed-rev="1" - name="devices.png" - text-time="2006-05-20T14:29:17.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="8aed2ee6a7d3e8711ffea772ad8ce71b" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:16.000000Z"/> -<entry - committed-rev="1" - name="gnome-dev-removable-usb.png" - text-time="2006-05-20T14:29:17.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="057bb39eae2fbf728c7e7c17c84ee17b" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:16.000000Z"/> -<entry - committed-rev="1" - name="gnome-window-manager.png" - text-time="2006-05-20T14:29:17.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="29f548137b14f0db606cad3ea03fadaa" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:16.000000Z"/> -<entry - committed-rev="1" - name="language.png" - text-time="2006-05-20T14:29:17.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="f9419fbbc3b70e5623d635996ef0e2d8" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:16.000000Z"/> -<entry - committed-rev="1" - name="athlon.png" - text-time="2006-05-20T14:29:17.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="a0a3fe2b1e5088151ee8b3bd51397d04" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:16.000000Z"/> -<entry - committed-rev="1" - name="network.png" - text-time="2006-05-20T14:29:17.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="f8494f9f1d6d7b7bd239e6f7f246c33e" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:17.000000Z"/> -<entry - committed-rev="1" - name="kblayout.png" - text-time="2006-05-20T14:29:17.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="ab1b9c8be7f41046c976f9a9263d41a3" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:17.000000Z"/> -<entry - committed-rev="1" - name="benchmark.png" - text-time="2006-05-20T14:29:17.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="d89b36e03b6c226c63dcc01ef038415f" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:17.000000Z"/> -<entry - committed-rev="1" - name="videocap.png" - text-time="2006-05-20T14:29:17.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="166460b7a5dfe66772dceb01b41cad5d" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:17.000000Z"/> -<entry - committed-rev="1" - name="compress.png" - text-time="2006-05-20T14:29:17.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="303364092a6462360a2d2624f0bc87c2" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:17.000000Z"/> -<entry - committed-rev="1" - name="stock_macro-watch-variable.png" - text-time="2006-05-20T14:29:17.000000Z" - committed-date="2006-01-23T22:38:33.949992Z" - checksum="de4a9322d90a29ecea17222b5cfdce90" - last-author="lafp" - kind="file" - prop-time="2006-05-20T14:29:17.000000Z"/> -</wc-entries> diff --git a/pixmaps/.svn/format b/pixmaps/.svn/format deleted file mode 100644 index b8626c4c..00000000 --- a/pixmaps/.svn/format +++ /dev/null @@ -1 +0,0 @@ -4 diff --git a/pixmaps/.svn/prop-base/2computer.png.svn-base b/pixmaps/.svn/prop-base/2computer.png.svn-base deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/prop-base/2computer.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/prop-base/athlon.png.svn-base b/pixmaps/.svn/prop-base/athlon.png.svn-base deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/prop-base/athlon.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/prop-base/audio.png.svn-base b/pixmaps/.svn/prop-base/audio.png.svn-base deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/prop-base/audio.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/prop-base/benchmark.png.svn-base b/pixmaps/.svn/prop-base/benchmark.png.svn-base deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/prop-base/benchmark.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/prop-base/blowfish.png.svn-base b/pixmaps/.svn/prop-base/blowfish.png.svn-base deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/prop-base/blowfish.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/prop-base/cdrom.png.svn-base b/pixmaps/.svn/prop-base/cdrom.png.svn-base deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/prop-base/cdrom.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/prop-base/compress.png.svn-base b/pixmaps/.svn/prop-base/compress.png.svn-base deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/prop-base/compress.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/prop-base/computer.png.svn-base b/pixmaps/.svn/prop-base/computer.png.svn-base deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/prop-base/computer.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/prop-base/dev_removable.png.svn-base b/pixmaps/.svn/prop-base/dev_removable.png.svn-base deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/prop-base/dev_removable.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/prop-base/devices.png.svn-base b/pixmaps/.svn/prop-base/devices.png.svn-base deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/prop-base/devices.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/prop-base/gnome-dev-removable-usb.png.svn-base b/pixmaps/.svn/prop-base/gnome-dev-removable-usb.png.svn-base deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/prop-base/gnome-dev-removable-usb.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/prop-base/gnome-devel.png.svn-base b/pixmaps/.svn/prop-base/gnome-devel.png.svn-base deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/prop-base/gnome-devel.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/prop-base/gnome-terminal.png.svn-base b/pixmaps/.svn/prop-base/gnome-terminal.png.svn-base deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/prop-base/gnome-terminal.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/prop-base/gnome-window-manager.png.svn-base b/pixmaps/.svn/prop-base/gnome-window-manager.png.svn-base deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/prop-base/gnome-window-manager.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/prop-base/graphics.png.svn-base b/pixmaps/.svn/prop-base/graphics.png.svn-base deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/prop-base/graphics.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/prop-base/hdd.png.svn-base b/pixmaps/.svn/prop-base/hdd.png.svn-base deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/prop-base/hdd.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/prop-base/joystick.png.svn-base b/pixmaps/.svn/prop-base/joystick.png.svn-base deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/prop-base/joystick.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/prop-base/kblayout.png.svn-base b/pixmaps/.svn/prop-base/kblayout.png.svn-base deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/prop-base/kblayout.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/prop-base/keyboard.png.svn-base b/pixmaps/.svn/prop-base/keyboard.png.svn-base deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/prop-base/keyboard.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/prop-base/language.png.svn-base b/pixmaps/.svn/prop-base/language.png.svn-base deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/prop-base/language.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/prop-base/logo.png.svn-base b/pixmaps/.svn/prop-base/logo.png.svn-base deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/prop-base/logo.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/prop-base/memory.png.svn-base b/pixmaps/.svn/prop-base/memory.png.svn-base deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/prop-base/memory.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/prop-base/modem.png.svn-base b/pixmaps/.svn/prop-base/modem.png.svn-base deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/prop-base/modem.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/prop-base/module.png.svn-base b/pixmaps/.svn/prop-base/module.png.svn-base deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/prop-base/module.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/prop-base/monitor.png.svn-base b/pixmaps/.svn/prop-base/monitor.png.svn-base deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/prop-base/monitor.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/prop-base/mouse.png.svn-base b/pixmaps/.svn/prop-base/mouse.png.svn-base deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/prop-base/mouse.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/prop-base/network.png.svn-base b/pixmaps/.svn/prop-base/network.png.svn-base deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/prop-base/network.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/prop-base/os.png.svn-base b/pixmaps/.svn/prop-base/os.png.svn-base deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/prop-base/os.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/prop-base/pcmcia.png.svn-base b/pixmaps/.svn/prop-base/pcmcia.png.svn-base deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/prop-base/pcmcia.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/prop-base/printer.png.svn-base b/pixmaps/.svn/prop-base/printer.png.svn-base deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/prop-base/printer.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/prop-base/processor.png.svn-base b/pixmaps/.svn/prop-base/processor.png.svn-base deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/prop-base/processor.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/prop-base/report.png.svn-base b/pixmaps/.svn/prop-base/report.png.svn-base deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/prop-base/report.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/prop-base/shares.png.svn-base b/pixmaps/.svn/prop-base/shares.png.svn-base deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/prop-base/shares.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/prop-base/stock_channel.png.svn-base b/pixmaps/.svn/prop-base/stock_channel.png.svn-base deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/prop-base/stock_channel.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/prop-base/stock_insert-floating-frame.png.svn-base b/pixmaps/.svn/prop-base/stock_insert-floating-frame.png.svn-base deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/prop-base/stock_insert-floating-frame.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/prop-base/stock_landline-phone.png.svn-base b/pixmaps/.svn/prop-base/stock_landline-phone.png.svn-base deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/prop-base/stock_landline-phone.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/prop-base/stock_macro-watch-variable.png.svn-base b/pixmaps/.svn/prop-base/stock_macro-watch-variable.png.svn-base deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/prop-base/stock_macro-watch-variable.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/prop-base/summary.png.svn-base b/pixmaps/.svn/prop-base/summary.png.svn-base deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/prop-base/summary.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/prop-base/therm.png.svn-base b/pixmaps/.svn/prop-base/therm.png.svn-base deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/prop-base/therm.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/prop-base/usb.png.svn-base b/pixmaps/.svn/prop-base/usb.png.svn-base deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/prop-base/usb.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/prop-base/users.png.svn-base b/pixmaps/.svn/prop-base/users.png.svn-base deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/prop-base/users.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/prop-base/videocap.png.svn-base b/pixmaps/.svn/prop-base/videocap.png.svn-base deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/prop-base/videocap.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/props/2computer.png.svn-work b/pixmaps/.svn/props/2computer.png.svn-work deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/props/2computer.png.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/props/athlon.png.svn-work b/pixmaps/.svn/props/athlon.png.svn-work deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/props/athlon.png.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/props/audio.png.svn-work b/pixmaps/.svn/props/audio.png.svn-work deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/props/audio.png.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/props/benchmark.png.svn-work b/pixmaps/.svn/props/benchmark.png.svn-work deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/props/benchmark.png.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/props/blowfish.png.svn-work b/pixmaps/.svn/props/blowfish.png.svn-work deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/props/blowfish.png.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/props/cdrom.png.svn-work b/pixmaps/.svn/props/cdrom.png.svn-work deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/props/cdrom.png.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/props/compress.png.svn-work b/pixmaps/.svn/props/compress.png.svn-work deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/props/compress.png.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/props/computer.png.svn-work b/pixmaps/.svn/props/computer.png.svn-work deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/props/computer.png.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/props/dev_removable.png.svn-work b/pixmaps/.svn/props/dev_removable.png.svn-work deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/props/dev_removable.png.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/props/devices.png.svn-work b/pixmaps/.svn/props/devices.png.svn-work deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/props/devices.png.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/props/gnome-dev-removable-usb.png.svn-work b/pixmaps/.svn/props/gnome-dev-removable-usb.png.svn-work deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/props/gnome-dev-removable-usb.png.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/props/gnome-devel.png.svn-work b/pixmaps/.svn/props/gnome-devel.png.svn-work deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/props/gnome-devel.png.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/props/gnome-terminal.png.svn-work b/pixmaps/.svn/props/gnome-terminal.png.svn-work deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/props/gnome-terminal.png.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/props/gnome-window-manager.png.svn-work b/pixmaps/.svn/props/gnome-window-manager.png.svn-work deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/props/gnome-window-manager.png.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/props/graphics.png.svn-work b/pixmaps/.svn/props/graphics.png.svn-work deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/props/graphics.png.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/props/hdd.png.svn-work b/pixmaps/.svn/props/hdd.png.svn-work deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/props/hdd.png.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/props/joystick.png.svn-work b/pixmaps/.svn/props/joystick.png.svn-work deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/props/joystick.png.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/props/kblayout.png.svn-work b/pixmaps/.svn/props/kblayout.png.svn-work deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/props/kblayout.png.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/props/keyboard.png.svn-work b/pixmaps/.svn/props/keyboard.png.svn-work deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/props/keyboard.png.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/props/language.png.svn-work b/pixmaps/.svn/props/language.png.svn-work deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/props/language.png.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/props/logo.png.svn-work b/pixmaps/.svn/props/logo.png.svn-work deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/props/logo.png.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/props/memory.png.svn-work b/pixmaps/.svn/props/memory.png.svn-work deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/props/memory.png.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/props/modem.png.svn-work b/pixmaps/.svn/props/modem.png.svn-work deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/props/modem.png.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/props/module.png.svn-work b/pixmaps/.svn/props/module.png.svn-work deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/props/module.png.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/props/monitor.png.svn-work b/pixmaps/.svn/props/monitor.png.svn-work deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/props/monitor.png.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/props/mouse.png.svn-work b/pixmaps/.svn/props/mouse.png.svn-work deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/props/mouse.png.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/props/network.png.svn-work b/pixmaps/.svn/props/network.png.svn-work deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/props/network.png.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/props/os.png.svn-work b/pixmaps/.svn/props/os.png.svn-work deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/props/os.png.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/props/pcmcia.png.svn-work b/pixmaps/.svn/props/pcmcia.png.svn-work deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/props/pcmcia.png.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/props/printer.png.svn-work b/pixmaps/.svn/props/printer.png.svn-work deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/props/printer.png.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/props/processor.png.svn-work b/pixmaps/.svn/props/processor.png.svn-work deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/props/processor.png.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/props/report.png.svn-work b/pixmaps/.svn/props/report.png.svn-work deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/props/report.png.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/props/shares.png.svn-work b/pixmaps/.svn/props/shares.png.svn-work deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/props/shares.png.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/props/stock_channel.png.svn-work b/pixmaps/.svn/props/stock_channel.png.svn-work deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/props/stock_channel.png.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/props/stock_insert-floating-frame.png.svn-work b/pixmaps/.svn/props/stock_insert-floating-frame.png.svn-work deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/props/stock_insert-floating-frame.png.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/props/stock_landline-phone.png.svn-work b/pixmaps/.svn/props/stock_landline-phone.png.svn-work deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/props/stock_landline-phone.png.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/props/stock_macro-watch-variable.png.svn-work b/pixmaps/.svn/props/stock_macro-watch-variable.png.svn-work deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/props/stock_macro-watch-variable.png.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/props/summary.png.svn-work b/pixmaps/.svn/props/summary.png.svn-work deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/props/summary.png.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/props/therm.png.svn-work b/pixmaps/.svn/props/therm.png.svn-work deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/props/therm.png.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/props/usb.png.svn-work b/pixmaps/.svn/props/usb.png.svn-work deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/props/usb.png.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/props/users.png.svn-work b/pixmaps/.svn/props/users.png.svn-work deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/props/users.png.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/props/videocap.png.svn-work b/pixmaps/.svn/props/videocap.png.svn-work deleted file mode 100644 index 5e9587e6..00000000 --- a/pixmaps/.svn/props/videocap.png.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/pixmaps/.svn/text-base/2computer.png.svn-base b/pixmaps/.svn/text-base/2computer.png.svn-base Binary files differdeleted file mode 100644 index 46f29204..00000000 --- a/pixmaps/.svn/text-base/2computer.png.svn-base +++ /dev/null diff --git a/pixmaps/.svn/text-base/athlon.png.svn-base b/pixmaps/.svn/text-base/athlon.png.svn-base Binary files differdeleted file mode 100644 index 81a1b314..00000000 --- a/pixmaps/.svn/text-base/athlon.png.svn-base +++ /dev/null diff --git a/pixmaps/.svn/text-base/audio.png.svn-base b/pixmaps/.svn/text-base/audio.png.svn-base Binary files differdeleted file mode 100644 index 45096651..00000000 --- a/pixmaps/.svn/text-base/audio.png.svn-base +++ /dev/null diff --git a/pixmaps/.svn/text-base/benchmark.png.svn-base b/pixmaps/.svn/text-base/benchmark.png.svn-base Binary files differdeleted file mode 100644 index 1be159b7..00000000 --- a/pixmaps/.svn/text-base/benchmark.png.svn-base +++ /dev/null diff --git a/pixmaps/.svn/text-base/blowfish.png.svn-base b/pixmaps/.svn/text-base/blowfish.png.svn-base Binary files differdeleted file mode 100644 index 22c68614..00000000 --- a/pixmaps/.svn/text-base/blowfish.png.svn-base +++ /dev/null diff --git a/pixmaps/.svn/text-base/cdrom.png.svn-base b/pixmaps/.svn/text-base/cdrom.png.svn-base Binary files differdeleted file mode 100644 index eb65bcbb..00000000 --- a/pixmaps/.svn/text-base/cdrom.png.svn-base +++ /dev/null diff --git a/pixmaps/.svn/text-base/compress.png.svn-base b/pixmaps/.svn/text-base/compress.png.svn-base Binary files differdeleted file mode 100644 index e5dee194..00000000 --- a/pixmaps/.svn/text-base/compress.png.svn-base +++ /dev/null diff --git a/pixmaps/.svn/text-base/computer.png.svn-base b/pixmaps/.svn/text-base/computer.png.svn-base Binary files differdeleted file mode 100644 index f0de0386..00000000 --- a/pixmaps/.svn/text-base/computer.png.svn-base +++ /dev/null diff --git a/pixmaps/.svn/text-base/dev_removable.png.svn-base b/pixmaps/.svn/text-base/dev_removable.png.svn-base Binary files differdeleted file mode 100644 index 2453d8dc..00000000 --- a/pixmaps/.svn/text-base/dev_removable.png.svn-base +++ /dev/null diff --git a/pixmaps/.svn/text-base/devices.png.svn-base b/pixmaps/.svn/text-base/devices.png.svn-base Binary files differdeleted file mode 100644 index 0ad1400b..00000000 --- a/pixmaps/.svn/text-base/devices.png.svn-base +++ /dev/null diff --git a/pixmaps/.svn/text-base/gnome-dev-removable-usb.png.svn-base b/pixmaps/.svn/text-base/gnome-dev-removable-usb.png.svn-base Binary files differdeleted file mode 100644 index fb83bab2..00000000 --- a/pixmaps/.svn/text-base/gnome-dev-removable-usb.png.svn-base +++ /dev/null diff --git a/pixmaps/.svn/text-base/gnome-devel.png.svn-base b/pixmaps/.svn/text-base/gnome-devel.png.svn-base Binary files differdeleted file mode 100644 index 4c63e7dd..00000000 --- a/pixmaps/.svn/text-base/gnome-devel.png.svn-base +++ /dev/null diff --git a/pixmaps/.svn/text-base/gnome-terminal.png.svn-base b/pixmaps/.svn/text-base/gnome-terminal.png.svn-base Binary files differdeleted file mode 100644 index 2fe2d14d..00000000 --- a/pixmaps/.svn/text-base/gnome-terminal.png.svn-base +++ /dev/null diff --git a/pixmaps/.svn/text-base/gnome-window-manager.png.svn-base b/pixmaps/.svn/text-base/gnome-window-manager.png.svn-base Binary files differdeleted file mode 100644 index d5f0d3d9..00000000 --- a/pixmaps/.svn/text-base/gnome-window-manager.png.svn-base +++ /dev/null diff --git a/pixmaps/.svn/text-base/graphics.png.svn-base b/pixmaps/.svn/text-base/graphics.png.svn-base Binary files differdeleted file mode 100644 index a70492c1..00000000 --- a/pixmaps/.svn/text-base/graphics.png.svn-base +++ /dev/null diff --git a/pixmaps/.svn/text-base/hdd.png.svn-base b/pixmaps/.svn/text-base/hdd.png.svn-base Binary files differdeleted file mode 100644 index bbcdc825..00000000 --- a/pixmaps/.svn/text-base/hdd.png.svn-base +++ /dev/null diff --git a/pixmaps/.svn/text-base/joystick.png.svn-base b/pixmaps/.svn/text-base/joystick.png.svn-base Binary files differdeleted file mode 100644 index 954cca4b..00000000 --- a/pixmaps/.svn/text-base/joystick.png.svn-base +++ /dev/null diff --git a/pixmaps/.svn/text-base/kblayout.png.svn-base b/pixmaps/.svn/text-base/kblayout.png.svn-base Binary files differdeleted file mode 100644 index b99e27d1..00000000 --- a/pixmaps/.svn/text-base/kblayout.png.svn-base +++ /dev/null diff --git a/pixmaps/.svn/text-base/keyboard.png.svn-base b/pixmaps/.svn/text-base/keyboard.png.svn-base Binary files differdeleted file mode 100644 index a716f07e..00000000 --- a/pixmaps/.svn/text-base/keyboard.png.svn-base +++ /dev/null diff --git a/pixmaps/.svn/text-base/language.png.svn-base b/pixmaps/.svn/text-base/language.png.svn-base Binary files differdeleted file mode 100644 index ab82b50f..00000000 --- a/pixmaps/.svn/text-base/language.png.svn-base +++ /dev/null diff --git a/pixmaps/.svn/text-base/logo.png.svn-base b/pixmaps/.svn/text-base/logo.png.svn-base Binary files differdeleted file mode 100644 index d2dee31e..00000000 --- a/pixmaps/.svn/text-base/logo.png.svn-base +++ /dev/null diff --git a/pixmaps/.svn/text-base/memory.png.svn-base b/pixmaps/.svn/text-base/memory.png.svn-base Binary files differdeleted file mode 100644 index 1ea66b8a..00000000 --- a/pixmaps/.svn/text-base/memory.png.svn-base +++ /dev/null diff --git a/pixmaps/.svn/text-base/modem.png.svn-base b/pixmaps/.svn/text-base/modem.png.svn-base Binary files differdeleted file mode 100644 index 8d1ea2b0..00000000 --- a/pixmaps/.svn/text-base/modem.png.svn-base +++ /dev/null diff --git a/pixmaps/.svn/text-base/module.png.svn-base b/pixmaps/.svn/text-base/module.png.svn-base Binary files differdeleted file mode 100644 index 8f1279d0..00000000 --- a/pixmaps/.svn/text-base/module.png.svn-base +++ /dev/null diff --git a/pixmaps/.svn/text-base/monitor.png.svn-base b/pixmaps/.svn/text-base/monitor.png.svn-base Binary files differdeleted file mode 100644 index 669086a4..00000000 --- a/pixmaps/.svn/text-base/monitor.png.svn-base +++ /dev/null diff --git a/pixmaps/.svn/text-base/mouse.png.svn-base b/pixmaps/.svn/text-base/mouse.png.svn-base Binary files differdeleted file mode 100644 index 4043722d..00000000 --- a/pixmaps/.svn/text-base/mouse.png.svn-base +++ /dev/null diff --git a/pixmaps/.svn/text-base/network.png.svn-base b/pixmaps/.svn/text-base/network.png.svn-base Binary files differdeleted file mode 100644 index f8c623b6..00000000 --- a/pixmaps/.svn/text-base/network.png.svn-base +++ /dev/null diff --git a/pixmaps/.svn/text-base/os.png.svn-base b/pixmaps/.svn/text-base/os.png.svn-base Binary files differdeleted file mode 100644 index 166c2201..00000000 --- a/pixmaps/.svn/text-base/os.png.svn-base +++ /dev/null diff --git a/pixmaps/.svn/text-base/pcmcia.png.svn-base b/pixmaps/.svn/text-base/pcmcia.png.svn-base Binary files differdeleted file mode 100644 index 2baac660..00000000 --- a/pixmaps/.svn/text-base/pcmcia.png.svn-base +++ /dev/null diff --git a/pixmaps/.svn/text-base/printer.png.svn-base b/pixmaps/.svn/text-base/printer.png.svn-base Binary files differdeleted file mode 100644 index dd814d6c..00000000 --- a/pixmaps/.svn/text-base/printer.png.svn-base +++ /dev/null diff --git a/pixmaps/.svn/text-base/processor.png.svn-base b/pixmaps/.svn/text-base/processor.png.svn-base Binary files differdeleted file mode 100644 index 7b2a3fb1..00000000 --- a/pixmaps/.svn/text-base/processor.png.svn-base +++ /dev/null diff --git a/pixmaps/.svn/text-base/report.png.svn-base b/pixmaps/.svn/text-base/report.png.svn-base Binary files differdeleted file mode 100644 index 48bd5d01..00000000 --- a/pixmaps/.svn/text-base/report.png.svn-base +++ /dev/null diff --git a/pixmaps/.svn/text-base/shares.png.svn-base b/pixmaps/.svn/text-base/shares.png.svn-base Binary files differdeleted file mode 100644 index ab4e197d..00000000 --- a/pixmaps/.svn/text-base/shares.png.svn-base +++ /dev/null diff --git a/pixmaps/.svn/text-base/stock_channel.png.svn-base b/pixmaps/.svn/text-base/stock_channel.png.svn-base Binary files differdeleted file mode 100644 index 2a74f2e6..00000000 --- a/pixmaps/.svn/text-base/stock_channel.png.svn-base +++ /dev/null diff --git a/pixmaps/.svn/text-base/stock_insert-floating-frame.png.svn-base b/pixmaps/.svn/text-base/stock_insert-floating-frame.png.svn-base Binary files differdeleted file mode 100644 index 8f82250f..00000000 --- a/pixmaps/.svn/text-base/stock_insert-floating-frame.png.svn-base +++ /dev/null diff --git a/pixmaps/.svn/text-base/stock_landline-phone.png.svn-base b/pixmaps/.svn/text-base/stock_landline-phone.png.svn-base Binary files differdeleted file mode 100644 index 61da5dab..00000000 --- a/pixmaps/.svn/text-base/stock_landline-phone.png.svn-base +++ /dev/null diff --git a/pixmaps/.svn/text-base/stock_macro-watch-variable.png.svn-base b/pixmaps/.svn/text-base/stock_macro-watch-variable.png.svn-base Binary files differdeleted file mode 100644 index 2e52ddc9..00000000 --- a/pixmaps/.svn/text-base/stock_macro-watch-variable.png.svn-base +++ /dev/null diff --git a/pixmaps/.svn/text-base/summary.png.svn-base b/pixmaps/.svn/text-base/summary.png.svn-base Binary files differdeleted file mode 100644 index 5a2cd965..00000000 --- a/pixmaps/.svn/text-base/summary.png.svn-base +++ /dev/null diff --git a/pixmaps/.svn/text-base/therm.png.svn-base b/pixmaps/.svn/text-base/therm.png.svn-base Binary files differdeleted file mode 100644 index 3dac3913..00000000 --- a/pixmaps/.svn/text-base/therm.png.svn-base +++ /dev/null diff --git a/pixmaps/.svn/text-base/usb.png.svn-base b/pixmaps/.svn/text-base/usb.png.svn-base Binary files differdeleted file mode 100644 index 7c7c6746..00000000 --- a/pixmaps/.svn/text-base/usb.png.svn-base +++ /dev/null diff --git a/pixmaps/.svn/text-base/users.png.svn-base b/pixmaps/.svn/text-base/users.png.svn-base Binary files differdeleted file mode 100644 index cbc62084..00000000 --- a/pixmaps/.svn/text-base/users.png.svn-base +++ /dev/null diff --git a/pixmaps/.svn/text-base/videocap.png.svn-base b/pixmaps/.svn/text-base/videocap.png.svn-base Binary files differdeleted file mode 100644 index 8bbea0ba..00000000 --- a/pixmaps/.svn/text-base/videocap.png.svn-base +++ /dev/null diff --git a/pixmaps/2computer.png b/pixmaps/2computer.png Binary files differdeleted file mode 100644 index 46f29204..00000000 --- a/pixmaps/2computer.png +++ /dev/null diff --git a/pixmaps/about-modules.png b/pixmaps/about-modules.png Binary files differnew file mode 100644 index 00000000..0d49f9df --- /dev/null +++ b/pixmaps/about-modules.png diff --git a/pixmaps/athlon.png b/pixmaps/athlon.png Binary files differdeleted file mode 100644 index 81a1b314..00000000 --- a/pixmaps/athlon.png +++ /dev/null diff --git a/pixmaps/audio.png b/pixmaps/audio.png Binary files differindex 45096651..93d99aa4 100644 --- a/pixmaps/audio.png +++ b/pixmaps/audio.png diff --git a/pixmaps/battery.png b/pixmaps/battery.png Binary files differnew file mode 100644 index 00000000..ad456749 --- /dev/null +++ b/pixmaps/battery.png diff --git a/pixmaps/boot.png b/pixmaps/boot.png Binary files differnew file mode 100644 index 00000000..aef0e91a --- /dev/null +++ b/pixmaps/boot.png diff --git a/pixmaps/cdrom.png b/pixmaps/cdrom.png Binary files differindex eb65bcbb..af2c8261 100644 --- a/pixmaps/cdrom.png +++ b/pixmaps/cdrom.png diff --git a/pixmaps/close.png b/pixmaps/close.png Binary files differnew file mode 100644 index 00000000..9b43c0a7 --- /dev/null +++ b/pixmaps/close.png diff --git a/pixmaps/computer.png b/pixmaps/computer.png Binary files differindex f0de0386..8b3716cf 100644 --- a/pixmaps/computer.png +++ b/pixmaps/computer.png diff --git a/pixmaps/dev_removable.png b/pixmaps/dev_removable.png Binary files differindex 2453d8dc..f4873104 100644 --- a/pixmaps/dev_removable.png +++ b/pixmaps/dev_removable.png diff --git a/pixmaps/devices.png b/pixmaps/devices.png Binary files differindex 0ad1400b..8ea7357b 100644 --- a/pixmaps/devices.png +++ b/pixmaps/devices.png diff --git a/pixmaps/dialog-error.png b/pixmaps/dialog-error.png Binary files differnew file mode 100644 index 00000000..7d6aaf6f --- /dev/null +++ b/pixmaps/dialog-error.png diff --git a/pixmaps/dialog-information.png b/pixmaps/dialog-information.png Binary files differnew file mode 100644 index 00000000..07cf0102 --- /dev/null +++ b/pixmaps/dialog-information.png diff --git a/pixmaps/dialog-warning.png b/pixmaps/dialog-warning.png Binary files differnew file mode 100644 index 00000000..45b64a79 --- /dev/null +++ b/pixmaps/dialog-warning.png diff --git a/pixmaps/face-grin.png b/pixmaps/face-grin.png Binary files differnew file mode 100644 index 00000000..d15cf2d4 --- /dev/null +++ b/pixmaps/face-grin.png diff --git a/pixmaps/gnome-dev-removable-usb.png b/pixmaps/gnome-dev-removable-usb.png Binary files differdeleted file mode 100644 index fb83bab2..00000000 --- a/pixmaps/gnome-dev-removable-usb.png +++ /dev/null diff --git a/pixmaps/gnome-devel.png b/pixmaps/gnome-devel.png Binary files differdeleted file mode 100644 index 4c63e7dd..00000000 --- a/pixmaps/gnome-devel.png +++ /dev/null diff --git a/pixmaps/gnome-terminal.png b/pixmaps/gnome-terminal.png Binary files differindex 2fe2d14d..ceb0fb99 100644 --- a/pixmaps/gnome-terminal.png +++ b/pixmaps/gnome-terminal.png diff --git a/pixmaps/gnome-window-manager.png b/pixmaps/gnome-window-manager.png Binary files differdeleted file mode 100644 index d5f0d3d9..00000000 --- a/pixmaps/gnome-window-manager.png +++ /dev/null diff --git a/pixmaps/graphics.png b/pixmaps/graphics.png Binary files differdeleted file mode 100644 index a70492c1..00000000 --- a/pixmaps/graphics.png +++ /dev/null diff --git a/pixmaps/hdd.png b/pixmaps/hdd.png Binary files differindex bbcdc825..da413059 100644 --- a/pixmaps/hdd.png +++ b/pixmaps/hdd.png diff --git a/pixmaps/inputdevices.png b/pixmaps/inputdevices.png Binary files differnew file mode 100644 index 00000000..985bcde5 --- /dev/null +++ b/pixmaps/inputdevices.png diff --git a/pixmaps/internet.png b/pixmaps/internet.png Binary files differnew file mode 100644 index 00000000..a5889683 --- /dev/null +++ b/pixmaps/internet.png diff --git a/pixmaps/joystick.png b/pixmaps/joystick.png Binary files differindex 954cca4b..18f77392 100644 --- a/pixmaps/joystick.png +++ b/pixmaps/joystick.png diff --git a/pixmaps/kblayout.png b/pixmaps/kblayout.png Binary files differdeleted file mode 100644 index b99e27d1..00000000 --- a/pixmaps/kblayout.png +++ /dev/null diff --git a/pixmaps/keyboard.png b/pixmaps/keyboard.png Binary files differindex a716f07e..4a63e535 100644 --- a/pixmaps/keyboard.png +++ b/pixmaps/keyboard.png diff --git a/pixmaps/language.png b/pixmaps/language.png Binary files differindex ab82b50f..ed0480b1 100644 --- a/pixmaps/language.png +++ b/pixmaps/language.png diff --git a/pixmaps/logo.png b/pixmaps/logo.png Binary files differindex d2dee31e..ed4f8ef5 100644 --- a/pixmaps/logo.png +++ b/pixmaps/logo.png diff --git a/pixmaps/logo.svg b/pixmaps/logo.svg new file mode 100644 index 00000000..159b96ed --- /dev/null +++ b/pixmaps/logo.svg @@ -0,0 +1,771 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://web.resource.org/cc/" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="32" + height="32" + id="svg2327" + sodipodi:version="0.32" + inkscape:version="0.44" + sodipodi:docbase="/home/leandro/Work/hardinfo/trunk/hardinfo2/pixmaps" + sodipodi:docname="logo.svg" + version="1.0" + inkscape:export-filename="/home/leandro/Work/hardinfo/trunk/hardinfo2/pixmaps/logo.png" + inkscape:export-xdpi="137.46988" + inkscape:export-ydpi="137.46988"> + <defs + id="defs3"> + <linearGradient + id="linearGradient2752"> + <stop + id="stop2754" + offset="0" + style="stop-color:#9d9d9d;stop-opacity:1;" /> + <stop + id="stop2756" + offset="1.0000000" + style="stop-color:#b9b9b9;stop-opacity:1.0000000;" /> + </linearGradient> + <linearGradient + id="linearGradient2711"> + <stop + id="stop2713" + offset="0.0000000" + style="stop-color:#909090;stop-opacity:1.0000000;" /> + <stop + id="stop2715" + offset="1.0000000" + style="stop-color:#bebebe;stop-opacity:0.0000000;" /> + </linearGradient> + <linearGradient + id="linearGradient2701"> + <stop + id="stop2703" + offset="0.0000000" + style="stop-color:#585956;stop-opacity:1.0000000;" /> + <stop + id="stop2705" + offset="1.0000000" + style="stop-color:#bbbeb8;stop-opacity:1.0000000;" /> + </linearGradient> + <linearGradient + id="linearGradient2683" + inkscape:collect="always"> + <stop + id="stop2685" + offset="0" + style="stop-color:#000000;stop-opacity:1;" /> + <stop + id="stop2687" + offset="1" + style="stop-color:#000000;stop-opacity:0;" /> + </linearGradient> + <linearGradient + id="linearGradient2675"> + <stop + id="stop2677" + offset="0.0000000" + style="stop-color:#5b5b97;stop-opacity:1.0000000;" /> + <stop + id="stop2679" + offset="1.0000000" + style="stop-color:#1b1b43;stop-opacity:1.0000000;" /> + </linearGradient> + <linearGradient + id="linearGradient2667"> + <stop + id="stop2669" + offset="0.0000000" + style="stop-color:#ffffff;stop-opacity:1.0000000;" /> + <stop + id="stop2671" + offset="1.0000000" + style="stop-color:#fcfcff;stop-opacity:0.0000000;" /> + </linearGradient> + <linearGradient + id="linearGradient2635" + inkscape:collect="always"> + <stop + id="stop2637" + offset="0" + style="stop-color:#f9fff5;stop-opacity:1;" /> + <stop + id="stop2639" + offset="1" + style="stop-color:#f9fff5;stop-opacity:0;" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + id="linearGradient2454"> + <stop + style="stop-color:#000000;stop-opacity:1;" + offset="0" + id="stop2456" /> + <stop + style="stop-color:#000000;stop-opacity:0;" + offset="1" + id="stop2458" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + id="linearGradient2415"> + <stop + style="stop-color:#ffffff;stop-opacity:1;" + offset="0" + id="stop2417" /> + <stop + style="stop-color:#ffffff;stop-opacity:0;" + offset="1" + id="stop2419" /> + </linearGradient> + <linearGradient + id="linearGradient2253"> + <stop + style="stop-color:#8f8f8f;stop-opacity:1.0000000;" + offset="0.0000000" + id="stop2255" /> + <stop + style="stop-color:#494949;stop-opacity:1.0000000;" + offset="1.0000000" + id="stop2257" /> + </linearGradient> + <linearGradient + id="linearGradient2245"> + <stop + style="stop-color:#dde1d9;stop-opacity:1.0000000;" + offset="0.0000000" + id="stop2247" /> + <stop + style="stop-color:#cacdc6;stop-opacity:1.0000000;" + offset="1.0000000" + id="stop2249" /> + </linearGradient> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient2454" + id="radialGradient2119" + gradientUnits="userSpaceOnUse" + gradientTransform="scale(1.925808,0.519262)" + cx="12.57571" + cy="67.501709" + fx="12.57571" + fy="67.501709" + r="8.7662792" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2245" + id="linearGradient3151" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.754296,0,0,0.650713,-0.158607,-3.549207)" + x1="18.316999" + y1="48.643234" + x2="18.176752" + y2="52.536461" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2253" + id="linearGradient3153" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.737296,0,0,0.665717,-0.158607,-3.549207)" + x1="10.390738" + y1="5.3817744" + x2="32.536823" + y2="31.246054" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2752" + id="linearGradient3155" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1.540139,0,0,0.264783,-0.187732,2.141243)" + x1="8.1134243" + y1="88.509071" + x2="8.1134233" + y2="100.20015" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2752" + id="linearGradient3157" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1.540139,0,0,0.264783,-0.187732,2.141243)" + x1="8.1134243" + y1="88.509071" + x2="8.1134233" + y2="100.20015" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2752" + id="linearGradient3159" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1.540139,0,0,0.264783,-0.187732,2.141243)" + x1="8.1134243" + y1="88.509071" + x2="8.1134233" + y2="100.20015" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2635" + id="linearGradient3161" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1.409488,0,0,0.31705,0.718141,-1.635309)" + x1="13.62871" + y1="101.2846" + x2="8.6485014" + y2="74.098007" /> + <linearGradient + y2="3.8451097" + x2="35.520542" + y1="3.9384086" + x1="34.300991" + gradientUnits="userSpaceOnUse" + id="linearGradient3006" + xlink:href="#linearGradient2711" + inkscape:collect="always" /> + <linearGradient + y2="3.8451097" + x2="35.520542" + y1="3.9384086" + x1="34.300991" + gradientUnits="userSpaceOnUse" + id="linearGradient3002" + xlink:href="#linearGradient2711" + inkscape:collect="always" /> + <linearGradient + y2="3.8451097" + x2="35.520542" + y1="3.9384086" + x1="34.300991" + gradientUnits="userSpaceOnUse" + id="linearGradient2998" + xlink:href="#linearGradient2711" + inkscape:collect="always" /> + <radialGradient + r="8.7662792" + fy="67.501709" + fx="12.57571" + cy="67.501709" + cx="12.57571" + gradientTransform="scale(1.925808,0.519262)" + gradientUnits="userSpaceOnUse" + id="radialGradient2013" + xlink:href="#linearGradient2454" + inkscape:collect="always" /> + <linearGradient + inkscape:collect="always" + id="linearGradient2321"> + <stop + style="stop-color:#7b7f7a;stop-opacity:1;" + offset="0" + id="stop2323" /> + <stop + style="stop-color:#7b7f7a;stop-opacity:0;" + offset="1" + id="stop2325" /> + </linearGradient> + <linearGradient + id="linearGradient2329"> + <stop + style="stop-color:#ffffff;stop-opacity:1.0000000;" + offset="0.0000000" + id="stop2331" /> + <stop + style="stop-color:#ffffff;stop-opacity:0.0000000;" + offset="1.0000000" + id="stop2333" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2667" + id="linearGradient3407" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.825985,0,0,0.597304,3.484242,-1.538064)" + x1="11.492236" + y1="1.6537577" + x2="17.199417" + y2="26.729263" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2415" + id="linearGradient3410" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.735452,0,0,0.59631,3.472291,0.397507)" + x1="17.698339" + y1="13.004725" + x2="34.974548" + y2="55.200756" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2683" + id="linearGradient3413" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(3.803441,0,0,0.116853,3.71313,-1.108211)" + x1="3.7069976" + y1="171.29134" + x2="3.7069974" + y2="162.45061" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2675" + id="linearGradient3416" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.777649,0,0,0.664731,3.629634,-1.713604)" + x1="19.150396" + y1="32.622238" + x2="16.315819" + y2="8.8666229" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2245" + id="linearGradient3419" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.770539,0,0,0.610387,1.337506,-1.56896)" + x1="8.6116238" + y1="7.2293582" + x2="34.784473" + y2="33.339787" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2253" + id="linearGradient3421" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.753173,0,0,0.624463,2.445717,-0.669394)" + x1="10.390738" + y1="5.3817744" + x2="32.536823" + y2="31.246054" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2701" + id="linearGradient3424" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1.210897,0,0,0.852618,1.322911,-29.79883)" + x1="12.206709" + y1="53.535141" + x2="12.127711" + y2="64.892525" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2329" + id="linearGradient3430" + gradientUnits="userSpaceOnUse" + x1="-35.122688" + y1="34.242237" + x2="-35.074745" + y2="30.962345" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2321" + id="linearGradient3432" + gradientUnits="userSpaceOnUse" + x1="-35.658386" + y1="33.416473" + x2="-35.658386" + y2="28.205938" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2711" + id="linearGradient3436" + gradientUnits="userSpaceOnUse" + x1="34.300991" + y1="3.9384086" + x2="35.520542" + y2="3.8451097" /> + <radialGradient + r="8.753643" + fy="16.855663" + fx="-19.515638" + cy="16.855663" + cx="-19.515638" + gradientTransform="matrix(2.828299,0,0,4.35457,72.19634,-62.10365)" + gradientUnits="userSpaceOnUse" + id="radialGradient2953" + xlink:href="#linearGradient2431" + inkscape:collect="always" /> + <radialGradient + r="22.376116" + fy="28.458725" + fx="26.544321" + cy="28.458725" + cx="26.544321" + gradientTransform="matrix(1.238342,5.954846e-3,-6.507762e-3,1.351272,-6.992513,-9.744842)" + gradientUnits="userSpaceOnUse" + id="radialGradient2062" + xlink:href="#linearGradient2933" + inkscape:collect="always" /> + <linearGradient + id="linearGradient2431"> + <stop + style="stop-color:#ffffff;stop-opacity:1;" + offset="0" + id="stop2433" /> + <stop + style="stop-color:#b8b8b8;stop-opacity:1;" + offset="1" + id="stop2435" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + id="linearGradient21644"> + <stop + style="stop-color:#000000;stop-opacity:1;" + offset="0" + id="stop21646" /> + <stop + style="stop-color:#000000;stop-opacity:0;" + offset="1" + id="stop21648" /> + </linearGradient> + <linearGradient + id="linearGradient2933"> + <stop + id="stop2935" + offset="0" + style="stop-color:#9cbcde;stop-opacity:1" /> + <stop + id="stop2937" + offset="1" + style="stop-color:#204a87" /> + </linearGradient> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient21644" + id="radialGradient1887" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1,0,0,0.595238,0,14.875)" + cx="25.125" + cy="36.75" + fx="25.125" + fy="36.75" + r="15.75" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient2431" + id="radialGradient1996" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(2.828299,0,0,4.35457,111.3213,-64.97613)" + cx="-19.515638" + cy="16.855663" + fx="-19.515638" + fy="16.855663" + r="8.753643" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient21644" + id="radialGradient2012" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1,0,0,0.595238,0,14.875)" + cx="25.125" + cy="36.75" + fx="25.125" + fy="36.75" + r="15.75" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient2933" + id="radialGradient2014" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1.238342,5.954846e-3,-6.507762e-3,1.351272,-6.992513,-9.744842)" + cx="26.544321" + cy="28.458725" + fx="26.544321" + fy="28.458725" + r="22.376116" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666" + borderopacity="1" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="8" + inkscape:cx="37.875488" + inkscape:cy="18.167741" + inkscape:current-layer="layer1" + showgrid="false" + inkscape:grid-bbox="true" + inkscape:document-units="px" + inkscape:window-width="1034" + inkscape:window-height="622" + inkscape:window-x="236" + inkscape:window-y="25" + inkscape:showpageshadow="false" + width="32px" + height="32px" + showborder="false" /> + <metadata + id="metadata4"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title>Computer</dc:title> + <dc:date>2005-03-08</dc:date> + <dc:creator> + <cc:Agent> + <dc:title>Jakub Steiner</dc:title> + </cc:Agent> + </dc:creator> + <dc:subject> + <rdf:Bag> + <rdf:li>workstation</rdf:li> + <rdf:li>computer</rdf:li> + <rdf:li>node</rdf:li> + <rdf:li>client</rdf:li> + </rdf:Bag> + </dc:subject> + <cc:license + rdf:resource="http://creativecommons.org/licenses/by-sa/2.0/" /> + <dc:source>http://jimmac.musichall.cz/</dc:source> + </cc:Work> + <cc:License + rdf:about="http://creativecommons.org/licenses/by-sa/2.0/"> + <cc:permits + rdf:resource="http://web.resource.org/cc/Reproduction" /> + <cc:permits + rdf:resource="http://web.resource.org/cc/Distribution" /> + <cc:requires + rdf:resource="http://web.resource.org/cc/Notice" /> + <cc:requires + rdf:resource="http://web.resource.org/cc/Attribution" /> + <cc:permits + rdf:resource="http://web.resource.org/cc/DerivativeWorks" /> + <cc:requires + rdf:resource="http://web.resource.org/cc/ShareAlike" /> + </cc:License> + </rdf:RDF> + </metadata> + <g + id="layer1" + inkscape:label="Layer 1" + inkscape:groupmode="layer"> + <path + transform="matrix(0.842932,0,0,0.860842,-4.144223,-2.66695)" + d="M 41.10058 35.051105 A 16.882174 4.552 0 1 1 7.3362331,35.051105 A 16.882174 4.552 0 1 1 41.10058 35.051105 z" + sodipodi:ry="4.552" + sodipodi:rx="16.882174" + sodipodi:cy="35.051105" + sodipodi:cx="24.218407" + id="path2657" + style="color:black;fill:url(#radialGradient2119);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:0.70063692;visibility:visible;display:inline;overflow:visible" + sodipodi:type="arc" /> + <path + sodipodi:type="arc" + style="opacity:0.50857143;color:black;fill:url(#radialGradient2013);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:0.70063692;visibility:visible;display:inline;overflow:visible" + id="path2452" + sodipodi:cx="24.218407" + sodipodi:cy="35.051105" + sodipodi:rx="16.882174" + sodipodi:ry="4.552" + d="M 41.10058 35.051105 A 16.882174 4.552 0 1 1 7.3362331,35.051105 A 16.882174 4.552 0 1 1 41.10058 35.051105 z" + transform="matrix(0.700168,0,0,1.245259,-0.630378,-20.73743)" /> + <path + sodipodi:type="arc" + style="color:black;fill:#adb0aa;fill-opacity:1;fill-rule:evenodd;stroke:#4b4d4a;stroke-width:1.46916819;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" + id="path2407" + sodipodi:cx="-35.658386" + sodipodi:cy="29.716238" + sodipodi:rx="9.3944187" + sodipodi:ry="3.939595" + d="M -26.263968 29.716238 A 9.3944187 3.939595 0 1 1 -45.052805,29.716238 A 9.3944187 3.939595 0 1 1 -26.263968 29.716238 z" + transform="matrix(0.694942,0,0,0.666667,40.76488,2.385605)" /> + <path + transform="matrix(0.638173,0,0,0.52797,38.69372,6.192003)" + d="M -26.263968 29.716238 A 9.3944187 3.939595 0 1 1 -45.052805,29.716238 A 9.3944187 3.939595 0 1 1 -26.263968 29.716238 z" + sodipodi:ry="3.939595" + sodipodi:rx="9.3944187" + sodipodi:cy="29.716238" + sodipodi:cx="-35.658386" + id="path1825" + style="color:black;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient3432);stroke-width:1.72276604;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" + sodipodi:type="arc" /> + <path + sodipodi:type="arc" + style="color:black;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient3430);stroke-width:1.67341197;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" + id="path2983" + sodipodi:cx="-35.658386" + sodipodi:cy="29.716238" + sodipodi:rx="9.3944187" + sodipodi:ry="3.939595" + d="M -26.263968 29.716238 A 9.3944187 3.939595 0 1 1 -45.052805,29.716238 A 9.3944187 3.939595 0 1 1 -26.263968 29.716238 z" + transform="matrix(0.628221,0,0,0.568437,38.54718,4.306169)" /> + <rect + y="17.750319" + x="12.971182" + height="4.2433615" + width="6.0264516" + id="rect2699" + style="color:black;fill:url(#linearGradient3424);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.60872948;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" /> + <path + sodipodi:nodetypes="ccccccccccccccccc" + style="fill:#d0d0d0;fill-opacity:1;fill-rule:evenodd;stroke:#979797;stroke-width:0.4000003;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1" + d="M 17.126296,19.177505 L 17.083349,19.844172 C 17.083349,19.844172 20.054664,22.243617 23.267708,22.645845 C 24.874229,22.846958 26.5342,23.11412 27.905977,23.437512 C 29.277754,23.760904 30.37172,24.183916 30.740474,24.541679 C 30.953774,24.74862 31.050423,24.924105 31.08405,25.062513 C 31.117678,25.20092 31.110311,25.299056 31.01963,25.437513 C 30.838269,25.714426 30.277605,26.082614 29.323226,26.375013 C 27.414468,26.95981 24.018129,27.333347 19.31659,27.333347 L 19.31659,28.000014 C 24.055181,28.000014 27.468719,27.648233 29.516487,27.020847 C 30.540371,26.707153 31.251503,26.343722 31.599413,25.812513 C 31.773369,25.546909 31.844947,25.220213 31.771201,24.916679 C 31.697456,24.613145 31.506954,24.326975 31.234364,24.062512 C 30.631341,23.477465 29.491174,23.124885 28.077765,22.791678 C 26.664356,22.458471 24.974773,22.182125 23.353601,21.979178 C 20.111261,21.573283 17.126296,19.177505 17.126296,19.177505 z " + id="path2411" /> + <path + style="color:black;fill:url(#linearGradient3419);fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient3421);stroke-width:1.0000006;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" + d="M 4.5468197,0.5000001 L 27.453174,0.5000001 C 28.074688,0.5000001 28.560804,0.9024013 28.589859,1.4666116 L 29.498282,19.106685 C 29.537979,19.877537 28.883783,20.499998 28.120482,20.499998 L 3.8795124,20.499998 C 3.116211,20.499998 2.4620149,19.877537 2.5017119,19.106685 L 3.4101343,1.4666116 C 3.4376069,0.9331395 3.7835182,0.5000001 4.5468197,0.5000001 z " + id="rect2404" + sodipodi:nodetypes="cssssssss" /> + <path + sodipodi:nodetypes="ccccc" + id="path2377" + d="M 6.0727205,2.2499997 L 5.2499969,17.749996 L 26.212503,17.749996 L 25.328301,2.3156892 L 6.0727205,2.2499997 z " + style="fill:url(#linearGradient3416);fill-opacity:1;fill-rule:evenodd;stroke:#000079;stroke-width:0.50000036;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <path + sodipodi:nodetypes="cc" + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:url(#linearGradient3413);stroke-width:0.99618173;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:0.24840764" + d="M 4.4980854,18.501907 L 28.117082,18.501907" + id="path2393" /> + <path + sodipodi:nodetypes="cssssssss" + id="path2397" + d="M 4.7430574,1.5249746 L 27.207154,1.4999972 C 27.39545,1.4997879 27.578376,1.6567607 27.59351,1.9311672 L 28.497431,18.319972 C 28.535954,19.018408 28.139187,19.499992 27.436553,19.499992 L 4.5221432,19.499992 C 3.8195091,19.499992 3.4648201,19.018441 3.5027474,18.319972 L 4.3815789,2.1353932 C 4.4072623,1.6624066 4.4920129,1.5252537 4.7430574,1.5249746 z " + style="color:black;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient3410);stroke-width:0.99999988;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:0.70063692;visibility:visible;display:inline;overflow:visible" /> + <path + sodipodi:nodetypes="ccccc" + style="opacity:0.53142856;fill:url(#linearGradient3407);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.25pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M 6.2315651,2.5138621 L 5.6965455,14.427421 C 13.059641,12.827001 15.977526,7.4326186 25.132577,5.662917 L 25.024928,2.5579048 L 6.2315651,2.5138621 z " + id="path2443" /> + <path + id="text2735" + d="M 15.000002,18.128436 L 15.187812,18.128436 C 15.243656,18.128437 15.286469,18.140879 15.316252,18.165763 C 15.346232,18.190452 15.361221,18.225721 15.361222,18.271572 C 15.361221,18.317619 15.346232,18.353084 15.316252,18.377969 C 15.286469,18.402658 15.243656,18.415002 15.187812,18.415002 L 15.113158,18.415002 L 15.113158,18.567249 L 15.000002,18.567249 L 15.000002,18.128436 M 15.113158,18.210438 L 15.113158,18.333 L 15.175762,18.333 C 15.197707,18.333 15.214656,18.327709 15.226609,18.317129 C 15.238561,18.306352 15.244538,18.291167 15.244538,18.271572 C 15.244538,18.251978 15.238561,18.236891 15.226609,18.226309 C 15.214656,18.215729 15.197707,18.210438 15.175762,18.210438 L 15.113158,18.210438 M 15.641321,18.202502 C 15.606835,18.202503 15.580089,18.215239 15.561082,18.240711 C 15.542076,18.266184 15.532573,18.302041 15.532573,18.348284 C 15.532573,18.39433 15.542076,18.43009 15.561082,18.455562 C 15.580089,18.481035 15.606835,18.493771 15.641321,18.493771 C 15.676003,18.493771 15.702847,18.481035 15.721854,18.455562 C 15.74086,18.43009 15.750363,18.39433 15.750363,18.348284 C 15.750363,18.302041 15.74086,18.266184 15.721854,18.240711 C 15.702847,18.215239 15.676003,18.202503 15.641321,18.202502 M 15.641321,18.1205 C 15.71186,18.120501 15.767116,18.140683 15.807089,18.181047 C 15.847061,18.221411 15.867047,18.277157 15.867047,18.348284 C 15.867047,18.419215 15.847061,18.474862 15.807089,18.515226 C 15.767116,18.555591 15.71186,18.575773 15.641321,18.575773 C 15.570978,18.575773 15.515722,18.555591 15.475554,18.515226 C 15.435582,18.474862 15.415596,18.419215 15.415596,18.348284 C 15.415596,18.277157 15.435582,18.221411 15.475554,18.181047 C 15.515722,18.140683 15.570978,18.120501 15.641321,18.1205 M 15.952282,18.128436 L 16.078665,18.128436 L 16.23826,18.429404 L 16.23826,18.128436 L 16.345539,18.128436 L 16.345539,18.567249 L 16.219155,18.567249 L 16.059561,18.266281 L 16.059561,18.567249 L 15.952282,18.567249 L 15.952282,18.128436 M 16.394328,18.128436 L 16.518066,18.128436 L 16.617996,18.284798 L 16.717927,18.128436 L 16.841959,18.128436 L 16.674722,18.382378 L 16.674722,18.567249 L 16.561565,18.567249 L 16.561565,18.382378 L 16.394328,18.128436" + style="font-size:0.9029026px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;writing-mode:lr-tb;text-anchor:start;fill:#4a4a4a;fill-opacity:1;stroke:none;stroke-width:1pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" /> + <path + sodipodi:type="arc" + style="color:black;fill:url(#linearGradient2998);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" + id="path2996" + sodipodi:cx="34.780815" + sodipodi:cy="3.9384086" + sodipodi:rx="0.83968931" + sodipodi:ry="0.83968931" + d="M 35.620504 3.9384086 A 0.83968931 0.83968931 0 1 1 33.941126,3.9384086 A 0.83968931 0.83968931 0 1 1 35.620504 3.9384086 z" + transform="matrix(1.191851,0,0,0.590943,-14.20356,3.172623)" /> + <path + sodipodi:type="arc" + style="color:black;fill:url(#linearGradient3002);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" + id="path3000" + sodipodi:cx="34.780815" + sodipodi:cy="3.9384086" + sodipodi:rx="0.83968931" + sodipodi:ry="0.83968931" + d="M 35.620504 3.9384086 A 0.83968931 0.83968931 0 1 1 33.941126,3.9384086 A 0.83968931 0.83968931 0 1 1 35.620504 3.9384086 z" + transform="matrix(1.191851,0,0,0.590943,-14.07856,5.172623)" /> + <path + sodipodi:type="arc" + style="color:black;fill:url(#linearGradient3006);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" + id="path3004" + sodipodi:cx="34.780815" + sodipodi:cy="3.9384086" + sodipodi:rx="0.83968931" + sodipodi:ry="0.83968931" + d="M 35.620504 3.9384086 A 0.83968931 0.83968931 0 1 1 33.941126,3.9384086 A 0.83968931 0.83968931 0 1 1 35.620504 3.9384086 z" + transform="matrix(1.191851,0,0,0.590943,-13.98481,7.172623)" /> + <g + id="g3140" + transform="matrix(1.07411,0,0,1,-7.474908e-2,0)"> + <path + style="color:black;fill:url(#linearGradient3151);fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient3153);stroke-width:0.96488512;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" + d="M 4.1555474,23.519597 L 24.852756,23.519597 C 25.599965,23.519597 25.505238,23.719163 25.581927,23.970171 L 27.474336,30.164233 C 27.551025,30.415242 27.492376,30.614807 26.745165,30.614807 L 2.2631378,30.614807 C 1.515927,30.614807 1.457278,30.415242 1.5339666,30.164233 L 3.4263762,23.970171 C 3.5030648,23.719162 3.4083366,23.519597 4.1555474,23.519597 z " + id="path2409" + sodipodi:nodetypes="cssssssss" /> + <path + style="fill:#7a7d77;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.25pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M 4.1084868,24.998609 L 2.9283249,28.967343 L 6.5868268,28.967343 L 6.9408752,27.393536 L 16.854234,27.393536 L 17.2212,29 L 21.338848,29 L 20.217696,24.998609 L 4.1084868,24.998609 z " + id="path2611" + sodipodi:nodetypes="ccccccccc" /> + <path + style="fill:#777874;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.25pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M 7.2359158,27.667242 L 6.9408752,28.967344 L 16.795227,28.967344 L 16.500186,27.598815 L 7.2359158,27.667242 z " + id="path2613" /> + <path + id="path2619" + d="M 24.938342,24.99861 L 26.059498,28.898918 L 22.400995,28.830491 L 21.397857,25.067036 L 24.938342,24.99861 z " + style="color:black;fill:#777a75;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.25pt;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" /> + <g + transform="matrix(0.99867,0,0,0.940591,3.681797e-2,1.004505)" + id="g2197"> + <path + id="path2615" + d="M 24.878007,25.565138 L 25.997768,28.64651 L 22.343815,28.59245 L 21.341925,25.619197 L 24.878007,25.565138 z " + style="color:black;fill:url(#linearGradient3155);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.25pt;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" /> + <path + style="fill:url(#linearGradient3157);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.25pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M 4.0740554,25.511079 L 2.8953613,28.64651 L 6.5493134,28.64651 L 6.9029215,27.403149 L 16.803952,27.403149 L 17.170462,28.672308 L 21.282989,28.672308 L 20.163231,25.511079 L 4.0740554,25.511079 z " + id="path2617" + sodipodi:nodetypes="ccccccccc" /> + <path + style="color:black;fill:url(#linearGradient3159);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.25pt;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" + d="M 7.1975952,27.673445 L 6.9029215,28.700569 L 16.745018,28.700569 L 16.450344,27.619386 L 7.1975952,27.673445 z " + id="path2621" /> + </g> + <path + sodipodi:nodetypes="ccccc" + id="path2631" + d="M 4.0897989,24.249996 L 25.016002,24.249996 L 26.750007,29.750003 L 2.2500001,29.750003 L 4.0897989,24.249996 z " + style="color:black;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient3161);stroke-width:0.48244256;stroke-linecap:butt;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" /> + </g> + <path + sodipodi:type="arc" + style="color:black;fill:url(#linearGradient3436);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" + id="path3434" + sodipodi:cx="34.780815" + sodipodi:cy="3.9384086" + sodipodi:rx="0.83968931" + sodipodi:ry="0.83968931" + d="M 35.620504 3.9384086 A 0.83968931 0.83968931 0 1 1 33.941126,3.9384086 A 0.83968931 0.83968931 0 1 1 35.620504 3.9384086 z" + transform="matrix(1.191851,0,0,0.590943,-14.45356,1.172623)" /> + <g + id="g2005" + transform="matrix(0.470834,0,0,0.470834,-17.64221,12.13147)"> + <path + transform="matrix(0.773935,0,0,0.397914,36.00038,9.77376)" + d="M 40.875 36.75 A 15.75 9.375 0 1 1 9.375,36.75 A 15.75 9.375 0 1 1 40.875 36.75 z" + sodipodi:ry="9.375" + sodipodi:rx="15.75" + sodipodi:cy="36.75" + sodipodi:cx="25.125" + id="path21642" + style="opacity:0.63068183;color:black;fill:url(#radialGradient2012);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" + sodipodi:type="arc" /> + <path + transform="matrix(0.664228,0,0,0.641487,39.24394,-2.658954)" + d="M 45.785164 23.825787 A 21.876116 21.876116 0 1 1 2.0329323,23.825787 A 21.876116 21.876116 0 1 1 45.785164 23.825787 z" + sodipodi:ry="21.876116" + sodipodi:rx="21.876116" + sodipodi:cy="23.825787" + sodipodi:cx="23.909048" + id="path2093" + style="fill:url(#radialGradient2014);fill-opacity:1;stroke:#204a87;stroke-width:1.43783867" + sodipodi:type="arc" /> + <path + sodipodi:type="arc" + style="opacity:0.96022728;fill:none;fill-opacity:1;stroke:white;stroke-width:3.43368769;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="path2209" + sodipodi:cx="23.909048" + sodipodi:cy="23.825787" + sodipodi:rx="21.876116" + sodipodi:ry="21.876116" + d="M 45.785164 23.825787 A 21.876116 21.876116 0 1 1 2.0329323,23.825787 A 21.876116 21.876116 0 1 1 45.785164 23.825787 z" + transform="matrix(0.594256,0,0,0.570906,40.91689,-0.974785)" /> + <text + id="text2001" + y="21.797297" + x="50.589512" + style="font-size:25.51218796px;font-style:normal;font-weight:normal;fill:#f2f2f2;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Alianna" + xml:space="preserve"><tspan + style="fill:#f2f2f2;font-family:Arial Black" + y="21.797297" + x="50.589512" + id="tspan2003" + sodipodi:role="line">i</tspan></text> + </g> + </g> +</svg> diff --git a/pixmaps/memory.png b/pixmaps/memory.png Binary files differindex 1ea66b8a..16a45b9f 100644 --- a/pixmaps/memory.png +++ b/pixmaps/memory.png diff --git a/pixmaps/module.png b/pixmaps/module.png Binary files differindex 8f1279d0..2bb2adfc 100644 --- a/pixmaps/module.png +++ b/pixmaps/module.png diff --git a/pixmaps/monitor.png b/pixmaps/monitor.png Binary files differindex 669086a4..58fc213e 100644 --- a/pixmaps/monitor.png +++ b/pixmaps/monitor.png diff --git a/pixmaps/mouse.png b/pixmaps/mouse.png Binary files differindex 4043722d..c1bbc79d 100644 --- a/pixmaps/mouse.png +++ b/pixmaps/mouse.png diff --git a/pixmaps/network.png b/pixmaps/network.png Binary files differindex f8c623b6..51c8b16f 100644 --- a/pixmaps/network.png +++ b/pixmaps/network.png diff --git a/pixmaps/os.png b/pixmaps/os.png Binary files differindex 166c2201..4decc893 100644 --- a/pixmaps/os.png +++ b/pixmaps/os.png diff --git a/pixmaps/printer.png b/pixmaps/printer.png Binary files differindex dd814d6c..3c3aa974 100644 --- a/pixmaps/printer.png +++ b/pixmaps/printer.png diff --git a/pixmaps/raytrace.png b/pixmaps/raytrace.png Binary files differnew file mode 100644 index 00000000..60bfc64a --- /dev/null +++ b/pixmaps/raytrace.png diff --git a/pixmaps/report-large.png b/pixmaps/report-large.png Binary files differnew file mode 100644 index 00000000..1cc693f5 --- /dev/null +++ b/pixmaps/report-large.png diff --git a/pixmaps/shares.png b/pixmaps/shares.png Binary files differindex ab4e197d..91ccf9b7 100644 --- a/pixmaps/shares.png +++ b/pixmaps/shares.png diff --git a/pixmaps/status-curr.png b/pixmaps/status-curr.png Binary files differnew file mode 100644 index 00000000..1ee5a29e --- /dev/null +++ b/pixmaps/status-curr.png diff --git a/pixmaps/status-done.png b/pixmaps/status-done.png Binary files differnew file mode 100644 index 00000000..fa39fd70 --- /dev/null +++ b/pixmaps/status-done.png diff --git a/pixmaps/stock_channel.png b/pixmaps/stock_channel.png Binary files differdeleted file mode 100644 index 2a74f2e6..00000000 --- a/pixmaps/stock_channel.png +++ /dev/null diff --git a/pixmaps/stock_insert-floating-frame.png b/pixmaps/stock_insert-floating-frame.png Binary files differdeleted file mode 100644 index 8f82250f..00000000 --- a/pixmaps/stock_insert-floating-frame.png +++ /dev/null diff --git a/pixmaps/stock_landline-phone.png b/pixmaps/stock_landline-phone.png Binary files differdeleted file mode 100644 index 61da5dab..00000000 --- a/pixmaps/stock_landline-phone.png +++ /dev/null diff --git a/pixmaps/stock_macro-watch-variable.png b/pixmaps/stock_macro-watch-variable.png Binary files differdeleted file mode 100644 index 2e52ddc9..00000000 --- a/pixmaps/stock_macro-watch-variable.png +++ /dev/null diff --git a/pixmaps/summary.png b/pixmaps/summary.png Binary files differindex 5a2cd965..0abb49f3 100644 --- a/pixmaps/summary.png +++ b/pixmaps/summary.png diff --git a/pixmaps/syncmanager-small.png b/pixmaps/syncmanager-small.png Binary files differnew file mode 100644 index 00000000..58f19c68 --- /dev/null +++ b/pixmaps/syncmanager-small.png diff --git a/pixmaps/syncmanager.png b/pixmaps/syncmanager.png Binary files differnew file mode 100644 index 00000000..9f019ac5 --- /dev/null +++ b/pixmaps/syncmanager.png diff --git a/pixmaps/users.png b/pixmaps/users.png Binary files differindex cbc62084..bced28cf 100644 --- a/pixmaps/users.png +++ b/pixmaps/users.png diff --git a/pixmaps/videocap.png b/pixmaps/videocap.png Binary files differdeleted file mode 100644 index 8bbea0ba..00000000 --- a/pixmaps/videocap.png +++ /dev/null @@ -1,6 +1,6 @@ /* * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> + * Copyright (C) 2003-2007 Leandro A. F. Pereira <leandro@linuxmag.com.br> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,67 +20,72 @@ #include <stdio.h> #include <string.h> #include <shell.h> +#include <iconcache.h> #include <hardinfo.h> +#include <config.h> static ReportDialog *report_dialog_new(GtkTreeModel *model, GtkWidget *parent); static void set_all_active(ReportDialog *rd, gboolean setting); -static void -report_html_header(ReportContext *ctx) +static FileTypes file_types[] = { + { "HTML (*.html)", "text/html", ".html", report_context_html_new }, + { "Plain Text (*.txt)", "text/plain", ".txt", report_context_text_new }, + { NULL, NULL, NULL, NULL } +}; + +void +report_header(ReportContext *ctx) { - fprintf(ctx->stream, - "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Final//EN\">\n" \ - "<html><head>\n" \ - "<title>HardInfo System Report</title>\n" \ - "<style>\n" \ - "body { background: #fff }\n" \ - ".title { font: bold 130%% serif; color: #0066FF; padding: 30px 0 10px 0 }\n" \ - ".stitle { font: bold 100%% sans-serif; color: #0044DD; padding: 30px 0 10px 0 }\n" \ - ".sstitle{ font: bold 80%% serif; color: #000000; background: #efefef }\n" \ - ".field { font: 80%% sans-serif; color: #000000; padding: 2px; padding-left: 50px }\n" \ - ".value { font: 80%% sans-serif; color: #505050 }\n" \ - "</style>\n" \ - "</head><body>\n" \ - "<table width=\"100%%\"><tbody>"); + ctx->header(ctx); } -static void -report_html_footer(ReportContext *ctx) +void +report_footer(ReportContext *ctx) { - fprintf(ctx->stream, - "</tbody></table></body></html>"); + ctx->footer(ctx); } -static void -report_html_title(ReportContext *ctx, gchar *text) +void +report_title(ReportContext *ctx, gchar *text) { - fprintf(ctx->stream, - "<tr><td colspan=\"2\" class=\"title\">%s</td></tr>\n", text); + ctx->title(ctx, text); } -static void -report_html_subtitle(ReportContext *ctx, gchar *text) +void +report_subtitle(ReportContext *ctx, gchar *text) { - fprintf(ctx->stream, - "<tr><td colspan=\"2\" class=\"stitle\">%s</td></tr>\n", text); + ctx->subtitle(ctx, text); } -static void -report_html_subsubtitle(ReportContext *ctx, gchar *text) + +void +report_subsubtitle(ReportContext *ctx, gchar *text) { - fprintf(ctx->stream, - "<tr><td colspan=\"2\" class=\"sstitle\">%s</td></tr>\n", text); + ctx->subsubtitle(ctx, text); } -static void -report_html_key_value(ReportContext *ctx, gchar *key, gchar *value) +void +report_key_value(ReportContext *ctx, gchar *key, gchar *value) { - fprintf(ctx->stream, - "<tr><td class=\"field\">%s</td>" \ - "<td class=\"value\">%s</td></tr>\n", key, value); + ctx->keyvalue(ctx, key, value); } -static void -report_html_table(ReportContext *ctx, gchar *text) +void +report_context_configure(ReportContext *ctx, GKeyFile *keyfile) +{ + /* FIXME: sometime in the future we'll save images in the report. this + flag will be set if we should support that. + + so i don't forget how to encode the images inside the html files: + http://en.wikipedia.org/wiki/Data:_URI_scheme */ + + ctx->is_image_enabled = (g_key_file_get_boolean(keyfile, + "$ShellParam$", + "ViewType", + NULL) == SHELL_VIEW_PROGRESS); +} + +void +report_table(ReportContext *ctx, gchar *text) { GKeyFile *key_file = g_key_file_new(); gchar **groups; @@ -94,50 +99,56 @@ report_html_table(ReportContext *ctx, gchar *text) gchar **keys; gint j; - if (groups[i][0] == '$') + if (groups[i][0] == '$') { + report_context_configure(ctx, key_file); continue; + } group = groups[i]; - keys = g_key_file_get_keys(key_file, group, NULL, NULL); tmpgroup = g_strdup(group); strend(group, '#'); - report_html_subsubtitle(ctx, group); + report_subsubtitle(ctx, group); - for (j = 0; keys[j]; j++) { - gchar *key = keys[j]; - gchar *value; - - value = g_key_file_get_value(key_file, tmpgroup, key, NULL); - - if (g_utf8_validate(key, -1, NULL) && g_utf8_validate(value, -1, NULL)) { - strend(key, '#'); - - if (g_str_equal(value, "...")) { - g_free(value); - if (!(value = ctx->entry->fieldfunc(key))) { - value = g_strdup("..."); +#if 0 + if (ctx->is_image_enabled) { + report_embed_image(ctx, key_file, group); + } else { +#endif + keys = g_key_file_get_keys(key_file, tmpgroup, NULL, NULL); + for (j = 0; keys[j]; j++) { + gchar *key = keys[j]; + gchar *value; + + value = g_key_file_get_value(key_file, tmpgroup, key, NULL); + + if (g_utf8_validate(key, -1, NULL) && g_utf8_validate(value, -1, NULL)) { + strend(key, '#'); + + if (g_str_equal(value, "...")) { + g_free(value); + if (!(value = ctx->entry->fieldfunc(key))) { + value = g_strdup("..."); + } + } + + if (*key == '$') { + report_key_value(ctx, strchr(key + 1, '$') + 1, value); + } else { + report_key_value(ctx, key, value); } - } - - if (*key == '$') { - gchar **tmp; - - tmp = g_strsplit(++key, "$", 0); - report_html_key_value(ctx, tmp[1], value); - g_strfreev(tmp); - } else { - report_html_key_value(ctx, key, value); - } - + + } + + g_free(value); } - g_free(value); - } - + g_strfreev(keys); +#if 0 + } +#endif g_free(tmpgroup); - g_strfreev(keys); } g_strfreev(groups); @@ -145,43 +156,213 @@ report_html_table(ReportContext *ctx, gchar *text) } static void -report_generate_child(ReportContext *ctx, GtkTreeIter *iter) +report_html_header(ReportContext *ctx) { - ShellModuleEntry *entry; - gboolean selected; + if (ctx->output) + g_free(ctx->output); - gtk_tree_model_get(ctx->rd->model, iter, TREE_COL_SEL, &selected, -1); - if (!selected) - return; + ctx->output = g_strdup_printf("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Final//EN\">\n" \ + "<html><head>\n" \ + "<title>HardInfo (%s) System Report</title>\n" \ + "<style>\n" \ + " body { background: #fff }\n" \ + " .title { font: bold 130%% serif; color: #0066FF; padding: 30px 0 10px 0 }\n" \ + " .stitle { font: bold 100%% sans-serif; color: #0044DD; padding: 30px 0 10px 0 }\n" \ + " .sstitle{ font: bold 80%% serif; color: #000000; background: #efefef }\n" \ + " .field { font: 80%% sans-serif; color: #000000; padding: 2px; padding-left: 50px }\n" \ + " .value { font: 80%% sans-serif; color: #505050 }\n" \ + "</style>\n" \ + "</head><body>\n" \ + "<table width=\"100%%\"><tbody>", VERSION); +} + +static void +report_html_footer(ReportContext *ctx) +{ + ctx->output = g_strconcat(ctx->output, + "</tbody></table></body></html>", + NULL); +} + +static void +report_html_title(ReportContext *ctx, gchar *text) +{ + ctx->output = g_strdup_printf("%s" \ + "<tr><td colspan=\"2\" class=\"titl" \ + "e\">%s</td></tr>\n", + ctx->output, text); +} + +static void +report_html_subtitle(ReportContext *ctx, gchar *text) +{ + ctx->output = g_strdup_printf("%s" \ + "<tr><td colspan=\"2\" class=\"stit" \ + "le\">%s</td></tr>\n", + ctx->output, text); +} + +static void +report_html_subsubtitle(ReportContext *ctx, gchar *text) +{ + ctx->output = g_strdup_printf("%s" \ + "<tr><td colspan=\"2\" class=\"ssti" \ + "tle\">%s</td></tr>\n", + ctx->output, text); +} + +static void +report_html_key_value(ReportContext *ctx, gchar *key, gchar *value) +{ + ctx->output = g_strdup_printf("%s" \ + "<tr><td class=\"field\">%s</td>" \ + "<td class=\"value\">%s</td></tr>\n", + ctx->output, key, value); +} + +static void +report_text_header(ReportContext *ctx) +{ + if (ctx->output) + g_free(ctx->output); + + ctx->output = g_strdup(""); +} + +static void +report_text_footer(ReportContext *ctx) +{ +} + +static void +report_text_title(ReportContext *ctx, gchar *text) +{ + gchar *str = (gchar*)ctx->output; + int i = strlen(text); - gtk_tree_model_get(ctx->rd->model, iter, TREE_COL_DATA, &entry, -1); + str = g_strdup_printf("%s\n%s\n", str, text); + for (; i; i--) + str = g_strconcat(str, "*", NULL); + + str = g_strconcat(str, "\n\n", NULL); + ctx->output = str; +} + +static void +report_text_subtitle(ReportContext *ctx, gchar *text) +{ + gchar *str = ctx->output; + int i = strlen(text); - ctx->entry = entry; + str = g_strdup_printf("%s\n%s\n", str, text); + for (; i; i--) + str = g_strconcat(str, "-", NULL); + + str = g_strconcat(str, "\n\n", NULL); + ctx->output = str; +} - report_html_subtitle(ctx, entry->name); - report_html_table(ctx, entry->func(entry->number)); +static void +report_text_subsubtitle(ReportContext *ctx, gchar *text) +{ + ctx->output = g_strdup_printf("%s-%s-\n", ctx->output, text); } static void -report_generate_children(ReportContext *ctx, GtkTreeIter *iter) +report_text_key_value(ReportContext *ctx, gchar *key, gchar *value) { - GtkTreeModel *model = ctx->rd->model; - gchar *name; + if (strlen(value)) + ctx->output = g_strdup_printf("%s%s\t\t: %s\n", ctx->output, key, value); + else + ctx->output = g_strdup_printf("%s%s\n", ctx->output, key); +} - gtk_tree_model_get(model, iter, TREE_COL_NAME, &name, -1); - report_html_title(ctx, name); +static GSList * +report_create_module_list_from_dialog(ReportDialog *rd) +{ + ShellModule *module; + GSList *modules = NULL; + GtkTreeModel *model = rd->model; + GtkTreeIter iter; - if (gtk_tree_model_iter_has_child(model, iter)) { - gint children = gtk_tree_model_iter_n_children(model, iter); - gint i; + gtk_tree_model_get_iter_first(model, &iter); + do { + gboolean selected; + gchar *name; - for (i = 0; i < children; i++) { - GtkTreeIter child; + gtk_tree_model_get(model, &iter, TREE_COL_SEL, &selected, -1); + if (!selected) + continue; - gtk_tree_model_iter_nth_child(model, &child, iter, i); - report_generate_child(ctx, &child); + module = g_new0(ShellModule, 1); + + gtk_tree_model_get(model, &iter, TREE_COL_NAME, &name, -1); + module->name = name; + module->entries = NULL; + + if (gtk_tree_model_iter_has_child(model, &iter)) { + ShellModuleEntry *entry; + + gint children = gtk_tree_model_iter_n_children(model, &iter); + gint i; + + for (i = 0; i < children; i++) { + GtkTreeIter child; + + gtk_tree_model_iter_nth_child(model, &child, &iter, i); + + gtk_tree_model_get(model, &child, TREE_COL_SEL, &selected, -1); + if (!selected) + continue; + + gtk_tree_model_get(model, &child, TREE_COL_DATA, &entry, -1); + module->entries = g_slist_append(module->entries, entry); + } } + + modules = g_slist_append(modules, module); + } while (gtk_tree_model_iter_next(rd->model, &iter)); + + return modules; +} + +static void +report_create_inner_from_module_list(ReportContext *ctx, GSList *modules) +{ + for (; modules; modules = modules->next) { + ShellModule *module = (ShellModule *) modules->data; + GSList *entries; + + if (!params.gui_running) + fprintf(stderr, "\033[40;32m%s\033[0m\n", module->name); + + report_title(ctx, module->name); + + for (entries = module->entries; entries; entries = entries->next) { + ShellModuleEntry *entry = (ShellModuleEntry *) entries->data; + + if (!params.gui_running) + fprintf(stderr, "\033[2K\033[40;32;1m %s\033[0m\n", entry->name); + + ctx->entry = entry; + report_subtitle(ctx, entry->name); + module_entry_scan(entry); + report_table(ctx, module_entry_function(entry)); + } + } +} + +void report_module_list_free(GSList *modules) +{ + GSList *m; + + for (m = modules; m; m = m->next) { + ShellModule *module = (ShellModule *) m->data; + + g_slist_free(module->entries); } + + g_slist_free(modules); } static gchar * @@ -196,55 +377,151 @@ report_get_filename(void) GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, NULL); -#if GTK_CHECK_VERSION(2,8,0) - gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER(dialog), - TRUE); -#endif - gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(dialog), - "hardinfo report.html"); + gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(dialog), "hardinfo report"); + + file_chooser_add_filters(dialog, file_types); + file_chooser_open_expander(dialog); if (gtk_dialog_run(GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) { - filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); - } - + gchar *ext = file_chooser_get_extension(dialog, file_types); + filename = file_chooser_build_filename(dialog, ext); + } gtk_widget_destroy (dialog); return filename; } +ReportContext* +report_context_html_new() +{ + ReportContext *ctx; + + ctx = g_new0(ReportContext, 1); + ctx->header = report_html_header; + ctx->footer = report_html_footer; + ctx->title = report_html_title; + ctx->subtitle = report_html_subtitle; + ctx->subsubtitle = report_html_subsubtitle; + ctx->keyvalue = report_html_key_value; + + ctx->output = g_strdup(""); + ctx->format = REPORT_FORMAT_HTML; + + return ctx; +} + +ReportContext* +report_context_text_new() +{ + ReportContext *ctx; + + ctx = g_new0(ReportContext, 1); + ctx->header = report_text_header; + ctx->footer = report_text_footer; + ctx->title = report_text_title; + ctx->subtitle = report_text_subtitle; + ctx->subsubtitle = report_text_subsubtitle; + ctx->keyvalue = report_text_key_value; + + ctx->output = g_strdup(""); + ctx->format = REPORT_FORMAT_TEXT; + + return ctx; +} + +void +report_context_free(ReportContext *ctx) +{ + g_free(ctx->output); + g_free(ctx); +} + +void +report_create_from_module_list(ReportContext *ctx, GSList *modules) +{ + report_header(ctx); + + report_create_inner_from_module_list(ctx, modules); + report_module_list_free(modules); + + report_footer(ctx); +} + +gchar * +report_create_from_module_list_format(GSList *modules, ReportFormat format) +{ + ReportContext *(*create_context)(); + ReportContext *ctx; + gchar *retval; + + if (format >= N_REPORT_FORMAT) + return NULL; + + create_context = file_types[format].data; + if (!create_context) + return NULL; + + ctx = create_context(); + + report_create_from_module_list(ctx, modules); + retval = g_strdup(ctx->output); + + report_context_free(ctx); + + return retval; +} + static gboolean report_generate(ReportDialog *rd) { - GtkTreeIter iter; - GtkTreeModel *model; + GSList *modules; ReportContext *ctx; + ReportContext *(*create_context)(); gchar *file; FILE *stream; - file = report_get_filename(); - if (!file) + if (!(file = report_get_filename())) return FALSE; - stream = fopen(file, "w+"); - if (!stream) + + if (!(stream = fopen(file, "w+"))) { + g_free(file); return FALSE; + } + + create_context = file_types_get_data_by_name(file_types, file); - model = rd->model; - ctx = g_new0(ReportContext, 1); - ctx->rd = rd; - ctx->stream = stream; + if (!create_context) { + g_warning("Cannot create ReportContext. Programming bug?"); + g_free(file); + return FALSE; + } - report_html_header(ctx); + ctx = create_context(); + modules = report_create_module_list_from_dialog(rd); - gtk_tree_model_get_iter_first(model, &iter); + report_create_from_module_list(ctx, modules); + fputs(ctx->output, stream); + fclose(stream); - do { - report_generate_children(ctx, &iter); - } while (gtk_tree_model_iter_next(model, &iter)); - - report_html_footer(ctx); + if (ctx->format == REPORT_FORMAT_HTML) { + GtkWidget *dialog; + dialog = gtk_message_dialog_new(NULL, + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_QUESTION, + GTK_BUTTONS_NONE, + "Open the report with your web browser?"); + gtk_dialog_add_buttons(GTK_DIALOG(dialog), + GTK_STOCK_NO, GTK_RESPONSE_REJECT, + GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, + NULL); + if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) + open_url(file); + + gtk_widget_destroy(dialog); + } - fclose(ctx->stream); - g_free(ctx); + report_context_free(ctx); + g_free(file); return TRUE; } @@ -353,10 +630,11 @@ static ReportDialog GtkWidget *button8; GtkWidget *button7; GtkWidget *label; + GtkWidget *hbox; GtkTreeViewColumn *column; GtkCellRenderer *cr_text, *cr_pbuf, *cr_toggle; - + rd = g_new0(ReportDialog, 1); dialog = gtk_dialog_new(); @@ -373,14 +651,21 @@ static ReportDialog gtk_container_set_border_width(GTK_CONTAINER(dialog1_vbox), 4); gtk_widget_show(dialog1_vbox); + hbox = gtk_hbox_new(FALSE, 5); + gtk_box_pack_start(GTK_BOX(dialog1_vbox), hbox, FALSE, FALSE, 0); + label = gtk_label_new("<big><b>Generate Report</b></big>\n" \ "Please choose the information that you wish " \ "to view in your report:"); gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); gtk_label_set_use_markup(GTK_LABEL(label), TRUE); gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); - gtk_widget_show(label); - gtk_box_pack_start(GTK_BOX(dialog1_vbox), label, FALSE, FALSE, 0); + + gtk_box_pack_start(GTK_BOX(hbox), + icon_cache_get_image("report-large.png"), + FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, TRUE, 0); + gtk_widget_show_all(hbox); scrolledwindow2 = gtk_scrolled_window_new(NULL, NULL); gtk_widget_show(scrolledwindow2); @@ -439,7 +724,6 @@ static ReportDialog gtk_button_box_set_layout(GTK_BUTTON_BOX(dialog1_action_area), GTK_BUTTONBOX_END); - button8 = gtk_button_new_from_stock(GTK_STOCK_CANCEL); gtk_widget_show(button8); gtk_dialog_add_action_widget(GTK_DIALOG(dialog), button8, @@ -1,6 +1,6 @@ /* * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> + * Copyright (C) 2003-2007 Leandro A. F. Pereira <leandro@linuxmag.com.br> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,14 +21,29 @@ #include <gtk/gtk.h> #include <shell.h> +typedef enum { + REPORT_FORMAT_HTML, + REPORT_FORMAT_TEXT, + N_REPORT_FORMAT +} ReportFormat; + typedef struct _ReportDialog ReportDialog; typedef struct _ReportContext ReportContext; struct _ReportContext { - ReportDialog *rd; ShellModuleEntry *entry; + gchar *output; + + void (*header) (ReportContext *ctx); + void (*footer) (ReportContext *ctx); + void (*title) (ReportContext *ctx, gchar *text); + void (*subtitle) (ReportContext *ctx, gchar *text); + void (*subsubtitle) (ReportContext *ctx, gchar *text); + void (*keyvalue) (ReportContext *ctx, gchar *key, gchar *value); - FILE *stream; + ReportFormat format; + + gboolean is_image_enabled; }; struct _ReportDialog { @@ -43,6 +58,23 @@ struct _ReportDialog { GtkTreeModel *model; }; -void report_dialog_show(); +void report_dialog_show(); + +ReportContext *report_context_html_new(); +ReportContext *report_context_text_new(); + +void report_header (ReportContext *ctx); +void report_footer (ReportContext *ctx); +void report_title (ReportContext *ctx, gchar *text); +void report_subtitle (ReportContext *ctx, gchar *text); +void report_subsubtitle (ReportContext *ctx, gchar *text); +void report_key_value (ReportContext *ctx, gchar *key, gchar *value); +void report_table (ReportContext *ctx, gchar *text); + +void report_create_from_module_list(ReportContext *ctx, GSList *modules); +gchar *report_create_from_module_list_format(GSList *modules, ReportFormat format); + +void report_context_free(ReportContext *ctx); +void report_module_list_free(GSList *modules); #endif /* __REPORT_H__ */ @@ -19,11 +19,6 @@ A million repetitions of "a" #include <string.h> #include <sha1.h> -#include <glib.h> -#if G_BYTE_ORDER == G_LITTLE_ENDIAN -#define LITTLE_ENDIAN /* This should be #define'd if true. */ -#endif - #if defined(__OPTIMIZE__) #error You must compile this program without "-O". #endif @@ -52,16 +47,16 @@ A million repetitions of "a" /* Hash a single 512-bit block. This is the core of the algorithm. */ -void SHA1Transform(unsigned long state[5], unsigned char buffer[64]) +void SHA1Transform(guint32 state[5], guchar buffer[64]) { - unsigned long a, b, c, d, e; + guint32 a, b, c, d, e; typedef union { - unsigned char c[64]; - unsigned long l[16]; + guchar c[64]; + guint32 l[16]; } CHAR64LONG16; CHAR64LONG16 *block; #ifdef SHA1HANDSOFF - static unsigned char workspace[64]; + static guchar workspace[64]; block = (CHAR64LONG16 *) workspace; memcpy(block, buffer, 64); #else @@ -181,9 +176,9 @@ void SHA1Init(SHA1_CTX * context) /* Run your data through this. */ -void SHA1Update(SHA1_CTX * context, unsigned char *data, unsigned int len) +void SHA1Update(SHA1_CTX * context, guchar *data, guint32 len) { - unsigned int i, j; + guint32 i, j; j = (context->count[0] >> 3) & 63; if ((context->count[0] += len << 3) < (len << 3)) @@ -204,22 +199,22 @@ void SHA1Update(SHA1_CTX * context, unsigned char *data, unsigned int len) /* Add padding and return the message digest. */ -void SHA1Final(unsigned char digest[20], SHA1_CTX * context) +void SHA1Final(guchar digest[20], SHA1_CTX * context) { - unsigned long i, j; - unsigned char finalcount[8]; + guint32 i, j; + guchar finalcount[8]; for (i = 0; i < 8; i++) { - finalcount[i] = (unsigned char) ((context->count[(i >= 4 ? 0 : 1)] + finalcount[i] = (guchar) ((context->count[(i >= 4 ? 0 : 1)] >> ((3 - (i & 3)) * 8)) & 255); /* Endian independent */ } - SHA1Update(context, (unsigned char *) "\200", 1); + SHA1Update(context, (guchar *) "\200", 1); while ((context->count[0] & 504) != 448) { - SHA1Update(context, (unsigned char *) "\0", 1); + SHA1Update(context, (guchar *) "\0", 1); } SHA1Update(context, finalcount, 8); /* Should cause a SHA1Transform() */ for (i = 0; i < 20; i++) { - digest[i] = (unsigned char) + digest[i] = (guchar) ((context->state[i >> 2] >> ((3 - (i & 3)) * 8)) & 255); } /* Wipe variables */ @@ -241,12 +236,12 @@ void g_assert(int a) /* Bah, who needs testing anyway... ;) */ } -static void base32_encode_exactly(unsigned char *buf, int len, - unsigned char *encbuf, int enclen) +static void base32_encode_exactly(guchar *buf, gint len, + guchar *encbuf, gint enclen) { - int i = 0; - unsigned char *ip = buf + len; - unsigned char *op = encbuf + enclen; + gint i = 0; + guchar *ip = buf + len; + guchar *op = encbuf + enclen; switch (len % 5) { case 0: @@ -257,26 +252,26 @@ static void base32_encode_exactly(unsigned char *buf, int len, i >>= 5; /* upper <234>, input #4 */ /* FALLTHROUGH */ case 4: - i |= ((unsigned int) *--ip) << 3; /* had 3 bits in `i' */ + i |= ((guint32) *--ip) << 3; /* had 3 bits in `i' */ *--op = b32_alphabet[i & 0x1f]; /* Output #6 */ i >>= 5; /* upper <401234>, input #3 */ *--op = b32_alphabet[i & 0x1f]; /* Output #5 */ i >>= 5; /* upper <4>, input #3 */ /* FALLTHROUGH */ case 3: - i |= ((unsigned int) *--ip) << 1; /* had 1 bits in `i' */ + i |= ((guint32) *--ip) << 1; /* had 1 bits in `i' */ *--op = b32_alphabet[i & 0x1f]; /* Output #4 */ i >>= 5; /* upper <1234>, input #2 */ /* FALLTHROUGH */ case 2: - i |= ((unsigned int) *--ip) << 4; /* had 4 bits in `i' */ + i |= ((guint32) *--ip) << 4; /* had 4 bits in `i' */ *--op = b32_alphabet[i & 0x1f]; /* Output #3 */ i >>= 5; /* upper <3401234>, input #1 */ *--op = b32_alphabet[i & 0x1f]; /* Output #2 */ i >>= 5; /* upper <34>, input #1 */ /* FALLTHROUGH */ case 1: - i |= ((unsigned int) *--ip) << 2; /* had 2 bits in `i' */ + i |= ((guint32) *--ip) << 2; /* had 2 bits in `i' */ *--op = b32_alphabet[i & 0x1f]; /* Output #1 */ i >>= 5; /* upper <01234>, input #0 */ *--op = b32_alphabet[i & 0x1f]; /* Output #0 */ @@ -293,9 +288,9 @@ static void base32_encode_exactly(unsigned char *buf, int len, int main(int argc, char **argv) { - int i, j; + gint i, j; SHA1_CTX context; - unsigned char digest[20], buffer[16384]; + guchar digest[20], buffer[16384]; FILE *file; if (argc > 2) { @@ -329,7 +324,7 @@ int main(int argc, char **argv) */ { - unsigned char tmp[33]; + guchar tmp[33]; tmp[32] = '\0'; base32_encode_exactly(digest, 20, tmp, 32); printf("%s\n", tmp); @@ -7,15 +7,24 @@ #ifndef __SHA1_H__ #define __SHA1_H__ +#include <glib.h> + +#ifndef LITTLE_ENDIAN +#if G_BYTE_ORDER == G_LITTLE_ENDIAN +#define LITTLE_ENDIAN /* This should be #define'd if true. */ +#endif /* G_BYTE_ORDER */ +#endif /* LITTLE_ENDIAN */ + + typedef struct { - unsigned long state[5]; - unsigned long count[2]; - unsigned char buffer[64]; + guint32 state[5]; + guint32 count[2]; + guchar buffer[64]; } SHA1_CTX; -void SHA1Transform(unsigned long state[5], unsigned char buffer[64]); +void SHA1Transform(guint32 state[5], guchar buffer[64]); void SHA1Init(SHA1_CTX* context); -void SHA1Update(SHA1_CTX* context, unsigned char* data, unsigned int len); -void SHA1Final(unsigned char digest[20], SHA1_CTX* context); +void SHA1Update(SHA1_CTX* context, guchar* data, unsigned int len); +void SHA1Final(guchar digest[20], SHA1_CTX* context); #endif /* __SHA1_H__ */ @@ -1,6 +1,6 @@ /* * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> + * Copyright (C) 2003-2007 Leandro A. F. Pereira <leandro@linuxmag.com.br> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,29 +28,32 @@ #include <menu.h> #include <stock.h> -#include <binreloc.h> +#include <callbacks.h> /* * Internal Prototypes ******************************************************** */ -static void create_window(); -static ShellTree *tree_new(void); -static ShellInfoTree *info_tree_new(gboolean extra); +static void create_window(); +static ShellTree *tree_new(void); +static ShellInfoTree *info_tree_new(gboolean extra); -static void module_selected(GtkTreeSelection * ts, gpointer data); -static void module_selected_show_info(ShellModuleEntry * entry, - gboolean reload); -static void info_selected(GtkTreeSelection * ts, gpointer data); -static void info_selected_show_extra(gchar * data); -static gboolean reload_section(gpointer data); +static void module_selected(gpointer data); +static void module_selected_show_info(ShellModuleEntry * entry, + gboolean reload); +static void info_selected(GtkTreeSelection * ts, gpointer data); +static void info_selected_show_extra(gchar * data); +static gboolean reload_section(gpointer data); +static gboolean rescan_section(gpointer data); +static gboolean update_field(gpointer data); /* * Globals ******************************************************************** */ -static Shell *shell = NULL; -static GHashTable *update_tbl = NULL; +static Shell *shell = NULL; +static GHashTable *update_tbl = NULL; +static GSList *update_sfusrc = NULL; /* * Code :) ******************************************************************** @@ -60,200 +63,292 @@ Shell *shell_get_main_shell(void) { return shell; } - -void shell_ui_manager_set_visible(const gchar *path, - gboolean setting) + +void shell_ui_manager_set_visible(const gchar * path, gboolean setting) { GtkWidget *widget; - + + if (!params.gui_running) + return; + widget = gtk_ui_manager_get_widget(shell->ui_manager, path); if (!widget) - return; - + return; + if (setting) gtk_widget_show(widget); else gtk_widget_hide(widget); } -void shell_action_set_property(const gchar *action_name, - const gchar *property, - gboolean setting) +void shell_action_set_property(const gchar * action_name, + const gchar * property, gboolean setting) { GtkAction *action; - + + if (!params.gui_running) + return; + action = gtk_action_group_get_action(shell->action_group, action_name); if (action) { - GValue value = {0}; - - g_value_init(&value, G_TYPE_BOOLEAN); - g_value_set_boolean(&value, setting); - - g_object_set_property(G_OBJECT(action), property, &value); - - g_value_unset(&value); - } + GValue value = { 0 }; + + g_value_init(&value, G_TYPE_BOOLEAN); + g_value_set_boolean(&value, setting); + + g_object_set_property(G_OBJECT(action), property, &value); + + g_value_unset(&value); + } } -void shell_action_set_enabled(const gchar *action_name, gboolean setting) +void shell_action_set_enabled(const gchar * action_name, gboolean setting) +{ + if (params.gui_running) { + GtkAction *action; + + action = + gtk_action_group_get_action(shell->action_group, action_name); + if (action) { + gtk_action_set_sensitive(action, setting); + } + } +} + +gboolean shell_action_get_enabled(const gchar * action_name) { GtkAction *action; - + + if (!params.gui_running) + return FALSE; + action = gtk_action_group_get_action(shell->action_group, action_name); if (action) { - gtk_action_set_sensitive(action, setting); + return gtk_action_get_sensitive(action); } + + return FALSE; } void shell_set_side_pane_visible(gboolean setting) { + if (!params.gui_running) + return; + if (setting) gtk_widget_show(shell->tree->scroll); else gtk_widget_hide(shell->tree->scroll); } -gboolean shell_action_get_active(const gchar *action_name) +gboolean shell_action_get_active(const gchar * action_name) { - GtkAction *action; - GSList *proxies; - + GtkAction *action; + GSList *proxies; + /* FIXME: Ugh. Are you sure there isn't any simpler way? O_o */ + if (!params.gui_running) + return FALSE; action = gtk_action_group_get_action(shell->action_group, action_name); if (action) { - proxies = gtk_action_get_proxies(action); - - for (; proxies; proxies = proxies->next) { - GtkWidget *widget = (GtkWidget *)proxies->data; - - if (GTK_IS_CHECK_MENU_ITEM(widget)) { - return gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget)); - } - } + proxies = gtk_action_get_proxies(action); + + for (; proxies; proxies = proxies->next) { + GtkWidget *widget = (GtkWidget *) proxies->data; + + if (GTK_IS_CHECK_MENU_ITEM(widget)) { + return + gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM + (widget)); + } + } } - + return FALSE; } -void shell_action_set_active(const gchar *action_name, gboolean setting) +void shell_action_set_active(const gchar * action_name, gboolean setting) { - GtkAction *action; - GSList *proxies; - + GtkAction *action; + GSList *proxies; + /* FIXME: Ugh. Are you sure there isn't any simpler way? O_o */ + if (!params.gui_running) + return; action = gtk_action_group_get_action(shell->action_group, action_name); if (action) { - proxies = gtk_action_get_proxies(action); - - for (; proxies; proxies = proxies->next) { - GtkWidget *widget = (GtkWidget *)proxies->data; - - if (GTK_IS_CHECK_MENU_ITEM(widget)) { - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(widget), setting); - return; - } - } + proxies = gtk_action_get_proxies(action); + + for (; proxies; proxies = proxies->next) { + GtkWidget *widget = (GtkWidget *) proxies->data; + + if (GTK_IS_CHECK_MENU_ITEM(widget)) { + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(widget), + setting); + return; + } + } } } -void -shell_status_pulse(void) +void shell_status_pulse(void) { - if (shell->_pulses++ == 20) { - /* we're pulsing for some time, disable the interface and change the cursor - to a hourglass */ - shell_view_set_enabled(FALSE); - } + if (params.gui_running) { + if (shell->_pulses++ == 20) { + /* we're pulsing for some time, disable the interface and change the cursor + to a hourglass */ + shell_view_set_enabled(FALSE); + } - gtk_progress_bar_pulse(GTK_PROGRESS_BAR(shell->progress)); - while (gtk_events_pending()) - gtk_main_iteration(); + gtk_progress_bar_pulse(GTK_PROGRESS_BAR(shell->progress)); + while (gtk_events_pending()) + gtk_main_iteration(); + } else { + static gint counter = 0; + + fprintf(stderr, "\033[2K\033[40;37;1m %c\033[0m\r", + "|/-\\"[counter++ % 4]); + } } -void -shell_status_set_percentage(gint percentage) +void shell_status_set_percentage(gint percentage) { - gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(shell->progress), - (float)percentage/100.0); - while (gtk_events_pending()) - gtk_main_iteration(); + if (params.gui_running) { + gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(shell->progress), + (float) percentage / 100.0); + while (gtk_events_pending()) + gtk_main_iteration(); + } else { + if (percentage < 1 || percentage >= 100) { + fprintf(stderr, "\033[2K"); + } else { + gchar pbar[] = "----------"; + + memset(pbar, '#', percentage / 10); + + fprintf(stderr, "\r\033[40;37;1m%3d%% \033[40;34;1m" + "%s\033[0m\r", percentage, pbar); + } + } } -void -shell_view_set_enabled(gboolean setting) +void shell_view_set_enabled(gboolean setting) { + if (!params.gui_running) + return; + if (setting) { - shell->_pulses = 0; - widget_set_cursor(shell->window, GDK_LEFT_PTR); + shell->_pulses = 0; + widget_set_cursor(shell->window, GDK_LEFT_PTR); } else { - widget_set_cursor(shell->window, GDK_WATCH); + widget_set_cursor(shell->window, GDK_WATCH); } gtk_widget_set_sensitive(shell->hpaned, setting); shell_action_set_enabled("ViewMenuAction", setting); shell_action_set_enabled("RefreshAction", setting); + shell_action_set_enabled("CopyAction", setting); shell_action_set_enabled("ReportAction", setting); + shell_action_set_enabled("SaveGraphAction", setting ? shell->view_type == SHELL_VIEW_PROGRESS : FALSE); } -void -shell_status_set_enabled(gboolean setting) +void shell_status_set_enabled(gboolean setting) { + if (!params.gui_running) + return; + if (setting) gtk_widget_show(shell->progress); else { gtk_widget_hide(shell->progress); shell_view_set_enabled(TRUE); + + shell_status_update("Done."); } } -void -shell_do_reload(void) +void shell_do_reload(void) { + if (!params.gui_running || !shell->selected) + return; + shell_action_set_enabled("RefreshAction", FALSE); + shell_action_set_enabled("CopyAction", FALSE); shell_action_set_enabled("ReportAction", FALSE); - if (shell->selected && shell->selected->reloadfunc) { - GtkTreeSelection *ts; - - ts = gtk_tree_view_get_selection(GTK_TREE_VIEW(shell->tree->view)); - shell_status_set_enabled(TRUE); - - shell->selected->reloadfunc(shell->selected->number); - module_selected(ts, NULL); - } + shell_status_set_enabled(TRUE); + + module_entry_reload(shell->selected); + module_selected(NULL); shell_action_set_enabled("RefreshAction", TRUE); + shell_action_set_enabled("CopyAction", TRUE); shell_action_set_enabled("ReportAction", TRUE); } -void -shell_status_update(const gchar *message) +void shell_status_update(const gchar * message) { - gtk_label_set_markup(GTK_LABEL(shell->status), message); - gtk_progress_bar_pulse(GTK_PROGRESS_BAR(shell->progress)); - while (gtk_events_pending()) - gtk_main_iteration(); + if (params.gui_running) { + gtk_label_set_markup(GTK_LABEL(shell->status), message); + gtk_progress_bar_pulse(GTK_PROGRESS_BAR(shell->progress)); + while (gtk_events_pending()) + gtk_main_iteration(); + } else { + fprintf(stderr, "\033[2K\033[40;37;1m %s\033[0m\r", message); + } } -static void -destroy_me(void) +static void destroy_me(void) { - gtk_main_quit(); - exit(0); + cb_quit(); } -static void -create_window(void) +static void close_note(GtkWidget *widget, gpointer user_data) { - GtkWidget *vbox, *hbox; + gtk_widget_hide(shell->note->frame); +} + +static ShellNote *note_new(void) +{ + ShellNote *note; + GtkWidget *hbox, *icon, *button; + + note = g_new0(ShellNote, 1); + note->label = gtk_label_new(""); + note->frame = gtk_frame_new(NULL); + button = gtk_button_new(); + + icon = icon_cache_get_image("close.png"); + gtk_widget_show(icon); + gtk_container_add(GTK_CONTAINER(button), icon); + gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE); + g_signal_connect(G_OBJECT(button), "clicked", (GCallback) close_note, NULL); + + hbox = gtk_hbox_new(FALSE, 3); + icon = icon_cache_get_image("dialog-information.png"); + + gtk_box_pack_start(GTK_BOX(hbox), icon, FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(hbox), note->label, FALSE, FALSE, 0); + gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); + + gtk_container_set_border_width(GTK_CONTAINER(hbox), 5); + gtk_container_add(GTK_CONTAINER(note->frame), hbox); + gtk_widget_show_all(hbox); + + return note; +} + +static void create_window(void) +{ + GtkWidget *vbox, *hbox; shell = g_new0(Shell, 1); shell->window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_icon(GTK_WINDOW(shell->window), - icon_cache_get_pixbuf("logo.png")); + icon_cache_get_pixbuf("logo.png")); gtk_window_set_title(GTK_WINDOW(shell->window), "System Information"); gtk_widget_set_size_request(shell->window, 600, 400); g_signal_connect(G_OBJECT(shell->window), "destroy", destroy_me, NULL); @@ -262,7 +357,7 @@ create_window(void) gtk_widget_show(vbox); gtk_container_add(GTK_CONTAINER(shell->window), vbox); shell->vbox = vbox; - + menu_init(shell); hbox = gtk_hbox_new(FALSE, 5); @@ -284,185 +379,118 @@ create_window(void) gtk_box_pack_end(GTK_BOX(vbox), shell->hpaned, TRUE, TRUE, 0); gtk_paned_set_position(GTK_PANED(shell->hpaned), 210); + vbox = gtk_vbox_new(FALSE, 5); + gtk_widget_show(vbox); + gtk_paned_add2(GTK_PANED(shell->hpaned), vbox); + + shell->note = note_new(); + gtk_box_pack_end(GTK_BOX(vbox), shell->note->frame, FALSE, FALSE, 0); + shell->vpaned = gtk_vpaned_new(); + gtk_box_pack_start(GTK_BOX(vbox), shell->vpaned, TRUE, TRUE, 0); gtk_widget_show(shell->vpaned); - gtk_paned_add2(GTK_PANED(shell->hpaned), shell->vpaned); - + shell->notebook = gtk_notebook_new(); gtk_paned_add2(GTK_PANED(shell->vpaned), shell->notebook); - + gtk_widget_show(shell->window); while (gtk_events_pending()) gtk_main_iteration(); } -static void -shell_tree_modules_load(ShellTree * shelltree) -{ - gchar *modules_conf; - GKeyFile *keyfile = g_key_file_new(); - guint categories, i; - - keyfile = g_key_file_new(); - - modules_conf = g_strdup_printf("%s/hardinfo/modules.conf", - gbr_find_data_dir(PREFIX)); - g_key_file_load_from_file(keyfile, modules_conf, 0, NULL); - g_free(modules_conf); - - if (g_key_file_get_integer(keyfile, "general", "version", NULL) != 2) { - g_error("Wrong version of modules.conf"); - } - - gchar **cat = g_key_file_get_keys(keyfile, "categories", &categories, NULL); - for (i = 0; i < categories; i++) { - ShellModule *module; - gchar *tmp, *iname; - - module = g_new0(ShellModule, 1); - module->name = g_strdup(cat[i]); - iname = g_key_file_get_value(keyfile, "categories", cat[i], NULL); - - tmp = g_strdup_printf("%s.png", iname); - module->icon = icon_cache_get_pixbuf(tmp); - g_free(tmp); - - tmp = g_strdup_printf("%s/hardinfo/modules/%s.so", - gbr_find_lib_dir(PREFIX), - iname); - module->dll = g_module_open(tmp, G_MODULE_BIND_LAZY); - g_free(tmp); - - if (module->dll) { - gint(*n_entries) (void); - gint i; - - if (!g_module_symbol(module->dll, "hi_n_entries", (gpointer) & n_entries)) - continue; - - gint j = n_entries(); - for (i = 0; i <= j; i++) { - GdkPixbuf *(*shell_icon) (gint); - const gchar *(*shell_name) (gint); - ShellModuleEntry *entry = g_new0(ShellModuleEntry, 1); - - if (g_module_symbol(module->dll, "hi_icon", (gpointer)&(shell_icon))) { - entry->icon = shell_icon(i); - } - if (g_module_symbol(module->dll, "hi_name", (gpointer)&(shell_name))) { - entry->name = g_strdup(shell_name(i)); - } - g_module_symbol(module->dll, "hi_info", - (gpointer) & (entry->func)); - g_module_symbol(module->dll, "hi_reload", - (gpointer) & (entry->reloadfunc)); - g_module_symbol(module->dll, "hi_more_info", - (gpointer) & (entry->morefunc)); - g_module_symbol(module->dll, "hi_get_field", - (gpointer) & (entry->fieldfunc)); - - entry->number = i; - module->entries = g_slist_append(module->entries, entry); - } - - shelltree->modules = g_slist_append(shelltree->modules, module); - } else { - g_free(module->name); - g_free(module->icon); - g_free(module); - } - - g_free(iname); - } - - g_strfreev(cat); - g_key_file_free(keyfile); -} - static void view_menu_select_entry(gpointer data, gpointer data2) { - GtkTreeSelection *ts; - GtkTreePath *path; - GtkTreeIter *iter = (GtkTreeIter*) data2; + GtkTreePath *path; + GtkTreeIter *iter = (GtkTreeIter *) data2; - ts = gtk_tree_view_get_selection(GTK_TREE_VIEW(shell->tree->view)); path = gtk_tree_model_get_path(shell->tree->model, iter); - - gtk_tree_selection_select_path(ts, path); - gtk_tree_view_set_cursor(GTK_TREE_VIEW(shell->tree->view), path, NULL, FALSE); + + gtk_tree_selection_select_path(shell->tree->selection, path); + gtk_tree_view_set_cursor(GTK_TREE_VIEW(shell->tree->view), path, NULL, + FALSE); gtk_tree_path_free(path); } -static void -add_module_to_view_menu(gchar *name, GdkPixbuf *pixbuf) +static void add_module_to_menu(gchar * name, GdkPixbuf * pixbuf) { + gchar *about_module = g_strdup_printf("AboutModule%s", name); + stock_icon_register_pixbuf(pixbuf, name); GtkActionEntry entries[] = { - { name, /* name */ - name, /* stockid */ - name, /* label */ - NULL, /* accelerator */ - NULL, /* tooltip */ - NULL, /* callback */ - }, + { + name, /* name */ + name, /* stockid */ + name, /* label */ + NULL, /* accelerator */ + NULL, /* tooltip */ + NULL, /* callback */ + }, + { + about_module, + name, + name, + NULL, + name, + (GCallback) cb_about_module, + }, }; - - gtk_action_group_add_actions(shell->action_group, entries, 1, NULL); + + gtk_action_group_add_actions(shell->action_group, entries, 2, NULL); gtk_ui_manager_add_ui(shell->ui_manager, - gtk_ui_manager_new_merge_id(shell->ui_manager), - "/menubar/ViewMenu/LastSep", - name, - name, - GTK_UI_MANAGER_MENU, - TRUE); + gtk_ui_manager_new_merge_id(shell->ui_manager), + "/menubar/ViewMenu/LastSep", + name, name, GTK_UI_MANAGER_MENU, TRUE); + + gtk_ui_manager_add_ui(shell->ui_manager, + gtk_ui_manager_new_merge_id(shell->ui_manager), + "/menubar/HelpMenu/HelpMenuModules/LastSep", + about_module, about_module, GTK_UI_MANAGER_AUTO, TRUE); } static void -add_module_entry_to_view_menu(gchar *module, gchar *name, GdkPixbuf *pixbuf, GtkTreeIter *iter) +add_module_entry_to_view_menu(gchar * module, gchar * name, + GdkPixbuf * pixbuf, GtkTreeIter * iter) { stock_icon_register_pixbuf(pixbuf, name); GtkActionEntry entries[] = { - { name, /* name */ - name, /* stockid */ - name, /* label */ - NULL, /* accelerator */ - NULL, /* tooltip */ - (GCallback)view_menu_select_entry,/* callback */ - }, + { + name, /* name */ + name, /* stockid */ + name, /* label */ + NULL, /* accelerator */ + NULL, /* tooltip */ + (GCallback) view_menu_select_entry, /* callback */ + }, }; - + gtk_action_group_add_actions(shell->action_group, entries, 1, iter); gtk_ui_manager_add_ui(shell->ui_manager, - gtk_ui_manager_new_merge_id(shell->ui_manager), - g_strdup_printf("/menubar/ViewMenu/%s", module), - name, - name, - GTK_UI_MANAGER_AUTO, - FALSE); + gtk_ui_manager_new_merge_id(shell->ui_manager), + g_strdup_printf("/menubar/ViewMenu/%s", module), + name, name, GTK_UI_MANAGER_AUTO, FALSE); } -static void -add_modules_to_gui(gpointer data, gpointer user_data) +static void add_modules_to_gui(gpointer data, gpointer user_data) { - ShellTree *shelltree = (ShellTree *) user_data; - ShellModule *module = (ShellModule *) data; - GtkTreeStore *store = GTK_TREE_STORE(shelltree->model); - GtkTreeIter parent; + ShellTree *shelltree = (ShellTree *) user_data; + ShellModule *module = (ShellModule *) data; + GtkTreeStore *store = GTK_TREE_STORE(shelltree->model); + GtkTreeIter parent; gtk_tree_store_append(store, &parent, NULL); gtk_tree_store_set(store, &parent, TREE_COL_NAME, module->name, - TREE_COL_DATA, NULL, - TREE_COL_SEL, FALSE, -1); + TREE_COL_DATA, NULL, TREE_COL_SEL, FALSE, -1); if (module->icon) { - gtk_tree_store_set(store, &parent, TREE_COL_PBUF, module->icon, -1); + gtk_tree_store_set(store, &parent, TREE_COL_PBUF, module->icon, + -1); } - add_module_to_view_menu(module->name, module->icon); + add_module_to_menu(module->name, module->icon); if (module->entries) { ShellModuleEntry *entry; @@ -475,15 +503,16 @@ add_modules_to_gui(gpointer data, gpointer user_data) gtk_tree_store_append(store, &child, &parent); gtk_tree_store_set(store, &child, TREE_COL_NAME, entry->name, TREE_COL_DATA, entry, - TREE_COL_SEL, FALSE, -1); + TREE_COL_SEL, FALSE, -1); if (entry->icon) { gtk_tree_store_set(store, &child, TREE_COL_PBUF, entry->icon, -1); } - - add_module_entry_to_view_menu(module->name, entry->name, entry->icon, - gtk_tree_iter_copy(&child)); + + add_module_entry_to_view_menu(module->name, entry->name, + entry->icon, + gtk_tree_iter_copy(&child)); shell_status_pulse(); } @@ -491,16 +520,22 @@ add_modules_to_gui(gpointer data, gpointer user_data) } } -void -shell_init(void) + +void shell_init(GSList * modules) { if (shell) { g_error("Shell already created"); return; } + DEBUG("initializing shell"); + create_window(); + shell_action_set_property("CopyAction", "is-important", TRUE); + shell_action_set_property("RefreshAction", "is-important", TRUE); + shell_action_set_property("ReportAction", "is-important", TRUE); + shell->tree = tree_new(); shell->info = info_tree_new(FALSE); shell->moreinfo = info_tree_new(TRUE); @@ -512,9 +547,10 @@ shell_init(void) SHELL_PACK_RESIZE, SHELL_PACK_SHRINK); gtk_notebook_append_page(GTK_NOTEBOOK(shell->notebook), - shell->moreinfo->scroll, NULL); + shell->moreinfo->scroll, NULL); gtk_notebook_append_page(GTK_NOTEBOOK(shell->notebook), - load_graph_get_framed(shell->loadgraph), NULL); + load_graph_get_framed(shell->loadgraph), + NULL); gtk_notebook_set_show_tabs(GTK_NOTEBOOK(shell->notebook), FALSE); gtk_notebook_set_show_border(GTK_NOTEBOOK(shell->notebook), FALSE); @@ -522,62 +558,65 @@ shell_init(void) shell_status_set_enabled(TRUE); shell_status_update("Loading modules..."); - shell_tree_modules_load(shell->tree); + shell->tree->modules = modules ? modules : modules_load_all(); + g_slist_foreach(shell->tree->modules, add_modules_to_gui, shell->tree); gtk_tree_view_expand_all(GTK_TREE_VIEW(shell->tree->view)); - shell_status_update("Done."); - shell_status_set_enabled(FALSE); - gtk_widget_show_all(shell->hpaned); load_graph_configure_expose(shell->loadgraph); - gtk_widget_hide(shell->notebook); + gtk_widget_hide(shell->note->frame); + + shell_status_update("Done."); + shell_status_set_enabled(FALSE); shell_action_set_enabled("RefreshAction", FALSE); + shell_action_set_enabled("CopyAction", FALSE); + shell_action_set_enabled("SaveGraphAction", FALSE); shell_action_set_active("SidePaneAction", TRUE); shell_action_set_active("ToolbarAction", TRUE); - shell_action_set_property("RefreshAction", "is-important", TRUE); - shell_action_set_property("ReportAction", "is-important", TRUE); } -static gboolean -update_field(gpointer data) +static gboolean update_field(gpointer data) { - ShellFieldUpdate *fu = (ShellFieldUpdate *) data; - + ShellFieldUpdate *fu = (ShellFieldUpdate *) data; + GtkTreeIter *iter = g_hash_table_lookup(update_tbl, fu->field_name); + /* if the entry is still selected, update it */ - if (fu->entry->selected && fu->entry->fieldfunc) { - gchar *value = fu->entry->fieldfunc(fu->field_name); - GtkTreeIter *iter = g_hash_table_lookup(update_tbl, fu->field_name); - - /* this function is also used to feed the load graph when ViewType = - SHELL_VIEW_LOAD_GRAPH */ - if (fu->loadgraph && shell->view_type == SHELL_VIEW_LOAD_GRAPH) { - GtkTreeSelection *ts; - - ts = gtk_tree_view_get_selection(GTK_TREE_VIEW - (shell->info->view)); - - if (iter && gtk_tree_selection_iter_is_selected(ts, iter)) { - load_graph_update(shell->loadgraph, atoi(value)); - } - - g_free(value); - - return TRUE; + if (iter && fu->entry->selected && fu->entry->fieldfunc) { + GtkTreeStore *store = GTK_TREE_STORE(shell->info->model); + gchar *value = fu->entry->fieldfunc(fu->field_name); + + /* + * this function is also used to feed the load graph when ViewType + * is SHELL_VIEW_LOAD_GRAPH + */ + if (shell->view_type == SHELL_VIEW_LOAD_GRAPH && + gtk_tree_selection_iter_is_selected(shell->info->selection, + iter)) { + load_graph_update(shell->loadgraph, atoi(value)); } + + gtk_tree_store_set(store, iter, INFO_TREE_COL_VALUE, value, -1); + + g_free(value); + return TRUE; + } + + if (update_sfusrc) { + GSList *sfu; - if (iter) { - GtkTreeStore *store = GTK_TREE_STORE(shell->info->model); - - gtk_tree_store_set(store, iter, INFO_TREE_COL_VALUE, value, -1); - g_free(value); - - return TRUE; + for (sfu = update_sfusrc; sfu; sfu = sfu->next) { + g_free(sfu->data); } + + g_slist_free(update_sfusrc); + update_sfusrc = NULL; } + + DEBUG("destroying ShellFieldUpdate for field %s", fu->field_name); /* otherwise, cleanup and destroy the timeout */ g_free(fu->field_name); @@ -586,31 +625,28 @@ update_field(gpointer data) return FALSE; } -static gboolean -reload_section(gpointer data) +static gboolean reload_section(gpointer data) { - ShellModuleEntry *entry = (ShellModuleEntry *) data; + ShellModuleEntry *entry = (ShellModuleEntry *) data; /* if the entry is still selected, update it */ - if (entry->selected && entry->reloadfunc) { - GtkTreePath *path = NULL; - GtkTreeSelection *ts; - GtkTreeIter iter; + if (entry->selected) { + GtkTreePath *path = NULL; + GtkTreeIter iter; /* gets the current selected path */ - ts = gtk_tree_view_get_selection(GTK_TREE_VIEW - (shell->info->view)); - if (gtk_tree_selection_get_selected(ts, &shell->info->model, &iter)) + if (gtk_tree_selection_get_selected + (shell->info->selection, &shell->info->model, &iter)) path = gtk_tree_model_get_path(shell->info->model, &iter); /* update the information, clear the treeview and populate it again */ - entry->reloadfunc(entry->number); + module_entry_reload(entry); info_selected_show_extra(NULL); /* clears the more info store */ module_selected_show_info(entry, TRUE); /* if there was a selection, reselect it */ if (path) { - gtk_tree_selection_select_path(ts, path); + gtk_tree_selection_select_path(shell->info->selection, path); gtk_tree_path_free(path); } } @@ -619,37 +655,90 @@ reload_section(gpointer data) return FALSE; } -static void -set_view_type(ShellViewType viewtype) +static gboolean rescan_section(gpointer data) +{ + ShellModuleEntry *entry = (ShellModuleEntry *) data; + + module_entry_reload(entry); + + return entry->selected; +} + +gint +info_tree_compare_val_func(GtkTreeModel * model, + GtkTreeIter * a, + GtkTreeIter * b, + gpointer userdata) +{ + gint ret = 0; + gchar *col1, *col2; + + gtk_tree_model_get(model, a, INFO_TREE_COL_VALUE, &col1, -1); + gtk_tree_model_get(model, b, INFO_TREE_COL_VALUE, &col2, -1); + + if (col1 == NULL || col2 == NULL) { + if (col1 == NULL && col2 == NULL) + return 0; + + ret = (col1 == NULL) ? -1 : 1; + } else { + ret = shell->_order_type ? (atof(col1) < atof(col2)) : + (atof(col1) > atof(col2)); + } + + g_free(col1); + g_free(col2); + + return ret; +} + +static void set_view_type(ShellViewType viewtype) { + /* reset to the default model */ + gtk_tree_view_set_model(GTK_TREE_VIEW(shell->info->view), + shell->info->model); + + /* reset to the default view columns */ + gtk_tree_view_column_set_visible(shell->info->col_progress, FALSE); + gtk_tree_view_column_set_visible(shell->info->col_value, TRUE); + + /* turn off the rules hint */ gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(shell->info->view), FALSE); + /* turn off the save graphic action */ + shell_action_set_enabled("SaveGraphAction", FALSE); + if (viewtype == shell->view_type) - return; + return; + + if (viewtype < SHELL_VIEW_NORMAL || viewtype >= SHELL_VIEW_N_VIEWS) + viewtype = SHELL_VIEW_NORMAL; + + shell->view_type = viewtype; switch (viewtype) { default: case SHELL_VIEW_NORMAL: gtk_widget_hide(shell->notebook); - - shell->view_type = SHELL_VIEW_NORMAL; break; case SHELL_VIEW_DUAL: gtk_notebook_set_page(GTK_NOTEBOOK(shell->notebook), 0); gtk_widget_show(shell->notebook); - - shell->view_type = SHELL_VIEW_DUAL; break; case SHELL_VIEW_LOAD_GRAPH: gtk_notebook_set_page(GTK_NOTEBOOK(shell->notebook), 1); gtk_widget_show(shell->notebook); load_graph_clear(shell->loadgraph); - - gtk_paned_set_position(GTK_PANED(shell->vpaned), - shell->hpaned->allocation.height - - shell->loadgraph->height - 16); - shell->view_type = SHELL_VIEW_LOAD_GRAPH; + gtk_paned_set_position(GTK_PANED(shell->vpaned), + shell->hpaned->allocation.height - + shell->loadgraph->height - 16); + break; + case SHELL_VIEW_PROGRESS: + shell_action_set_enabled("SaveGraphAction", TRUE); + gtk_tree_view_column_set_visible(shell->info->col_progress, TRUE); + gtk_tree_view_column_set_visible(shell->info->col_value, FALSE); + gtk_widget_hide(shell->notebook); break; } } @@ -659,60 +748,71 @@ group_handle_special(GKeyFile * key_file, ShellModuleEntry * entry, gchar * group, gchar ** keys) { if (g_str_equal(group, "$ShellParam$")) { - gint i; - - for (i = 0; keys[i]; i++) { + gint i; + + for (i = 0; keys[i]; i++) { gchar *key = keys[i]; if (g_str_has_prefix(key, "UpdateInterval")) { + ShellFieldUpdate *fu = g_new0(ShellFieldUpdate, 1); + ShellFieldUpdateSource *sfutbl; gint ms; - ShellFieldUpdate *fu = g_new0(ShellFieldUpdate, 1); ms = g_key_file_get_integer(key_file, group, key, NULL); fu->field_name = g_strdup(strchr(key, '$') + 1); fu->entry = entry; - fu->loadgraph = FALSE; - g_timeout_add(ms, update_field, fu); - } else if (g_str_has_prefix(key, "LoadGraphInterval")) { + sfutbl = g_new0(ShellFieldUpdateSource, 1); + sfutbl->source_id = g_timeout_add(ms, update_field, fu); + sfutbl->sfu = fu; + + update_sfusrc = g_slist_prepend(update_sfusrc, sfutbl); + } else if (g_str_equal(key, "LoadGraphSuffix")) { + gchar *suffix = g_key_file_get_value(key_file, group, key, NULL); + load_graph_set_data_suffix(shell->loadgraph, suffix); + g_free(suffix); + } else if (g_str_equal(key, "ReloadInterval")) { gint ms; - ShellFieldUpdate *fu = g_new0(ShellFieldUpdate, 1); ms = g_key_file_get_integer(key_file, group, key, NULL); - fu->field_name = g_strdup(strchr(key, '$') + 1); - fu->entry = entry; - fu->loadgraph = TRUE; - - g_timeout_add(ms, update_field, fu); - } else if (g_str_equal(key, "ReloadInterval")) { + g_timeout_add(ms, reload_section, entry); + } else if (g_str_equal(key, "RescanInterval")) { gint ms; ms = g_key_file_get_integer(key_file, group, key, NULL); - g_timeout_add(ms, reload_section, entry); + g_timeout_add(ms, rescan_section, entry); + } else if (g_str_equal(key, "OrderType")) { + shell->_order_type = g_key_file_get_integer(key_file, + group, + key, NULL); } else if (g_str_equal(key, "ViewType")) { set_view_type(g_key_file_get_integer(key_file, group, - key, NULL)); + key, NULL)); } else if (g_str_has_prefix(key, "Icon")) { - GtkTreeIter *iter = g_hash_table_lookup(update_tbl, - strchr(key, '$') + 1); - - if (iter) { - gchar *file = g_key_file_get_value(key_file, group, key, NULL); - gtk_tree_store_set(GTK_TREE_STORE(shell->info->model), - iter, INFO_TREE_COL_PBUF, - icon_cache_get_pixbuf_at_size(file, 24, 24), - -1); - g_free(file); - } - } else if (g_str_equal(key, "Zebra")) { - gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(shell->info->view), - g_key_file_get_boolean(key_file, - group, - key, NULL)); - } + GtkTreeIter *iter = g_hash_table_lookup(update_tbl, + strchr(key, + '$') + 1); + + if (iter) { + gchar *file = + g_key_file_get_value(key_file, group, key, NULL); + gtk_tree_store_set(GTK_TREE_STORE(shell->info->model), + iter, INFO_TREE_COL_PBUF, + icon_cache_get_pixbuf_at_size(file, + 22, + 22), + -1); + g_free(file); + } + } else if (g_str_equal(key, "Zebra")) { + gtk_tree_view_set_rules_hint(GTK_TREE_VIEW + (shell->info->view), + g_key_file_get_boolean + (key_file, group, key, NULL)); + } } } else { g_warning("Unknown parameter group '%s'", group); @@ -721,18 +821,20 @@ group_handle_special(GKeyFile * key_file, ShellModuleEntry * entry, static void group_handle_normal(GKeyFile * key_file, ShellModuleEntry * entry, - gchar * group, gchar ** keys) + gchar * group, gchar ** keys, gsize ngroups) { - GtkTreeIter parent; - GtkTreeStore *store = GTK_TREE_STORE(shell->info->model); - gchar *tmp = g_strdup(group); - gint i; + GtkTreeIter parent; + GtkTreeStore *store = GTK_TREE_STORE(shell->info->model); + gchar *tmp = g_strdup(group); + gint i; - gtk_tree_store_append(store, &parent, NULL); + if (ngroups > 1) { + gtk_tree_store_append(store, &parent, NULL); - strend(tmp, '#'); - gtk_tree_store_set(store, &parent, INFO_TREE_COL_NAME, tmp, -1); - g_free(tmp); + strend(tmp, '#'); + gtk_tree_store_set(store, &parent, INFO_TREE_COL_NAME, tmp, -1); + g_free(tmp); + } for (i = 0; keys[i]; i++) { gchar *key = keys[i]; @@ -741,33 +843,38 @@ group_handle_normal(GKeyFile * key_file, ShellModuleEntry * entry, value = g_key_file_get_value(key_file, group, key, NULL); if (g_str_equal(value, "...") && entry->fieldfunc) { - g_free(value); - value = entry->fieldfunc(key); + g_free(value); + value = entry->fieldfunc(key); } - - if (g_utf8_validate(key, -1, NULL) && g_utf8_validate(value, -1, NULL)) { + + if (g_utf8_validate(key, -1, NULL) + && g_utf8_validate(value, -1, NULL)) { + if (ngroups == 1) { + gtk_tree_store_append(store, &child, NULL); + } else { gtk_tree_store_append(store, &child, &parent); - gtk_tree_store_set(store, &child, INFO_TREE_COL_VALUE, value, -1); + } + gtk_tree_store_set(store, &child, INFO_TREE_COL_VALUE, value, -1); - strend(key, '#'); + strend(key, '#'); - if (*key == '$') { - gchar **tmp; + if (*key == '$') { + gchar **tmp; - tmp = g_strsplit(++key, "$", 0); + tmp = g_strsplit(++key, "$", 0); - gtk_tree_store_set(store, &child, INFO_TREE_COL_NAME, tmp[1], - INFO_TREE_COL_DATA, tmp[0], -1); + gtk_tree_store_set(store, &child, INFO_TREE_COL_NAME, + tmp[1], INFO_TREE_COL_DATA, tmp[0], -1); - g_strfreev(tmp); - } else { - gtk_tree_store_set(store, &child, INFO_TREE_COL_NAME, key, - INFO_TREE_COL_DATA, NULL, -1); - } + g_strfreev(tmp); + } else { + gtk_tree_store_set(store, &child, INFO_TREE_COL_NAME, key, + INFO_TREE_COL_DATA, NULL, -1); + } + + g_hash_table_insert(update_tbl, g_strdup(key), + gtk_tree_iter_copy(&child)); - g_hash_table_insert(update_tbl, g_strdup(key), - gtk_tree_iter_copy(&child)); - } g_free(value); @@ -777,9 +884,9 @@ group_handle_normal(GKeyFile * key_file, ShellModuleEntry * entry, static void moreinfo_handle_normal(GKeyFile * key_file, gchar * group, gchar ** keys) { - GtkTreeIter parent; - GtkTreeStore *store = GTK_TREE_STORE(shell->moreinfo->model); - gint i; + GtkTreeIter parent; + GtkTreeStore *store = GTK_TREE_STORE(shell->moreinfo->model); + gint i; gtk_tree_store_append(store, &parent, NULL); gtk_tree_store_set(store, &parent, INFO_TREE_COL_NAME, group, -1); @@ -787,60 +894,154 @@ moreinfo_handle_normal(GKeyFile * key_file, gchar * group, gchar ** keys) for (i = 0; keys[i]; i++) { gchar *key = keys[i]; GtkTreeIter child; - gchar *value; - - value = g_key_file_get_value(key_file, group, key, NULL); + gchar *value; - if (g_utf8_validate(key, -1, NULL) && g_utf8_validate(value, -1, NULL)) { - strend(key, '#'); - - gtk_tree_store_append(store, &child, &parent); - gtk_tree_store_set(store, &child, INFO_TREE_COL_VALUE, value, - INFO_TREE_COL_NAME, key, -1); + value = g_key_file_get_value(key_file, group, key, NULL); + + if (g_utf8_validate(key, -1, NULL) + && g_utf8_validate(value, -1, NULL)) { + strend(key, '#'); + + gtk_tree_store_append(store, &child, &parent); + gtk_tree_store_set(store, &child, INFO_TREE_COL_VALUE, + value, INFO_TREE_COL_NAME, key, -1); } - - g_free(value); + + g_free(value); } } -static gboolean -g_true(gpointer key, gpointer value, gpointer data) +/* FIXME: This code must be rewritten. Although it works, it is *very* slow and + too complex for this simple task. I am lazy, so I'm not fixing it. + Be my guest to fix it. */ +static void update_progress() { - return TRUE; + GtkTreeModel *model = shell->info->model; + GtkTreeStore *store = GTK_TREE_STORE(model); + GtkTreeIter iter, fiter; + gchar *tmp; + gdouble maxv = 0, maxp = 0, cur; + + gtk_tree_model_get_iter_first(model, &fiter); + + /* finds the maximum value */ + iter = fiter; + do { + gtk_tree_model_get(model, &iter, INFO_TREE_COL_VALUE, &tmp, -1); + + cur = atof(tmp); + maxv = MAX(maxv, cur); + + g_free(tmp); + } while (gtk_tree_model_iter_next(model, &iter)); + + /* calculates the relative percentage and finds the maximum percentage */ + if (shell->_order_type == SHELL_ORDER_ASCENDING) { + iter = fiter; + do { + gtk_tree_model_get(model, &iter, INFO_TREE_COL_VALUE, &tmp, -1); + + cur = 100 - 100 * atof(tmp) / maxv; + maxp = MAX(cur, maxp); + + g_free(tmp); + } while (gtk_tree_model_iter_next(model, &iter)); + + maxp = 100 - maxp; + } + + /* fix the maximum relative percentage */ + iter = fiter; + do { + gtk_tree_model_get(model, &iter, INFO_TREE_COL_VALUE, &tmp, -1); + + cur = 100 * atof(tmp) / maxv; + if (shell->_order_type == SHELL_ORDER_ASCENDING) + cur = 100 - cur + maxp; + + gtk_tree_store_set(store, &iter, INFO_TREE_COL_PROGRESS, cur, -1); + g_free(tmp); + } while (gtk_tree_model_iter_next(model, &iter)); + + /* now sort everything up. that wasn't as hard as i thought :) */ + GtkTreeSortable *sortable = GTK_TREE_SORTABLE(shell->info->model); + + gtk_tree_sortable_set_sort_func(sortable, INFO_TREE_COL_VALUE, + info_tree_compare_val_func, 0, NULL); + gtk_tree_sortable_set_sort_column_id(sortable, + INFO_TREE_COL_VALUE, + GTK_SORT_DESCENDING); + gtk_tree_view_set_model(GTK_TREE_VIEW(shell->info->view), + GTK_TREE_MODEL(sortable)); } -static void -module_selected_show_info(ShellModuleEntry * entry, gboolean reload) +void shell_set_note_from_entry(ShellModuleEntry *entry) { - GKeyFile *key_file = g_key_file_new(); - gchar *key_data; - gchar **groups; - GtkTreeStore *store; - gint i; - - if (entry->func) { - key_data = entry->func(entry->number); + if (entry->notefunc) { + const gchar *note = module_entry_get_note(entry); + + if (note) { + gtk_label_set_markup(GTK_LABEL(shell->note->label), note); + gtk_widget_show(shell->note->frame); + } else { + gtk_widget_hide(shell->note->frame); + } } else { - key_data = g_strdup("[Error]\n" - "Invalid module="); + gtk_widget_hide(shell->note->frame); } +} + +static void +module_selected_show_info(ShellModuleEntry * entry, gboolean reload) +{ + GKeyFile *key_file = g_key_file_new(); + gchar *key_data; + gchar **groups; + GtkTreeStore *store; + gint i; + gsize ngroups; + + module_entry_scan(entry); + key_data = module_entry_function(entry); /* reset the view type to normal */ set_view_type(SHELL_VIEW_NORMAL); - /* recreate the iter hash table only if we're not reloading the module section */ + /* recreate the iter hash table */ if (!reload) { - if (update_tbl != NULL) { - g_hash_table_foreach_remove(update_tbl, g_true, NULL); - } - update_tbl = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); + if (update_tbl) { + g_hash_table_foreach_remove(update_tbl, (GHRFunc) gtk_true, NULL); + } else { + update_tbl = + g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); + } + } + + if (update_sfusrc) { + GSList *sfusrc; + + for (sfusrc = update_sfusrc; sfusrc; sfusrc = sfusrc->next) { + ShellFieldUpdateSource *src = (ShellFieldUpdateSource *)sfusrc->data; + + g_source_remove(src->source_id); + g_free(src->sfu->field_name); + g_free(src->sfu); + g_free(src); + } + + g_slist_free(update_sfusrc); + update_sfusrc = NULL; } store = GTK_TREE_STORE(shell->info->model); gtk_tree_store_clear(store); - g_key_file_load_from_data(key_file, key_data, strlen(key_data), 0, NULL); - groups = g_key_file_get_groups(key_file, NULL); + g_key_file_load_from_data(key_file, key_data, strlen(key_data), 0, + NULL); + groups = g_key_file_get_groups(key_file, &ngroups); + + for (i = 0; groups[i]; i++) + if (groups[i][0] == '$') ngroups--; for (i = 0; groups[i]; i++) { gchar *group = groups[i]; @@ -849,21 +1050,28 @@ module_selected_show_info(ShellModuleEntry * entry, gboolean reload) if (*group == '$') { group_handle_special(key_file, entry, group, keys); } else { - group_handle_normal(key_file, entry, group, keys); + group_handle_normal(key_file, entry, group, keys, ngroups); } + + g_strfreev(keys); } gtk_tree_view_expand_all(GTK_TREE_VIEW(shell->info->view)); + if (shell->view_type == SHELL_VIEW_PROGRESS) { + update_progress(); + } + + shell_set_note_from_entry(entry); + g_strfreev(groups); g_key_file_free(key_file); g_free(key_data); } -static void -info_selected_show_extra(gchar * data) +static void info_selected_show_extra(gchar * data) { - GtkTreeStore *store; + GtkTreeStore *store; store = GTK_TREE_STORE(shell->moreinfo->model); gtk_tree_store_clear(store); @@ -883,13 +1091,13 @@ info_selected_show_extra(gchar * data) for (i = 0; groups[i]; i++) { gchar *group = groups[i]; - gchar **keys = g_key_file_get_keys(key_file, group, NULL, NULL); + gchar **keys = + g_key_file_get_keys(key_file, group, NULL, NULL); - moreinfo_handle_normal(key_file, group, keys); + moreinfo_handle_normal(key_file, group, keys); } - gtk_tree_view_expand_all(GTK_TREE_VIEW - (shell->moreinfo->view)); + gtk_tree_view_expand_all(GTK_TREE_VIEW(shell->moreinfo->view)); g_strfreev(groups); g_key_file_free(key_file); @@ -897,24 +1105,23 @@ info_selected_show_extra(gchar * data) } } -static void -module_selected(GtkTreeSelection * ts, gpointer data) +static void module_selected(gpointer data) { - ShellTree *shelltree = shell->tree; - GtkTreeModel *model = GTK_TREE_MODEL(shelltree->model); - GtkTreeIter parent; - ShellModuleEntry *entry; - static ShellModuleEntry *current = NULL; - static gboolean updating = FALSE; - + ShellTree *shelltree = shell->tree; + GtkTreeModel *model = GTK_TREE_MODEL(shelltree->model); + GtkTreeIter parent; + ShellModuleEntry *entry; + static ShellModuleEntry *current = NULL; + static gboolean updating = FALSE; + if (updating) - return; - + return; + updating = TRUE; /* Gets the currently selected item on the left-side TreeView; if there is no selection, silently return */ - if (!gtk_tree_selection_get_selected(ts, &model, &parent)) + if (!gtk_tree_selection_get_selected(shelltree->selection, &model, &parent)) return; /* Mark the currently selected module as "unselected"; this is used to kill the @@ -924,70 +1131,78 @@ module_selected(GtkTreeSelection * ts, gpointer data) /* Get the current selection and shows its related info */ gtk_tree_model_get(model, &parent, TREE_COL_DATA, &entry, -1); - if (entry && entry->func && !entry->selected) { + if (entry && !entry->selected) { shell_status_set_enabled(TRUE); shell_status_update("Updating..."); entry->selected = TRUE; - shell->selected = entry; + shell->selected = entry; module_selected_show_info(entry, FALSE); info_selected_show_extra(NULL); /* clears the more info store */ gtk_tree_view_columns_autosize(GTK_TREE_VIEW(shell->info->view)); /* urgh. why don't GTK do this when the model is cleared? */ - gtk_range_set_value(GTK_RANGE(GTK_SCROLLED_WINDOW(shell->info->scroll)->vscrollbar), 0.0); - gtk_range_set_value(GTK_RANGE(GTK_SCROLLED_WINDOW(shell->info->scroll)->hscrollbar), 0.0); - gtk_range_set_value(GTK_RANGE(GTK_SCROLLED_WINDOW(shell->moreinfo->scroll)->vscrollbar), 0.0); - gtk_range_set_value(GTK_RANGE(GTK_SCROLLED_WINDOW(shell->moreinfo->scroll)->hscrollbar), 0.0); - + gtk_range_set_value(GTK_RANGE + (GTK_SCROLLED_WINDOW(shell->info->scroll)-> + vscrollbar), 0.0); + gtk_range_set_value(GTK_RANGE + (GTK_SCROLLED_WINDOW(shell->info->scroll)-> + hscrollbar), 0.0); + gtk_range_set_value(GTK_RANGE + (GTK_SCROLLED_WINDOW(shell->moreinfo->scroll)-> + vscrollbar), 0.0); + gtk_range_set_value(GTK_RANGE + (GTK_SCROLLED_WINDOW(shell->moreinfo->scroll)-> + hscrollbar), 0.0); + shell_status_update("Done."); shell_status_set_enabled(FALSE); - - gchar *tmp = g_strdup_printf("%s - System Information", entry->name); - gtk_window_set_title(GTK_WINDOW(shell->window), tmp); - g_free(tmp); - - shell_action_set_enabled("RefreshAction", entry->reloadfunc ? TRUE : FALSE); + + gtk_window_set_title(GTK_WINDOW(shell->window), + idle_free(g_strdup_printf("%s - System Information", entry->name))); + + shell_action_set_enabled("RefreshAction", TRUE); + shell_action_set_enabled("CopyAction", TRUE); } else { - gtk_window_set_title(GTK_WINDOW(shell->window), "System Information"); - shell_action_set_enabled("RefreshAction", FALSE); + gtk_window_set_title(GTK_WINDOW(shell->window), + "System Information"); + shell_action_set_enabled("RefreshAction", FALSE); + shell_action_set_enabled("CopyAction", FALSE); gtk_tree_store_clear(GTK_TREE_STORE(shell->info->model)); set_view_type(SHELL_VIEW_NORMAL); } - + current = entry; updating = FALSE; } -static void -info_selected(GtkTreeSelection * ts, gpointer data) +static void info_selected(GtkTreeSelection * ts, gpointer data) { - ShellInfoTree *info = (ShellInfoTree *) data; - GtkTreeModel *model = GTK_TREE_MODEL(info->model); - GtkTreeIter parent; - gchar *datacol; + ShellInfoTree *info = (ShellInfoTree *) data; + GtkTreeModel *model = GTK_TREE_MODEL(info->model); + GtkTreeIter parent; + gchar *datacol; if (!gtk_tree_selection_get_selected(ts, &model, &parent)) return; gtk_tree_model_get(model, &parent, INFO_TREE_COL_DATA, &datacol, -1); info_selected_show_extra(datacol); - gtk_tree_view_columns_autosize(GTK_TREE_VIEW - (shell->moreinfo->view)); + gtk_tree_view_columns_autosize(GTK_TREE_VIEW(shell->moreinfo->view)); } -static ShellInfoTree * -info_tree_new(gboolean extra) +static ShellInfoTree *info_tree_new(gboolean extra) { - ShellInfoTree *info; - GtkWidget *treeview, *scroll; - GtkTreeModel *model; - GtkTreeStore *store; - GtkTreeViewColumn *column; - GtkCellRenderer *cr_text, *cr_pbuf; - + ShellInfoTree *info; + GtkWidget *treeview, *scroll; + GtkTreeModel *model; + GtkTreeStore *store; + GtkTreeViewColumn *column; + GtkCellRenderer *cr_text, *cr_pbuf, *cr_progress; + GtkTreeSelection *sel; + info = g_new0(ShellInfoTree, 1); scroll = gtk_scrolled_window_new(NULL, NULL); @@ -997,8 +1212,9 @@ info_tree_new(gboolean extra) GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - store = gtk_tree_store_new(INFO_TREE_NCOL, G_TYPE_STRING, G_TYPE_STRING, - G_TYPE_STRING, GDK_TYPE_PIXBUF); + store = + gtk_tree_store_new(INFO_TREE_NCOL, G_TYPE_STRING, G_TYPE_STRING, + G_TYPE_STRING, GDK_TYPE_PIXBUF, G_TYPE_FLOAT); model = GTK_TREE_MODEL(store); treeview = gtk_tree_view_new_with_model(model); gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(treeview), FALSE); @@ -1012,47 +1228,56 @@ info_tree_new(gboolean extra) INFO_TREE_COL_PBUF); cr_text = gtk_cell_renderer_text_new(); - gtk_tree_view_column_pack_start(column, cr_text, TRUE); + gtk_tree_view_column_pack_start(column, cr_text, FALSE); gtk_tree_view_column_add_attribute(column, cr_text, "markup", INFO_TREE_COL_NAME); - - column = gtk_tree_view_column_new(); + + info->col_value = column = gtk_tree_view_column_new(); gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column); cr_text = gtk_cell_renderer_text_new(); - gtk_tree_view_column_pack_start(column, cr_text, TRUE); + gtk_tree_view_column_pack_start(column, cr_text, FALSE); gtk_tree_view_column_add_attribute(column, cr_text, "markup", INFO_TREE_COL_VALUE); - if (!extra) { - GtkTreeSelection *sel; + info->col_progress = column = gtk_tree_view_column_new(); + gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column); - sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview)); + cr_progress = gtk_cell_renderer_progress_new(); + gtk_tree_view_column_pack_start(column, cr_progress, TRUE); + gtk_tree_view_column_add_attribute(column, cr_progress, "value", + INFO_TREE_COL_PROGRESS); + gtk_tree_view_column_add_attribute(column, cr_progress, "text", + INFO_TREE_COL_VALUE); + gtk_tree_view_column_set_visible(column, FALSE); + + sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview)); + + if (!extra) g_signal_connect(G_OBJECT(sel), "changed", (GCallback) info_selected, info); - } - + gtk_container_add(GTK_CONTAINER(scroll), treeview); info->scroll = scroll; info->view = treeview; info->model = model; + info->selection = sel; gtk_widget_show_all(scroll); return info; } -static ShellTree * -tree_new() +static ShellTree *tree_new() { - ShellTree *shelltree; - GtkWidget *treeview, *scroll; - GtkTreeModel *model; - GtkTreeStore *store; - GtkCellRenderer *cr_text, *cr_pbuf; - GtkTreeViewColumn *column; - GtkTreeSelection *sel; + ShellTree *shelltree; + GtkWidget *treeview, *scroll; + GtkTreeModel *model; + GtkTreeStore *store; + GtkCellRenderer *cr_text, *cr_pbuf; + GtkTreeViewColumn *column; + GtkTreeSelection *sel; shelltree = g_new0(ShellTree, 1); @@ -1092,6 +1317,7 @@ tree_new() shelltree->view = treeview; shelltree->model = model; shelltree->modules = NULL; + shelltree->selection = sel; gtk_widget_show_all(scroll); @@ -1,6 +1,6 @@ /* * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> + * Copyright (C) 2003-2007 Leandro A. F. Pereira <leandro@linuxmag.com.br> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -24,11 +24,19 @@ typedef struct _Shell Shell; typedef struct _ShellTree ShellTree; typedef struct _ShellInfoTree ShellInfoTree; +typedef struct _ShellNote ShellNote; typedef struct _ShellModule ShellModule; +typedef struct _ShellModuleMethod ShellModuleMethod; typedef struct _ShellModuleEntry ShellModuleEntry; typedef struct _ShellFieldUpdate ShellFieldUpdate; +typedef struct _ShellFieldUpdateSource ShellFieldUpdateSource; + +typedef enum { + SHELL_ORDER_DESCENDING, + SHELL_ORDER_ASCENDING, +} ShellOrderType; typedef enum { SHELL_PACK_RESIZE = 1 << 0, @@ -39,6 +47,8 @@ typedef enum { SHELL_VIEW_NORMAL, SHELL_VIEW_DUAL, SHELL_VIEW_LOAD_GRAPH, + SHELL_VIEW_PROGRESS, + SHELL_VIEW_N_VIEWS } ShellViewType; typedef enum { @@ -54,6 +64,7 @@ typedef enum { INFO_TREE_COL_VALUE, INFO_TREE_COL_DATA, INFO_TREE_COL_PBUF, + INFO_TREE_COL_PROGRESS, INFO_TREE_NCOL } ShellInfoTreeColumns; @@ -66,6 +77,7 @@ struct _Shell { ShellTree *tree; ShellInfoTree *info, *moreinfo; ShellModuleEntry *selected; + ShellNote *note; LoadGraph *loadgraph; GtkActionGroup *action_group; @@ -74,12 +86,14 @@ struct _Shell { ShellViewType view_type; gint _pulses; + ShellOrderType _order_type; }; struct _ShellTree { GtkWidget *scroll; GtkWidget *view; GtkTreeModel *model; + GtkTreeSelection *selection; GSList *modules; }; @@ -87,42 +101,64 @@ struct _ShellTree { struct _ShellInfoTree { GtkWidget *scroll; GtkWidget *view; - GtkTreeModel *model; + GtkTreeModel *model; + GtkTreeSelection *selection; + + GtkTreeViewColumn *col_progress, *col_value; +}; + +struct _ShellNote { + GtkWidget *frame; + GtkWidget *label; }; struct _ShellModule { gchar *name; GdkPixbuf *icon; GModule *dll; + + guchar weight; GSList *entries; }; +struct _ShellModuleMethod { + gchar *name; + gchar *(*function) (void); +}; + struct _ShellModuleEntry { gchar *name; - gint number; GdkPixbuf *icon; gboolean selected; + gint number; - gchar *(*func) (gint entry); - gchar *(*reloadfunc) (gint entry); + gchar *(*func) (); + void (*scan_func) (); + gchar *(*fieldfunc) (gchar * entry); gchar *(*morefunc) (gchar * entry); + gchar *(*notefunc) (gint entry); }; struct _ShellFieldUpdate { ShellModuleEntry *entry; gchar *field_name; - gboolean loadgraph; }; -void shell_init(void); +struct _ShellFieldUpdateSource { + guint source_id; + ShellFieldUpdate *sfu; +}; + +void shell_init(GSList *modules); void shell_do_reload(void); Shell *shell_get_main_shell(); void shell_action_set_enabled(const gchar *action_name, gboolean setting); +gboolean shell_action_get_enabled(const gchar *action_name); gboolean shell_action_get_active(const gchar *action_name); void shell_action_set_active(const gchar *action_name, gboolean setting); @@ -131,6 +167,7 @@ void shell_action_set_property(const gchar *action_name, gboolean setting); void shell_set_side_pane_visible(gboolean setting); +void shell_set_note_from_entry(ShellModuleEntry *entry); void shell_ui_manager_set_visible(const gchar *path, gboolean setting); diff --git a/socket.c b/socket.c new file mode 100644 index 00000000..aa451c0c --- /dev/null +++ b/socket.c @@ -0,0 +1,119 @@ +/* + * HardInfo - Displays System Information + * Copyright (C) 2003-2007 Leandro A. F. Pereira <leandro@linuxmag.com.br> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, version 2. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <stdio.h> +#include <string.h> +#include <arpa/inet.h> +#include <errno.h> +#include <netdb.h> +#include <netinet/in.h> +#include <sys/socket.h> +#include <sys/types.h> +#include <unistd.h> + +#include <glib.h> + +#include "socket.h" + +Socket *sock_connect(gchar * host, gint port) +{ + struct sockaddr_in server; + Socket *s; + int sock; + + sock = socket(AF_INET, SOCK_STREAM, 0); + if (sock > 0) { + memset(&server, 0, sizeof(server)); + server.sin_family = AF_INET; + server.sin_addr.s_addr = inet_addr(host); + server.sin_port = htons(port); + + if (connect(sock, (struct sockaddr *) (void *) &server, sizeof(server)) < 0) { + return NULL; + } + + s = g_new0(Socket, 1); + s->sock = sock; + + return s; + } + + return NULL; +} + +/* From: http://www.erlenstar.demon.co.uk/unix/faq_3.html#SEC26 */ +static inline int __sock_is_ready(Socket * s, int mode) +{ + int rc, fd = s->sock; + fd_set fds; + struct timeval tv; + + FD_ZERO(&fds); + FD_SET(fd, &fds); + tv.tv_sec = tv.tv_usec = 0; + + if (mode == 0) { + /* read */ + rc = select(fd + 1, &fds, NULL, NULL, &tv); + } else { + /* write */ + rc = select(fd + 1, NULL, &fds, NULL, &tv); + } + + if (rc < 0) + return -1; + + return FD_ISSET(fd, &fds) ? 1 : 0; +} + +int sock_ready_to_read(Socket * s) +{ + return __sock_is_ready(s, 0); +} + +int sock_ready_to_write(Socket * s) +{ + return __sock_is_ready(s, 1); +} + +int sock_read(Socket * s, gchar * buffer, gint size) +{ + if (sock_ready_to_read(s)) { + gint n; + + n = read(s->sock, buffer, size); + buffer[n] = '\0'; + + return n; + } + + return 0; +} + +int sock_write(Socket * s, gchar * str) +{ + while (!sock_ready_to_write(s)); + + return write(s->sock, str, strlen(str)); +} + +void sock_close(Socket * s) +{ + close(s->sock); + g_free(s); +} diff --git a/socket.h b/socket.h new file mode 100644 index 00000000..ae124d4f --- /dev/null +++ b/socket.h @@ -0,0 +1,36 @@ +/* + * HardInfo - Displays System Information + * Copyright (C) 2003-2007 Leandro A. F. Pereira <leandro@linuxmag.com.br> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, version 2. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef __HI_SOCKET_H__ +#define __HI_SOCKET_H__ + +typedef struct _Socket Socket; + +struct _Socket { + gint sock; +}; + +Socket *sock_connect(gchar * host, gint port); +int sock_write(Socket * s, gchar * str); +int sock_read(Socket * s, gchar * buffer, gint size); +void sock_close(Socket * s); + +int sock_ready_to_read(Socket *s); +int sock_ready_to_write(Socket *s); + +#endif /* __HI_SOCKET_H__ */ @@ -1,6 +1,6 @@ /* * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> + * Copyright (C) 2003-2007 Leandro A. F. Pereira <leandro@linuxmag.com.br> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,6 +16,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include <config.h> #include <gtk/gtk.h> #include <stock.h> #include <iconcache.h> @@ -24,7 +25,12 @@ static struct { gchar *filename; gchar *stock_id; } stock_icons[] = { - { "report.png", HI_STOCK_REPORT} + { "report.png", HI_STOCK_REPORT }, + { "internet.png", HI_STOCK_INTERNET }, + { "module.png", HI_STOCK_MODULE }, + { "about-modules.png", HI_STOCK_ABOUT_MODULES }, + { "syncmanager-small.png", HI_STOCK_SYNC_MENU }, + { "face-grin.png", HI_STOCK_DONATE }, }; static GtkIconFactory *icon_factory; @@ -68,6 +74,8 @@ void stock_icons_init(void) gint i; guint n_stock_icons = G_N_ELEMENTS(stock_icons); + DEBUG("initializing stock icons"); + icon_factory = gtk_icon_factory_new(); for (i = 0; i < n_stock_icons; i++) { @@ -1,6 +1,6 @@ /* * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> + * Copyright (C) 2003-2007 Leandro A. F. Pereira <leandro@linuxmag.com.br> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,6 +20,11 @@ #define __STOCK_H__ #define HI_STOCK_REPORT "hi-stock-report" +#define HI_STOCK_INTERNET "hi-stock-internet" +#define HI_STOCK_MODULE "hi-stock-module" +#define HI_STOCK_ABOUT_MODULES "hi-stock-about-modules" +#define HI_STOCK_SYNC_MENU "hi-stock-sync-menu" +#define HI_STOCK_DONATE "hi-stock-donate" void stock_icons_init(void); void stock_icon_register(gchar *filename, gchar *stock_id); diff --git a/syncmanager.c b/syncmanager.c new file mode 100644 index 00000000..6602407a --- /dev/null +++ b/syncmanager.c @@ -0,0 +1,728 @@ +/* + * HardInfo - Displays System Information + * Copyright (C) 2003-2007 Leandro A. F. Pereira <leandro@linuxmag.com.br> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, version 2. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "syncmanager.h" +#include "iconcache.h" +#include "hardinfo.h" +#include "config.h" + +#include <libsoup/soup.h> +#include <libsoup/soup-xmlrpc-message.h> +#include <libsoup/soup-xmlrpc-response.h> + +#include <stdarg.h> +#include <string.h> + +typedef struct _SyncDialog SyncDialog; +typedef struct _SyncNetArea SyncNetArea; +typedef struct _SyncNetAction SyncNetAction; + +struct _SyncNetArea { + GtkWidget *vbox; +}; + +struct _SyncNetAction { + gchar *name; + gboolean (*do_action)(SyncDialog *sd, gpointer sna); + + SyncEntry *entry; + GError *error; +}; + +struct _SyncDialog { + GtkWidget *dialog; + GtkWidget *label; + + GtkWidget *button_sync; + GtkWidget *button_cancel; + GtkWidget *button_close; + + GtkWidget *scroll_box; + + SyncNetArea *sna; + + gboolean flag_cancel : 1; +}; + +static GSList *entries = NULL; +static SoupSession *session = NULL; +static GMainLoop *loop; +static GQuark err_quark; + +#define XMLRPC_SERVER_URI "http://hardinfo.berlios.de/xmlrpc/" +#define XMLRPC_SERVER_API_VERSION 1 + +#define LABEL_SYNC_DEFAULT "<big><b>Synchronize with Central Database</b></big>\n" \ + "The following information may be synchronized " \ + "with the HardInfo central database." +#define LABEL_SYNC_SYNCING "<big><b>Synchronizing</b></big>\n" \ + "This may take some time." + +static SyncDialog *sync_dialog_new(void); +static void sync_dialog_destroy(SyncDialog *sd); +static void sync_dialog_start_sync(SyncDialog *sd); + +static SyncNetArea *sync_dialog_netarea_new(void); +static void sync_dialog_netarea_destroy(SyncNetArea *sna); +static void sync_dialog_netarea_show(SyncDialog *sd); +#if 0 +static void sync_dialog_netarea_hide(SyncDialog *sd); +#endif +static void sync_dialog_netarea_start_actions(SyncDialog *sd, SyncNetAction *sna, + gint n); + +#define SNA_ERROR(code,message,...) if (!sna->error) { \ + sna->error = g_error_new(err_quark, code, message, \ + ##__VA_ARGS__); \ + } + + +void sync_manager_add_entry(SyncEntry *entry) +{ + DEBUG("registering syncmanager entry ''%s''", entry->fancy_name); + + entry->selected = TRUE; + entries = g_slist_prepend(entries, entry); +} + +void sync_manager_show(void) +{ + SyncDialog *sd = sync_dialog_new(); + + err_quark = g_quark_from_static_string("syncmanager"); + + if (gtk_dialog_run(GTK_DIALOG(sd->dialog)) == GTK_RESPONSE_ACCEPT) { + shell_view_set_enabled(FALSE); + shell_status_set_enabled(TRUE); + + sync_dialog_start_sync(sd); + + shell_status_set_enabled(FALSE); + shell_view_set_enabled(TRUE); + } + + sync_dialog_destroy(sd); +} + +static SoupXmlrpcValue *_soup_get_xmlrpc_value(SoupMessage *msg, SyncNetAction *sna) +{ + SoupXmlrpcResponse *response = NULL; + SoupXmlrpcValue *value = NULL; + + sna->error = NULL; + + if (!SOUP_STATUS_IS_SUCCESSFUL(msg->status_code)) { + SNA_ERROR(1, "%s (error #%d)", msg->reason_phrase, msg->status_code); + goto bad; + } + + response = soup_xmlrpc_message_parse_response(SOUP_XMLRPC_MESSAGE(msg)); + if (!response) { + SNA_ERROR(2, "Could not parse XML-RPC response"); + goto bad; + } + + value = soup_xmlrpc_response_get_value(response); + if (!value) { + SNA_ERROR(3, "No response value in XML-RPC response"); + } + + /* g_object_unref(response); */ +bad: + return value; +} + +static long _soup_get_xmlrpc_value_int(SoupMessage *msg, SyncNetAction *sna) +{ + SoupXmlrpcValue *value; + long int_value = -1; + + value = _soup_get_xmlrpc_value(msg, sna); + if (!value) { + SNA_ERROR(4, "Could not extract result from XML-RPC response"); + goto bad; + } + + if (!soup_xmlrpc_value_get_int(value, &int_value)) { + SNA_ERROR(4, "Could not extract result from XML-RPC response"); + } + +bad: + return int_value; +} + +static gchar* _soup_get_xmlrpc_value_string(SoupMessage *msg, SyncNetAction *sna) +{ + SoupXmlrpcValue *value; + gchar *string = NULL; + + value = _soup_get_xmlrpc_value(msg, sna); + if (!value) { + SNA_ERROR(4, "Could not extract result from XML-RPC response"); + goto bad; + } + + if (!soup_xmlrpc_value_get_string(value, &string)) { + SNA_ERROR(4, "Could not extract result from XML-RPC response"); + } + +bad: + return string; +} + +static gboolean _soup_xmlrpc_call(gchar *method, SyncNetAction *sna, + SoupMessageCallbackFn callback) +{ + SoupXmlrpcMessage *msg; + + sna->error = NULL; + + msg = soup_xmlrpc_message_new(XMLRPC_SERVER_URI); + if (!msg) + return FALSE; + + DEBUG("calling xmlrpc method %s", method); + soup_xmlrpc_message_start_call(msg, method); + soup_xmlrpc_message_end_call(msg); + + soup_xmlrpc_message_persist(msg); + + soup_session_queue_message(session, SOUP_MESSAGE(msg), + callback, sna); + g_main_run(loop); + + return TRUE; +} + +static gboolean _soup_xmlrpc_call_with_parameters(gchar *method, SyncNetAction *sna, + SoupMessageCallbackFn callback, + ...) +{ + SoupXmlrpcMessage *msg; + gchar *argument; + va_list ap; + + sna->error = NULL; + + msg = soup_xmlrpc_message_new(XMLRPC_SERVER_URI); + if (!msg) + return FALSE; + + DEBUG("calling xmlrpc method %s", method); + soup_xmlrpc_message_start_call(msg, method); + + va_start(ap, callback); + while ((argument = va_arg(ap, gchar *))) { + soup_xmlrpc_message_start_param(msg); + soup_xmlrpc_message_write_string(msg, argument); + soup_xmlrpc_message_end_param(msg); + + DEBUG("with parameter: %s", argument); + } + va_end(ap); + + soup_xmlrpc_message_end_call(msg); + soup_xmlrpc_message_persist(msg); + + soup_session_queue_message(session, SOUP_MESSAGE(msg), callback, sna); + g_main_run(loop); + + return TRUE; +} + +static void _action_check_api_version_got_response(SoupMessage *msg, gpointer user_data) +{ + SyncNetAction *sna = (SyncNetAction *) user_data; + long version = _soup_get_xmlrpc_value_int(msg, sna); + + if (version != XMLRPC_SERVER_API_VERSION) { + SNA_ERROR(5, "Server says it supports API version %ld, but " \ + "this version of HardInfo only supports API " \ + "version %d.", version, XMLRPC_SERVER_API_VERSION); + } + + g_main_quit(loop); +} + +static gboolean _action_check_api_version(SyncDialog *sd, gpointer user_data) +{ + SyncNetAction *sna = (SyncNetAction *) user_data; + + if (!_soup_xmlrpc_call("server.getAPIVersion", sna, + _action_check_api_version_got_response)) + return FALSE; + + return sna->error ? FALSE : TRUE; +} + +static void _action_call_function_got_response(SoupMessage *msg, gpointer user_data) +{ + SyncNetAction *sna = (SyncNetAction *) user_data; + gchar *string; + + string = _soup_get_xmlrpc_value_string(msg, sna); + DEBUG("received string: %s\n", string); + + if (sna->entry->save_to) { + gchar *filename = g_build_filename(g_get_home_dir(), ".hardinfo", + sna->entry->save_to, NULL); + + DEBUG("saving to %s", filename); + +#ifdef g_file_set_contents + g_file_set_contents(filename, string, -1, NULL); +#else + { + FILE *f; + + f = fopen(filename, "w+"); + if (f) { + fwrite(string, 1, strlen(string), f); + fclose(f); + } + } +#endif + g_free(filename); + } + + g_free(string); + g_main_quit(loop); +} + +static gboolean _action_call_function(SyncDialog *sd, gpointer user_data) +{ + SyncNetAction *sna = (SyncNetAction *) user_data; + + if (sna->entry) { + gchar *str_data = NULL; + + if (sna->entry->get_data) + str_data = sna->entry->get_data(); + + if (!_soup_xmlrpc_call_with_parameters("sync.callFunction", sna, + _action_call_function_got_response, + VERSION, ARCH, + sna->entry->name, + str_data, NULL)) { + if (str_data) + g_free(str_data); + + return FALSE; + } + + if (str_data) + g_free(str_data); + } + + return sna->error ? FALSE : TRUE; +} + +static gboolean _cancel_sync(GtkWidget *widget, gpointer data) +{ + SyncDialog *sd = (SyncDialog *) data; + + if (session) { + soup_session_abort(session); + } + + sd->flag_cancel = TRUE; + g_main_quit(loop); + + gtk_widget_set_sensitive(widget, FALSE); + + return FALSE; +} + +static SyncNetAction *sync_manager_get_selected_actions(gint *n) +{ + gint i; + GSList *entry; + SyncNetAction *actions; + SyncNetAction action_check_api = { "Contacting HardInfo Central Database", + _action_check_api_version }, + action_clean_up = { "Cleaning up", NULL }; + + actions = g_new0(SyncNetAction, 2 + g_slist_length(entries)); + + for (entry = entries, i = 1; entry; entry = entry->next) { + SyncEntry *e = (SyncEntry *) entry->data; + + if (e->selected) { + SyncNetAction sna = { e->fancy_name, _action_call_function, e }; + + actions[i++] = sna; + } + } + + actions[0] = action_check_api; + actions[i++] = action_clean_up; + + *n = i; + return actions; +} + +static SoupUri *sync_manager_get_proxy(void) +{ + const gchar *conf; + + if (!(conf = g_getenv("HTTP_PROXY"))) { + if (!(conf = g_getenv("http_proxy"))) { + return NULL; + } + } + + return soup_uri_new(conf); +} + +static void sync_dialog_start_sync(SyncDialog *sd) +{ + gint nactions; + SyncNetAction *actions; + + if (!session) { + SoupUri *proxy = sync_manager_get_proxy(); + + session = soup_session_async_new_with_options(SOUP_SESSION_TIMEOUT, 10, + SOUP_SESSION_PROXY_URI, proxy, NULL); + /* Crashes if we unref the proxy? O_o + if (proxy) + g_object_unref(proxy); + */ + } + + loop = g_main_loop_new(NULL, TRUE); + + gtk_widget_hide(sd->button_sync); + sync_dialog_netarea_show(sd); + g_signal_connect(G_OBJECT(sd->button_cancel), "clicked", + (GCallback)_cancel_sync, sd); + + actions = sync_manager_get_selected_actions(&nactions); + sync_dialog_netarea_start_actions(sd, actions, nactions); + g_free(actions); + + if (sd->flag_cancel) { + gtk_widget_hide(sd->button_cancel); + gtk_widget_show(sd->button_close); + + /* wait for the user to close the dialog */ + g_main_run(loop); + } + + g_main_loop_unref(loop); +} + +static void sync_dialog_netarea_start_actions(SyncDialog *sd, SyncNetAction sna[], gint n) +{ + gint i; + GtkWidget **labels; + GtkWidget **icons; + GdkPixbuf *done_icon = icon_cache_get_pixbuf("status-done.png"); + GdkPixbuf *curr_icon = icon_cache_get_pixbuf("status-curr.png"); + + labels = g_new0(GtkWidget *, n); + icons = g_new0(GtkWidget *, n); + + for (i = 0; i < n; i++) { + GtkWidget *hbox; + + hbox = gtk_hbox_new(FALSE, 5); + + labels[i] = gtk_label_new(sna[i].name); + icons[i] = gtk_image_new(); + + gtk_widget_set_size_request(icons[i], + gdk_pixbuf_get_width(done_icon), + gdk_pixbuf_get_height(done_icon)); + + gtk_label_set_use_markup(GTK_LABEL(labels[i]), TRUE); + gtk_misc_set_alignment(GTK_MISC(labels[i]), 0.0, 0.5); + + gtk_box_pack_start(GTK_BOX(hbox), icons[i], FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(hbox), labels[i], TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(sd->sna->vbox), hbox, FALSE, FALSE, 3); + + gtk_widget_show_all(hbox); + } + + while (gtk_events_pending()) + gtk_main_iteration(); + + for (i = 0; i < n; i++) { + gchar *markup; + + if (sd->flag_cancel) { + markup = g_strdup_printf("<s>%s</s> <i>(canceled)</i>", sna[i].name); + gtk_label_set_markup(GTK_LABEL(labels[i]), markup); + g_free(markup); + + gtk_image_set_from_pixbuf(GTK_IMAGE(icons[i]), + icon_cache_get_pixbuf("dialog-error.png")); + break; + } + + markup = g_strdup_printf("<b>%s</b>", sna[i].name); + gtk_label_set_markup(GTK_LABEL(labels[i]), markup); + g_free(markup); + + gtk_image_set_from_pixbuf(GTK_IMAGE(icons[i]), curr_icon); + + if (sna[i].do_action && !sna[i].do_action(sd, &sna[i])) { + markup = g_strdup_printf("<b><s>%s</s></b> <i>(failed)</i>", sna[i].name); + gtk_label_set_markup(GTK_LABEL(labels[i]), markup); + g_free(markup); + + sd->flag_cancel = TRUE; + + gtk_image_set_from_pixbuf(GTK_IMAGE(icons[i]), + icon_cache_get_pixbuf("dialog-error.png")); + if (sna[i].error) { + g_warning("Failed while performing \"%s\". Please file a bug report " \ + "if this problem persists. (Use the Help\342\206\222Report" \ + " bug option.)\n\nDetails: %s", + sna[i].name, sna[i].error->message); + + g_error_free(sna[i].error); + } else { + g_warning("Failed while performing \"%s\". Please file a bug report " \ + "if this problem persists. (Use the Help\342\206\222Report" \ + " bug option.)", sna[i].name); + } + break; + } + + gtk_image_set_from_pixbuf(GTK_IMAGE(icons[i]), done_icon); + gtk_label_set_markup(GTK_LABEL(labels[i]), sna[i].name); + } + + g_free(labels); + g_free(icons); +} + +static SyncNetArea *sync_dialog_netarea_new(void) +{ + SyncNetArea *sna = g_new0(SyncNetArea, 1); + + sna->vbox = gtk_vbox_new(FALSE, 0); + + gtk_container_set_border_width(GTK_CONTAINER(sna->vbox), 10); + + gtk_widget_show_all(sna->vbox); + gtk_widget_hide(sna->vbox); + + return sna; +} + +static void sync_dialog_netarea_destroy(SyncNetArea *sna) +{ + g_return_if_fail(sna != NULL); + + g_free(sna); +} + +static void sync_dialog_netarea_show(SyncDialog *sd) +{ + g_return_if_fail(sd && sd->sna); + + gtk_widget_hide(GTK_WIDGET(sd->scroll_box)); + gtk_widget_show(GTK_WIDGET(sd->sna->vbox)); + + gtk_label_set_markup(GTK_LABEL(sd->label), LABEL_SYNC_SYNCING); + gtk_window_set_default_size(GTK_WINDOW(sd->dialog), 0, 0); + gtk_window_reshow_with_initial_size(GTK_WINDOW(sd->dialog)); +} + +#if 0 +static void sync_dialog_netarea_hide(SyncDialog *sd) +{ + g_return_if_fail(sd && sd->sna); + + gtk_widget_show(GTK_WIDGET(sd->scroll_box)); + gtk_widget_hide(GTK_WIDGET(sd->sna->vbox)); + + gtk_label_set_markup(GTK_LABEL(sd->label), LABEL_SYNC_DEFAULT); + gtk_window_reshow_with_initial_size(GTK_WINDOW(sd->dialog)); +} +#endif + +static void populate_store(GtkListStore *store) +{ + GSList *entry; + SyncEntry *e; + + gtk_list_store_clear(store); + + for (entry = entries; entry; entry = entry->next) { + GtkTreeIter iter; + + e = (SyncEntry *) entry->data; + + e->selected = TRUE; + + gtk_list_store_append(store, &iter); + gtk_list_store_set(store, &iter, 0, TRUE, 1, e->fancy_name, 2, e, -1); + } +} + +static void +sel_toggle(GtkCellRendererToggle *cellrenderertoggle, + gchar *path_str, + GtkTreeModel *model) +{ + GtkTreeIter iter; + GtkTreePath *path = gtk_tree_path_new_from_string(path_str); + SyncEntry *se; + gboolean active; + + gtk_tree_model_get_iter(model, &iter, path); + gtk_tree_model_get(model, &iter, 0, &active, 2, &se, -1); + + se->selected = !active; + + gtk_list_store_set(GTK_LIST_STORE(model), &iter, 0, se->selected, -1); + gtk_tree_path_free(path); +} + +static void close_clicked(void) +{ + g_main_quit(loop); +} + +static SyncDialog *sync_dialog_new(void) +{ + SyncDialog *sd; + GtkWidget *dialog; + GtkWidget *dialog1_vbox; + GtkWidget *scrolledwindow2; + GtkWidget *treeview2; + GtkWidget *dialog1_action_area; + GtkWidget *button8; + GtkWidget *button7; + GtkWidget *button6; + GtkWidget *label; + GtkWidget *hbox; + + GtkTreeViewColumn *column; + GtkTreeModel *model; + GtkListStore *store; + GtkCellRenderer *cr_text, *cr_toggle; + + sd = g_new0(SyncDialog, 1); + sd->sna = sync_dialog_netarea_new(); + + dialog = gtk_dialog_new(); + gtk_window_set_title(GTK_WINDOW(dialog), "Network Updater"); + gtk_container_set_border_width(GTK_CONTAINER(dialog), 5); + gtk_window_set_default_size(GTK_WINDOW(dialog), 420, 260); + gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER_ON_PARENT); + gtk_window_set_type_hint(GTK_WINDOW(dialog), + GDK_WINDOW_TYPE_HINT_DIALOG); + + dialog1_vbox = GTK_DIALOG(dialog)->vbox; + gtk_box_set_spacing(GTK_BOX(dialog1_vbox), 5); + gtk_container_set_border_width(GTK_CONTAINER(dialog1_vbox), 4); + gtk_widget_show(dialog1_vbox); + + hbox = gtk_hbox_new(FALSE, 5); + gtk_box_pack_start(GTK_BOX(dialog1_vbox), hbox, FALSE, FALSE, 0); + + label = gtk_label_new(LABEL_SYNC_DEFAULT); + gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); + gtk_label_set_use_markup(GTK_LABEL(label), TRUE); + gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); + + gtk_box_pack_start(GTK_BOX(hbox), + icon_cache_get_image("syncmanager.png"), + FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, TRUE, 0); + gtk_widget_show_all(hbox); + + + gtk_box_pack_start(GTK_BOX(dialog1_vbox), sd->sna->vbox, TRUE, TRUE, 0); + + scrolledwindow2 = gtk_scrolled_window_new(NULL, NULL); + gtk_widget_show(scrolledwindow2); + gtk_box_pack_start(GTK_BOX(dialog1_vbox), scrolledwindow2, TRUE, TRUE, 0); + gtk_widget_set_size_request(scrolledwindow2, -1, 200); + gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwindow2), + GTK_POLICY_AUTOMATIC, + GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW + (scrolledwindow2), GTK_SHADOW_IN); + + store = gtk_list_store_new(3, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_POINTER); + model = GTK_TREE_MODEL(store); + + treeview2 = gtk_tree_view_new_with_model(model); + gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(treeview2), FALSE); + gtk_widget_show(treeview2); + gtk_container_add(GTK_CONTAINER(scrolledwindow2), treeview2); + + column = gtk_tree_view_column_new(); + gtk_tree_view_append_column(GTK_TREE_VIEW(treeview2), column); + + cr_toggle = gtk_cell_renderer_toggle_new(); + gtk_tree_view_column_pack_start(column, cr_toggle, FALSE); + g_signal_connect(cr_toggle, "toggled", G_CALLBACK(sel_toggle), model); + gtk_tree_view_column_add_attribute(column, cr_toggle, "active", 0); + + cr_text = gtk_cell_renderer_text_new(); + gtk_tree_view_column_pack_start(column, cr_text, TRUE); + gtk_tree_view_column_add_attribute(column, cr_text, "markup", 1); + + populate_store(store); + + dialog1_action_area = GTK_DIALOG(dialog)->action_area; + gtk_widget_show(dialog1_action_area); + gtk_button_box_set_layout(GTK_BUTTON_BOX(dialog1_action_area), + GTK_BUTTONBOX_END); + + button8 = gtk_button_new_from_stock(GTK_STOCK_CANCEL); + gtk_widget_show(button8); + gtk_dialog_add_action_widget(GTK_DIALOG(dialog), button8, + GTK_RESPONSE_CANCEL); + GTK_WIDGET_SET_FLAGS(button8, GTK_CAN_DEFAULT); + + button7 = gtk_button_new_with_mnemonic("_Synchronize"); + gtk_widget_show(button7); + gtk_dialog_add_action_widget(GTK_DIALOG(dialog), button7, + GTK_RESPONSE_ACCEPT); + GTK_WIDGET_SET_FLAGS(button7, GTK_CAN_DEFAULT); + + button6 = gtk_button_new_from_stock(GTK_STOCK_CLOSE); + g_signal_connect(G_OBJECT(button6), "clicked", (GCallback)close_clicked, NULL); + gtk_dialog_add_action_widget(GTK_DIALOG(dialog), button6, + GTK_RESPONSE_ACCEPT); + GTK_WIDGET_SET_FLAGS(button6, GTK_CAN_DEFAULT); + + sd->dialog = dialog; + sd->button_sync = button7; + sd->button_cancel = button8; + sd->button_close = button6; + sd->scroll_box = scrolledwindow2; + sd->label = label; + + return sd; +} + +static void sync_dialog_destroy(SyncDialog *sd) +{ + gtk_widget_destroy(sd->dialog); + sync_dialog_netarea_destroy(sd->sna); + g_free(sd); +} diff --git a/arch/linux/common/.svn/text-base/loadavg.h.svn-base b/syncmanager.h index 28132b5f..9cd812d0 100644 --- a/arch/linux/common/.svn/text-base/loadavg.h.svn-base +++ b/syncmanager.h @@ -1,6 +1,6 @@ /* * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> + * Copyright (C) 2003-2007 Leandro A. F. Pereira <leandro@linuxmag.com.br> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,32 +16,24 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -static LoadInfo * -computer_get_loadinfo(void) -{ - LoadInfo *li = g_new0(LoadInfo, 1); - FILE *procloadavg; +#ifndef __SYNCMANAGER_H__ +#define __SYNCMANAGER_H__ - procloadavg = fopen("/proc/loadavg", "r"); - fscanf(procloadavg, "%f %f %f", &(li->load1), &(li->load5), - &(li->load15)); - fclose(procloadavg); +#include <gtk/gtk.h> - return li; -} +typedef struct _SyncEntry SyncEntry; -static gchar * -computer_get_formatted_loadavg() -{ - LoadInfo *li; - gchar *tmp; +struct _SyncEntry { + gchar *name; + gchar *fancy_name; + gchar *save_to; - li = computer_get_loadinfo(); + gchar *(*get_data)(void); + + gboolean selected; +}; - tmp = - g_strdup_printf("%.2f, %.2f, %.2f", li->load1, li->load5, - li->load15); +void sync_manager_add_entry(SyncEntry *entry); +void sync_manager_show(void); - g_free(li); - return tmp; -} +#endif /* __SYNCMANAGER_H__ */ diff --git a/uidefs.h b/uidefs.h new file mode 100644 index 00000000..75549f35 --- /dev/null +++ b/uidefs.h @@ -0,0 +1,50 @@ +#ifndef __UIDEFS_H__ +#define __UIDEFS_H__ + +char *uidefs_str = "<ui>" \ +"<menubar>" \ +"<menu name=\"InformationMenu\" action=\"InformationMenuAction\">" \ +"<menuitem name=\"Report\" action=\"ReportAction\" />" \ +"<separator/>" \ +"<menuitem name=\"Copy\" action=\"CopyAction\" />" \ +"<menuitem name=\"SaveGraph\" action=\"SaveGraphAction\" />" \ +"<separator/>" \ +"<menuitem name=\"SyncManager\" action=\"SyncManagerAction\" />" \ +"<separator/>" \ +"<menuitem name=\"Quit\" action=\"QuitAction\" />" \ +"</menu>" \ +"<menu name=\"ViewMenu\" action=\"ViewMenuAction\">" \ +"<menuitem name=\"SidePane\" action=\"SidePaneAction\"/>" \ +"<menuitem name=\"Toolbar\" action=\"ToolbarAction\"/>" \ +"<separator/>" \ +"<menuitem name=\"Refresh\" action=\"RefreshAction\"/>" \ +"<separator/>" \ +"<separator name=\"LastSep\"/>" \ +"</menu>" \ +"<menu name=\"HelpMenu\" action=\"HelpMenuAction\">" \ +"<menuitem name=\"OnlineDocs\" action=\"OnlineDocsAction\"/>" \ +"<separator/>" \ +"<menuitem name=\"WebPage\" action=\"HomePageAction\"/>" \ +"<menuitem name=\"ReportBug\" action=\"ReportBugAction\"/>" \ +"<separator/>" \ +"<menuitem name=\"Donate\" action=\"DonateAction\"/>" \ +"<separator/>" \ +"<menu name=\"HelpMenuModules\" action=\"HelpMenuModulesAction\">" \ +"<separator name=\"LastSep\"/>" \ +"</menu>" \ +"<menuitem name=\"About\" action=\"AboutAction\"/>" \ +"</menu>" \ +"</menubar>" \ +"" \ +"<toolbar action=\"MainMenuBar\" action=\"MainMenuBarAction\">" \ +"<placeholder name=\"ToolItems\">" \ +"<toolitem name=\"Refresh\" action=\"RefreshAction\"/>" \ +"<separator/>" \ +"<toolitem name=\"Copy\" action=\"CopyAction\"/>" \ +"<toolitem name=\"Report\" action=\"ReportAction\"/>" \ +"</placeholder>" \ +"</toolbar>" \ +"</ui>" \ +""; + +#endif /* __UIDEFS_H__ */ diff --git a/uidefs.xml b/uidefs.xml deleted file mode 100644 index 280c7951..00000000 --- a/uidefs.xml +++ /dev/null @@ -1,29 +0,0 @@ -<ui> - <menubar> - <menu name="FileMenu" action="FileMenuAction"> - <menuitem name="Generate Report..." action="ReportAction" /> - <separator/> - <menuitem name="Quit" action="QuitAction" /> - <placeholder name="FileMenuAdditions" /> - </menu> - <menu name="ViewMenu" action="ViewMenuAction"> - <menuitem name="SidePane" action="SidePaneAction"/> - <menuitem name="Toolbar" action="ToolbarAction"/> - <separator/> - <menuitem name="Refresh" action="RefreshAction"/> - <separator/> - <separator name="LastSep"/> - </menu> - <menu name="HelpMenu" action="HelpMenuAction"> - <menuitem name="About" action="AboutAction"/> - </menu> - </menubar> - - <toolbar action="MainMenuBar" action="MainMenuBarAction"> - <placeholder name="ToolItems"> - <toolitem name="Refresh" action="RefreshAction"/> - <separator/> - <toolitem name="Report" action="ReportAction"/> - </placeholder> - </toolbar> -</ui> @@ -1,6 +1,6 @@ /* * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> + * Copyright (C) 2003-2007 Leandro A. F. Pereira <leandro@linuxmag.com.br> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,16 +15,55 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include <config.h> + +#include <report.h> #include <string.h> +#include <shell.h> +#include <iconcache.h> #include <hardinfo.h> #include <gtk/gtk.h> +#include <binreloc.h> + +#include <sys/stat.h> +#include <sys/types.h> + #define KiB 1024 #define MiB 1048576 #define GiB 1073741824 -inline gchar * -size_human_readable(gfloat size) +gchar *seconds_to_string(unsigned int seconds) +{ + unsigned int hours, minutes, days; + + minutes = seconds / 60; + hours = minutes / 60; + minutes %= 60; + days = hours / 24; + hours %= 24; + +#define plural(x) ((x > 1) ? "s" : "") + + if (days < 1) { + if (hours < 1) { + return g_strdup_printf("%d minute%s", minutes, + plural(minutes)); + } else { + return g_strdup_printf("%d hour%s, %d minute%s", + hours, + plural(hours), minutes, + plural(minutes)); + } + } + + return g_strdup_printf("%d day%s, %d hour%s and %d minute%s", + days, plural(days), hours, + plural(hours), minutes, + plural(minutes)); +} + +inline gchar *size_human_readable(gfloat size) { if (size < KiB) return g_strdup_printf("%.1f B", size); @@ -36,44 +75,889 @@ size_human_readable(gfloat size) return g_strdup_printf("%.1f GiB", size / GiB); } -inline void -strend(gchar *str, gchar chr) +inline void strend(gchar * str, gchar chr) { if (!str) - return; - + return; + char *p; if ((p = strchr(str, chr))) - *p = 0; + *p = 0; } -inline void -remove_quotes(gchar *str) +inline void remove_quotes(gchar * str) { if (!str) - return; + return; while (*str == '"') - *(str++) = ' '; - + *(str++) = ' '; + strend(str, '"'); } -inline void -remove_linefeed(gchar * str) +inline void remove_linefeed(gchar * str) { strend(str, '\n'); } -void -widget_set_cursor(GtkWidget *widget, GdkCursorType cursor_type) -{ - GdkCursor *cursor; +void widget_set_cursor(GtkWidget * widget, GdkCursorType cursor_type) +{ + GdkCursor *cursor; + + cursor = gdk_cursor_new(cursor_type); + gdk_window_set_cursor(GDK_WINDOW(widget->window), cursor); + gdk_cursor_unref(cursor); + + while (gtk_events_pending()) + gtk_main_iteration(); +} + +static gboolean __nonblock_cb(gpointer data) +{ + gtk_main_quit(); + return FALSE; +} + +void nonblock_sleep(guint msec) +{ + g_timeout_add(msec, (GSourceFunc) __nonblock_cb, NULL); + gtk_main(); +} + +static void __expand_cb(GtkWidget * widget, gpointer data) +{ + if (GTK_IS_EXPANDER(widget)) { + gtk_expander_set_expanded(GTK_EXPANDER(widget), TRUE); + } else if (GTK_IS_CONTAINER(widget)) { + gtk_container_foreach(GTK_CONTAINER(widget), + (GtkCallback) __expand_cb, NULL); + } +} + +void file_chooser_open_expander(GtkWidget * chooser) +{ + gtk_container_foreach(GTK_CONTAINER(chooser), + (GtkCallback) __expand_cb, NULL); +} + +void file_chooser_add_filters(GtkWidget * chooser, FileTypes * filters) +{ + GtkFileFilter *filter; + gint i; + + for (i = 0; filters[i].name; i++) { + filter = gtk_file_filter_new(); + gtk_file_filter_add_mime_type(filter, filters[i].mime_type); + gtk_file_filter_set_name(filter, filters[i].name); + gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(chooser), filter); + } +} + +gchar * +file_chooser_get_extension(GtkWidget * chooser, FileTypes * filters) +{ + GtkFileFilter *filter; + const gchar *filter_name; + gint i; + + filter = gtk_file_chooser_get_filter(GTK_FILE_CHOOSER(chooser)); + filter_name = gtk_file_filter_get_name(filter); + for (i = 0; filters[i].name; i++) { + if (g_str_equal(filter_name, filters[i].name)) { + return filters[i].extension; + } + } + + return NULL; +} + +gpointer file_types_get_data_by_name(FileTypes * filters, gchar * filename) +{ + gint i; + + for (i = 0; filters[i].name; i++) { + if (g_str_has_suffix(filename, filters[i].extension)) { + return filters[i].data; + } + } + + return NULL; +} + +gchar * file_chooser_build_filename(GtkWidget * chooser, gchar * extension) +{ + gchar *filename = + gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(chooser)); + gchar *retval; + + if (g_str_has_suffix(filename, extension)) { + return filename; + } + + retval = g_strconcat(filename, extension, NULL); + g_free(filename); + + return retval; +} + +gboolean binreloc_init(gboolean try_hardcoded) +{ + GError *error = NULL; + gchar *tmp; + + DEBUG("initializing binreloc (hardcoded = %d)", try_hardcoded); + + /* If the runtime data directories we previously found, don't even try + to find them again. */ + if (params.path_data && params.path_lib) { + DEBUG("data and lib path already found."); + return TRUE; + } + + if (try_hardcoded || !gbr_init(&error)) { + /* We were asked to try hardcoded paths or BinReloc failed to initialize. */ + params.path_data = g_strdup(PREFIX); + params.path_lib = g_strdup(LIBPREFIX); + + if (error) { + g_error_free(error); + } + + DEBUG("%strying hardcoded paths.", try_hardcoded ? "" : "binreloc init failed. "); + } else { + /* If we were able to initialize BinReloc, build the default data + and library paths. */ + DEBUG("done, trying to use binreloc paths."); + + tmp = gbr_find_data_dir(PREFIX); + params.path_data = g_build_filename(tmp, "hardinfo", NULL); + g_free(tmp); + + tmp = gbr_find_lib_dir(PREFIX); + params.path_lib = g_build_filename(tmp, "hardinfo", NULL); + g_free(tmp); + } + + DEBUG("searching for runtime data on these locations:"); + DEBUG(" lib: %s", params.path_lib); + DEBUG(" data: %s", params.path_data); + + /* Try to see if the uidefs.xml file isn't missing. This isn't the + definitive test, but it should do okay for most situations. */ + tmp = g_build_filename(params.path_data, "benchmark.data", NULL); + if (!g_file_test(tmp, G_FILE_TEST_EXISTS)) { + DEBUG("runtime data not found"); + + g_free(params.path_data); + g_free(params.path_lib); + g_free(tmp); + + params.path_data = params.path_lib = NULL; + + if (try_hardcoded) { + /* We tried the hardcoded paths, but still was unable to find the + runtime data. Give up. */ + DEBUG("giving up"); + return FALSE; + } else { + /* Even though BinReloc worked OK, the runtime data was not found. + Try the hardcoded paths. */ + DEBUG("trying to find elsewhere"); + return binreloc_init(TRUE); + } + } + g_free(tmp); + + DEBUG("runtime data found!"); + /* We found the runtime data; hope everything is fine */ + return TRUE; +} + +static void +log_handler(const gchar * log_domain, + GLogLevelFlags log_level, + const gchar * message, gpointer user_data) +{ + if (!params.gui_running) { + /* No GUI running: spit the message to the terminal */ + g_print("\n\n*** %s: %s\n\n", + (log_level & G_LOG_FLAG_FATAL) ? "Error" : "Warning", + message); + } else { + /* Hooray! We have a GUI running! */ + GtkWidget *dialog; + + dialog = gtk_message_dialog_new_with_markup(NULL, GTK_DIALOG_MODAL, + (log_level & + G_LOG_FLAG_FATAL) ? + GTK_MESSAGE_ERROR : + GTK_MESSAGE_WARNING, + GTK_BUTTONS_CLOSE, + "<big><b>%s</b></big>\n\n%s", + (log_level & + G_LOG_FLAG_FATAL) ? + "Fatal Error" : + "Warning", message); + + gtk_dialog_run(GTK_DIALOG(dialog)); + gtk_widget_destroy(dialog); + } +} + +void parameters_init(int *argc, char ***argv, ProgramParameters * param) +{ + static gboolean create_report = FALSE; + static gboolean show_version = FALSE; + static gboolean list_modules = FALSE; + static gboolean autoload_deps = FALSE; + static gchar *report_format = NULL; + static gchar **use_modules = NULL; + + static GOptionEntry options[] = { + { + .long_name = "generate-report", + .short_name = 'r', + .arg = G_OPTION_ARG_NONE, + .arg_data = &create_report, + .description = "creates a report and prints to standard output" + }, + { + .long_name = "report-format", + .short_name = 'f', + .arg = G_OPTION_ARG_STRING, + .arg_data = &report_format, + .description = "chooses a report format (text, html)" + }, + { + .long_name = "list-modules", + .short_name = 'l', + .arg = G_OPTION_ARG_NONE, + .arg_data = &list_modules, + .description = "lists modules" + }, + { + .long_name = "load-module", + .short_name = 'm', + .arg = G_OPTION_ARG_STRING_ARRAY, + .arg_data = &use_modules, + .description = "specify module to load" + }, + { + .long_name = "autoload-deps", + .short_name = 'a', + .arg = G_OPTION_ARG_NONE, + .arg_data = &autoload_deps, + .description = "automatically load module dependencies" + }, + { + .long_name = "version", + .short_name = 'v', + .arg = G_OPTION_ARG_NONE, + .arg_data = &show_version, + .description = "shows program version and quit" + }, + { NULL } + }; + GOptionContext *ctx; + + ctx = g_option_context_new("- System Profiler and Benchmark tool"); + g_option_context_set_ignore_unknown_options(ctx, FALSE); + g_option_context_set_help_enabled(ctx, TRUE); - cursor = gdk_cursor_new(cursor_type); - gdk_window_set_cursor(GDK_WINDOW(widget->window), cursor); - gdk_cursor_unref(cursor); + g_option_context_add_main_entries(ctx, options, *(argv)[0]); + g_option_context_parse(ctx, argc, argv, NULL); + + g_option_context_free(ctx); + + if (*argc >= 2) { + g_print("Unrecognized arguments.\n" + "Try ``%s --help'' for more information.\n", + *(argv)[0]); + exit(1); + } + + param->create_report = create_report; + param->report_format = REPORT_FORMAT_TEXT; + param->show_version = show_version; + param->list_modules = list_modules; + param->use_modules = use_modules; + param->autoload_deps = autoload_deps; + + if (report_format && g_str_equal(report_format, "html")) + param->report_format = REPORT_FORMAT_HTML; + + gchar *confdir = g_build_filename(g_get_home_dir(), ".hardinfo", NULL); + if (!g_file_test(confdir, G_FILE_TEST_EXISTS)) { + mkdir(confdir, 0744); + } + g_free(confdir); +} + +gboolean ui_init(int *argc, char ***argv) +{ + DEBUG("initializing gtk+ UI"); + + g_set_application_name("HardInfo"); + g_log_set_handler(NULL, + G_LOG_LEVEL_WARNING | G_LOG_FLAG_FATAL | + G_LOG_LEVEL_ERROR, log_handler, NULL); + + return gtk_init_check(argc, argv); +} + +void open_url(gchar * url) +{ + const gchar *browsers[] = { + "xdg-open", "gnome-open", "kfmclient openURL", + "sensible-browser", "firefox", "epiphany", + "iceweasel", "seamonkey", "galeon", "mozilla", + "opera", "konqueror", "netscape", "links -g", + NULL + }; + gint i; + + for (i = 0; browsers[i]; i++) { + gchar *cmdline = g_strdup_printf("%s '%s'", browsers[i], url); + + if (g_spawn_command_line_async(cmdline, NULL)) { + g_free(cmdline); + return; + } + + g_free(cmdline); + } + + g_warning("Couldn't find a Web browser to open URL %s.", url); +} + +/* Copyright: Jens Låås, SLU 2002 */ +gchar *strreplace(gchar * string, gchar * replace, gchar new_char) +{ + gchar *s; + for (s = string; *s; s++) + if (strchr(replace, *s)) + *s = new_char; + + return string; +} + +static GHashTable *__module_methods = NULL; + +static void module_register_methods(ShellModule *module) +{ + ShellModuleMethod *(*get_methods) (void); + gchar *method_name; + + if (__module_methods == NULL) { + __module_methods = g_hash_table_new(g_str_hash, g_str_equal); + } + + if (g_module_symbol(module->dll, "hi_exported_methods", (gpointer) &get_methods)) { + ShellModuleMethod *methods = get_methods(); + + while (TRUE) { + ShellModuleMethod method = *methods; + gchar *name = g_path_get_basename(g_module_name(module->dll)); + + strend(name, '.'); + + method_name = g_strdup_printf("%s::%s", name, method.name); + g_hash_table_insert(__module_methods, method_name, method.function); + g_free(name); + + if (!(*(++methods)).name) + break; + } + } + +} + +gchar *module_call_method(gchar *method) +{ + gchar *(*function) (void); + + if (__module_methods == NULL) { + return NULL; + } + + function = g_hash_table_lookup(__module_methods, method); + return function ? g_strdup(function()) : + g_strdup_printf("{Unknown method: \"%s\"}", method); +} + +static ShellModule *module_load(gchar *filename) +{ + ShellModule *module; + gchar *tmp; + + module = g_new0(ShellModule, 1); + + if (params.gui_running) { + gchar *tmpicon; + + tmpicon = g_strdup(filename); + gchar *dot = g_strrstr(tmpicon, "." G_MODULE_SUFFIX); + + *dot = '\0'; + + tmp = g_strdup_printf("%s.png", tmpicon); + module->icon = icon_cache_get_pixbuf(tmp); + + g_free(tmp); + g_free(tmpicon); + } + + tmp = g_build_filename(params.path_lib, "modules", filename, NULL); + module->dll = g_module_open(tmp, G_MODULE_BIND_LAZY); + g_free(tmp); + + if (module->dll) { + void (*init) (void); + ModuleEntry *(*get_module_entries) (void); + gint (*weight_func) (void); + gchar *(*name_func) (void); + ModuleEntry *entries; + gint i = 0; + + if (!g_module_symbol(module->dll, "hi_module_get_entries", (gpointer) & get_module_entries) || + !g_module_symbol(module->dll, "hi_module_get_name", (gpointer) & name_func)) { + goto failed; + } + + if (g_module_symbol(module->dll, "hi_module_init", (gpointer) & init)) { + init(); + } + + g_module_symbol(module->dll, "hi_module_get_weight", (gpointer) & weight_func); + + module->weight = weight_func ? weight_func() : 0; + module->name = name_func(); + + entries = get_module_entries(); + while (entries[i].name) { + ShellModuleEntry *entry = g_new0(ShellModuleEntry, 1); + + if (params.gui_running) { + entry->icon = icon_cache_get_pixbuf(entries[i].icon); + } + + g_module_symbol(module->dll, "hi_more_info", + (gpointer) & (entry->morefunc)); + g_module_symbol(module->dll, "hi_get_field", + (gpointer) & (entry->fieldfunc)); + g_module_symbol(module->dll, "hi_note_func", + (gpointer) & (entry->notefunc)); + + entry->name = entries[i].name; + entry->scan_func = entries[i].scan_callback; + entry->func = entries[i].callback; + entry->number = i; + + module->entries = g_slist_append(module->entries, entry); + + i++; + } + + module_register_methods(module); + } else { + failed: + DEBUG("loading module %s failed", filename); - while(gtk_events_pending()) - gtk_main_iteration(); + g_free(module->name); + g_free(module); + module = NULL; + } + + return module; +} + +static gboolean module_in_module_list(gchar *module, gchar **module_list) +{ + int i = 0; + + if (!module_list) + return TRUE; + + for (; module_list[i]; i++) { + if (g_str_equal(module_list[i], module)) + return TRUE; + } + + return FALSE; +} + +static gint module_cmp(gconstpointer m1, gconstpointer m2) +{ + ShellModule *a = (ShellModule *)m1; + ShellModule *b = (ShellModule *)m2; + + return a->weight - b->weight; +} + +static void module_entry_free(gpointer data, gpointer user_data) +{ + ShellModuleEntry *entry = (ShellModuleEntry *)data; + + if (entry) { + /*g_free(entry->name);*/ + g_object_unref(entry->icon); + + g_free(entry); + } +} + +static void module_free(ShellModule *module) +{ + g_free(module->name); + g_object_unref(module->icon); + /*g_module_close(module->dll);*/ + + DEBUG("module_free: module->entries, %p\n", module->entries); + g_slist_foreach(module->entries, (GFunc)module_entry_free, NULL); + g_slist_free(module->entries); + + g_free(module); +} + +ModuleAbout *module_get_about(ShellModule *module) +{ + ModuleAbout *(*get_about)(void); + + if (g_module_symbol(module->dll, "hi_module_get_about", + (gpointer) &get_about)) { + return get_about(); + } + + return NULL; +} + +static GSList *modules_check_deps(GSList *modules) +{ + GSList *mm; + ShellModule *module; + + for (mm = modules; mm; mm = mm->next) { + gchar **(*get_deps)(void); + gchar **deps; + gint i; + + module = (ShellModule *) mm->data; + + if (g_module_symbol(module->dll, "hi_module_get_dependencies", + (gpointer) & get_deps)) { + for (i = 0, deps = get_deps(); deps[i]; i++) { + GSList *l; + ShellModule *m; + gboolean found = FALSE; + + for (l = modules; l; l = l->next) { + m = (ShellModule *)l->data; + gchar *name = g_path_get_basename(g_module_name(m->dll)); + + if (g_str_equal(name, deps[i])) { + found = TRUE; + break; + } + + g_free(name); + } + + if (!found) { + if (params.autoload_deps) { + ShellModule *mod = module_load(deps[i]); + + if (mod) + modules = g_slist_append(modules, mod); + modules = modules_check_deps(modules); /* re-check dependencies */ + + break; + } + + if (params.gui_running) { + GtkWidget *dialog; + + dialog = gtk_message_dialog_new(NULL, + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_QUESTION, + GTK_BUTTONS_NONE, + "Module \"%s\" depends on module \"%s\", load it?", + module->name, deps[i]); + gtk_dialog_add_buttons(GTK_DIALOG(dialog), + GTK_STOCK_NO, GTK_RESPONSE_REJECT, + GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, + NULL); + + if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) { + ShellModule *mod = module_load(deps[i]); + + if (mod) + modules = g_slist_append(modules, mod); + modules = modules_check_deps(modules); /* re-check dependencies */ + } else { + modules = g_slist_remove(modules, module); + module_free(module); + } + + gtk_widget_destroy(dialog); + } else { + g_error("Module \"%s\" depends on module \"%s\".", module->name, deps[i]); + } + } + } + } + } + + return modules; +} + +static GSList *modules_load(gchar **module_list) +{ + GDir *dir; + GSList *modules = NULL; + ShellModule *module; + gchar *filename; + + filename = g_build_filename(params.path_lib, "modules", NULL); + dir = g_dir_open(filename, 0, NULL); + g_free(filename); + + if (dir) { + while ((filename = (gchar*)g_dir_read_name(dir))) { + if (g_strrstr(filename, "." G_MODULE_SUFFIX) && + module_in_module_list(filename, module_list) && + ((module = module_load(filename)))) { + modules = g_slist_append(modules, module); + } + } + + g_dir_close(dir); + } + + modules = modules_check_deps(modules); + + if (g_slist_length(modules) == 0) { + if (params.use_modules == NULL) { + g_error("No module could be loaded. Check permissions on \"%s\" and try again.", + params.path_lib); + } else { + g_error("No module could be loaded. Please use hardinfo -l to list all avai" + "lable modules and try again with a valid module list."); + + } + } + + return g_slist_sort(modules, module_cmp); +} + +GSList *modules_load_selected(void) +{ + return modules_load(params.use_modules); +} + +GSList *modules_load_all(void) +{ + return modules_load(NULL); +} + +gint tree_view_get_visible_height(GtkTreeView *tv) +{ + GtkTreePath *path; + GdkRectangle rect; + GtkTreeIter iter; + GtkTreeModel *model = gtk_tree_view_get_model(tv); + gint nrows = 1; + + path = gtk_tree_path_new_first(); + gtk_tree_view_get_cell_area(GTK_TREE_VIEW(tv), + path, NULL, &rect); + + /* FIXME: isn't there any easier way to tell the number of rows? */ + gtk_tree_model_get_iter_first(model, &iter); + do { + nrows++; + } while (gtk_tree_model_iter_next(model, &iter)); + + gtk_tree_path_free(path); + + return nrows * rect.height; +} + +void tree_view_save_image(gchar *filename) +{ + /* this is ridiculously complicated :/ why in the hell gtk+ makes this kind of + thing so difficult? */ + + /* FIXME: this does not work if the window (or part of it) isn't visible. does + anyone know how to fix this? :/ */ + Shell *shell = shell_get_main_shell(); + GtkWidget *widget = shell->info->view; + + PangoLayout *layout; + PangoContext *context; + PangoRectangle rect; + + GdkPixmap *pm; + GdkPixbuf *pb; + GdkGC *gc; + GdkColor black = { 0, 0, 0, 0 }; + GdkColor white = { 0, 65535, 65535, 65535 }; + + gint w, h, visible_height; + gchar *tmp; + + gboolean tv_enabled; + + /* present the window */ + gtk_window_present(GTK_WINDOW(shell->window)); + + /* if the treeview is disabled, we need to enable it so we get the + correct colors when saving. we make it insensitive later on if it + was this way before entering this function */ + tv_enabled = GTK_WIDGET_IS_SENSITIVE(widget); + gtk_widget_set_sensitive(widget, TRUE); + + gtk_widget_queue_draw(widget); + + /* unselect things in the information treeview */ + gtk_range_set_value(GTK_RANGE + (GTK_SCROLLED_WINDOW(shell->info->scroll)-> + vscrollbar), 0.0); + gtk_tree_selection_unselect_all( + gtk_tree_view_get_selection(GTK_TREE_VIEW(widget))); + while (gtk_events_pending()) + gtk_main_iteration(); + + /* initialize stuff */ + gc = gdk_gc_new(widget->window); + gdk_gc_set_background(gc, &black); + gdk_gc_set_foreground(gc, &white); + + context = gtk_widget_get_pango_context (widget); + layout = pango_layout_new(context); + + visible_height = tree_view_get_visible_height(GTK_TREE_VIEW(widget)); + + /* draw the title */ + tmp = g_strdup_printf("<b><big>%s</big></b>\n<small>%s</small>", + shell->selected->name, + shell->selected->notefunc(shell->selected->number)); + pango_layout_set_markup(layout, tmp, -1); + pango_layout_set_width(layout, widget->allocation.width * PANGO_SCALE); + pango_layout_set_alignment(layout, PANGO_ALIGN_CENTER); + pango_layout_get_pixel_extents(layout, NULL, &rect); + + w = widget->allocation.width; + h = visible_height + rect.height; + + pm = gdk_pixmap_new(widget->window, w, rect.height, -1); + gdk_draw_rectangle(GDK_DRAWABLE(pm), gc, TRUE, 0, 0, w, rect.height); + gdk_draw_layout_with_colors (GDK_DRAWABLE(pm), gc, 0, 0, layout, + &white, &black); + + /* copy the pixmap from the treeview and from the title */ + pb = gdk_pixbuf_get_from_drawable(NULL, + widget->window, + NULL, + 0, 0, + 0, 0, + w, h); + pb = gdk_pixbuf_get_from_drawable(pb, + pm, + NULL, + 0, 0, + 0, visible_height, + w, rect.height); + + /* save the pixbuf to a png file */ + gdk_pixbuf_save(pb, filename, "png", NULL, + "compression", "9", + "tEXt::hardinfo::version", VERSION, + "tEXt::hardinfo::arch", ARCH, + NULL); + + /* unref */ + g_object_unref(pb); + g_object_unref(layout); + g_object_unref(pm); + g_object_unref(gc); + g_free(tmp); + + gtk_widget_set_sensitive(widget, tv_enabled); +} + + +static gboolean __idle_free_do(gpointer ptr) +{ + if (ptr) { + g_free(ptr); + } + + return FALSE; +} + +gpointer idle_free(gpointer ptr) +{ + if (ptr) { + g_timeout_add(10000, __idle_free_do, ptr); + } + + return ptr; +} + +void module_entry_scan_all_except(ModuleEntry *entries, gint except_entry) +{ + ModuleEntry entry; + gint i = 0; + void (*scan_callback)(gboolean reload); + + shell_view_set_enabled(FALSE); + + for (entry = entries[0]; entry.name; entry = entries[++i]) { + if (i == except_entry) + continue; + + shell_status_update(idle_free(g_strdup_printf("Scanning: %s...", entry.name))); + + if ((scan_callback = entry.scan_callback)) { + scan_callback(FALSE); + } + } + + shell_view_set_enabled(TRUE); + shell_status_update("Done."); +} + +void module_entry_scan_all(ModuleEntry *entries) +{ + module_entry_scan_all_except(entries, -1); +} + +void module_entry_reload(ShellModuleEntry *module_entry) +{ + if (module_entry->scan_func) { + module_entry->scan_func(TRUE); + } +} + +void module_entry_scan(ShellModuleEntry *module_entry) +{ + if (module_entry->scan_func) { + module_entry->scan_func(FALSE); + } +} + +gchar *module_entry_function(ShellModuleEntry *module_entry) +{ + if (module_entry->func) { + return g_strdup(module_entry->func()); + } + + return g_strdup("[Error]\n" + "Invalid module="); +} + +const gchar *module_entry_get_note(ShellModuleEntry *module_entry) +{ + return module_entry->notefunc(module_entry->number); } diff --git a/vendor.c b/vendor.c new file mode 100644 index 00000000..e5744a0f --- /dev/null +++ b/vendor.c @@ -0,0 +1,86 @@ +/* + * HardInfo - Displays System Information + * Copyright (C) 2003-2007 Leandro A. F. Pereira <leandro@linuxmag.com.br> + * + * List of vendors based on GtkSysInfo (c) Pissens Sebastien. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, version 2. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <string.h> +#include <gtk/gtk.h> +#include "vendor.h" + +static const Vendor vendors[] = { + { "ATI", "ATI Technologies, Inc.","www.ati.com" }, + { "nVidia", "NVIDIA Corporation", "www.nvidia.com" }, + { "3Com", "3Com", "www.3com.com" }, + { "Intel" , "Intel Corp.", "www.intel.com" }, + { "Cirrus Logic", "Cirrus Logic", "www.cirrus.com" }, + { "VIA Technologies", "VIA Technologies", "www.via.com.tw" }, + { "VIA", "VIA Technologies", "www.via.com.tw" }, + { "hp", "Hewlett-Packard", "www.hp.com" }, + { "NEC Corporation", "NEC Coporation", "www.nec.com" }, + { "MAXTOR", "MAXTOR", "www.maxtor.com" }, + { "SAMSUNG", "SAMSUNG", "www.samsung.com" }, + { "PIONEER", "PIONEER", "www.pioneer-eur.com" }, + { "PLEXTOR", "PLEXTOR", "www.plextor.be" }, + { "Realtek Semiconductor", "Realtek", "www.realtek.com.tw" }, + { "TOSHIBA", "TOSHIBA", "www.toshiba.com" }, + { "LITE-ON", "LITE-ON", "www.liteonit.com" }, + { "WDC", "Western Digital", "www.wdc.com" }, + { "HL-DT-ST", "LG Electronics", "www.lge.com" }, + { "ST", "SEAGATE", "www.seagate.com" }, + { "Lexmark", "Lexmark", "www.lexmark.com" }, + { "_NEC", "NEC Corporation", "www.nec.com" }, + { "Creative Labs", "Creative Labs", "www.creative.com" }, + { "Brooktree", "Conexant", "www.brooktree.com" }, + { "Atheros", "Atheros Communications","www.atheros.com" }, + { "MATSHITA", "Panasonic", "www.panasonic.com" }, + { "Silicon Image", "Silicon Image, Inc.", "www.siliconimage.com" }, + { "KYE", "KYE Systems Corp.", "www.genius-kye.com" }, + { "Broadcom", "Broadcom Corp.", "www.broadcom.com" }, + { "Apple", "Apple Computer, Inc.", "www.apple.com" }, + { "IBM", "IBM Corp.", "www.ibm.com" }, + { "Dell", "Dell Computer Corp.", "www.dell.com" }, + { "Logitech", "Logitech International SA", "www.logitech.com" }, + { "FUJITSU", "Fujitsu", "www.fujitsu.com" }, + { "CDU", "Sony", "www.sony.com" }, + { NULL, NULL, NULL }, +}; + +const gchar *vendor_get_name(const gchar *id) +{ + int i; + + for (i = 0; vendors[i].id; i++) { + if (strstr(id, vendors[i].id)) + return vendors[i].name; + } + + return id; +} + +const gchar *vendor_get_url(const gchar *id) +{ + int i; + + for (i = 0; vendors[i].id; i++) { + if (strstr(id, vendors[i].id)) + return vendors[i].url; + } + + return NULL; +} + diff --git a/vendor.h b/vendor.h new file mode 100644 index 00000000..cdbb3547 --- /dev/null +++ b/vendor.h @@ -0,0 +1,33 @@ +/* + * HardInfo - Displays System Information + * Copyright (C) 2003-2007 Leandro A. F. Pereira <leandro@linuxmag.com.br> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, version 2. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef __VENDOR_H__ +#define __VENDOR_H__ + +typedef struct _Vendor Vendor; +struct _Vendor { + char *id; + char *name; + char *url; +}; + +const gchar *vendor_get_name(const gchar *id); +const gchar *vendor_get_url(const gchar *id); + + +#endif /* __VENDOR_H__ */ |