aboutsummaryrefslogtreecommitdiff
path: root/arch/common
diff options
context:
space:
mode:
authorAgney Lopes Roth Ferraz <agney@debian.org>2007-04-09 11:45:31 -0300
committerSimon Quigley <tsimonq2@ubuntu.com>2017-06-19 14:38:41 -0500
commitadb3993ba087ede46f62d5f018e17b07e99b5260 (patch)
tree67b4fa7e224f09d21eb76060422ca23e50e6dfe0 /arch/common
parentb3e31ae3787c8806f48c85a52bba9aa3554e2c07 (diff)
parent11b8179a57e675c6672cbe649c655230ae3e9744 (diff)
Import Debian changes 0.4.2.1-1
hardinfo (0.4.2.1-1) unstable; urgency=low * New upstream release. * Fixed segfault on device entry (Closes: #387955)
Diffstat (limited to 'arch/common')
-rw-r--r--arch/common/.svn/README.txt2
-rw-r--r--arch/common/.svn/empty-file0
-rw-r--r--arch/common/.svn/entries101
-rw-r--r--arch/common/.svn/format1
-rw-r--r--arch/common/.svn/prop-base/blowfish.h.svn-base0
-rw-r--r--arch/common/.svn/prop-base/display.h.svn-base0
-rw-r--r--arch/common/.svn/prop-base/fib.h.svn-base0
-rw-r--r--arch/common/.svn/prop-base/languages.h.svn-base0
-rw-r--r--arch/common/.svn/prop-base/md5.h.svn-base0
-rw-r--r--arch/common/.svn/prop-base/printers.h.svn-base0
-rw-r--r--arch/common/.svn/prop-base/sha1.h.svn-base0
-rw-r--r--arch/common/.svn/prop-base/zlib.h.svn-base0
-rw-r--r--arch/common/.svn/props/blowfish.h.svn-work0
-rw-r--r--arch/common/.svn/props/display.h.svn-work0
-rw-r--r--arch/common/.svn/props/fib.h.svn-work0
-rw-r--r--arch/common/.svn/props/languages.h.svn-work0
-rw-r--r--arch/common/.svn/props/md5.h.svn-work0
-rw-r--r--arch/common/.svn/props/printers.h.svn-work0
-rw-r--r--arch/common/.svn/props/sha1.h.svn-work0
-rw-r--r--arch/common/.svn/props/zlib.h.svn-work0
-rw-r--r--arch/common/.svn/text-base/blowfish.h.svn-base70
-rw-r--r--arch/common/.svn/text-base/display.h.svn-base137
-rw-r--r--arch/common/.svn/text-base/languages.h.svn-base102
-rw-r--r--arch/common/.svn/text-base/md5.h.svn-base67
-rw-r--r--arch/common/.svn/text-base/printers.h.svn-base81
-rw-r--r--arch/common/.svn/text-base/sha1.h.svn-base67
-rw-r--r--arch/common/.svn/text-base/users.h.svn-base63
-rw-r--r--arch/common/.svn/text-base/zlib.h.svn-base90
-rw-r--r--arch/common/blowfish.h19
-rw-r--r--arch/common/display.h32
-rw-r--r--arch/common/fib.h28
-rw-r--r--arch/common/languages.h15
-rw-r--r--arch/common/md5.h16
-rw-r--r--arch/common/printers.h24
-rw-r--r--arch/common/raytrace.h (renamed from arch/common/.svn/text-base/fib.h.svn-base)40
-rw-r--r--arch/common/sha1.h17
-rw-r--r--arch/common/users.h3
-rw-r--r--arch/common/zlib.h24
38 files changed, 102 insertions, 897 deletions
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 db77551b..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;
@@ -30,8 +30,7 @@ benchmark_zlib(void)
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;
}
-