diff options
author | Simon Quigley <tsimonq2@ubuntu.com> | 2017-06-19 15:19:47 -0500 |
---|---|---|
committer | Simon Quigley <tsimonq2@ubuntu.com> | 2017-06-19 15:19:47 -0500 |
commit | 79c11b29d78a70ae1b04af3b7ca4ec9bb12dd8d7 (patch) | |
tree | c4577e59ae13a8031f937991dcc3a63f68d18db5 | |
parent | 62eb92d94fa902b4a34dafce45547680a2655b40 (diff) | |
parent | 7aacc9f2510901c9e97b30fa9bcb550bb7f99c03 (diff) |
Merge tag 'upstream/0.5.1+git20170605'
Upstream version 0.5.1+git20170605
417 files changed, 18284 insertions, 4173 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..1b6c8d15 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +Makefile +config.h +*.so +*.o +*~ +arch/this +build/ + diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000..f93c835e --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,201 @@ +project(HardInfo) +cmake_minimum_required(VERSION 2.6) +cmake_policy(VERSION 2.6) + +set(HARDINFO_VERSION "0.6-alpha") +option(HARDINFO_NOSYNC "Disable database sync via libsoup" 1) +SET( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ) +include(GNUInstallDirs) + +if(${CMAKE_BUILD_TYPE} MATCHES [Dd]ebug) + set(HARDINFO_DEBUG 1) +endif() + +if(${CMAKE_HOST_SYSTEM_NAME} MATCHES "Linux") + set(HARDINFO_OS "linux") +else() + message(FATAL_ERROR "Unsupported operating system: ${CMAKE_HOST_SYSTEM_NAME}") +endif() + +if(${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "i[3-6]86") + set(HARDINFO_ARCH "x86") +elseif(${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "x86_64") + set(HARDINFO_ARCH "x86_64") +elseif(${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "ppc{32,64}") + set(HARDINFO_ARCH "ppc") +elseif(${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "mips") + set(HARDINFO_ARCH "mips") +elseif(${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "parisc.*") + set(HARDINFO_ARCH "parisc") +elseif(${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "sparc{32,64}") + set(HARDINFO_ARCH "sparc") +elseif(${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "arm.*") + set(HARDINFO_ARCH "arm") +elseif(${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "ia64") + set(HARDINFO_ARCH "ia64") +elseif(${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "alpha") + set(HARDINFO_ARCH "alpha") +elseif(${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "s390.*") + set(HARDINFO_ARCH "s390") +elseif(${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "m68k") + set(HARDINFO_ARCH "m68k") +elseif(${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "sh{3,4}") + set(HARDINFO_ARCH "sh") +else() + message(FATAL_ERROR "Unsupported architecture: ${CMAKE_HOST_SYSTEM_PROCESSOR}") +endif() + +message(STATUS "Building HardInfo for architecture: ${HARDINFO_OS}-${HARDINFO_ARCH}") + +add_definitions("-std=gnu89") + +add_subdirectory(po) + +include(FindPkgConfig) +pkg_check_modules(GTK REQUIRED gtk+-2.0>=2.10 glib-2.0>=2.10 gthread-2.0>=2.10 gmodule-export-2.0>=2.10) +if(NOT HARDINFO_NOSYNC) + pkg_check_modules(LIBSOUP libsoup-2.4>=2.24) +endif() + +include_directories( + ${CMAKE_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/includes + ${CMAKE_SOURCE_DIR}/includes/${HARDINFO_ARCH} + ${CMAKE_BINARY_DIR} + ${GTK_INCLUDE_DIRS} + ${LIBSOUP_INCLUDE_DIRS} +) +link_directories( + ${GTK_LIBRARY_DIRS} + ${LIBSOUP_LIBRARY_DIRS} +) + +set(HARDINFO_MODULES + computer + devices + benchmark + network +) +set(HARDINFO_RESOURCES + "benchmark.conf" + "benchmark.data" +) + +set(MODULE_computer_SOURCES + modules/computer.c + modules/computer/alsa.c + modules/computer/boots.c + modules/computer/display.c + modules/computer/environment.c + modules/computer/filesystem.c + modules/computer/languages.c + modules/computer/loadavg.c + modules/computer/memory.c + modules/computer/modules.c + modules/computer/os.c + modules/computer/uptime.c + modules/computer/users.c + modules/computer/groups.c +) +set(MODULE_devices_SOURCES + modules/devices.c + modules/devices/${HARDINFO_ARCH}/processor.c + modules/devices/battery.c + modules/devices/devmemory.c + modules/devices/dmi.c + modules/devices/inputdevices.c + modules/devices/pci.c + modules/devices/printers.c + modules/devices/resources.c + modules/devices/sensors.c + modules/devices/spd-decode.c + modules/devices/storage.c + modules/devices/usb.c +) +set(MODULE_network_SOURCES + modules/network.c + modules/network/net.c + modules/network/nfs.c + modules/network/samba.c +) +set(MODULE_benchmark_SOURCES + modules/benchmark.c + modules/benchmark/blowfish.c + modules/benchmark/cryptohash.c + modules/benchmark/drawing.c + modules/benchmark/fbench.c + modules/benchmark/fftbench.c + modules/benchmark/fft.c + modules/benchmark/fib.c + modules/benchmark/guibench.c + modules/benchmark/md5.c + modules/benchmark/nqueens.c + modules/benchmark/raytrace.c + modules/benchmark/sha1.c +) + +set_source_files_properties( + modules/benchmark/blowfish.c + modules/benchmark/fftbench.c + modules/benchmark/md5.c + modules/benchmark/sha1.c + PROPERTIES + COMPILE_FLAGS "-O0" +) + +foreach (_module ${HARDINFO_MODULES}) + add_library(${_module} MODULE ${MODULE_${_module}_SOURCES}) + set_target_properties(${_module} PROPERTIES PREFIX "") +endforeach() + +add_library(hardinfo-shell STATIC + shell/callbacks.c + shell/iconcache.c + shell/loadgraph.c + shell/menu.c + shell/report.c + shell/shell.c + shell/stock.c + shell/syncmanager.c +) +add_executable(hardinfo + hardinfo/binreloc.c + hardinfo/expr.c + hardinfo/hardinfo.c + hardinfo/socket.c + hardinfo/util.c + hardinfo/vendor.c +) +target_link_libraries(hardinfo + ${GTK_LIBRARIES} + ${LIBSOUP_LIBRARIES} + hardinfo-shell + m +) + +configure_file(config.h.cmake ${CMAKE_BINARY_DIR}/config.h @ONLY) +configure_file(hardinfo.desktop.cmake ${CMAKE_BINARY_DIR}/hardinfo.desktop @ONLY) + +install(TARGETS hardinfo ${HARDINFO_MODULES} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/hardinfo/modules + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE +) +install(FILES ${CMAKE_BINARY_DIR}/hardinfo.desktop + DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ +) +install(FILES ${HARDINFO_RESOURCES} + DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/hardinfo + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ +) +install(DIRECTORY pixmaps + DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/hardinfo + PATTERN "*.{png,svg}" + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ +) +install(DIRECTORY doc + DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/hardinfo + PATTERN "*.{hlp,png}" + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ +) diff --git a/Makefile.in b/Makefile.in deleted file mode 100644 index 03a9df8b..00000000 --- a/Makefile.in +++ /dev/null @@ -1,90 +0,0 @@ - -CCFLAGS = -fPIC -pipe -Wall -g -CFLAGS = $(GTK_CFLAGS) $(SOUP_CFLAGS) -I. -CC = gcc $(ARCHOPTS) -g -CCSLOW = gcc -O0 -g - -# ---------------------------------------------------------------------------- - -OBJECTS = hardinfo.o shell.o util.o iconcache.o loadgraph.o \ - menu.o stock.o callbacks.o expr.o report.o binreloc.o \ - vendor.o socket.o syncmanager.o -BENCHMARK_OBJECTS = fbench.o sha1.o blowfish.o md5.o nqueens.o fftbench.o - -MODULES = computer.so devices.so benchmark.so network.so - -all: $(OBJECTS) $(MODULES) - $(CC) $(CCFLAGS) -o hardinfo -Wl,-export-dynamic $(OBJECTS) $(GTK_LIBS) \ - $(SOUP_LIBS) - -md5.o: - $(CCSLOW) $(CCFLAGS) $(CFLAGS) -c md5.c -o $@ - -blowfish.o: - $(CCSLOW) $(CCFLAGS) $(CFLAGS) -c blowfish.c -o $@ - -sha1.o: - $(CCSLOW) $(CCFLAGS) $(CFLAGS) -c sha1.c -o $@ - -fbench.o: - $(CCSLOW) $(CCFLAGS) $(CFLAGS) -c fbench.c -o $@ - -fftbench.o: - $(CCSLOW) $(CCFLAGS) $(CFLAGS) -c fftbench.c -o $@ - -nqueens.o: - $(CCSLOW) $(CCFLAGS) $(CFLAGS) -c nqueens.c -o $@ - -benchmark.so: benchmark.c - make $(BENCHMARK_OBJECTS) - $(CCSLOW) $(CCFLAGS) $(CFLAGS) -o $@ -shared $< $(BENCHMARK_OBJECTS) \ - $(GTK_FLAGS) $(GTK_LIBS) - ln -sf ../$@ modules - -%.so: %.c - $(CC) $(CCFLAGS) $(CFLAGS) -o $@ -shared $< $(GTK_FLAGS) $(GTK_LIBS) - ln -sf ../$@ modules - -clean: - rm -rf .xvpics pixmaps/.xvpics *.o *.so hardinfo modules/*.so report - find . -name \*~ -exec rm -v {} \; - find . -name x86 -type l -exec rm -v {} \; - -dist-clean: clean - rm -rf Makefile debian/hardinfo/ config.h arch/this - -package: dist-clean - @echo "Creating tar.gz..." - cd .. && tar czf $(PACKAGE).tar.gz $(PACKAGE)/* && cd $(PACKAGE) - @echo "Creating tar.bz2..." - cd .. && tar cjf $(PACKAGE).tar.bz2 $(PACKAGE)/* && cd $(PACKAGE) - -deb: dist-clean - @echo "Creating deb..." - dpkg-buildpackage -rfakeroot -k${USER} - -install: all - rm -rf ${DESTDIR}${LIBDIR}/hardinfo/modules ${DESTDIR}/usr/share/hardinfo/pixmaps - - mkdir -p ${DESTDIR}/usr/bin - mkdir -p ${DESTDIR}/usr/local - mkdir -p ${DESTDIR}/usr/share/applications - mkdir -p ${DESTDIR}${LIBDIR}/hardinfo/modules - mkdir -p ${DESTDIR}/usr/share/hardinfo/pixmaps - - cp hardinfo.desktop ${DESTDIR}/usr/share/applications - - cp hardinfo ${DESTDIR}/usr/bin/hardinfo - - cp -Lr modules/*.so ${DESTDIR}${LIBDIR}/hardinfo/modules - - cp -Lr pixmaps/* ${DESTDIR}/usr/share/hardinfo/pixmaps - - cp benchmark.conf ${DESTDIR}/usr/share/hardinfo - cp benchmark.data ${DESTDIR}/usr/share/hardinfo - - chmod 755 ${DESTDIR}/usr/bin/hardinfo - -installer: - makepackage - @@ -0,0 +1,71 @@ + + *** This project is not dead, but needs a maintainer *** + *** Please contact the author if you're interested *** + + +HardInfo is a system profiler and benchmark for Linux systems. It is able to +obtain information from both hardware and basic software, and organize them +in a simple to use GUI. + +Features include: +- Report generation (in either HTML or plain text) +- Benchmark result synchronization +- Ability to explore the information on remote computers + + +DEPENDENCIES +------------ + +Required: +- GTK+ 2.10 (or newer) +- GLib 2.10 (or newer) + +Optional (for synchronization/remote): +- Libsoup 2.24 (or newer) + +If having trouble building with libsoup, disable it with: + cmake -DHARDINFO_NOSYNC=1 + +BUILDING +-------- + +HardInfo previously used a hand-made Makefile and configure scripts, but it +is now using CMake. This makes the job of maintaining HardInfo simpler and +also produces better binaries. + +To build, it is recommended to create a build directory and build from +there: + + hardinfo $ mkdir build + hardinfo $ cd build + build $ cmake .. + build $ make + +There are some variables that can be changed: + + CMAKE_BUILD_TYPE Can be either Release or Debug + [Default: Release] Debug builds prints messages to console + and are not recommended for general use + CMAKE_INSTALL_PREFIX Sets the installation prefix. + [Default: /usr/local] + +To set a variable, pass use cmake's -D command-line parameter. For example: + + build $ cmake .. -DCMAKE_BUILD_TYPE=Debug + +SETTING UP +---------- + +Most things in HardInfo are detected automatically. However, some things +depends on manual set up. They are: + +Sensors +------- + +lm-sensors: If your computer is compatible with lm-sensors module, use the +"sensors-detect" program included with the lm-sensors package, and be sure +to have the detected kernel modules loaded. + +hddtemp: To obtain the hard disk drive temperature, be sure to run hddtemp +in daemon mode, using the default port. + @@ -7,7 +7,6 @@ - Benchmark * New benchmarks - o Video o FPU+CPU o Disk o Phoronix? @@ -25,12 +24,9 @@ - i18n, build system * GNU gettext - * Better build system (no more symlink mess) - Misc - * Remove (R), (TM), etc from processor strings as per - Wikipedia's Manual of Style [1] * Round benchmark results to two decimal places at most, or get rid of decimal places altogether. * Add preferences window @@ -45,6 +41,3 @@ * Auto-detect; * Use GNOME settings; * Manual configuration. - -[1] http://en.wikipedia.org/wiki/Wikipedia:Manual_of_Style_(trademarks)#General_rules - diff --git a/arch/common/blowfish.h b/arch/common/blowfish.h deleted file mode 100644 index 5fea2e22..00000000 --- a/arch/common/blowfish.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * HardInfo - Displays System Information - * Copyright (C) 2003-2007 Leandro A. F. Pereira <leandro@hardinfo.org> - * - * 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> - -static gpointer -parallel_blowfish(unsigned int start, unsigned int end, void *data, GTimer *timer) -{ - BLOWFISH_CTX ctx; - unsigned int i; - unsigned long L, R; - - L = 0xBEBACAFE; - R = 0xDEADBEEF; - - for (i = start; i <= end; i++) { - Blowfish_Init(&ctx, (unsigned char*)data, 65536); - Blowfish_Encrypt(&ctx, &L, &R); - Blowfish_Decrypt(&ctx, &L, &R); - } - - return NULL; -} - -static void -benchmark_fish(void) -{ - gdouble elapsed = 0; - gchar *tmpsrc; - - gchar *bdata_path; - - 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; - } - - shell_view_set_enabled(FALSE); - shell_status_update("Performing Blowfish benchmark..."); - - elapsed = benchmark_parallel_for(0, 50000, parallel_blowfish, tmpsrc); - - g_free(bdata_path); - g_free(tmpsrc); - - bench_results[BENCHMARK_BLOWFISH] = elapsed; -} diff --git a/arch/common/users.h b/arch/common/users.h deleted file mode 100644 index 2361a4bf..00000000 --- a/arch/common/users.h +++ /dev/null @@ -1,50 +0,0 @@ -static gchar *users = NULL; - -static gboolean -remove_users(gpointer key, gpointer value, gpointer data) -{ - return g_str_has_prefix(key, "USER"); -} - -static void -scan_users_do(void) -{ - FILE *passwd; - char buffer[512]; - - passwd = fopen("/etc/passwd", "r"); - if (!passwd) - return; - - if (users) { - g_free(users); - - g_hash_table_foreach_remove(moreinfo, remove_users, NULL); - } - - 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], ','); - users = h_strdup_cprintf("$%s$%s=%s\n", users, key, tmp[0], tmp[4]); - - g_strfreev(tmp); - } - - fclose(passwd); -} diff --git a/arch/linux/alpha/alsa.h b/arch/linux/alpha/alsa.h deleted file mode 120000 index ede8a364..00000000 --- a/arch/linux/alpha/alsa.h +++ /dev/null @@ -1 +0,0 @@ -../../../arch/linux/common/alsa.h
\ No newline at end of file diff --git a/arch/linux/alpha/battery.h b/arch/linux/alpha/battery.h deleted file mode 120000 index ed7360e1..00000000 --- a/arch/linux/alpha/battery.h +++ /dev/null @@ -1 +0,0 @@ -../../../arch/linux/common/battery.h
\ No newline at end of file diff --git a/arch/linux/alpha/boots.h b/arch/linux/alpha/boots.h deleted file mode 120000 index 97384500..00000000 --- a/arch/linux/alpha/boots.h +++ /dev/null @@ -1 +0,0 @@ -../../../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 deleted file mode 120000 index f8a833e7..00000000 --- a/arch/linux/alpha/devmemory.h +++ /dev/null @@ -1 +0,0 @@ -../../../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 deleted file mode 120000 index d884bcd0..00000000 --- a/arch/linux/alpha/filesystem.h +++ /dev/null @@ -1 +0,0 @@ -../../../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 deleted file mode 120000 index 0f594231..00000000 --- a/arch/linux/alpha/inputdevices.h +++ /dev/null @@ -1 +0,0 @@ -../../../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 deleted file mode 120000 index 1f64e107..00000000 --- a/arch/linux/alpha/loadavg.h +++ /dev/null @@ -1 +0,0 @@ -../../../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 deleted file mode 120000 index 64c6e0ed..00000000 --- a/arch/linux/alpha/memory.h +++ /dev/null @@ -1 +0,0 @@ -../../../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 deleted file mode 120000 index d21c9a20..00000000 --- a/arch/linux/alpha/modules.h +++ /dev/null @@ -1 +0,0 @@ -../../../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 deleted file mode 120000 index 488b5ae3..00000000 --- a/arch/linux/alpha/net.h +++ /dev/null @@ -1 +0,0 @@ -../../../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 deleted file mode 120000 index 73e0b8c9..00000000 --- a/arch/linux/alpha/nfs.h +++ /dev/null @@ -1 +0,0 @@ -../../../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 deleted file mode 120000 index 44051626..00000000 --- a/arch/linux/alpha/os.h +++ /dev/null @@ -1 +0,0 @@ -../../../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 deleted file mode 120000 index 8df04a0e..00000000 --- a/arch/linux/alpha/pci.h +++ /dev/null @@ -1 +0,0 @@ -../../../arch/linux/common/pci.h
\ No newline at end of file diff --git a/arch/linux/alpha/resources.h b/arch/linux/alpha/resources.h deleted file mode 120000 index 20a4815d..00000000 --- a/arch/linux/alpha/resources.h +++ /dev/null @@ -1 +0,0 @@ -../../../arch/linux/common/resources.h
\ No newline at end of file diff --git a/arch/linux/alpha/samba.h b/arch/linux/alpha/samba.h deleted file mode 120000 index ebab9b11..00000000 --- a/arch/linux/alpha/samba.h +++ /dev/null @@ -1 +0,0 @@ -../../../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 deleted file mode 120000 index 3b799377..00000000 --- a/arch/linux/alpha/sensors.h +++ /dev/null @@ -1 +0,0 @@ -../../../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 deleted file mode 120000 index 3ea886ce..00000000 --- a/arch/linux/alpha/storage.h +++ /dev/null @@ -1 +0,0 @@ -../../../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 deleted file mode 120000 index a5bac980..00000000 --- a/arch/linux/alpha/uptime.h +++ /dev/null @@ -1 +0,0 @@ -../../../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 deleted file mode 120000 index aee3046c..00000000 --- a/arch/linux/alpha/usb.h +++ /dev/null @@ -1 +0,0 @@ -../../../arch/linux/common/usb.h
\ No newline at end of file diff --git a/arch/linux/armv4l/alsa.h b/arch/linux/armv4l/alsa.h deleted file mode 120000 index 0216845a..00000000 --- a/arch/linux/armv4l/alsa.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/alsa.h
\ No newline at end of file diff --git a/arch/linux/armv4l/battery.h b/arch/linux/armv4l/battery.h deleted file mode 120000 index e4c794f2..00000000 --- a/arch/linux/armv4l/battery.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/battery.h
\ No newline at end of file diff --git a/arch/linux/armv4l/boots.h b/arch/linux/armv4l/boots.h deleted file mode 120000 index 97384500..00000000 --- a/arch/linux/armv4l/boots.h +++ /dev/null @@ -1 +0,0 @@ -../../../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 deleted file mode 120000 index f8a833e7..00000000 --- a/arch/linux/armv4l/devmemory.h +++ /dev/null @@ -1 +0,0 @@ -../../../arch/linux/common/devmemory.h
\ No newline at end of file diff --git a/arch/linux/armv4l/filesystem.h b/arch/linux/armv4l/filesystem.h deleted file mode 120000 index 6b325b40..00000000 --- a/arch/linux/armv4l/filesystem.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/filesystem.h
\ No newline at end of file diff --git a/arch/linux/armv4l/inputdevices.h b/arch/linux/armv4l/inputdevices.h deleted file mode 120000 index b9226a29..00000000 --- a/arch/linux/armv4l/inputdevices.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/inputdevices.h
\ No newline at end of file diff --git a/arch/linux/armv4l/loadavg.h b/arch/linux/armv4l/loadavg.h deleted file mode 120000 index daaed6d5..00000000 --- a/arch/linux/armv4l/loadavg.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/loadavg.h
\ No newline at end of file diff --git a/arch/linux/armv4l/memory.h b/arch/linux/armv4l/memory.h deleted file mode 120000 index 5ffc013e..00000000 --- a/arch/linux/armv4l/memory.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/memory.h
\ No newline at end of file diff --git a/arch/linux/armv4l/modules.h b/arch/linux/armv4l/modules.h deleted file mode 120000 index 8ce5a808..00000000 --- a/arch/linux/armv4l/modules.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/modules.h
\ No newline at end of file diff --git a/arch/linux/armv4l/net.h b/arch/linux/armv4l/net.h deleted file mode 120000 index 72d77b26..00000000 --- a/arch/linux/armv4l/net.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/net.h
\ No newline at end of file diff --git a/arch/linux/armv4l/nfs.h b/arch/linux/armv4l/nfs.h deleted file mode 120000 index 3d1048da..00000000 --- a/arch/linux/armv4l/nfs.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/nfs.h
\ No newline at end of file diff --git a/arch/linux/armv4l/os.h b/arch/linux/armv4l/os.h deleted file mode 120000 index ef547be5..00000000 --- a/arch/linux/armv4l/os.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/os.h
\ No newline at end of file diff --git a/arch/linux/armv4l/pci.h b/arch/linux/armv4l/pci.h deleted file mode 120000 index 63760048..00000000 --- a/arch/linux/armv4l/pci.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/pci.h
\ No newline at end of file diff --git a/arch/linux/armv4l/processor.h b/arch/linux/armv4l/processor.h deleted file mode 100644 index 82b6be04..00000000 --- a/arch/linux/armv4l/processor.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@hardinfo.org> - * - * 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 - */ - -struct _Processor { - gchar *model_name; - gchar *flags; - gfloat bogomips, cpu_mhz; - - gchar *has_fpu; -}; - - -static GSList * -__scan_processors(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); - } - - processor->cpu_mhz = 0.0f; - - fclose(cpuinfo); - - return g_slist_append(NULL, processor); -} - -static gchar * -processor_get_info(GSList *processors) -{ - Processor *processor = (Processor *)processors->data; - - 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/resources.h b/arch/linux/armv4l/resources.h deleted file mode 120000 index 20a4815d..00000000 --- a/arch/linux/armv4l/resources.h +++ /dev/null @@ -1 +0,0 @@ -../../../arch/linux/common/resources.h
\ No newline at end of file diff --git a/arch/linux/armv4l/samba.h b/arch/linux/armv4l/samba.h deleted file mode 120000 index 9227f722..00000000 --- a/arch/linux/armv4l/samba.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/samba.h
\ No newline at end of file diff --git a/arch/linux/armv4l/sensors.h b/arch/linux/armv4l/sensors.h deleted file mode 120000 index 35e5f37a..00000000 --- a/arch/linux/armv4l/sensors.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/sensors.h
\ No newline at end of file diff --git a/arch/linux/armv4l/storage.h b/arch/linux/armv4l/storage.h deleted file mode 120000 index 55b68de3..00000000 --- a/arch/linux/armv4l/storage.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/storage.h
\ No newline at end of file diff --git a/arch/linux/armv4l/uptime.h b/arch/linux/armv4l/uptime.h deleted file mode 120000 index 78c026ff..00000000 --- a/arch/linux/armv4l/uptime.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/uptime.h
\ No newline at end of file diff --git a/arch/linux/armv4l/usb.h b/arch/linux/armv4l/usb.h deleted file mode 120000 index 8b8fbb5d..00000000 --- a/arch/linux/armv4l/usb.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/usb.h
\ No newline at end of file diff --git a/arch/linux/common/nfs.h b/arch/linux/common/nfs.h deleted file mode 100644 index 5ae22797..00000000 --- a/arch/linux/common/nfs.h +++ /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/samba.h b/arch/linux/common/samba.h deleted file mode 100644 index 65cdc890..00000000 --- a/arch/linux/common/samba.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@hardinfo.org> - * - * 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 = -1; - 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) || length == 0) { - smb_shares_list = g_strdup("Cannot open /etc/samba/smb.conf=\n"); - if (error) - 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"); - if (error) - 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/storage.h b/arch/linux/common/storage.h deleted file mode 100644 index 06593a09..00000000 --- a/arch/linux/common/storage.h +++ /dev/null @@ -1,371 +0,0 @@ -/* - * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@hardinfo.org> - * - * 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 = NULL; - -static gboolean -remove_scsi_devices(gpointer key, gpointer value, gpointer data) -{ - return g_str_has_prefix(key, "SCSI"); -} - -/* SCSI support by Pascal F.Martin <pascalmartin@earthlink.net> */ -void -__scan_scsi_devices(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; - gchar *scsi_storage_list; - - /* remove old devices from global device table */ - g_hash_table_foreach_remove(moreinfo, remove_scsi_devices, NULL); - - if (!g_file_test("/proc/scsi/scsi", G_FILE_TEST_EXISTS)) - return; - - scsi_storage_list = g_strdup("\n[SCSI Disks]\n"); - - 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)) { - buf[17] = '\0'; - buf[41] = '\0'; - buf[53] = '\0'; - - vendor = g_strdup(g_strstrip(buf + 8)); - model = g_strdup_printf("%s %s", vendor, g_strstrip(buf + 24)); - revision = g_strdup(g_strstrip(buf + 46)); - } else if (!strncmp(buf, "Type: ", 8)) { - char *p; - gchar *type = NULL, *icon = NULL; - - if (!(p = strstr(buf, "ANSI SCSI revision"))) { - p = strstr(buf, "ANSI SCSI revision"); - } - - 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", "cdrom"}, - { "CD-ROM", "CD-ROM", "cdrom"}, - { "Scanner", "Scanner", "scanner"}, - { "Flash Disk", "USB Flash Disk", "usbfldisk" }, - { NULL, "Generic", "scsi"} - }; - int i; - - if (strstr(model, "Flash Disk")) { - type = "Flash Disk"; - icon = "usbfldisk"; - } else { - for (i = 0; type2icon[i].type != NULL; i++) - if (g_str_equal(buf + 8, type2icon[i].type)) - break; - - type = type2icon[i].label; - icon = type2icon[i].icon; - } - } - - gchar *devid = g_strdup_printf("SCSI%d", n); - scsi_storage_list = h_strdup_cprintf("$%s$%s=\n", scsi_storage_list, devid, model); - storage_icons = h_strdup_cprintf("Icon$%s$%s=%s.png\n", storage_icons, devid, model, icon); - - gchar *strhash = g_strdup_printf("[Device Information]\n" - "Model=%s\n", model); - - const gchar *url = vendor_get_url(model); - if (url) { - strhash = h_strdup_cprintf("Vendor=%s (%s)\n", - strhash, - vendor_get_name(model), - url); - } else { - strhash = h_strdup_cprintf("Vendor=%s\n", - strhash, - vendor_get_name(model)); - } - - strhash = h_strdup_cprintf("Type=%s\n" - "Revision=%s\n" - "[SCSI Controller]\n" - "Controller=scsi%d\n" - "Channel=%d\n" - "ID=%d\n" "LUN=%d\n", - strhash, - type, - revision, - scsi_controller, - scsi_channel, - scsi_id, - scsi_lun); - g_hash_table_insert(moreinfo, devid, strhash); - - g_free(model); - g_free(revision); - g_free(vendor); - } - } - fclose(proc_scsi); - - if (n) { - storage_list = h_strconcat(storage_list, scsi_storage_list, NULL); - g_free(scsi_storage_list); - } -} - -static gboolean -remove_ide_devices(gpointer key, gpointer value, gpointer data) -{ - return g_str_has_prefix(key, "IDE"); -} - -void -__scan_ide_devices(void) -{ - FILE *proc_ide; - gchar *device, iface, *model, *media, *pgeometry = NULL, *lgeometry = - NULL; - gint n = 0, i = 0, cache, nn = 0; - gchar *capab = NULL, *speed = NULL, *driver = NULL, *ide_storage_list; - - /* remove old devices from global device table */ - g_hash_table_foreach_remove(moreinfo, remove_ide_devices, NULL); - - ide_storage_list = g_strdup("\n[IDE Disks]\n"); - - 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[128]; - - cache = 0; - - proc_ide = fopen(device, "r"); - (void)fgets(buf, 128, 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"); - (void)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 = h_strdup_cprintf("\nCan %s#%d=%s\n", - capab, - ttmp[1], ++nn, ttmp[2]); - - g_strfreev(ttmp); - } else if (strstr(buf, "Buffer-Underrun-Free")) { - capab = h_strdup_cprintf("\nSupports BurnProof=%s\n", - capab, - strstr(buf, "Does not") ? "No" : "Yes"); - } else if (strstr(buf, "multi-session")) { - capab = h_strdup_cprintf("\nCan read multi-session CDs=%s\n", - capab, - strstr(buf, "Does not") ? "No" : "Yes"); - } else if (strstr(buf, "audio CDs")) { - capab = h_strdup_cprintf("\nCan play audio CDs=%s\n", - capab, - strstr(buf, "Does not") ? "No" : "Yes"); - } else if (strstr(buf, "PREVENT/ALLOW")) { - capab = h_strdup_cprintf("\nCan lock media=%s\n", - 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); - - device = g_strdup_printf("/proc/ide/hd%c/cache", iface); - if (g_file_test(device, G_FILE_TEST_EXISTS)) { - proc_ide = fopen(device, "r"); - (void)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"); - - (void)fgets(buf, 64, proc_ide); - for (tmp = buf; *tmp; tmp++) { - if (*tmp >= '0' && *tmp <= '9') - break; - } - - pgeometry = g_strdup(g_strstrip(tmp)); - - (void)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); - - ide_storage_list = h_strdup_cprintf("$%s$%s=\n", ide_storage_list, - devid, model); - storage_icons = h_strdup_cprintf("Icon$%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", - model); - - const gchar *url = vendor_get_url(model); - - if (url) { - strhash = h_strdup_cprintf("Vendor=%s (%s)\n", - strhash, - vendor_get_name(model), - url); - } else { - strhash = h_strdup_cprintf("Vendor=%s\n", - strhash, - vendor_get_name(model)); - } - - strhash = h_strdup_cprintf("Device Name=hd%c\n" - "Media=%s\n" - "Cache=%dkb\n", - strhash, - iface, - media, - cache); - if (driver) { - strhash = h_strdup_cprintf("%s\n", strhash, driver); - - g_free(driver); - driver = NULL; - } - - if (pgeometry && lgeometry) { - strhash = h_strdup_cprintf("[Geometry]\n" - "Physical=%s\n" - "Logical=%s\n", - strhash, pgeometry, lgeometry); - - g_free(pgeometry); - pgeometry = NULL; - g_free(lgeometry); - lgeometry = NULL; - } - - if (capab) { - strhash = h_strdup_cprintf("[Capabilities]\n%s", strhash, capab); - - g_free(capab); - capab = NULL; - } - - if (speed) { - strhash = h_strdup_cprintf("[Speeds]\n%s", strhash, speed); - - g_free(speed); - speed = NULL; - } - - g_hash_table_insert(moreinfo, devid, strhash); - - g_free(model); - model = g_strdup(""); - } else - g_free(device); - - iface++; - } - - if (n) { - storage_list = h_strconcat(storage_list, ide_storage_list, NULL); - g_free(ide_storage_list); - } -} diff --git a/arch/linux/common/usb.h b/arch/linux/common/usb.h deleted file mode 100644 index cb939ff8..00000000 --- a/arch/linux/common/usb.h +++ /dev/null @@ -1,248 +0,0 @@ -/* - * HardInfo - Displays System Information - * Copyright (C) 2003-2008 Leandro A. F. Pereira <leandro@hardinfo.org> - * - * 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 - */ -/* - * FIXME: - * - listing with sysfs does not generate device hierarchy - */ -static gboolean -remove_usb_devices(gpointer key, gpointer value, gpointer data) -{ - return g_str_has_prefix(key, "USB"); -} - -static gchar *usb_list = NULL; - -void __scan_usb_sysfs_add_device(gchar * endpoint, int n) -{ - gchar *manufacturer, *product, *mxpwr, *tmp, *strhash; - gint bus, classid, vendor, prodid; - gfloat version, speed; - - classid = h_sysfs_read_int(endpoint, "bDeviceClass"); - vendor = h_sysfs_read_int(endpoint, "idVendor"); - prodid = h_sysfs_read_int(endpoint, "idProduct"); - bus = h_sysfs_read_int(endpoint, "busnum"); - speed = h_sysfs_read_float(endpoint, "speed"); - version = h_sysfs_read_float(endpoint, "version"); - - if (!(mxpwr = h_sysfs_read_string(endpoint, "bMaxPower"))) { - mxpwr = g_strdup("0 mA"); - } - - if (!(manufacturer = h_sysfs_read_string(endpoint, "manufacturer"))) { - manufacturer = g_strdup("Unknown"); - } - - if (!(product = h_sysfs_read_string(endpoint, "product"))) { - if (classid == 9) { - product = g_strdup_printf("USB %.2f Hub", version); - } else { - product = g_strdup_printf("Unknown USB %.2f Device (class %d)", version, classid); - } - } - - const gchar *url = vendor_get_url(manufacturer); - if (url) { - tmp = g_strdup_printf("%s (%s)", vendor_get_name(manufacturer), url); - - g_free(manufacturer); - manufacturer = tmp; - } - - tmp = g_strdup_printf("USB%d", n); - usb_list = h_strdup_cprintf("$%s$%s=\n", usb_list, tmp, product); - - strhash = g_strdup_printf("[Device Information]\n" - "Product=%s\n" - "Manufacturer=%s\n" - "Speed=%.2fMbit/s\n" - "Max Current=%s\n" - "[Misc]\n" - "USB Version=%.2f\n" - "Class=0x%x\n" - "Vendor=0x%x\n" - "Product ID=0x%x\n" - "Bus=%d\n", - product, - manufacturer, - speed, - mxpwr, - version, classid, vendor, prodid, bus); - - g_hash_table_insert(moreinfo, tmp, strhash); - - g_free(manufacturer); - g_free(product); - g_free(mxpwr); -} - -void __scan_usb_sysfs(void) -{ - GDir *sysfs; - gchar *filename; - const gchar *sysfs_path = "/sys/class/usb_endpoint"; - gint usb_device_number = 0; - - if (!(sysfs = g_dir_open(sysfs_path, 0, NULL))) { - return; - } - - if (usb_list) { - g_hash_table_foreach_remove(moreinfo, remove_usb_devices, NULL); - g_free(usb_list); - } - usb_list = g_strdup("[USB Devices]\n"); - - while ((filename = (gchar *) g_dir_read_name(sysfs))) { - gchar *endpoint = - g_build_filename(sysfs_path, filename, "device", NULL); - gchar *temp; - - temp = g_build_filename(endpoint, "idVendor", NULL); - if (g_file_test(temp, G_FILE_TEST_EXISTS)) { - __scan_usb_sysfs_add_device(endpoint, ++usb_device_number); - } - - g_free(temp); - g_free(endpoint); - } - - g_dir_close(sysfs); -} - -int __scan_usb_procfs(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 0; - - if (usb_list) { - g_hash_table_foreach_remove(moreinfo, remove_usb_devices, NULL); - g_free(usb_list); - } - usb_list = g_strdup("[USB Devices]\n"); - - 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 = h_strdup_cprintf("[%s#%d]\n", - usb_list, product, n); - } else { /* everything else */ - usb_list = h_strdup_cprintf("$%s$%s=\n", - usb_list, tmp, product); - - const gchar *url = vendor_get_url(manuf); - if (url) { - gchar *tmp = - g_strdup_printf("%s (%s)", vendor_get_name(manuf), - url); - g_free(manuf); - manuf = tmp; - } - - gchar *strhash = g_strdup_printf("[Device Information]\n" - "Product=%s\n", - product); - if (manuf && strlen(manuf)) - strhash = h_strdup_cprintf("Manufacturer=%s\n", - strhash, manuf); - - strhash = h_strdup_cprintf("[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", - strhash, - port, speed, mxpwr, - ver, rev, classid, - vendor, prodid, bus, level); - - g_hash_table_insert(moreinfo, tmp, strhash); - } - - g_free(manuf); - g_free(product); - manuf = g_strdup(""); - product = g_strdup(""); - } - } - - fclose(dev); - - return n; -} - -void __scan_usb(void) -{ - if (!__scan_usb_procfs()) - __scan_usb_sysfs(); -} diff --git a/arch/linux/ia64/alsa.h b/arch/linux/ia64/alsa.h deleted file mode 120000 index ede8a364..00000000 --- a/arch/linux/ia64/alsa.h +++ /dev/null @@ -1 +0,0 @@ -../../../arch/linux/common/alsa.h
\ No newline at end of file diff --git a/arch/linux/ia64/battery.h b/arch/linux/ia64/battery.h deleted file mode 120000 index ed7360e1..00000000 --- a/arch/linux/ia64/battery.h +++ /dev/null @@ -1 +0,0 @@ -../../../arch/linux/common/battery.h
\ No newline at end of file diff --git a/arch/linux/ia64/boots.h b/arch/linux/ia64/boots.h deleted file mode 120000 index 97384500..00000000 --- a/arch/linux/ia64/boots.h +++ /dev/null @@ -1 +0,0 @@ -../../../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 deleted file mode 120000 index f8a833e7..00000000 --- a/arch/linux/ia64/devmemory.h +++ /dev/null @@ -1 +0,0 @@ -../../../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 deleted file mode 120000 index d884bcd0..00000000 --- a/arch/linux/ia64/filesystem.h +++ /dev/null @@ -1 +0,0 @@ -../../../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 deleted file mode 120000 index 0f594231..00000000 --- a/arch/linux/ia64/inputdevices.h +++ /dev/null @@ -1 +0,0 @@ -../../../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 deleted file mode 120000 index 1f64e107..00000000 --- a/arch/linux/ia64/loadavg.h +++ /dev/null @@ -1 +0,0 @@ -../../../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 deleted file mode 120000 index 64c6e0ed..00000000 --- a/arch/linux/ia64/memory.h +++ /dev/null @@ -1 +0,0 @@ -../../../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 deleted file mode 120000 index d21c9a20..00000000 --- a/arch/linux/ia64/modules.h +++ /dev/null @@ -1 +0,0 @@ -../../../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 deleted file mode 120000 index 488b5ae3..00000000 --- a/arch/linux/ia64/net.h +++ /dev/null @@ -1 +0,0 @@ -../../../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 deleted file mode 120000 index 73e0b8c9..00000000 --- a/arch/linux/ia64/nfs.h +++ /dev/null @@ -1 +0,0 @@ -../../../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 deleted file mode 120000 index 44051626..00000000 --- a/arch/linux/ia64/os.h +++ /dev/null @@ -1 +0,0 @@ -../../../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 deleted file mode 120000 index 8df04a0e..00000000 --- a/arch/linux/ia64/pci.h +++ /dev/null @@ -1 +0,0 @@ -../../../arch/linux/common/pci.h
\ No newline at end of file diff --git a/arch/linux/ia64/resources.h b/arch/linux/ia64/resources.h deleted file mode 120000 index 20a4815d..00000000 --- a/arch/linux/ia64/resources.h +++ /dev/null @@ -1 +0,0 @@ -../../../arch/linux/common/resources.h
\ No newline at end of file diff --git a/arch/linux/ia64/samba.h b/arch/linux/ia64/samba.h deleted file mode 120000 index ebab9b11..00000000 --- a/arch/linux/ia64/samba.h +++ /dev/null @@ -1 +0,0 @@ -../../../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 deleted file mode 120000 index 3b799377..00000000 --- a/arch/linux/ia64/sensors.h +++ /dev/null @@ -1 +0,0 @@ -../../../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 deleted file mode 120000 index 3ea886ce..00000000 --- a/arch/linux/ia64/storage.h +++ /dev/null @@ -1 +0,0 @@ -../../../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 deleted file mode 120000 index a5bac980..00000000 --- a/arch/linux/ia64/uptime.h +++ /dev/null @@ -1 +0,0 @@ -../../../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 deleted file mode 120000 index aee3046c..00000000 --- a/arch/linux/ia64/usb.h +++ /dev/null @@ -1 +0,0 @@ -../../../arch/linux/common/usb.h
\ No newline at end of file diff --git a/arch/linux/m68k/alsa.h b/arch/linux/m68k/alsa.h deleted file mode 120000 index 0216845a..00000000 --- a/arch/linux/m68k/alsa.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/alsa.h
\ No newline at end of file diff --git a/arch/linux/m68k/battery.h b/arch/linux/m68k/battery.h deleted file mode 120000 index e4c794f2..00000000 --- a/arch/linux/m68k/battery.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/battery.h
\ No newline at end of file diff --git a/arch/linux/m68k/boots.h b/arch/linux/m68k/boots.h deleted file mode 120000 index 97384500..00000000 --- a/arch/linux/m68k/boots.h +++ /dev/null @@ -1 +0,0 @@ -../../../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 deleted file mode 120000 index f8a833e7..00000000 --- a/arch/linux/m68k/devmemory.h +++ /dev/null @@ -1 +0,0 @@ -../../../arch/linux/common/devmemory.h
\ No newline at end of file diff --git a/arch/linux/m68k/filesystem.h b/arch/linux/m68k/filesystem.h deleted file mode 120000 index 6b325b40..00000000 --- a/arch/linux/m68k/filesystem.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/filesystem.h
\ No newline at end of file diff --git a/arch/linux/m68k/inputdevices.h b/arch/linux/m68k/inputdevices.h deleted file mode 120000 index b9226a29..00000000 --- a/arch/linux/m68k/inputdevices.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/inputdevices.h
\ No newline at end of file diff --git a/arch/linux/m68k/loadavg.h b/arch/linux/m68k/loadavg.h deleted file mode 120000 index daaed6d5..00000000 --- a/arch/linux/m68k/loadavg.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/loadavg.h
\ No newline at end of file diff --git a/arch/linux/m68k/memory.h b/arch/linux/m68k/memory.h deleted file mode 120000 index 5ffc013e..00000000 --- a/arch/linux/m68k/memory.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/memory.h
\ No newline at end of file diff --git a/arch/linux/m68k/modules.h b/arch/linux/m68k/modules.h deleted file mode 120000 index 8ce5a808..00000000 --- a/arch/linux/m68k/modules.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/modules.h
\ No newline at end of file diff --git a/arch/linux/m68k/net.h b/arch/linux/m68k/net.h deleted file mode 120000 index 72d77b26..00000000 --- a/arch/linux/m68k/net.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/net.h
\ No newline at end of file diff --git a/arch/linux/m68k/nfs.h b/arch/linux/m68k/nfs.h deleted file mode 120000 index 3d1048da..00000000 --- a/arch/linux/m68k/nfs.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/nfs.h
\ No newline at end of file diff --git a/arch/linux/m68k/os.h b/arch/linux/m68k/os.h deleted file mode 120000 index ef547be5..00000000 --- a/arch/linux/m68k/os.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/os.h
\ No newline at end of file diff --git a/arch/linux/m68k/pci.h b/arch/linux/m68k/pci.h deleted file mode 120000 index 63760048..00000000 --- a/arch/linux/m68k/pci.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/pci.h
\ No newline at end of file diff --git a/arch/linux/m68k/resources.h b/arch/linux/m68k/resources.h deleted file mode 120000 index 20a4815d..00000000 --- a/arch/linux/m68k/resources.h +++ /dev/null @@ -1 +0,0 @@ -../../../arch/linux/common/resources.h
\ No newline at end of file diff --git a/arch/linux/m68k/samba.h b/arch/linux/m68k/samba.h deleted file mode 120000 index 9227f722..00000000 --- a/arch/linux/m68k/samba.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/samba.h
\ No newline at end of file diff --git a/arch/linux/m68k/sensors.h b/arch/linux/m68k/sensors.h deleted file mode 120000 index 35e5f37a..00000000 --- a/arch/linux/m68k/sensors.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/sensors.h
\ No newline at end of file diff --git a/arch/linux/m68k/storage.h b/arch/linux/m68k/storage.h deleted file mode 120000 index 55b68de3..00000000 --- a/arch/linux/m68k/storage.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/storage.h
\ No newline at end of file diff --git a/arch/linux/m68k/uptime.h b/arch/linux/m68k/uptime.h deleted file mode 120000 index 78c026ff..00000000 --- a/arch/linux/m68k/uptime.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/uptime.h
\ No newline at end of file diff --git a/arch/linux/m68k/usb.h b/arch/linux/m68k/usb.h deleted file mode 120000 index 8b8fbb5d..00000000 --- a/arch/linux/m68k/usb.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/usb.h
\ No newline at end of file diff --git a/arch/linux/mips/alsa.h b/arch/linux/mips/alsa.h deleted file mode 120000 index 0216845a..00000000 --- a/arch/linux/mips/alsa.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/alsa.h
\ No newline at end of file diff --git a/arch/linux/mips/battery.h b/arch/linux/mips/battery.h deleted file mode 120000 index e4c794f2..00000000 --- a/arch/linux/mips/battery.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/battery.h
\ No newline at end of file diff --git a/arch/linux/mips/boots.h b/arch/linux/mips/boots.h deleted file mode 120000 index 97384500..00000000 --- a/arch/linux/mips/boots.h +++ /dev/null @@ -1 +0,0 @@ -../../../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 deleted file mode 120000 index f8a833e7..00000000 --- a/arch/linux/mips/devmemory.h +++ /dev/null @@ -1 +0,0 @@ -../../../arch/linux/common/devmemory.h
\ No newline at end of file diff --git a/arch/linux/mips/filesystem.h b/arch/linux/mips/filesystem.h deleted file mode 120000 index 6b325b40..00000000 --- a/arch/linux/mips/filesystem.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/filesystem.h
\ No newline at end of file diff --git a/arch/linux/mips/inputdevices.h b/arch/linux/mips/inputdevices.h deleted file mode 120000 index b9226a29..00000000 --- a/arch/linux/mips/inputdevices.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/inputdevices.h
\ No newline at end of file diff --git a/arch/linux/mips/loadavg.h b/arch/linux/mips/loadavg.h deleted file mode 120000 index daaed6d5..00000000 --- a/arch/linux/mips/loadavg.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/loadavg.h
\ No newline at end of file diff --git a/arch/linux/mips/memory.h b/arch/linux/mips/memory.h deleted file mode 120000 index 5ffc013e..00000000 --- a/arch/linux/mips/memory.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/memory.h
\ No newline at end of file diff --git a/arch/linux/mips/modules.h b/arch/linux/mips/modules.h deleted file mode 120000 index 8ce5a808..00000000 --- a/arch/linux/mips/modules.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/modules.h
\ No newline at end of file diff --git a/arch/linux/mips/net.h b/arch/linux/mips/net.h deleted file mode 120000 index 72d77b26..00000000 --- a/arch/linux/mips/net.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/net.h
\ No newline at end of file diff --git a/arch/linux/mips/nfs.h b/arch/linux/mips/nfs.h deleted file mode 120000 index 3d1048da..00000000 --- a/arch/linux/mips/nfs.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/nfs.h
\ No newline at end of file diff --git a/arch/linux/mips/os.h b/arch/linux/mips/os.h deleted file mode 120000 index ef547be5..00000000 --- a/arch/linux/mips/os.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/os.h
\ No newline at end of file diff --git a/arch/linux/mips/pci.h b/arch/linux/mips/pci.h deleted file mode 120000 index 63760048..00000000 --- a/arch/linux/mips/pci.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/pci.h
\ No newline at end of file diff --git a/arch/linux/mips/resources.h b/arch/linux/mips/resources.h deleted file mode 120000 index 20a4815d..00000000 --- a/arch/linux/mips/resources.h +++ /dev/null @@ -1 +0,0 @@ -../../../arch/linux/common/resources.h
\ No newline at end of file diff --git a/arch/linux/mips/samba.h b/arch/linux/mips/samba.h deleted file mode 120000 index 9227f722..00000000 --- a/arch/linux/mips/samba.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/samba.h
\ No newline at end of file diff --git a/arch/linux/mips/sensors.h b/arch/linux/mips/sensors.h deleted file mode 120000 index 35e5f37a..00000000 --- a/arch/linux/mips/sensors.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/sensors.h
\ No newline at end of file diff --git a/arch/linux/mips/storage.h b/arch/linux/mips/storage.h deleted file mode 120000 index 55b68de3..00000000 --- a/arch/linux/mips/storage.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/storage.h
\ No newline at end of file diff --git a/arch/linux/mips/uptime.h b/arch/linux/mips/uptime.h deleted file mode 120000 index 78c026ff..00000000 --- a/arch/linux/mips/uptime.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/uptime.h
\ No newline at end of file diff --git a/arch/linux/mips/usb.h b/arch/linux/mips/usb.h deleted file mode 120000 index 8b8fbb5d..00000000 --- a/arch/linux/mips/usb.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/usb.h
\ No newline at end of file diff --git a/arch/linux/parisc/alsa.h b/arch/linux/parisc/alsa.h deleted file mode 120000 index 0216845a..00000000 --- a/arch/linux/parisc/alsa.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/alsa.h
\ No newline at end of file diff --git a/arch/linux/parisc/battery.h b/arch/linux/parisc/battery.h deleted file mode 120000 index e4c794f2..00000000 --- a/arch/linux/parisc/battery.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/battery.h
\ No newline at end of file diff --git a/arch/linux/parisc/boots.h b/arch/linux/parisc/boots.h deleted file mode 120000 index 97384500..00000000 --- a/arch/linux/parisc/boots.h +++ /dev/null @@ -1 +0,0 @@ -../../../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 deleted file mode 120000 index f8a833e7..00000000 --- a/arch/linux/parisc/devmemory.h +++ /dev/null @@ -1 +0,0 @@ -../../../arch/linux/common/devmemory.h
\ No newline at end of file diff --git a/arch/linux/parisc/filesystem.h b/arch/linux/parisc/filesystem.h deleted file mode 120000 index 6b325b40..00000000 --- a/arch/linux/parisc/filesystem.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/filesystem.h
\ No newline at end of file diff --git a/arch/linux/parisc/inputdevices.h b/arch/linux/parisc/inputdevices.h deleted file mode 120000 index b9226a29..00000000 --- a/arch/linux/parisc/inputdevices.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/inputdevices.h
\ No newline at end of file diff --git a/arch/linux/parisc/loadavg.h b/arch/linux/parisc/loadavg.h deleted file mode 120000 index daaed6d5..00000000 --- a/arch/linux/parisc/loadavg.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/loadavg.h
\ No newline at end of file diff --git a/arch/linux/parisc/memory.h b/arch/linux/parisc/memory.h deleted file mode 120000 index 5ffc013e..00000000 --- a/arch/linux/parisc/memory.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/memory.h
\ No newline at end of file diff --git a/arch/linux/parisc/modules.h b/arch/linux/parisc/modules.h deleted file mode 120000 index 8ce5a808..00000000 --- a/arch/linux/parisc/modules.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/modules.h
\ No newline at end of file diff --git a/arch/linux/parisc/net.h b/arch/linux/parisc/net.h deleted file mode 120000 index 72d77b26..00000000 --- a/arch/linux/parisc/net.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/net.h
\ No newline at end of file diff --git a/arch/linux/parisc/nfs.h b/arch/linux/parisc/nfs.h deleted file mode 120000 index 3d1048da..00000000 --- a/arch/linux/parisc/nfs.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/nfs.h
\ No newline at end of file diff --git a/arch/linux/parisc/os.h b/arch/linux/parisc/os.h deleted file mode 120000 index ef547be5..00000000 --- a/arch/linux/parisc/os.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/os.h
\ No newline at end of file diff --git a/arch/linux/parisc/pci.h b/arch/linux/parisc/pci.h deleted file mode 120000 index 63760048..00000000 --- a/arch/linux/parisc/pci.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/pci.h
\ No newline at end of file diff --git a/arch/linux/parisc/resources.h b/arch/linux/parisc/resources.h deleted file mode 120000 index 20a4815d..00000000 --- a/arch/linux/parisc/resources.h +++ /dev/null @@ -1 +0,0 @@ -../../../arch/linux/common/resources.h
\ No newline at end of file diff --git a/arch/linux/parisc/samba.h b/arch/linux/parisc/samba.h deleted file mode 120000 index 9227f722..00000000 --- a/arch/linux/parisc/samba.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/samba.h
\ No newline at end of file diff --git a/arch/linux/parisc/sensors.h b/arch/linux/parisc/sensors.h deleted file mode 120000 index 35e5f37a..00000000 --- a/arch/linux/parisc/sensors.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/sensors.h
\ No newline at end of file diff --git a/arch/linux/parisc/storage.h b/arch/linux/parisc/storage.h deleted file mode 120000 index 55b68de3..00000000 --- a/arch/linux/parisc/storage.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/storage.h
\ No newline at end of file diff --git a/arch/linux/parisc/uptime.h b/arch/linux/parisc/uptime.h deleted file mode 120000 index 78c026ff..00000000 --- a/arch/linux/parisc/uptime.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/uptime.h
\ No newline at end of file diff --git a/arch/linux/parisc/usb.h b/arch/linux/parisc/usb.h deleted file mode 120000 index 8b8fbb5d..00000000 --- a/arch/linux/parisc/usb.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/usb.h
\ No newline at end of file diff --git a/arch/linux/ppc/alsa.h b/arch/linux/ppc/alsa.h deleted file mode 120000 index 0216845a..00000000 --- a/arch/linux/ppc/alsa.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/alsa.h
\ No newline at end of file diff --git a/arch/linux/ppc/battery.h b/arch/linux/ppc/battery.h deleted file mode 120000 index e4c794f2..00000000 --- a/arch/linux/ppc/battery.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/battery.h
\ No newline at end of file diff --git a/arch/linux/ppc/boots.h b/arch/linux/ppc/boots.h deleted file mode 120000 index 97384500..00000000 --- a/arch/linux/ppc/boots.h +++ /dev/null @@ -1 +0,0 @@ -../../../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 deleted file mode 120000 index f8a833e7..00000000 --- a/arch/linux/ppc/devmemory.h +++ /dev/null @@ -1 +0,0 @@ -../../../arch/linux/common/devmemory.h
\ No newline at end of file diff --git a/arch/linux/ppc/filesystem.h b/arch/linux/ppc/filesystem.h deleted file mode 120000 index 6b325b40..00000000 --- a/arch/linux/ppc/filesystem.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/filesystem.h
\ No newline at end of file diff --git a/arch/linux/ppc/inputdevices.h b/arch/linux/ppc/inputdevices.h deleted file mode 120000 index b9226a29..00000000 --- a/arch/linux/ppc/inputdevices.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/inputdevices.h
\ No newline at end of file diff --git a/arch/linux/ppc/loadavg.h b/arch/linux/ppc/loadavg.h deleted file mode 120000 index daaed6d5..00000000 --- a/arch/linux/ppc/loadavg.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/loadavg.h
\ No newline at end of file diff --git a/arch/linux/ppc/memory.h b/arch/linux/ppc/memory.h deleted file mode 120000 index 5ffc013e..00000000 --- a/arch/linux/ppc/memory.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/memory.h
\ No newline at end of file diff --git a/arch/linux/ppc/modules.h b/arch/linux/ppc/modules.h deleted file mode 120000 index 8ce5a808..00000000 --- a/arch/linux/ppc/modules.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/modules.h
\ No newline at end of file diff --git a/arch/linux/ppc/net.h b/arch/linux/ppc/net.h deleted file mode 120000 index 72d77b26..00000000 --- a/arch/linux/ppc/net.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/net.h
\ No newline at end of file diff --git a/arch/linux/ppc/nfs.h b/arch/linux/ppc/nfs.h deleted file mode 120000 index 3d1048da..00000000 --- a/arch/linux/ppc/nfs.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/nfs.h
\ No newline at end of file diff --git a/arch/linux/ppc/os.h b/arch/linux/ppc/os.h deleted file mode 120000 index ef547be5..00000000 --- a/arch/linux/ppc/os.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/os.h
\ No newline at end of file diff --git a/arch/linux/ppc/pci.h b/arch/linux/ppc/pci.h deleted file mode 120000 index 63760048..00000000 --- a/arch/linux/ppc/pci.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/pci.h
\ No newline at end of file diff --git a/arch/linux/ppc/resources.h b/arch/linux/ppc/resources.h deleted file mode 120000 index 20a4815d..00000000 --- a/arch/linux/ppc/resources.h +++ /dev/null @@ -1 +0,0 @@ -../../../arch/linux/common/resources.h
\ No newline at end of file diff --git a/arch/linux/ppc/samba.h b/arch/linux/ppc/samba.h deleted file mode 120000 index 9227f722..00000000 --- a/arch/linux/ppc/samba.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/samba.h
\ No newline at end of file diff --git a/arch/linux/ppc/sensors.h b/arch/linux/ppc/sensors.h deleted file mode 120000 index 35e5f37a..00000000 --- a/arch/linux/ppc/sensors.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/sensors.h
\ No newline at end of file diff --git a/arch/linux/ppc/storage.h b/arch/linux/ppc/storage.h deleted file mode 120000 index 55b68de3..00000000 --- a/arch/linux/ppc/storage.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/storage.h
\ No newline at end of file diff --git a/arch/linux/ppc/uptime.h b/arch/linux/ppc/uptime.h deleted file mode 120000 index 78c026ff..00000000 --- a/arch/linux/ppc/uptime.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/uptime.h
\ No newline at end of file diff --git a/arch/linux/ppc/usb.h b/arch/linux/ppc/usb.h deleted file mode 120000 index 8b8fbb5d..00000000 --- a/arch/linux/ppc/usb.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/usb.h
\ No newline at end of file diff --git a/arch/linux/s390/alsa.h b/arch/linux/s390/alsa.h deleted file mode 120000 index ede8a364..00000000 --- a/arch/linux/s390/alsa.h +++ /dev/null @@ -1 +0,0 @@ -../../../arch/linux/common/alsa.h
\ No newline at end of file diff --git a/arch/linux/s390/battery.h b/arch/linux/s390/battery.h deleted file mode 120000 index ed7360e1..00000000 --- a/arch/linux/s390/battery.h +++ /dev/null @@ -1 +0,0 @@ -../../../arch/linux/common/battery.h
\ No newline at end of file diff --git a/arch/linux/s390/boots.h b/arch/linux/s390/boots.h deleted file mode 120000 index 97384500..00000000 --- a/arch/linux/s390/boots.h +++ /dev/null @@ -1 +0,0 @@ -../../../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 deleted file mode 120000 index f8a833e7..00000000 --- a/arch/linux/s390/devmemory.h +++ /dev/null @@ -1 +0,0 @@ -../../../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 deleted file mode 120000 index d884bcd0..00000000 --- a/arch/linux/s390/filesystem.h +++ /dev/null @@ -1 +0,0 @@ -../../../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 deleted file mode 120000 index 0f594231..00000000 --- a/arch/linux/s390/inputdevices.h +++ /dev/null @@ -1 +0,0 @@ -../../../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 deleted file mode 120000 index 1f64e107..00000000 --- a/arch/linux/s390/loadavg.h +++ /dev/null @@ -1 +0,0 @@ -../../../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 deleted file mode 120000 index 64c6e0ed..00000000 --- a/arch/linux/s390/memory.h +++ /dev/null @@ -1 +0,0 @@ -../../../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 deleted file mode 120000 index d21c9a20..00000000 --- a/arch/linux/s390/modules.h +++ /dev/null @@ -1 +0,0 @@ -../../../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 deleted file mode 120000 index 488b5ae3..00000000 --- a/arch/linux/s390/net.h +++ /dev/null @@ -1 +0,0 @@ -../../../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 deleted file mode 120000 index 73e0b8c9..00000000 --- a/arch/linux/s390/nfs.h +++ /dev/null @@ -1 +0,0 @@ -../../../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 deleted file mode 120000 index 44051626..00000000 --- a/arch/linux/s390/os.h +++ /dev/null @@ -1 +0,0 @@ -../../../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 deleted file mode 120000 index 8df04a0e..00000000 --- a/arch/linux/s390/pci.h +++ /dev/null @@ -1 +0,0 @@ -../../../arch/linux/common/pci.h
\ No newline at end of file diff --git a/arch/linux/s390/resources.h b/arch/linux/s390/resources.h deleted file mode 120000 index 20a4815d..00000000 --- a/arch/linux/s390/resources.h +++ /dev/null @@ -1 +0,0 @@ -../../../arch/linux/common/resources.h
\ No newline at end of file diff --git a/arch/linux/s390/samba.h b/arch/linux/s390/samba.h deleted file mode 120000 index ebab9b11..00000000 --- a/arch/linux/s390/samba.h +++ /dev/null @@ -1 +0,0 @@ -../../../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 deleted file mode 120000 index 3b799377..00000000 --- a/arch/linux/s390/sensors.h +++ /dev/null @@ -1 +0,0 @@ -../../../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 deleted file mode 120000 index 3ea886ce..00000000 --- a/arch/linux/s390/storage.h +++ /dev/null @@ -1 +0,0 @@ -../../../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 deleted file mode 120000 index a5bac980..00000000 --- a/arch/linux/s390/uptime.h +++ /dev/null @@ -1 +0,0 @@ -../../../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 deleted file mode 120000 index aee3046c..00000000 --- a/arch/linux/s390/usb.h +++ /dev/null @@ -1 +0,0 @@ -../../../arch/linux/common/usb.h
\ No newline at end of file diff --git a/arch/linux/sh/alsa.h b/arch/linux/sh/alsa.h deleted file mode 120000 index 0216845a..00000000 --- a/arch/linux/sh/alsa.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/alsa.h
\ No newline at end of file diff --git a/arch/linux/sh/battery.h b/arch/linux/sh/battery.h deleted file mode 120000 index e4c794f2..00000000 --- a/arch/linux/sh/battery.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/battery.h
\ No newline at end of file diff --git a/arch/linux/sh/boots.h b/arch/linux/sh/boots.h deleted file mode 120000 index e7ef0408..00000000 --- a/arch/linux/sh/boots.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/boots.h
\ No newline at end of file diff --git a/arch/linux/sh/devmemory.h b/arch/linux/sh/devmemory.h deleted file mode 120000 index 5b1b866f..00000000 --- a/arch/linux/sh/devmemory.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/devmemory.h
\ No newline at end of file diff --git a/arch/linux/sh/filesystem.h b/arch/linux/sh/filesystem.h deleted file mode 120000 index 6b325b40..00000000 --- a/arch/linux/sh/filesystem.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/filesystem.h
\ No newline at end of file diff --git a/arch/linux/sh/inputdevices.h b/arch/linux/sh/inputdevices.h deleted file mode 120000 index b9226a29..00000000 --- a/arch/linux/sh/inputdevices.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/inputdevices.h
\ No newline at end of file diff --git a/arch/linux/sh/loadavg.h b/arch/linux/sh/loadavg.h deleted file mode 120000 index daaed6d5..00000000 --- a/arch/linux/sh/loadavg.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/loadavg.h
\ No newline at end of file diff --git a/arch/linux/sh/memory.h b/arch/linux/sh/memory.h deleted file mode 120000 index 5ffc013e..00000000 --- a/arch/linux/sh/memory.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/memory.h
\ No newline at end of file diff --git a/arch/linux/sh/modules.h b/arch/linux/sh/modules.h deleted file mode 120000 index 8ce5a808..00000000 --- a/arch/linux/sh/modules.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/modules.h
\ No newline at end of file diff --git a/arch/linux/sh/net.h b/arch/linux/sh/net.h deleted file mode 120000 index 72d77b26..00000000 --- a/arch/linux/sh/net.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/net.h
\ No newline at end of file diff --git a/arch/linux/sh/nfs.h b/arch/linux/sh/nfs.h deleted file mode 120000 index 3d1048da..00000000 --- a/arch/linux/sh/nfs.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/nfs.h
\ No newline at end of file diff --git a/arch/linux/sh/os.h b/arch/linux/sh/os.h deleted file mode 120000 index ef547be5..00000000 --- a/arch/linux/sh/os.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/os.h
\ No newline at end of file diff --git a/arch/linux/sh/pci.h b/arch/linux/sh/pci.h deleted file mode 120000 index 63760048..00000000 --- a/arch/linux/sh/pci.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/pci.h
\ No newline at end of file diff --git a/arch/linux/sh/resources.h b/arch/linux/sh/resources.h deleted file mode 120000 index 20a4815d..00000000 --- a/arch/linux/sh/resources.h +++ /dev/null @@ -1 +0,0 @@ -../../../arch/linux/common/resources.h
\ No newline at end of file diff --git a/arch/linux/sh/samba.h b/arch/linux/sh/samba.h deleted file mode 120000 index 9227f722..00000000 --- a/arch/linux/sh/samba.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/samba.h
\ No newline at end of file diff --git a/arch/linux/sh/sensors.h b/arch/linux/sh/sensors.h deleted file mode 120000 index 35e5f37a..00000000 --- a/arch/linux/sh/sensors.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/sensors.h
\ No newline at end of file diff --git a/arch/linux/sh/storage.h b/arch/linux/sh/storage.h deleted file mode 120000 index 55b68de3..00000000 --- a/arch/linux/sh/storage.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/storage.h
\ No newline at end of file diff --git a/arch/linux/sh/uptime.h b/arch/linux/sh/uptime.h deleted file mode 120000 index 78c026ff..00000000 --- a/arch/linux/sh/uptime.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/uptime.h
\ No newline at end of file diff --git a/arch/linux/sh/usb.h b/arch/linux/sh/usb.h deleted file mode 120000 index 8b8fbb5d..00000000 --- a/arch/linux/sh/usb.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/usb.h
\ No newline at end of file diff --git a/arch/linux/sparc/alsa.h b/arch/linux/sparc/alsa.h deleted file mode 120000 index 0216845a..00000000 --- a/arch/linux/sparc/alsa.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/alsa.h
\ No newline at end of file diff --git a/arch/linux/sparc/battery.h b/arch/linux/sparc/battery.h deleted file mode 120000 index e4c794f2..00000000 --- a/arch/linux/sparc/battery.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/battery.h
\ No newline at end of file diff --git a/arch/linux/sparc/boots.h b/arch/linux/sparc/boots.h deleted file mode 120000 index 97384500..00000000 --- a/arch/linux/sparc/boots.h +++ /dev/null @@ -1 +0,0 @@ -../../../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 deleted file mode 120000 index f8a833e7..00000000 --- a/arch/linux/sparc/devmemory.h +++ /dev/null @@ -1 +0,0 @@ -../../../arch/linux/common/devmemory.h
\ No newline at end of file diff --git a/arch/linux/sparc/filesystem.h b/arch/linux/sparc/filesystem.h deleted file mode 120000 index 6b325b40..00000000 --- a/arch/linux/sparc/filesystem.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/filesystem.h
\ No newline at end of file diff --git a/arch/linux/sparc/inputdevices.h b/arch/linux/sparc/inputdevices.h deleted file mode 120000 index b9226a29..00000000 --- a/arch/linux/sparc/inputdevices.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/inputdevices.h
\ No newline at end of file diff --git a/arch/linux/sparc/loadavg.h b/arch/linux/sparc/loadavg.h deleted file mode 120000 index daaed6d5..00000000 --- a/arch/linux/sparc/loadavg.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/loadavg.h
\ No newline at end of file diff --git a/arch/linux/sparc/memory.h b/arch/linux/sparc/memory.h deleted file mode 120000 index 5ffc013e..00000000 --- a/arch/linux/sparc/memory.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/memory.h
\ No newline at end of file diff --git a/arch/linux/sparc/modules.h b/arch/linux/sparc/modules.h deleted file mode 120000 index 8ce5a808..00000000 --- a/arch/linux/sparc/modules.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/modules.h
\ No newline at end of file diff --git a/arch/linux/sparc/net.h b/arch/linux/sparc/net.h deleted file mode 120000 index 72d77b26..00000000 --- a/arch/linux/sparc/net.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/net.h
\ No newline at end of file diff --git a/arch/linux/sparc/nfs.h b/arch/linux/sparc/nfs.h deleted file mode 120000 index 3d1048da..00000000 --- a/arch/linux/sparc/nfs.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/nfs.h
\ No newline at end of file diff --git a/arch/linux/sparc/os.h b/arch/linux/sparc/os.h deleted file mode 120000 index ef547be5..00000000 --- a/arch/linux/sparc/os.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/os.h
\ No newline at end of file diff --git a/arch/linux/sparc/pci.h b/arch/linux/sparc/pci.h deleted file mode 120000 index 63760048..00000000 --- a/arch/linux/sparc/pci.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/pci.h
\ No newline at end of file diff --git a/arch/linux/sparc/resources.h b/arch/linux/sparc/resources.h deleted file mode 120000 index 20a4815d..00000000 --- a/arch/linux/sparc/resources.h +++ /dev/null @@ -1 +0,0 @@ -../../../arch/linux/common/resources.h
\ No newline at end of file diff --git a/arch/linux/sparc/samba.h b/arch/linux/sparc/samba.h deleted file mode 120000 index 9227f722..00000000 --- a/arch/linux/sparc/samba.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/samba.h
\ No newline at end of file diff --git a/arch/linux/sparc/sensors.h b/arch/linux/sparc/sensors.h deleted file mode 120000 index 35e5f37a..00000000 --- a/arch/linux/sparc/sensors.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/sensors.h
\ No newline at end of file diff --git a/arch/linux/sparc/storage.h b/arch/linux/sparc/storage.h deleted file mode 120000 index 55b68de3..00000000 --- a/arch/linux/sparc/storage.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/storage.h
\ No newline at end of file diff --git a/arch/linux/sparc/uptime.h b/arch/linux/sparc/uptime.h deleted file mode 120000 index 78c026ff..00000000 --- a/arch/linux/sparc/uptime.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/uptime.h
\ No newline at end of file diff --git a/arch/linux/sparc/usb.h b/arch/linux/sparc/usb.h deleted file mode 120000 index 8b8fbb5d..00000000 --- a/arch/linux/sparc/usb.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/usb.h
\ No newline at end of file diff --git a/arch/linux/x86/alsa.h b/arch/linux/x86/alsa.h deleted file mode 120000 index 0216845a..00000000 --- a/arch/linux/x86/alsa.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/alsa.h
\ No newline at end of file diff --git a/arch/linux/x86/battery.h b/arch/linux/x86/battery.h deleted file mode 120000 index e4c794f2..00000000 --- a/arch/linux/x86/battery.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/battery.h
\ No newline at end of file diff --git a/arch/linux/x86/boots.h b/arch/linux/x86/boots.h deleted file mode 120000 index e7ef0408..00000000 --- a/arch/linux/x86/boots.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/boots.h
\ No newline at end of file diff --git a/arch/linux/x86/devmemory.h b/arch/linux/x86/devmemory.h deleted file mode 120000 index f8a833e7..00000000 --- a/arch/linux/x86/devmemory.h +++ /dev/null @@ -1 +0,0 @@ -../../../arch/linux/common/devmemory.h
\ No newline at end of file diff --git a/arch/linux/x86/dmi.h b/arch/linux/x86/dmi.h deleted file mode 120000 index 1a285fbd..00000000 --- a/arch/linux/x86/dmi.h +++ /dev/null @@ -1 +0,0 @@ -../../../arch/linux/common/dmi.h
\ No newline at end of file diff --git a/arch/linux/x86/filesystem.h b/arch/linux/x86/filesystem.h deleted file mode 120000 index 6b325b40..00000000 --- a/arch/linux/x86/filesystem.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/filesystem.h
\ No newline at end of file diff --git a/arch/linux/x86/inputdevices.h b/arch/linux/x86/inputdevices.h deleted file mode 120000 index b9226a29..00000000 --- a/arch/linux/x86/inputdevices.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/inputdevices.h
\ No newline at end of file diff --git a/arch/linux/x86/loadavg.h b/arch/linux/x86/loadavg.h deleted file mode 120000 index daaed6d5..00000000 --- a/arch/linux/x86/loadavg.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/loadavg.h
\ No newline at end of file diff --git a/arch/linux/x86/memory.h b/arch/linux/x86/memory.h deleted file mode 120000 index 5ffc013e..00000000 --- a/arch/linux/x86/memory.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/memory.h
\ No newline at end of file diff --git a/arch/linux/x86/modules.h b/arch/linux/x86/modules.h deleted file mode 120000 index 8ce5a808..00000000 --- a/arch/linux/x86/modules.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/modules.h
\ No newline at end of file diff --git a/arch/linux/x86/net.h b/arch/linux/x86/net.h deleted file mode 120000 index 72d77b26..00000000 --- a/arch/linux/x86/net.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/net.h
\ No newline at end of file diff --git a/arch/linux/x86/nfs.h b/arch/linux/x86/nfs.h deleted file mode 120000 index 3d1048da..00000000 --- a/arch/linux/x86/nfs.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/nfs.h
\ No newline at end of file diff --git a/arch/linux/x86/os.h b/arch/linux/x86/os.h deleted file mode 120000 index ef547be5..00000000 --- a/arch/linux/x86/os.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/os.h
\ No newline at end of file diff --git a/arch/linux/x86/pci.h b/arch/linux/x86/pci.h deleted file mode 120000 index 63760048..00000000 --- a/arch/linux/x86/pci.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/pci.h
\ No newline at end of file diff --git a/arch/linux/x86/resources.h b/arch/linux/x86/resources.h deleted file mode 120000 index 20a4815d..00000000 --- a/arch/linux/x86/resources.h +++ /dev/null @@ -1 +0,0 @@ -../../../arch/linux/common/resources.h
\ No newline at end of file diff --git a/arch/linux/x86/samba.h b/arch/linux/x86/samba.h deleted file mode 120000 index 9227f722..00000000 --- a/arch/linux/x86/samba.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/samba.h
\ No newline at end of file diff --git a/arch/linux/x86/sensors.h b/arch/linux/x86/sensors.h deleted file mode 120000 index 35e5f37a..00000000 --- a/arch/linux/x86/sensors.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/sensors.h
\ No newline at end of file diff --git a/arch/linux/x86/storage.h b/arch/linux/x86/storage.h deleted file mode 120000 index 55b68de3..00000000 --- a/arch/linux/x86/storage.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/storage.h
\ No newline at end of file diff --git a/arch/linux/x86/uptime.h b/arch/linux/x86/uptime.h deleted file mode 120000 index 78c026ff..00000000 --- a/arch/linux/x86/uptime.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/uptime.h
\ No newline at end of file diff --git a/arch/linux/x86/usb.h b/arch/linux/x86/usb.h deleted file mode 120000 index 8b8fbb5d..00000000 --- a/arch/linux/x86/usb.h +++ /dev/null @@ -1 +0,0 @@ -../../linux/common/usb.h
\ No newline at end of file diff --git a/arch/linux/x86_64 b/arch/linux/x86_64 deleted file mode 120000 index f4bad791..00000000 --- a/arch/linux/x86_64 +++ /dev/null @@ -1 +0,0 @@ -x86
\ No newline at end of file diff --git a/autopackage/default.apspec b/autopackage/default.apspec deleted file mode 100644 index a8598d01..00000000 --- a/autopackage/default.apspec +++ /dev/null @@ -1,58 +0,0 @@ -# -*- shell-script -*- -# Generated by mkapspec 0.2 -[Meta] -ShortName: hardinfo -SoftwareVersion: 0.5.1 -DisplayName: HardInfo -RootName: @hardinfo.org/hardinfo:$SOFTWAREVERSION -Summary: System profiler and benchmark tool -Maintainer: Leandro A. F. Pereira <leandro@hardinfo.org> -Packager: Leandro A. F. Pereira <leandro@hardinfo.org> -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" -export CC="apgcc" -prepareBuild - -[BuildUnprepare] -# If you're using prepareBuild above, there is no need to change this! -unprepareBuild - -[Globals] - -[Prepare] -require '@gtk.org/gtk' 2.6 -require '@gtk.org/glib' 2.6 -require '@gnome.org/libsoup' 8.0 - -[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 -copyFile lib/hardinfo/modules/network.so $PREFIX/lib/hardinfo/modules/network.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 deleted file mode 100644 index e31d6b34..00000000 --- a/benchmark.c +++ /dev/null @@ -1,421 +0,0 @@ -/* - * HardInfo - Displays System Information - * Copyright (C) 2003-2009 Leandro A. F. Pereira <leandro@hardinfo.org> - * - * 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 <hardinfo.h> -#include <iconcache.h> -#include <shell.h> -#include <config.h> -#include <syncmanager.h> - -#include <sys/time.h> -#include <sys/resource.h> - -enum { - BENCHMARK_BLOWFISH, - BENCHMARK_CRYPTOHASH, - BENCHMARK_FIB, - BENCHMARK_NQUEENS, - BENCHMARK_FFT, - BENCHMARK_RAYTRACE, - BENCHMARK_N_ENTRIES -} Entries; - -void scan_fft(gboolean reload); -void scan_raytr(gboolean reload); -void scan_bfsh(gboolean reload); -void scan_cryptohash(gboolean reload); -void scan_fib(gboolean reload); -void scan_nqueens(gboolean reload); - -gchar *callback_fft(); -gchar *callback_raytr(); -gchar *callback_bfsh(); -gchar *callback_fib(); -gchar *callback_cryptohash(); -gchar *callback_nqueens(); - -static ModuleEntry entries[] = { - {"CPU Blowfish", "blowfish.png", callback_bfsh, scan_bfsh}, - {"CPU CryptoHash", "cryptohash.png", callback_cryptohash, scan_cryptohash}, - {"CPU Fibonacci", "nautilus.png", callback_fib, scan_fib}, - {"CPU N-Queens", "nqueens.png", callback_nqueens, scan_nqueens}, - {"FPU FFT", "fft.png", callback_fft, scan_fft}, - {"FPU Raytracing", "raytrace.png", callback_raytr, scan_raytr}, - {NULL} -}; - -typedef struct _ParallelBenchTask ParallelBenchTask; - -struct _ParallelBenchTask { - guint start, end; - gpointer data, callback; -}; - -gpointer benchmark_parallel_for_dispatcher(gpointer data) -{ - ParallelBenchTask *pbt = (ParallelBenchTask *)data; - gpointer (*callback)(unsigned int start, unsigned int end, void *data); - gpointer return_value; - - if ((callback = pbt->callback)) { - DEBUG("this is thread %p; items %d -> %d, data %p", g_thread_self(), - pbt->start, pbt->end, pbt->data); - return_value = callback(pbt->start, pbt->end, pbt->data); - DEBUG("this is thread %p; return value is %p", g_thread_self(), return_value); - } else { - DEBUG("this is thread %p; callback is NULL and it should't be!", g_thread_self()); - } - - g_free(pbt); - - return return_value; -} - -gdouble benchmark_parallel_for(guint start, guint end, - gpointer callback, gpointer callback_data) { - gchar *temp; - guint n_cores, iter_per_core, iter; - gdouble elapsed_time; - GSList *threads = NULL, *t; - GTimer *timer; - - timer = g_timer_new(); - - temp = module_call_method("devices::getProcessorCount"); - n_cores = temp ? atoi(temp) : 1; - g_free(temp); - - while (1) { - iter_per_core = (end - start) / n_cores; - - if (iter_per_core == 0) { - DEBUG("not enough items per core; disabling one"); - n_cores--; - } else { - break; - } - } - - DEBUG("processor has %d cores; processing %d elements (%d per core)", - n_cores, (end - start), iter_per_core); - - g_timer_start(timer); - for (iter = start; iter < end; iter += iter_per_core) { - ParallelBenchTask *pbt = g_new0(ParallelBenchTask, 1); - GThread *thread; - - DEBUG("launching thread %d", 1 + (iter / iter_per_core)); - - pbt->start = iter == 0 ? 0 : iter + 1; - pbt->end = iter + iter_per_core - 1; - pbt->data = callback_data; - pbt->callback = callback; - - if (pbt->end > end) - pbt->end = end; - - thread = g_thread_create((GThreadFunc) benchmark_parallel_for_dispatcher, - pbt, TRUE, NULL); - threads = g_slist_append(threads, thread); - - DEBUG("thread %d launched as context %p", 1 + (iter / iter_per_core), threads->data); - } - - DEBUG("waiting for all threads to finish"); - for (t = threads; t; t = t->next) { - DEBUG("waiting for thread with context %p", t->data); - g_thread_join((GThread *)t->data); - } - - g_timer_stop(timer); - elapsed_time = g_timer_elapsed(timer, NULL); - - g_slist_free(threads); - g_timer_destroy(timer); - - DEBUG("finishing; all threads took %f seconds to finish", elapsed_time); - - return elapsed_time; -} - -static gchar *__benchmark_include_results(gdouble result, - const gchar * benchmark, - ShellOrderType order_type) -{ - GKeyFile *conf; - gchar **machines; - gchar *path, *results = g_strdup(""), *return_value, *processor_frequency; - int i; - - conf = g_key_file_new(); - - 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; - - 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); - - processor_frequency = module_call_method("devices::getProcessorFrequency"); - return_value = g_strdup_printf("[$ShellParam$]\n" - "Zebra=1\n" - "OrderType=%d\n" - "ViewType=3\n" - "ColumnTitle$Extra1=CPU Clock\n" - "ColumnTitle$Progress=Results\n" - "ColumnTitle$TextValue=CPU\n" - "ShowColumnHeaders=true\n" - "[%s]\n" - "<big><b>This Machine</b></big>=%.3f|%s MHz\n" - "%s", order_type, benchmark, result, processor_frequency, results); - g_free(processor_frequency); - return return_value; -} - - - -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/cryptohash.h> -#include <arch/common/blowfish.h> -#include <arch/common/raytrace.h> -#include <arch/common/nqueens.h> -#include <arch/common/fft.h> - -gchar *callback_fft() -{ - return benchmark_include_results(bench_results[BENCHMARK_FFT], - "FPU FFT"); -} - -gchar *callback_nqueens() -{ - return benchmark_include_results(bench_results[BENCHMARK_NQUEENS], - "CPU N-Queens"); -} - -gchar *callback_raytr() -{ - return benchmark_include_results(bench_results[BENCHMARK_RAYTRACE], - "FPU Raytracing"); -} - -gchar *callback_bfsh() -{ - return benchmark_include_results(bench_results[BENCHMARK_BLOWFISH], - "CPU Blowfish"); -} - -gchar *callback_cryptohash() -{ - return benchmark_include_results_reverse(bench_results[BENCHMARK_CRYPTOHASH], - "CPU CryptoHash"); -} - -gchar *callback_fib() -{ - return benchmark_include_results(bench_results[BENCHMARK_FIB], - "CPU Fibonacci"); -} - -#define RUN_WITH_HIGH_PRIORITY(fn) \ - do { \ - int old_priority = getpriority(PRIO_PROCESS, 0); \ - setpriority(PRIO_PROCESS, 0, -20); \ - fn(); \ - setpriority(PRIO_PROCESS, 0, old_priority); \ - } while (0); - -void scan_fft(gboolean reload) -{ - SCAN_START(); - RUN_WITH_HIGH_PRIORITY(benchmark_fft); - SCAN_END(); -} - -void scan_nqueens(gboolean reload) -{ - SCAN_START(); - RUN_WITH_HIGH_PRIORITY(benchmark_nqueens); - SCAN_END(); -} - -void scan_raytr(gboolean reload) -{ - SCAN_START(); - RUN_WITH_HIGH_PRIORITY(benchmark_raytrace); - SCAN_END(); -} - -void scan_bfsh(gboolean reload) -{ - SCAN_START(); - RUN_WITH_HIGH_PRIORITY(benchmark_fish); - SCAN_END(); -} - -void scan_cryptohash(gboolean reload) -{ - SCAN_START(); - RUN_WITH_HIGH_PRIORITY(benchmark_cryptohash); - SCAN_END(); -} - -void scan_fib(gboolean reload) -{ - SCAN_START(); - RUN_WITH_HIGH_PRIORITY(benchmark_fib); - SCAN_END(); -} - -const gchar *hi_note_func(gint entry) -{ - switch (entry) { - case BENCHMARK_CRYPTOHASH: - return "Results in MiB/second. Higher is better."; - - case BENCHMARK_FFT: - case BENCHMARK_RAYTRACE: - case BENCHMARK_BLOWFISH: - case BENCHMARK_FIB: - case BENCHMARK_NQUEENS: - return "Results in seconds. Lower is better."; - } - - return NULL; -} - -gchar *hi_module_get_name(void) -{ - return g_strdup("Benchmarks"); -} - -guchar hi_module_get_weight(void) -{ - return 240; -} - -ModuleEntry *hi_module_get_entries(void) -{ - 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 *machineclock = module_call_method("devices::getProcessorFrequency"); - gchar *machineram = module_call_method("devices::getMemoryTotal"); - gchar *result = g_strdup_printf("[param]\n" - "machine=%s\n" - "machineclock=%s\n" - "machineram=%s\n" - "nbenchmarks=%d\n", - machine, - machineclock, - machineram, i); - for (; i >= 0; i--) { - if ((scan_callback = entries[i].scan_callback)) { - scan_callback(FALSE); - - result = h_strdup_cprintf("[bench%d]\n" - "name=%s\n" - "value=%f\n", - result, - i, entries[i].name, bench_results[i]); - } - } - - g_free(machine); - g_free(machineclock); - g_free(machineram); - - 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]); -} - -gchar **hi_module_get_dependencies(void) -{ - static gchar *deps[] = { "devices.so", NULL }; - - return deps; -} diff --git a/benchmark.conf b/benchmark.conf index 3b7c6bcd..ef2162da 100644 --- a/benchmark.conf +++ b/benchmark.conf @@ -1,18 +1,311 @@ -[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 +[param] +last_update=1241368430 +[FPU FFT] +2x Intel(R) Pentium(R) DualCPUT3200@ 2.00GHz=5.500|2000 MHz|Unknown +Intel(R) Celeron(R) CPU 2.53GHz=10.122|2527 MHz|Unknown +Genuine Intel(R) CPU T1350@ 1.86GHz=83.465|1867 MHz|Unknown +2x AMD Turion(tm) 64 X2 Mobile Technology TL-60=8.225|2000 MHz|Unknown +2x AMD Turion(tm) X2 Dual-Core Mobile RM-70=8.312|500 MHz|Unknown +2x Intel(R) Core(TM) Duo CPUT2350@ 1.86GHz=5.356|1867 MHz|Unknown +2x Intel(R) Core(TM)2 Duo CPU T5750@ 2.00GHz=4.231|1994 MHz|Unknown +2x Intel(R) Core(TM)2 Duo CPU T9500@ 2.60GHz=3.124|2593 MHz|Unknown +2x AMD Athlon(tm) X2 Dual-Core QL-60=9.080|1900 MHz|Unknown +2x Intel(R) Core(TM)2 Duo CPU T5250@ 1.50GHz=5.507|1000 MHz|Unknown +Mobile AMD Athlon(tm) XP-M Processor 3000+=43.154|799 MHz|Unknown +2x AMD Athlon(tm) 64 X2 Dual Core Processor 4000+=7.997|1000 MHz|Unknown +AMD Athlon(tm) XP processor 1800+=25.139|1533 MHz|Unknown +2x Genuine Intel(R) CPU2140@ 1.60GHz=5.442|1595 MHz|Unknown +4x Intel(R) Core(TM)2 Quad CPUQ6600@ 2.40GHz=1.631|1603 MHz|Unknown +2x Intel(R) Core(TM)2 Duo CPU P7350@ 2.00GHz=4.758|2000 MHz|Unknown +2x Genuine Intel(R) CPU T2080@ 1.73GHz=4.985|800 MHz|Unknown +Intel(R) Celeron(R) CPU 2.50GHz=14.459|2492 MHz|Unknown +Intel(R) Pentium(R) M processor 1.86GHz=11.875|1867 MHz|Unknown +2x Intel(R) Core(TM)2 CPU T5200@ 1.60GHz=6.486|1067 MHz|Unknown +2x Intel(R) Core(TM)2 CPU6320@ 1.86GHz=4.908|1600 MHz|Unknown +AMD Athlon(tm) XP=84.350|906 MHz|Unknown +AMD Athlon(tm) 64 Processor 3000+=25.187|1800 MHz|Unknown +2x Intel(R) Pentium(R) 4 CPU 2.60GHz=8.536|2600 MHz|Unknown +4x Intel(R) Core(TM)2 Quad CPUQ9400@ 2.66GHz=1.485|2003 MHz|Unknown +Intel(R) Pentium(R) M processor 1600MHz=13.500|1600 MHz|Unknown +2x Pentium(R) Dual-Core CPU T4200@ 2.00GHz=4.615|1200 MHz|Unknown +4x Intel(R) Core(TM)2 Quad CPU @ 2.40GHz=1.696|2400 MHz|Unknown +4x Intel(R) Core(TM)2 Quad CPUQ8300@ 2.50GHz=1.659|2497 MHz|Unknown +2x Intel(R) Core(TM)2 Extreme CPU X7900@ 2.80GHz=3.065|2800 MHz|Unknown +Intel(R) Celeron(R) D CPU 3.20GHz=8.552|3196 MHz|Unknown +AMD Sempron(tm) 2600+=20.952|1840 MHz|Unknown +2x AMD Athlon(tm) 64 X2 Dual Core Processor 4400+=6.805|1000 MHz|Unknown +Intel(R) Celeron(R) CPU 2.66GHz=9.887|2666 MHz|Unknown +2x Intel(R) Core(TM) Duo CPUT2450@ 2.00GHz=4.331|800 MHz|Unknown +Intel(R) Celeron(R) M CPU520@ 1.60GHz=11.346|1600 MHz|Unknown +Intel(R) Pentium(R) 4 CPU 3.06GHz=12.724|3058 MHz|Unknown +2x Intel(R) Core(TM)2 CPU4300@ 1.80GHz=5.368|1200 MHz|Unknown +2x Intel(R) Core(TM)2 CPU6400@ 2.13GHz=4.678|2128 MHz|Unknown +AMD Turion(tm) 64 Mobile Technology MK-36=19.958|800 MHz|Unknown +2x Intel(R) Core(TM)2 CPU6600@ 2.40GHz=3.546|1596 MHz|Unknown +2x Intel(R) Core(TM)2 Duo CPU T7250@ 2.00GHz=4.160|2001 MHz|Unknown +Intel(R) Celeron(R) M processor900MHz=24.212|900 MHz|Unknown +AMD Sempron(tm) Processor 3400+=17.114|1000 MHz|Unknown +AMD Athlon(tm) XP 2500+=27.327|1792 MHz|Unknown +AMD Sempron(tm) Processor 3000+=18.941|1800 MHz|Unknown +AMD Athlon(tm) XP 2200+=22.197|1782 MHz|Unknown +2x Intel(R) Pentium(R) 4 CPU 3.06GHz=7.454|3065 MHz|Unknown +2x AMD Processor model unknown=5.242|3006 MHz|Unknown +2x AMD Turion(tm) 64 X2 Mobile Technology TL-62=7.519|800 MHz|Unknown +[CPU CryptoHash] +4x Intel(R) Atom(TM) CPU330 @ 1.60GHz=105.569|1596 MHz|Unknown +2x Intel(R) Core(TM)2 Duo CPU T5250@ 1.50GHz=102.949|1000 MHz|Unknown +Intel(R) Celeron(R) M processor900MHz=24.338|900 MHz|Unknown +2x Intel(R) Core(TM)2 CPU E8400@ 3.00GHz=163.391|3000 MHz|Unknown +2x Intel(R) Xeon(R) CPU E5405@ 2.00GHz=117.480|1995 MHz|Unknown +2x Intel(R) Core(TM) Duo CPUT2450@ 2.00GHz=127.241|800 MHz|Unknown +Intel(R) Pentium(R) 4 CPU 2.00GHz=24.650|1994 MHz|Unknown +4x AMD Phenom(tm) 9350e Quad-Core Processor=237.011|2000 MHz|Unknown +2x AMD Turion(tm) X2 Ultra Dual-Core Mobile ZM-82=100.065|600 MHz|Unknown +AMD Athlon(tm) XP 3000+=66.539|2158 MHz|Unknown +Intel(R) Celeron(R) M CPU520@ 1.60GHz=52.308|1600 MHz|Unknown +4x Intel(R) Core(TM)2 Quad CPUQ6700@ 2.66GHz=264.055|2669 MHz|Unknown +AMD Athlon(tm) XP 1900+=31.633|1593 MHz|Unknown +2x Intel(R) Pentium(R) 4 CPU 3.20GHz=66.611|2400 MHz|Unknown +AMD Sempron(tm) 2600+=53.870|1840 MHz|Unknown +2x AMD Athlon(tm) 64 X2 Dual Core Processor 3800+=94.123|2200 MHz|Unknown +2x AMD Turion(tm) 64 X2 Mobile Technology TL-62=119.427|800 MHz|Unknown +AMD Athlon(tm) XP 2000+=45.755|1667 MHz|Unknown +AMD Athlon(tm) 64 Processor 3500+=62.204|1000 MHz|Unknown +2x AMD Turion(tm) 64 X2 Mobile Technology TL-56=92.191|800 MHz|Unknown +2x AMD Athlon(tm) 64 X2 Dual Core Processor 4000+=97.036|1000 MHz|Unknown +2x Intel(R) Pentium(R) D CPU 3.00GHz=96.755|3000 MHz|Unknown +Mobile AMD Sempron(tm) Processor 3600+=54.437|800 MHz|Unknown +4x Intel(R) Core(TM)2 Quad CPUQ9650@ 3.00GHz=303.512|2997 MHz|Unknown +AMD Sempron(tm) Processor 3600+=43.977|1000 MHz|Unknown +2x Intel(R) Core(TM)2 Duo CPU T9400@ 2.53GHz=148.711|800 MHz|Unknown +2x AMD Turion(tm) 64 X2 Mobile Technology TL-58=101.693|1900 MHz|Unknown +2x Intel(R) Core(TM)2 Duo CPU P7350@ 2.00GHz=103.950|2000 MHz|Unknown +VIA Esther processor 1500MHz=7.752|1499 MHz|Unknown +2x Intel(R) Core(TM)2 Duo CPU P8600@ 2.40GHz=150.445|800 MHz|Unknown +2x Intel(R) Core(TM)2 Duo CPU T7700@ 2.40GHz=142.537|800 MHz|Unknown +2x Intel(R) Core(TM)2 Duo CPU T5550@ 1.83GHz=122.423|1829 MHz|Unknown +2x Intel(R) Core(TM)2 Duo CPU T7250@ 2.00GHz=121.915|2001 MHz|Unknown +2x Intel(R) Core(TM)2 CPU6700@ 2.66GHz=163.639|2667 MHz|Unknown +Intel(R) Pentium(R) 4 CPU 2.40GHz=30.963|2400 MHz|Unknown +4x Intel(R) Core(TM)2 Quad CPUQ9400@ 2.66GHz=296.869|2003 MHz|Unknown +AMD Athlon(tm) 64 Processor 3200+=42.300|1000 MHz|Unknown +2x Intel(R) Pentium(R) DualCPUT3200@ 2.00GHz=88.536|2000 MHz|Unknown +Intel(R) Pentium(R) 4 CPU 2.26GHz=29.413|2267 MHz|Unknown +AMD Sempron(tm) Processor 3400+=53.845|1000 MHz|Unknown +AMD Sempron(tm) Processor 3000+=47.787|1800 MHz|Unknown +AMD Athlon(tm) XP 2400+=61.644|1991 MHz|Unknown +2x Intel(R) Atom(TM) CPU Z530 @ 1.60GHz=54.891|1067 MHz|Unknown +Pentium III (Coppermine)=26.992|700 MHz|Unknown +8x Intel(R) Core(TM) i7 CPU 920@ 2.67GHz=390.240|3799 MHz|Unknown +2x AMD Athlon(tm) 64 X2 Dual Core Processor 6000+=146.744|3051 MHz|Unknown +AMD Turion(tm) 64 Mobile Technology ML-37=42.208|2000 MHz|Unknown +2x Intel(R) Xeon(R) CPU3040@ 1.86GHz=127.825|1862 MHz|Unknown +AMD Athlon(tm) XP 2500+=39.659|1792 MHz|Unknown +2x Intel(R) Core(TM)2 Duo CPU T9500@ 2.60GHz=172.640|2593 MHz|Unknown +[CPU N-Queens] +2x AMD Athlon(tm) 64 X2 Dual Core Processor 5400+=15.057|1000 MHz|Unknown +2x Genuine Intel(R) CPU T2080@ 1.73GHz=33.309|800 MHz|Unknown +2x Intel(R) Core(TM)2 Duo CPU T5450@ 1.66GHz=14.488|1000 MHz|Unknown +4x Intel(R) Core(TM)2 QuadCPU Q9300@ 2.50GHz=14.100|3000 MHz|Unknown +2x Intel(R) Atom(TM) CPU Z530 @ 1.60GHz=18.703|1067 MHz|Unknown +4x Intel(R) Atom(TM) CPU330 @ 1.60GHz=26.065|1596 MHz|Unknown +AMD Athlon(tm) XP 1600+=19.852|1398 MHz|Unknown +4x Intel(R) Core(TM)2 Quad CPUQ6700@ 2.66GHz=17.009|2669 MHz|Unknown +2x Intel(R) Pentium(R) 4 CPU 2.60GHz=14.827|2600 MHz|Unknown +2x Intel(R) Core(TM)2 CPU6320@ 1.86GHz=16.536|1600 MHz|Unknown +2x Intel(R) Core(TM)2 Extreme CPU X7900@ 2.80GHz=7.020|2800 MHz|Unknown +4x Intel(R) Core(TM)2 QuadCPU Q9450@ 2.66GHz=12.973|2000 MHz|Unknown +2x Intel(R) Core(TM)2 CPU E8400@ 3.00GHz=7.841|3000 MHz|Unknown +Pentium III (Coppermine)=27.983|700 MHz|Unknown +2x AMD Athlon(tm) 64 X2 Dual Core Processor 4000+=19.510|1000 MHz|Unknown +2x AMD Turion(tm) 64 X2 Mobile Technology TL-50=23.257|800 MHz|Unknown +2x Intel(R) Pentium(R) D CPU 3.40GHz=13.512|2400 MHz|Unknown +2x Pentium III (Coppermine)=35.147|999 MHz|Unknown +2x AMD Athlon(tm) 64 X2 Dual Core Processor 3600+=22.980|1000 MHz|Unknown +2x AMD Athlon(tm) 64 X2 Dual Core Processor 5200+=14.954|2705 MHz|Unknown +2x AMD Athlon(tm) 64 X2 Dual-Core Processor TK-55=20.494|800 MHz|Unknown +2x Intel(R) Core(TM)2 Duo CPU E6850@ 3.00GHz=7.522|1998 MHz|Unknown +2x Intel(R) Core(TM)2 Duo CPU P8400@ 2.26GHz=10.388|800 MHz|Unknown +4x Intel(R) Core(TM)2 Quad CPUQ9400@ 2.66GHz=18.246|2003 MHz|Unknown +AMD Athlon(tm) XP 1900+=26.739|1593 MHz|Unknown +2x Intel(R) Core(TM) Duo CPUT2350@ 1.86GHz=22.009|1867 MHz|Unknown +2x Intel(R) Core(TM)2 Duo CPU E8400@ 3.00GHz=7.663|2997 MHz|Unknown +AMD Athlon(tm) XP 2800+=13.555|2087 MHz|Unknown +2x Genuine Intel(R) CPU T2500@ 2.00GHz=28.389|1000 MHz|Unknown +2x AMD Turion(tm) 64 X2 Mobile Technology TL-58=20.024|1900 MHz|Unknown +2x Intel(R) Pentium(R) 4 CPU 3.40GHz=15.298|2400 MHz|Unknown +Intel(R) Celeron(R) M processor900MHz=33.259|900 MHz|Unknown +2x AMD Athlon(tm) X2 Dual-Core QL-60=20.337|1900 MHz|Unknown +2x Intel(R) Core(TM)2 Duo CPU T5850@ 2.16GHz=10.372|2167 MHz|Unknown +Mobile AMD Athlon(tm) XP-M Processor 3000+=52.785|799 MHz|Unknown +4x AMD Phenom(tm) 9500 Quad-Core Processor=10.061|1100 MHz|Unknown +Intel(R) Celeron(R) M processor 1.40GHz=94.050|1395 MHz|Unknown +Mobile AMD Athlon(tm) XP 2800+=13.362|1459 MHz|Unknown +AMD Athlon(tm) 64 Processor 3000+=18.076|1800 MHz|Unknown +2x Genuine Intel(R) CPU L2400@ 1.66GHz=19.551|1000 MHz|Unknown +AMD Sempron(tm) Processor 2800+=17.227|1999 MHz|Unknown +AMD Sempron(tm) 2600+=14.693|1840 MHz|Unknown +Intel(R) Pentium(R) M processor 1600MHz=15.228|1600 MHz|Unknown +Genuine Intel(R) CPU 575@ 2.00GHz=15.876|1995 MHz|Unknown +2x Genuine Intel(R) CPU T2300@ 1.66GHz=27.251|1000 MHz|Unknown +Intel(R) Pentium(R) M processor 1.70GHz=22.545|600 MHz|Unknown +AMD Athlon(tm) XP processor 1800+=17.547|1533 MHz|Unknown +2x Intel(R) Core(TM)2 Duo CPU T5750@ 2.00GHz=11.140|1994 MHz|Unknown +2x Intel(R) Core(TM)2 Duo CPU T7250@ 2.00GHz=11.387|2001 MHz|Unknown +Intel(R) Pentium(R) 4 CPU 1500MHz=28.460|1495 MHz|Unknown [FPU Raytracing] -Intel(R) Celeron(R) M processor 1.50GHz=40.8816714 -PowerPC 740/750 (280.00MHz)=161.312647 +2x Intel(R) Core(TM) Duo CPUT2450@ 2.00GHz=28.359|800 MHz|Unknown +AMD Athlon(tm) XP 2200+=29.739|1782 MHz|Unknown +2x Intel(R) Pentium(R) DualCPUT2370@ 1.73GHz=25.822|1733 MHz|Unknown +AMD Sempron(tm) Processor 3200+=30.191|1000 MHz|Unknown +2x AMD Athlon(tm) 64 X2 Dual-Core Processor TK-55=16.469|800 MHz|Unknown +2x Intel(R) Core(TM)2 CPU6600@ 2.40GHz=11.244|1596 MHz|Unknown +2x Intel(R) Core(TM)2 Duo CPU T5270@ 1.40GHz=32.813|800 MHz|Unknown +2x AMD Athlon(tm) 64 X2 Dual-Core Processor TK-53=18.472|800 MHz|Unknown +Intel(R) Pentium(R) M processor 1.86GHz=28.196|1867 MHz|Unknown +2x Intel(R) Core(TM)2 Duo CPU T5750@ 2.00GHz=16.383|1994 MHz|Unknown +AMD Turion(tm) 64 Mobile Technology ML-32=28.432|800 MHz|Unknown +Intel(R) Celeron(R) CPU530@ 1.73GHz=17.548|2593 MHz|Unknown +8x Intel(R) Core(TM) i7 CPU 920@ 2.67GHz=4.731|3799 MHz|Unknown +4x Intel(R) Core(TM)2 Quad CPUQ9650@ 3.00GHz=18.842|2997 MHz|Unknown +AMD Turion(tm) 64 Mobile Technology MK-36=30.838|800 MHz|Unknown +2x Intel(R) Pentium(R) D CPU 3.40GHz=25.418|2400 MHz|Unknown +2x AMD Athlon(tm) X2 Dual-Core QL-60=18.295|1900 MHz|Unknown +Intel(R) Pentium(R) III CPU - S 1400MHz=33.361|1392 MHz|Unknown +4x AMD Phenom(tm) II X4 20 Processor=13.290|3654 MHz|Unknown +2x Intel(R) Core(TM)2 CPU E8400@ 3.00GHz=15.790|3000 MHz|Unknown +Intel(R) Pentium(R) 4 CPU 2.66GHz=32.384|2676 MHz|Unknown +2x Intel(R) Pentium(R) 4 CPU 2.60GHz=57.371|2600 MHz|Unknown +2x Intel(R) Core(TM)2 Duo CPU P9500@ 2.53GHz=5.507|2535 MHz|Unknown +Intel(R) Celeron(R) M processor900MHz=64.668|900 MHz|Unknown +2x AMD Athlon(tm) 64 X2 Dual Core Processor 4800+=12.799|2512 MHz|Unknown +Intel(R) Pentium(R) M processor 1.73GHz=27.691|798 MHz|Unknown +2x Genuine Intel(R) CPU T2080@ 1.73GHz=31.108|800 MHz|Unknown +AMD Athlon(tm) 64 Processor 4000+=20.492|1000 MHz|Unknown +Intel(R) Pentium(R) 4 CPU 2.53GHz=36.544|2525 MHz|Unknown +Intel(R) Celeron(R) CPU560@ 2.13GHz=21.147|2128 MHz|Unknown +2x Intel(R) Core(TM)2 Extreme CPU X7900@ 2.80GHz=18.268|2800 MHz|Unknown +2x Intel(R) Core(TM)2 Duo CPU T9400@ 2.53GHz=5.586|800 MHz|Unknown +2x AMD Athlon(tm) 64 X2 Dual Core Processor 6400+=10.933|1000 MHz|Unknown +Intel(R) Celeron(R) M CPU420@ 1.60GHz=36.998|1599 MHz|Unknown +2x Intel(R) Xeon(R) CPU E5405@ 2.00GHz=17.808|1995 MHz|Unknown +2x Genuine Intel(R) CPU2140@ 1.60GHz=22.055|1595 MHz|Unknown +Intel(R) Pentium(R) M processor 1700MHz=27.284|600 MHz|Unknown +Pentium II (Deschutes)=124.072|401 MHz|Unknown +2x Intel(R) Core(TM)2 Duo CPU T8100@ 2.10GHz=23.759|2094 MHz|Unknown +2x Intel(R) Core(TM)2 CPU4300@ 1.80GHz=18.171|1200 MHz|Unknown +AMD Athlon(tm) XP 3000+=23.066|2158 MHz|Unknown +3x AMD Phenom(tm) 8450 Triple-Core Processor=18.564|1100 MHz|Unknown +2x Intel(R) Core(TM)2 Duo CPU P8400@ 2.26GHz=12.067|800 MHz|Unknown +AMD Athlon(tm) XP 1800+=31.725|1540 MHz|Unknown +Intel(R) Celeron(R) CPU550@ 2.00GHz=23.904|1995 MHz|Unknown +2x Intel(R) Pentium(R) 4 CPU 3.20GHz=31.439|2400 MHz|Unknown +Intel(R) Pentium(R) M processor 1.80GHz=27.133|600 MHz|Unknown +Intel(R) Celeron(R) CPU 2.80GHz=81.047|2793 MHz|Unknown +Genuine Intel(R) CPU T1350@ 1.86GHz=222.178|1867 MHz|Unknown +Intel(R) Pentium(R) 4 CPU 2.80GHz=28.658|2791 MHz|Unknown +[CPU Blowfish] +2x Intel(R) Pentium(R) D CPU 3.00GHz=10.838|3000 MHz|Unknown +Intel(R) Celeron(R) CPU540@ 1.86GHz=25.494|1861 MHz|Unknown +2x AMD Turion(tm) 64 X2 TL-58=12.576|800 MHz|Unknown +2x AMD Athlon(tm) 64 X2 Dual Core Processor 3800+=10.707|2200 MHz|Unknown +2x AMD Athlon(tm) 64 X2 Dual Core Processor 6400+=6.421|1000 MHz|Unknown +2x Intel(R) Core(TM)2 Extreme CPU X7900@ 2.80GHz=6.809|2800 MHz|Unknown +Intel(R) Pentium(R) M processor 1.70GHz=28.279|600 MHz|Unknown +3x AMD Phenom(tm) 8650 Triple-Core Processor=5.965|2300 MHz|Unknown +Intel(R) Pentium(R) 4 CPU 2.40GHz=24.567|2400 MHz|Unknown +2x AMD Athlon(tm) 64 X2 Dual Core Processor 4400+=7.918|1000 MHz|Unknown +4x AMD Phenom(tm) II X4 940 Processor=3.488|800 MHz|Unknown +2x Pentium III (Coppermine)=17.808|999 MHz|Unknown +2x Intel(R) Pentium(R) 4 CPU 3.20GHz=12.058|2400 MHz|Unknown +Intel(R) Pentium(R) 4 CPU 1500MHz=46.556|1495 MHz|Unknown +2x AMD Turion(tm) 64 X2 Mobile Technology TL-58=10.104|1900 MHz|Unknown +Intel(R) Celeron(R) M processor 1.40GHz=80.940|1395 MHz|Unknown +Mobile AMD Athlon(tm) XP 2800+=18.040|1459 MHz|Unknown +Intel(R) Celeron(R) CPU420@ 1.60GHz=21.238|1600 MHz|Unknown +4x AMD Phenom(tm) 9750 Quad-Core Processor=4.291|1200 MHz|Unknown +2x Intel(R) Atom(TM) CPU N280 @ 1.66GHz=16.764|1000 MHz|Unknown +2x AMD Athlon(tm) X2 Dual-Core QL-60=10.585|1900 MHz|Unknown +2x Intel(R) Pentium(R) DualCPUT2370@ 1.73GHz=9.581|1733 MHz|Unknown +AMD Athlon(tm) XP 1900+=31.620|1593 MHz|Unknown +AMD Athlon(tm) XP 1800+=23.128|1540 MHz|Unknown +Intel(R) Pentium(R) M processor 1.73GHz=19.657|798 MHz|Unknown +AMD Sempron(tm) Processor 3200+=25.468|1000 MHz|Unknown +VIA Esther processor 1500MHz=41.594|1499 MHz|Unknown +4x Intel(R) Core(TM)2 Quad CPUQ6700@ 2.66GHz=3.174|2669 MHz|Unknown +2x AMD Athlon(tm) 64 X2 Dual Core Processor 5000+=7.489|1000 MHz|Unknown +2x Intel(R) Xeon(R) CPU3040@ 1.86GHz=9.113|1862 MHz|Unknown +2x Intel(R) Pentium(R) DualCPUT2310@ 1.46GHz=11.596|1463 MHz|Unknown +2x Intel(R) Core(TM)2 Duo CPU P8400@ 2.26GHz=8.293|800 MHz|Unknown +2x AMD Turion(tm) X2 Dual-Core Mobile RM-74=8.970|600 MHz|Unknown +Genuine Intel(R) CPU 575@ 2.00GHz=20.357|1995 MHz|Unknown +2x AMD Turion(tm) 64 X2 Mobile Technology TL-62=8.836|800 MHz|Unknown +2x AMD Turion(tm) 64 X2 Mobile Technology TL-56=10.790|800 MHz|Unknown +Intel(R) Celeron(R) CPU 2.80GHz=40.872|2793 MHz|Unknown +2x Intel(R) Pentium(R) 4 CPU 2.80GHz=11.699|2800 MHz|Unknown +2x Genuine Intel(R) CPU2140@ 1.60GHz=10.672|1595 MHz|Unknown +2x AMD Athlon(tm) 7750 Dual-Core Processor=7.449|1350 MHz|Unknown +2x Intel(R) Core(TM)2 Duo CPU E8400@ 3.00GHz=5.538|2997 MHz|Unknown +2x Intel(R) Core(TM)2 CPU T7400@ 2.16GHz=9.372|2161 MHz|Unknown +Intel(R) Pentium(R) 4 CPU 2.53GHz=48.077|2525 MHz|Unknown +4x Intel(R) Core(TM)2 Quad CPUQ9550@ 2.83GHz=3.244|2830 MHz|Unknown +2x Intel(R) Core(TM)2 CPU6700@ 2.66GHz=6.902|2667 MHz|Unknown +2x AMD Turion(tm) X2 Dual-Core Mobile RM-72=11.859|500 MHz|Unknown +2x Intel(R) Core(TM)2 Duo CPU T9400@ 2.53GHz=6.757|800 MHz|Unknown +2x AMD Athlon(tm) 64 X2 Dual Core Processor 4800+=8.735|2512 MHz|Unknown +Intel(R) Celeron(R) M CPU520@ 1.60GHz=22.072|1600 MHz|Unknown +4x Intel(R) Core(TM)2 Quad CPUQ8300@ 2.50GHz=3.346|2497 MHz|Unknown +[CPU SHA1] +[CPU MD5] +[CPU Fibonacci] +4x AMD Phenom(tm) 9500 Quad-Core Processor=3.061|1100 MHz|Unknown +2x Intel(R) Core(TM)2 Duo CPU T7250@ 2.00GHz=4.572|2001 MHz|Unknown +2x Intel(R) Pentium(R) 4 CPU 2.80GHz=4.603|2800 MHz|Unknown +AMD Athlon(tm) Processor=7.342|1210 MHz|Unknown +2x Intel(R) Core(TM)2 CPU T5200@ 1.60GHz=7.274|1067 MHz|Unknown +4x Intel(R) Atom(TM) CPU330 @ 1.60GHz=8.789|1596 MHz|Unknown +4x AMD Phenom(tm) 9150e Quad-Core Processor=3.281|900 MHz|Unknown +AMD Turion(tm) 64 Mobile Technology MK-36=6.202|800 MHz|Unknown +AMD Athlon(tm) 64 Processor 3200+=5.764|1000 MHz|Unknown +4x Intel(R) Core(TM)2 Quad CPUQ9400@ 2.66GHz=2.759|2003 MHz|Unknown +2x Intel(R) Core(TM)2 Duo CPU T7500@ 2.20GHz=4.090|800 MHz|Unknown +AMD Athlon(tm) XP=33.451|906 MHz|Unknown +4x Intel(R) Core(TM)2 Quad CPUQ6700@ 2.66GHz=3.537|2669 MHz|Unknown +Intel(R) Pentium(R) 4 CPU 2.00GHz=8.698|1994 MHz|Unknown +2x Intel(R) Core(TM)2 Duo CPU E6550@ 2.33GHz=3.657|2700 MHz|Unknown +2x Intel(R) Core(TM)2 Duo CPU T7100@ 1.80GHz=4.788|1801 MHz|Unknown +2x Dual Core AMD Opteron(tm) Processor 165=4.257|1979 MHz|Unknown +Intel(R) Pentium(R) 4 CPU 2.40GHz=6.348|2400 MHz|Unknown +2x Intel(R) Core(TM)2 Duo CPU P8600@ 2.40GHz=3.374|800 MHz|Unknown +2x AMD Turion(tm) X2 Dual-Core Mobile RM-70=4.974|500 MHz|Unknown +Intel(R) Pentium(R) 4 CPU 2.53GHz=10.356|2525 MHz|Unknown +Unknown CPU Type=5.728|1660 MHz|Unknown +2x Pentium III (Coppermine)=10.217|999 MHz|Unknown +2x Intel(R) Core(TM)2 CPU T5600@ 1.83GHz=5.239|1000 MHz|Unknown +Intel(R) Celeron(R) CPU 3.06GHz=3.961|3059 MHz|Unknown +4x AMD Phenom(tm) 9850 Quad-Core Processor=2.594|1300 MHz|Unknown +2x Intel(R) Pentium(R) 4 CPU 3.00GHz=4.977|3458 MHz|Unknown +AMD Sempron(tm) Processor LE-1200=6.085|2109 MHz|Unknown +Intel(R) Pentium(R) 4 CPU 2.80GHz=5.654|2791 MHz|Unknown +2x AMD Athlon(tm) 64 X2 Dual Core Processor 4000+=4.124|1000 MHz|Unknown +AMD Athlon(tm) XP 1600+=6.387|1398 MHz|Unknown +2x Genuine Intel(R) CPU T2050@ 1.60GHz=6.104|800 MHz|Unknown +Intel(R) Celeron(R) CPU560@ 2.13GHz=4.776|2128 MHz|Unknown +3x AMD Phenom(tm) 8650 Triple-Core Processor=3.093|2300 MHz|Unknown +8x Intel(R) Core(TM) i7 CPU 920@ 2.67GHz=2.787|3799 MHz|Unknown +2x AMD Athlon(tm) 64 X2 Dual Core Processor 5000+=3.110|1000 MHz|Unknown +AMD Athlon(tm) XP 2500+=7.183|1792 MHz|Unknown +2x Intel(R) Xeon(R) CPU3040@ 1.86GHz=4.808|1862 MHz|Unknown +2x AMD Athlon(tm) X2 Dual-Core QL-60=4.354|1900 MHz|Unknown +2x Intel(R) Core(TM)2 CPU T7400@ 2.16GHz=4.984|2161 MHz|Unknown +2x AMD Turion(tm) 64 X2 Mobile Technology TL-60=4.189|2000 MHz|Unknown +2x AMD Turion(tm) 64 X2 Mobile Technology TL-52=5.447|1600 MHz|Unknown +2x AMD Athlon(tm) 64 X2 Dual Core Processor 6000+=2.747|3051 MHz|Unknown +2x Intel(R) Atom(TM) CPU N280 @ 1.66GHz=8.973|1000 MHz|Unknown +4x Intel(R) Core(TM)2 Quad CPUQ9550@ 2.83GHz=2.724|2830 MHz|Unknown +2x Intel(R) Core(TM)2 Duo CPU T7300@ 2.00GHz=4.773|2001 MHz|Unknown +AMD Sempron(tm) Processor 3600+=5.696|1000 MHz|Unknown +AMD Athlon(tm)=4.475|2305 MHz|Unknown +2x AMD Athlon(tm) X2 Dual Core Processor BE-2300=4.373|1899 MHz|Unknown +2x Intel(R) Core(TM)2 Duo CPU E6750@ 2.66GHz=4.096|2671 MHz|Unknown +[CPU ZLib] diff --git a/cmake/GNUInstallDirs.cmake b/cmake/GNUInstallDirs.cmake new file mode 100644 index 00000000..c3bb203a --- /dev/null +++ b/cmake/GNUInstallDirs.cmake @@ -0,0 +1,182 @@ +# - Define GNU standard installation directories +# Provides install directory variables as defined for GNU software: +# https://www.gnu.org/prep/standards/html_node/Directory-Variables.html +# Inclusion of this module defines the following variables: +# CMAKE_INSTALL_<dir> - destination for files of a given type +# CMAKE_INSTALL_FULL_<dir> - corresponding absolute path +# where <dir> is one of: +# BINDIR - user executables (bin) +# SBINDIR - system admin executables (sbin) +# LIBEXECDIR - program executables (libexec) +# SYSCONFDIR - read-only single-machine data (etc) +# SHAREDSTATEDIR - modifiable architecture-independent data (com) +# LOCALSTATEDIR - modifiable single-machine data (var) +# LIBDIR - object code libraries (lib or lib64) +# INCLUDEDIR - C header files (include) +# OLDINCLUDEDIR - C header files for non-gcc (/usr/include) +# DATAROOTDIR - read-only architecture-independent data root (share) +# DATADIR - read-only architecture-independent data (DATAROOTDIR) +# INFODIR - info documentation (DATAROOTDIR/info) +# LOCALEDIR - locale-dependent data (DATAROOTDIR/locale) +# MANDIR - man documentation (DATAROOTDIR/man) +# DOCDIR - documentation root (DATAROOTDIR/doc/PROJECT_NAME) +# Each CMAKE_INSTALL_<dir> value may be passed to the DESTINATION options of +# install() commands for the corresponding file type. If the includer does +# not define a value the above-shown default will be used and the value will +# appear in the cache for editing by the user. +# Each CMAKE_INSTALL_FULL_<dir> value contains an absolute path constructed +# from the corresponding destination by prepending (if necessary) the value +# of CMAKE_INSTALL_PREFIX. + +#============================================================================= +# Copyright 2011 Nikita Krupen'ko <krnekit@gmail.com> +# Copyright 2011 Kitware, Inc. +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + +# Installation directories +# +if(NOT DEFINED CMAKE_INSTALL_BINDIR) + set(CMAKE_INSTALL_BINDIR "bin" CACHE PATH "user executables (bin)") +endif() + +if(NOT DEFINED CMAKE_INSTALL_SBINDIR) + set(CMAKE_INSTALL_SBINDIR "sbin" CACHE PATH "system admin executables (sbin)") +endif() + +if(NOT DEFINED CMAKE_INSTALL_LIBEXECDIR) + set(CMAKE_INSTALL_LIBEXECDIR "libexec" CACHE PATH "program executables (libexec)") +endif() + +if(NOT DEFINED CMAKE_INSTALL_SYSCONFDIR) + set(CMAKE_INSTALL_SYSCONFDIR "etc" CACHE PATH "read-only single-machine data (etc)") +endif() + +if(NOT DEFINED CMAKE_INSTALL_SHAREDSTATEDIR) + set(CMAKE_INSTALL_SHAREDSTATEDIR "com" CACHE PATH "modifiable architecture-independent data (com)") +endif() + +if(NOT DEFINED CMAKE_INSTALL_LOCALSTATEDIR) + set(CMAKE_INSTALL_LOCALSTATEDIR "var" CACHE PATH "modifiable single-machine data (var)") +endif() + +if(NOT DEFINED CMAKE_INSTALL_LIBDIR) + set(_LIBDIR_DEFAULT "lib") + # Override this default 'lib' with 'lib64' iff: + # - we are on Linux system but NOT cross-compiling + # - we are NOT on debian + # - we are on a 64 bits system + # reason is: amd64 ABI: http://www.x86-64.org/documentation/abi.pdf + # Note that the future of multi-arch handling may be even + # more complicated than that: https://wiki.debian.org/Multiarch + if(CMAKE_SYSTEM_NAME MATCHES "Linux" + AND NOT CMAKE_CROSSCOMPILING + AND NOT EXISTS "/etc/debian_version") + if(NOT DEFINED CMAKE_SIZEOF_VOID_P) + message(AUTHOR_WARNING + "Unable to determine default CMAKE_INSTALL_LIBDIR directory because no target architecture is known. " + "Please enable at least one language before including GNUInstallDirs.") + else() + if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") + set(_LIBDIR_DEFAULT "lib64") + endif() + endif() + endif() + set(CMAKE_INSTALL_LIBDIR "${_LIBDIR_DEFAULT}" CACHE PATH "object code libraries (${_LIBDIR_DEFAULT})") +endif() + +if(NOT DEFINED CMAKE_INSTALL_INCLUDEDIR) + set(CMAKE_INSTALL_INCLUDEDIR "include" CACHE PATH "C header files (include)") +endif() + +if(NOT DEFINED CMAKE_INSTALL_OLDINCLUDEDIR) + set(CMAKE_INSTALL_OLDINCLUDEDIR "/usr/include" CACHE PATH "C header files for non-gcc (/usr/include)") +endif() + +if(NOT DEFINED CMAKE_INSTALL_DATAROOTDIR) + set(CMAKE_INSTALL_DATAROOTDIR "share" CACHE PATH "read-only architecture-independent data root (share)") +endif() + +#----------------------------------------------------------------------------- +# Values whose defaults are relative to DATAROOTDIR. Store empty values in +# the cache and store the defaults in local variables if the cache values are +# not set explicitly. This auto-updates the defaults as DATAROOTDIR changes. + +if(NOT CMAKE_INSTALL_DATADIR) + set(CMAKE_INSTALL_DATADIR "" CACHE PATH "read-only architecture-independent data (DATAROOTDIR)") + set(CMAKE_INSTALL_DATADIR "${CMAKE_INSTALL_DATAROOTDIR}") +endif() + +if(NOT CMAKE_INSTALL_INFODIR) + set(CMAKE_INSTALL_INFODIR "" CACHE PATH "info documentation (DATAROOTDIR/info)") + set(CMAKE_INSTALL_INFODIR "${CMAKE_INSTALL_DATAROOTDIR}/info") +endif() + +if(NOT CMAKE_INSTALL_LOCALEDIR) + set(CMAKE_INSTALL_LOCALEDIR "" CACHE PATH "locale-dependent data (DATAROOTDIR/locale)") + set(CMAKE_INSTALL_LOCALEDIR "${CMAKE_INSTALL_DATAROOTDIR}/locale") +endif() + +if(NOT CMAKE_INSTALL_MANDIR) + set(CMAKE_INSTALL_MANDIR "" CACHE PATH "man documentation (DATAROOTDIR/man)") + set(CMAKE_INSTALL_MANDIR "${CMAKE_INSTALL_DATAROOTDIR}/man") +endif() + +if(NOT CMAKE_INSTALL_DOCDIR) + set(CMAKE_INSTALL_DOCDIR "" CACHE PATH "documentation root (DATAROOTDIR/doc/PROJECT_NAME)") + set(CMAKE_INSTALL_DOCDIR "${CMAKE_INSTALL_DATAROOTDIR}/doc/${PROJECT_NAME}") +endif() + +#----------------------------------------------------------------------------- + +mark_as_advanced( + CMAKE_INSTALL_BINDIR + CMAKE_INSTALL_SBINDIR + CMAKE_INSTALL_LIBEXECDIR + CMAKE_INSTALL_SYSCONFDIR + CMAKE_INSTALL_SHAREDSTATEDIR + CMAKE_INSTALL_LOCALSTATEDIR + CMAKE_INSTALL_LIBDIR + CMAKE_INSTALL_INCLUDEDIR + CMAKE_INSTALL_OLDINCLUDEDIR + CMAKE_INSTALL_DATAROOTDIR + CMAKE_INSTALL_DATADIR + CMAKE_INSTALL_INFODIR + CMAKE_INSTALL_LOCALEDIR + CMAKE_INSTALL_MANDIR + CMAKE_INSTALL_DOCDIR + ) + +# Result directories +# +foreach(dir + BINDIR + SBINDIR + LIBEXECDIR + SYSCONFDIR + SHAREDSTATEDIR + LOCALSTATEDIR + LIBDIR + INCLUDEDIR + OLDINCLUDEDIR + DATAROOTDIR + DATADIR + INFODIR + LOCALEDIR + MANDIR + DOCDIR + ) + if(NOT IS_ABSOLUTE ${CMAKE_INSTALL_${dir}}) + set(CMAKE_INSTALL_FULL_${dir} "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_${dir}}") + else() + set(CMAKE_INSTALL_FULL_${dir} "${CMAKE_INSTALL_${dir}}") + endif() +endforeach() diff --git a/cmake/Translations.cmake b/cmake/Translations.cmake new file mode 100644 index 00000000..476fb374 --- /dev/null +++ b/cmake/Translations.cmake @@ -0,0 +1,41 @@ +# Translations.cmake, CMake macros written for Marlin, feel free to re-use them + +macro(add_translations_directory NLS_PACKAGE) + add_custom_target (i18n ALL COMMENT “Building i18n messages.â€) + find_program (MSGFMT_EXECUTABLE msgfmt) + file (GLOB PO_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.po) + foreach (PO_INPUT ${PO_FILES}) + get_filename_component (PO_INPUT_BASE ${PO_INPUT} NAME_WE) + set (MO_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${PO_INPUT_BASE}.mo) + add_custom_command (TARGET i18n COMMAND ${MSGFMT_EXECUTABLE} -o ${MO_OUTPUT} ${PO_INPUT}) + + install (FILES ${MO_OUTPUT} DESTINATION + share/locale/${PO_INPUT_BASE}/LC_MESSAGES + RENAME ${NLS_PACKAGE}.mo) + endforeach (PO_INPUT ${PO_FILES}) +endmacro(add_translations_directory) + + +macro(add_translations_catalog NLS_PACKAGE) + add_custom_target (pot COMMENT “Building translation catalog.â€) + find_program (XGETTEXT_EXECUTABLE xgettext) + + + set(C_SOURCE "") + + foreach(FILES_INPUT ${ARGN}) + file (GLOB_RECURSE SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/${FILES_INPUT}/*.c) + foreach(C_FILE ${SOURCE_FILES}) + set(C_SOURCE ${C_SOURCE} ${C_FILE}) + endforeach() + file (GLOB_RECURSE SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/${FILES_INPUT}/*.vala) + foreach(C_FILE ${SOURCE_FILES}) + set(C_SOURCE ${C_SOURCE} ${C_FILE}) + endforeach() + endforeach() + + add_custom_command (TARGET pot COMMAND + ${XGETTEXT_EXECUTABLE} -d ${NLS_PACKAGE} -o ${CMAKE_CURRENT_SOURCE_DIR}/${NLS_PACKAGE}.pot + ${VALA_SOURCE} ${C_SOURCE} --keyword="_" --keyword="N_" --from-code=UTF-8 + ) +endmacro() diff --git a/computer.c b/computer.c deleted file mode 100644 index 558206e7..00000000 --- a/computer.c +++ /dev/null @@ -1,416 +0,0 @@ -/* - * HardInfo - Displays System Information - * Copyright (C) 2003-2008 Leandro A. F. Pereira <leandro@hardinfo.org> - * - * 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 <stdlib.h> -#include <string.h> -#include <gtk/gtk.h> -#include <config.h> -#include <time.h> -#include <string.h> -#include <sys/utsname.h> -#include <sys/stat.h> - -#include <hardinfo.h> -#include <iconcache.h> -#include <shell.h> - -#include <vendor.h> - -/* Callbacks */ -gchar *callback_summary(); -gchar *callback_os(); -gchar *callback_modules(); -gchar *callback_boots(); -gchar *callback_locales(); -gchar *callback_fs(); -gchar *callback_display(); -gchar *callback_network(); -gchar *callback_users(); -gchar *callback_env_var(); - -/* 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_display(gboolean reload); -void scan_network(gboolean reload); -void scan_users(gboolean reload); -void scan_env_var(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}, - {"Display", "monitor.png", callback_display, scan_display}, - {"Environment Variables", "environment.png", callback_env_var, scan_env_var}, - {"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/os.h> -#include <arch/this/filesystem.h> -#include <arch/common/users.h> -#include <arch/this/boots.h> -#include <arch/common/environment.h> - -gchar *hi_more_info(gchar * entry) -{ - gchar *info = (gchar *) g_hash_table_lookup(moreinfo, entry); - - if (info) - return g_strdup(info); - - return g_strdup_printf("[%s]", entry); -} - -gchar *hi_get_field(gchar * field) -{ - gchar *tmp; - - if (g_str_equal(field, "Memory")) { - MemoryInfo *mi = computer_get_memory(); - tmp = g_strdup_printf("%dMB (%dMB used)", mi->total, mi->used); - g_free(mi); - } 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); - - 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(""); - } - - return tmp; -} - -void scan_summary(gboolean reload) -{ - SCAN_START(); - module_entry_scan_all_except(entries, 0); - 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(); -} - -void scan_fs(gboolean reload) -{ - SCAN_START(); - scan_filesystems(); - SCAN_END(); -} - -void scan_display(gboolean reload) -{ - SCAN_START(); - computer->display = computer_get_display(); - SCAN_END(); -} - -void scan_users(gboolean reload) -{ - SCAN_START(); - scan_users_do(); - SCAN_END(); -} - -gchar *callback_summary() -{ - gchar *processor_name, *alsa_cards, *input_devices, *printers, *storage_devices, *summary; - - processor_name = module_call_method("devices::getProcessorName"); - alsa_cards = computer_get_alsacards(computer); - input_devices = module_call_method("devices::getInputDevices"); - printers = module_call_method("devices::getPrinters"); - storage_devices = module_call_method("devices::getStorageDevices"); - - summary = 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", - processor_name, - computer->os->distro, - computer->os->username, - computer->display->width, - computer->display->height, - computer->display->ogl_renderer, - computer->display->vendor, - alsa_cards, - input_devices, printers, storage_devices); - - g_free(processor_name); - g_free(alsa_cards); - g_free(input_devices); - g_free(printers); - g_free(storage_devices); - - return summary; -} - -gchar *callback_os() -{ - 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" - "Default C Compiler=%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->gcc, - computer->os->distro, - computer->os->hostname, - computer->os->username, - computer->os->language, - computer->os->homedir, computer->os->desktop); -} - -gchar *callback_modules() -{ - return g_strdup_printf("[Loaded Modules]\n" - "%s" - "[$ShellParam$]\n" - "ViewType=1\n" - "ColumnTitle$TextValue=Name\n" - "ColumnTitle$Value=Description\n" - "ShowColumnHeaders=true\n", module_list); -} - -gchar *callback_boots() -{ - return g_strdup_printf("[$ShellParam$]\n" - "ColumnTitle$TextValue=Date & Time\n" - "ColumnTitle$Value=Kernel Version\n" - "ShowColumnHeaders=true\n" - "\n" - "%s", computer->os->boots); -} - -gchar *callback_locales() -{ - return g_strdup_printf("[$ShellParam$]\n" - "ViewType=1\n" - "ColumnTitle$TextValue=Language Code\n" - "ColumnTitle$Value=Name\n" - "ShowColumnHeaders=true\n" - "[Available Languages]\n" - "%s", computer->os->languages); -} - -gchar *callback_fs() -{ - return g_strdup_printf("[$ShellParam$]\n" - "ViewType=4\n" - "ReloadInterval=5000\n" - "Zebra=1\n" - "NormalizePercentage=false\n" - "ColumnTitle$Extra1=Mount Point\n" - "ColumnTitle$Progress=Usage\n" - "ColumnTitle$TextValue=Device\n" - "ShowColumnHeaders=true\n" - "[Mounted File Systems]\n%s\n", fs_list); -} - -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"); -} - -gchar *callback_users() -{ - return g_strdup_printf("[$ShellParam$]\n" - "ReloadInterval=10000\n" - "ViewType=1\n" - "[Users]\n" - "%s\n", users); -} - -gchar *get_os_kernel(void) -{ - scan_os(FALSE); - return computer->os->kernel; -} - -gchar *get_kernel_module_description(gchar *module) -{ - gchar *description; - - if (!_module_hash_table) { - scan_modules(FALSE); - } - - description = g_hash_table_lookup(_module_hash_table, module); - if (!description) { - return g_strdup(module); - } - - return g_strdup(description); -} - -ShellModuleMethod *hi_exported_methods(void) -{ - static ShellModuleMethod m[] = { - {"getOSKernel", get_os_kernel}, - {"getKernelModuleDescription", get_kernel_module_description}, - {NULL} - }; - - return m; -} - -ModuleEntry *hi_module_get_entries(void) -{ - return entries; -} - -gchar *hi_module_get_name(void) -{ - return g_strdup("Computer"); -} - -guchar hi_module_get_weight(void) -{ - return 80; -} - -gchar **hi_module_get_dependencies(void) -{ - static gchar *deps[] = { "devices.so", NULL }; - - return deps; -} - -void hi_module_init(void) -{ - computer = g_new0(Computer, 1); - moreinfo = - g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); -} - -ModuleAbout *hi_module_get_about(void) -{ - static ModuleAbout ma[] = { - { - .author = "Leandro A. F. Pereira", - .description = "Gathers high-level computer information", - .version = VERSION, - .license = "GNU GPL version 2"} - }; - - return ma; -} diff --git a/config.h.cmake b/config.h.cmake new file mode 100644 index 00000000..1621a890 --- /dev/null +++ b/config.h.cmake @@ -0,0 +1,36 @@ +#ifndef __CONFIG_H__ +#define __CONFIG_H__ + +#define VERSION "@HARDINFO_VERSION@" + +#define ARCH "ARCH_@HARDINFO_ARCH@" +#define OS "@HARDINFO_OS@" +#define PLATFORM OS "-" ARCH +#define KERNEL "@CMAKE_SYSTEM_VERSION@" +#define HOSTNAME "" +#define ARCH_@HARDINFO_ARCH@ + +#define LIBDIR "@CMAKE_INSTALL_LIBDIR@" +#define LIBPREFIX "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/hardinfo" +#define PREFIX "@CMAKE_INSTALL_PREFIX@/share/hardinfo" + +#cmakedefine LIBSOUP_FOUND +#cmakedefine HARDINFO_DEBUG @HARDINFO_DEBUG@ + +#ifdef LIBSOUP_FOUND +# define HAS_LIBSOUP +#endif /* LIBSOUP_FOUND */ + +#if defined(HARDINFO_DEBUG) && (HARDINFO_DEBUG==1) +# define RELEASE 0 +# define DEBUG(msg,...) fprintf(stderr, "*** %s:%d (%s) *** " msg "\n", \ + __FILE__, __LINE__, __FUNCTION__, ##__VA_ARGS__) +#else +# define RELEASE 1 +# define DEBUG(msg,...) +#endif /* HARDINFO_DEBUG */ + +#define ENABLE_BINRELOC 1 +#define HAS_LINUX_WE 1 + +#endif /* __CONFIG_H__ */ diff --git a/configure b/configure deleted file mode 100755 index b5903adf..00000000 --- a/configure +++ /dev/null @@ -1,247 +0,0 @@ -#!/usr/bin/env bash -# -# ToscoConf 0.04 -# Copyright (c) 2003-2004 Leandro Pereira <leandro@hardinfo.org> -# All rights reserved. -# -# This script is in the Tosco Public License. It may be copied and/or -# modified, in whole or in part, provided that all copies must retain the -# above copyright notice, this condition and the following disclaimer. -# -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, -# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -# COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# -# (yes, I did a copy&paste from the BSD license, eat me) -# -# --------------------------------------------------------------------------- - -PACKAGE=`basename ${PWD} | cut -d"-" -f1`; -VERSION=`basename ${PWD} | cut -d"-" -f2`; - -if [ "$PACKAGE" == "$VERSION" ]; then - VERSION=$(date +"%F.%H:%M:%S") - RELEASE=0 -else - RELEASE=1 -fi - -echo "ToscoConf (version 0.04) for $PACKAGE version $VERSION" - -# --------------------------------------------------------------------------- - -echo "Determining system architecture." -OS=`uname` -case $OS in - Linux) - ;; - *) - echo "$OS (not supported, yet!)" - exit ;; -esac - -PROC=`uname -m` -LIBDIR='/usr/lib' -case $PROC in - i?86) - ln -sf linux/x86 arch/this - ARCH="ARCH_i386" ;; - ppc*) - ln -sf linux/ppc arch/this - ARCH="ARCH_PPC" ;; - x86_64) - ln -sf linux/x86_64 arch/this - ARCH="ARCH_x86_64" - LIBDIR="/usr/lib64" ;; - mips*) - ln -sf linux/mips arch/this - ARCH="ARCH_MIPS" ;; - parisc*) - ln -sf linux/parisc arch/this - ARCH="ARCH_PARISC" ;; - sparc*) - ln -sf linux/sparc arch/this - ARCH="ARCH_SPARC" ;; - armv*) - ln -sf linux/armv4l arch/this - ARCH="ARCH_ARMV4L" ;; - 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" ;; - sh*) - ln -sf linux/sh arch/this - ARCH="ARCH_sh" ;; - -esac - -if [ "x$ARCH" == "x" ]; then - echo "Your architecture is not supported yet. Please send the" - echo "output of the following commands to leandro@hardinfo.org:" - echo "" - echo " $ cat /proc/cpuinfo" - echo " $ uname -a" - echo " $ uname -m" - exit 1 -fi - -# --------------------------------------------------------------------------- - -echo "Compiling $PACKAGE for $OS $PROC ($ARCH)." -echo "" - -# --------------------------------------------------------------------------- - -GTK2=-1 -MIN_VERSION="2.6.0" -echo -n "Checking for GTK version >= ${MIN_VERSION}... " -for i in `which pkg-config`; do - $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 - break ;; - *) - echo "not found." ;; - esac -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\taptitude install libgtk2.0-dev\n" - echo "Will do the trick." - exit 1 -fi - -# --------------------------------------------------------------------------- - -SOUP=-1 -MIN_VERSION="2.4" -echo -n "Checking for libsoup version >= ${MIN_VERSION}... " -for i in `which pkg-config`; do - $i --errors-to-stdout libsoup-2.4 \ - --atleast-version=$MIN_VERSION > /dev/null - case $? in - 0) - SOUP_FLAGS=`pkg-config libsoup-2.4 --cflags --static` - SOUP_LIBS=`pkg-config libsoup-2.4 --libs --static` - echo "found `pkg-config libsoup-2.4 --modversion`" - SOUP=1 - break ;; - *) - echo "not found." ;; - esac -done - -# -------------------------------------------------------------------------- - -if [ $SOUP -eq -1 ]; then - echo "Disabling libsoup support. (Network Updater won't be available.)" -fi - -# -------------------------------------------------------------------------- - -echo -n "Checking for Linux Wireless Extensions (CONFIG_NET_RADIO)... " -if [ -e /proc/net/wireless ]; then - echo "found." - LINUX_WE=1 -else - echo "not found." - LINUX_WE=-1 -fi - -# -------------------------------------------------------------------------- - -if [ $LINUX_WE -eq -1 ]; then - echo "Disabling Linux Wireless Extensions support." -fi - -# -------------------------------------------------------------------------- - -echo -e "\nWriting config.h..." -rm -f config.h -echo -e "#ifndef __CONFIG_H__\n#define __CONFIG_H__\n" > config.h - -echo "#define VERSION \"$VERSION\"" >> 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 -echo "#define HOSTNAME \"`hostname`\"" >> config.h - -echo "#define PREFIX \"/usr/share/hardinfo/\"" >> config.h -echo "#define LIBPREFIX \"/usr/lib/hardinfo/\"" >> config.h - -if [ "$SOUP" == "1" ]; then - echo "#define HAS_LIBSOUP" >> config.h -fi - -if [ "$LINUX_WE" == "1" ]; then - echo "#define HAS_LINUX_WE" >> config.h -fi - -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 - -echo "Writing Makefile..." -rm -f Makefile - -echo "GTK_LIBS = -lpthread -lgthread-2.0 -lrt ${GTK_LIBS}" > Makefile -echo "GTK_CFLAGS = ${GTK_FLAGS}" >> Makefile -echo "SOUP_LIBS = ${SOUP_LIBS}" >> Makefile -echo "SOUP_CFLAGS = ${SOUP_FLAGS}" >> Makefile -echo "PACKAGE = `basename ${PWD}`" >> Makefile -echo "ARCHOPTS = " >> Makefile -echo "LIBDIR = $LIBDIR" >> Makefile - -cat Makefile.in >> Makefile - -echo -e "\nDone. Type \"make\" to compile the program.\n" - - -if [ "$RELEASE" == 0 ]; then - cat << EOF -********************************************************* -* This is work in progress! Please report bugs at: * -* http://developer.berlios.de/bugs/?group_id=5897 * -* Or send patches to: * -* http://developer.berlios.de/patch/?group_id=5897 * -********************************************************* -EOF -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@hardinfo.org>. -EOF -fi diff --git a/devices.c b/devices.c deleted file mode 100644 index 35c3ea27..00000000 --- a/devices.c +++ /dev/null @@ -1,460 +0,0 @@ -/* - * HardInfo - Displays System Information - * Copyright (C) 2003-2007 Leandro A. F. Pereira <leandro@hardinfo.org> - * - * 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 __USE_XOPEN -#define __USE_XOPEN -#endif /* __USE_XOPEN */ - -#ifndef _XOPEN_SOURCE -#define _XOPEN_SOURCE -#endif /* _XOPEN_SOURCE */ - -#include <gtk/gtk.h> -#include <config.h> -#include <string.h> - -#include <hardinfo.h> -#include <shell.h> -#include <iconcache.h> -#include <syncmanager.h> - -#include <expr.h> -#include <socket.h> - -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(); -#if defined(ARCH_i386) || defined(ARCH_x86_64) -gchar *callback_dmi(); -#endif -gchar *callback_device_resources(); - -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); -#if defined(ARCH_i386) || defined(ARCH_x86_64) -void scan_dmi(gboolean reload); -#endif -void scan_device_resources(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}, -#if defined(ARCH_i386) || defined(ARCH_x86_64) - {"DMI", "computer.png", callback_dmi, scan_dmi}, -#endif /* x86 or x86_64 */ - {"Resources", "resources.png", callback_device_resources, scan_device_resources}, - {NULL} -}; - -static GHashTable *moreinfo = NULL; -static GSList *processors = NULL; -static gchar *printer_list = NULL; -static gchar *pci_list = NULL; -static gchar *input_list = NULL; -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 (!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/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> -#include <arch/this/resources.h> - -#if defined(ARCH_i386) || defined(ARCH_x86_64) -#include <arch/this/dmi.h> -#endif /* x86 or x86_64 */ - -gchar *get_processor_name(void) -{ - scan_processors(FALSE); - - Processor *p = (Processor *) processors->data; - - 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; - } -} - -gchar *get_storage_devices(void) -{ - scan_storage(FALSE); - - return storage_list; -} - -gchar *get_printers(void) -{ - scan_printers(FALSE); - - return printer_list; -} - -gchar *get_input_devices(void) -{ - scan_input(FALSE); - - return input_list; -} - -gchar *get_processor_count(void) -{ - scan_processors(FALSE); - - return g_strdup_printf("%d", g_slist_length(processors)); -} - -gchar *get_processor_frequency(void) -{ - Processor *p; - - scan_processors(FALSE); - - p = (Processor *)processors->data; - if (p->cpu_mhz == 0.0f) { - return g_strdup("Unknown"); - } else { - return g_strdup_printf("%.0f", p->cpu_mhz); - } -} - -gchar *get_pci_device_description(gchar *pci_id) -{ - gchar *description; - - if (!_pci_devices) { - scan_pci(FALSE); - } - - if ((description = g_hash_table_lookup(_pci_devices, pci_id))) { - return g_strdup(description); - } - - return NULL; -} - -gchar *get_memory_total(void) -{ - /* FIXME */ - return g_strdup("0.0"); -} - -ShellModuleMethod *hi_exported_methods(void) -{ - static ShellModuleMethod m[] = { - {"getProcessorCount", get_processor_count}, - {"getProcessorName", get_processor_name}, - {"getProcessorFrequency", get_processor_frequency}, - {"getMemoryTotal", get_memory_total}, - {"getStorageDevices", get_storage_devices}, - {"getPrinters", get_printers}, - {"getInputDevices", get_input_devices}, - {"getPCIDeviceDescription", get_pci_device_description}, - {NULL} - }; - - return m; -} - -gchar *hi_more_info(gchar * entry) -{ - gchar *info = (gchar *) g_hash_table_lookup(moreinfo, entry); - - if (info) - return g_strdup(info); - - return g_strdup("?"); -} - -gchar *hi_get_field(gchar * field) -{ - gchar *info = (gchar *) g_hash_table_lookup(moreinfo, field); - - if (info) - return g_strdup(info); - - return g_strdup(field); -} - -#if defined(ARCH_i386) || defined(ARCH_x86_64) -void scan_dmi(gboolean reload) -{ - SCAN_START(); - __scan_dmi(); - SCAN_END(); -} -#endif - -void 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 *callback_processors() -{ - return processor_get_info(processors); -} - -#if defined(ARCH_i386) || defined(ARCH_x86_64) -gchar *callback_dmi() -{ - return dmi_info; -} -#endif - -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); -} - -gchar *callback_printers() -{ - return g_strdup_printf("%s\n" - "[$ShellParam$]\n" - "ViewType=1\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_strdup_printf("[Input Devices]\n" - "%s" - "[$ShellParam$]\n" - "ViewType=1\n" - "ReloadInterval=5000\n%s", input_list, - input_icons); -} - -gchar *callback_usb() -{ - 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_module_get_name(void) -{ - return g_strdup("Devices"); -} - -guchar hi_module_get_weight(void) -{ - return 85; -} - -void hi_module_init(void) -{ - if (!g_file_test("/usr/share/misc/pci.ids", G_FILE_TEST_EXISTS)) { - static SyncEntry se = { - .fancy_name = "Update PCI ID listing", - .name = "GetPCIIds", - .save_to = "pci.ids", - .get_data = NULL - }; - - sync_manager_add_entry(&se); - } - - moreinfo = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); - __init_memory_labels(); - __init_cups(); -} - -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; -} diff --git a/doc/index.hlp b/doc/index.hlp new file mode 100644 index 00000000..649a7a4a --- /dev/null +++ b/doc/index.hlp @@ -0,0 +1,35 @@ +# HardInfo Documentation + +## Introduction + +HardInfo can gather information about your system's hardware and operating system, perform benchmarks, and generate printable reports either in HTML or in plain text formats. + +## Feature Overview + +* Obtains information about basic hardware items; +* Obtains information about basic operating system items; +* Performs CPU and FPU benchmarks; +* Allows [network-updater.hlp synchronization of benchmark results] with other HardInfo users; +* Some tables can be [network-updater.hlp updated] from the Internet; +* Can be used either in local or in [remote.hlp remote] mode; +* Generates repots in HTML or plain text formats; +* Can be used either with a GTK+ GUI or on a terminal. + +## Using + +* [report-generation.hlp Generating Reports] +* [network-updater.hlp Using the Network Updater] +* [remote.hlp Obtaining Information from a Remote Machine] +* [benchmark.hlp Performing and Understanding Benchmarks] +* [command-line.hlp Using HardInfo from the command line] + +## Improving + +* [bug-reporting.hlp How to Report Bugs] +* [feature-requests.hlp How to Request a Feature] +* [http://hardinfo.org/developer Developer Documentation] + +## Following + +* [https://twitter.com/hardinfo Twitter] (for GitHub commits) +* [http://lists.hardinfo.org Mailing Lists] diff --git a/fftbench.h b/fftbench.h deleted file mode 100644 index 3598baf1..00000000 --- a/fftbench.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef __FFTBENCH_H__ -#define __FFTBENCH_H__ - -void fft_bench_init(void); -void fft_bench_start(void); -void fft_bench_finish(void); - -#endif /* __FFTBENCH_H__ */ - - diff --git a/hardinfo.desktop b/hardinfo.desktop deleted file mode 100644 index 523432f1..00000000 --- a/hardinfo.desktop +++ /dev/null @@ -1,9 +0,0 @@ -[Desktop Entry] -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 -Type=Application -StartupNotify=true -Categories=System;
\ No newline at end of file diff --git a/hardinfo.desktop.cmake b/hardinfo.desktop.cmake new file mode 100644 index 00000000..4a94f8c5 --- /dev/null +++ b/hardinfo.desktop.cmake @@ -0,0 +1,14 @@ +[Desktop Entry] +Name=System Profiler and Benchmark +Name[es]=Informacion y Rendimiento del Sistema +Name[fr]=Informations et Benchmarks du Système +Name[pt_BR]=Informações e Testes do Sistema +Name[ru]=Ð˜Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð¾ ÑиÑтеме и теÑтирование +Comment=Displays system information +Comment[ru]=Показывает информацию о ÑиÑтеме +Exec=@CMAKE_INSTALL_FULL_BINDIR@/hardinfo +Icon=@CMAKE_INSTALL_FULL_DATAROOTDIR@/hardinfo/pixmaps/logo.png +Terminal=false +Type=Application +StartupNotify=true +Categories=System; diff --git a/binreloc.c b/hardinfo/binreloc.c index 1d1acfe6..f47a3fae 100644 --- a/binreloc.c +++ b/hardinfo/binreloc.c @@ -593,11 +593,7 @@ gchar *gbr_find_lib_dir(const gchar * default_lib_dir) return NULL; } -#ifdef ARCH_x86_64 - dir = g_build_filename(prefix, "lib64", NULL); -#else - dir = g_build_filename(prefix, "lib", NULL); -#endif + dir = g_build_filename(prefix, LIBDIR, NULL); g_free(prefix); return dir; diff --git a/expr.c b/hardinfo/expr.c index 32e303d7..32e303d7 100644 --- a/expr.c +++ b/hardinfo/expr.c diff --git a/hardinfo.c b/hardinfo/hardinfo.c index 651a39e0..4a38fe1a 100644 --- a/hardinfo.c +++ b/hardinfo/hardinfo.c @@ -1,6 +1,6 @@ /* * HardInfo - Displays System Information - * Copyright (C) 2003-2007 Leandro A. F. Pereira <leandro@hardinfo.org> + * Copyright (C) 2003-2009 Leandro A. F. Pereira <leandro@hardinfo.org> * * 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,11 +33,10 @@ int main(int argc, char **argv) { GSList *modules; - DEBUG("HardInfo version " VERSION ". Debug version."); + bindtextdomain("hardinfo", "/usr/share/locale"); + textdomain("hardinfo"); - DEBUG("g_thread_init()"); - if (!g_thread_supported()) - g_thread_init(NULL); + DEBUG("HardInfo version " VERSION ". Debug version."); /* parse all command line parameters */ parameters_init(&argc, &argv, ¶ms); @@ -46,16 +45,16 @@ int main(int argc, char **argv) if (params.show_version) { g_print("HardInfo version " VERSION "\n"); g_print - ("Copyright (C) 2003-2009 Leandro A. F. Pereira. See COPYING for details.\n\n"); + (_("Copyright (C) 2003-2009 Leandro A. F. Pereira. See COPYING for details.\n\n")); - g_print("Compile-time options:\n" + 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", + " Compiled on: %s %s (%s)\n"), + RELEASE ? _("Yes") : "No (" VERSION ")", ARCH, + ENABLE_BINRELOC ? _("Yes") : _("No"), PREFIX, LIBPREFIX, PLATFORM, KERNEL, HOSTNAME); DEBUG(" Debugging is enabled."); @@ -66,15 +65,15 @@ int main(int argc, char **argv) /* initialize the binreloc library, so we can load program data */ if (!binreloc_init(FALSE)) - g_error("Failed to find runtime data.\n\n" + 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.", + "\342\200\242 See if %s and %s exists and you have read permision."), PREFIX, LIBPREFIX); /* list all module names */ if (params.list_modules) { - g_print("Modules:\n" - "%-20s%-15s%-12s\n", "File Name", "Name", "Version"); + g_print(_("Modules:\n" + "%-20s%-15s%-12s\n"), _("File Name"), _("Name"), _("Version")); for (modules = modules_load_all(); modules; modules = modules->next) { @@ -90,9 +89,8 @@ int main(int argc, char **argv) return 0; } - if (!params.create_report) { - /* we only try to open the UI if the user didn't asked for a - report. */ + if (!params.create_report && !params.run_benchmark) { + /* we only try to open the UI if the user didn't ask for a report. */ params.gui_running = ui_init(&argc, &argv); /* as a fallback, if GTK+ initialization failed, run in report @@ -113,8 +111,21 @@ int main(int argc, char **argv) /* initialize vendor database */ vendor_init(); - - if (params.gui_running) { + + /* initialize moreinfo */ + moreinfo_init(); + + if (params.run_benchmark) { + gchar *result; + + result = module_call_method_param("benchmark::runBenchmark", params.run_benchmark); + if (!result) { + g_error(_("Unknown benchmark ``%s'' or libbenchmark.so not loaded"), params.run_benchmark); + } else { + g_print("%s\n", result); + g_free(result); + } + } else if (params.gui_running) { /* initialize gui and start gtk+ main loop */ icon_cache_init(); stock_icons_init(); @@ -136,8 +147,12 @@ int main(int argc, char **argv) g_print("%s", report); g_free(report); + } else { + g_error(_("Don't know what to do. Exiting.")); } + moreinfo_shutdown(); + DEBUG("finished"); return 0; } diff --git a/socket.c b/hardinfo/socket.c index cada32b6..40cb8e50 100644 --- a/socket.c +++ b/hardinfo/socket.c @@ -43,10 +43,8 @@ Socket *sock_connect(gchar * host, gint port) 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; + if (connect(sock, (struct sockaddr *) (void *) &server, sizeof(server)) < 0) { + goto cleanup; } s = g_new0(Socket, 1); @@ -55,6 +53,9 @@ Socket *sock_connect(gchar * host, gint port) return s; } +cleanup: + close(sock); + return NULL; } @@ -95,10 +96,10 @@ int sock_ready_to_write(Socket * s) int sock_read(Socket * s, gchar * buffer, gint size) { - if (sock_ready_to_read(s)) { + if (size > 2 && sock_ready_to_read(s)) { gint n; - n = read(s->sock, buffer, size); + n = read(s->sock, buffer, size - 1); if (n > 0) { buffer[n] = '\0'; } else { @@ -120,6 +121,7 @@ int sock_write(Socket * s, gchar * str) void sock_close(Socket * s) { + shutdown(s->sock, 2); close(s->sock); g_free(s); } diff --git a/util.c b/hardinfo/util.c index 266ce4eb..40566eac 100644 --- a/util.c +++ b/hardinfo/util.c @@ -44,35 +44,41 @@ #define KiB 1024 #define MiB 1048576 #define GiB 1073741824 +#define TiB 1099511627776 +#define PiB 1125899906842624 + +static GSList *modules_list = NULL; + +void sync_manager_clear_entries(void); gchar *find_program(gchar *program_name) { int i; char *temp; static GHashTable *cache = NULL; - const char *path[] = { "/bin", "/sbin", - "/usr/bin", "/usr/sbin", - "/usr/local/bin", "/usr/local/sbin", - NULL }; - + const char *path[] = { "/usr/local/bin", "/usr/local/sbin", + "/usr/bin", "/usr/sbin", + "/bin", "/sbin", + NULL }; + /* we don't need to call stat() every time: cache the results */ if (!cache) { cache = g_hash_table_new(g_str_hash, g_str_equal); } else if ((temp = g_hash_table_lookup(cache, program_name))) { return g_strdup(temp); } - + for (i = 0; path[i]; i++) { temp = g_build_filename(path[i], program_name, NULL); - + if (g_file_test(temp, G_FILE_TEST_IS_EXECUTABLE)) { g_hash_table_insert(cache, program_name, g_strdup(temp)); return temp; } - + g_free(temp); } - + /* our search has failed; use GLib's search (which uses $PATH env var) */ if ((temp = g_find_program_in_path(program_name))) { g_hash_table_insert(cache, program_name, g_strdup(temp)); @@ -92,35 +98,35 @@ gchar *seconds_to_string(unsigned int seconds) days = hours / 24; hours %= 24; -#define plural(x) ((x > 1) ? "s" : "") + gchar *wminutes; + gchar *whours; + gchar *wdays; + wdays = ngettext("%d day, ", "%d days, ", days); + whours = ngettext("%d hour, ", "%d hours, ", hours); + wminutes = ngettext("%d minute", "%d minutes", minutes); 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)); - } + if (hours < 1) + return g_strdup_printf(ngettext("%d minute", "%d minutes", minutes), minutes); + return g_strdup_printf(whours, wminutes); } - - return g_strdup_printf("%d day%s, %d hour%s and %d minute%s", - days, plural(days), hours, - plural(hours), minutes, plural(minutes)); + return g_strdup_printf(wdays, whours, wminutes); } inline gchar *size_human_readable(gfloat size) { if (size < KiB) - return g_strdup_printf("%.1f B", size); + return g_strdup_printf(_("%.1f B"), size); if (size < MiB) - return g_strdup_printf("%.1f KiB", size / KiB); + return g_strdup_printf(_("%.1f KiB"), size / KiB); if (size < GiB) - return g_strdup_printf("%.1f MiB", size / MiB); + return g_strdup_printf(_("%.1f MiB"), size / MiB); + if (size < TiB) + return g_strdup_printf(_("%.1f GiB"), size / GiB); + if (size < PiB) + return g_strdup_printf(_("%.1f TiB"), size / TiB); - return g_strdup_printf("%.1f GiB", size / GiB); + return g_strdup_printf(_("%.1f PiB"), size / PiB); } inline char *strend(gchar * str, gchar chr) @@ -129,7 +135,7 @@ inline char *strend(gchar * str, gchar chr) return NULL; char *p; - if ((p = strchr(str, chr))) + if ((p = g_utf8_strchr(str, -1, chr))) *p = 0; return str; @@ -334,7 +340,7 @@ log_handler(const gchar * log_domain, 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", + (log_level & G_LOG_FLAG_FATAL) ? _("Error") : _("Warning"), message); } else { /* Hooray! We have a GUI running! */ @@ -349,8 +355,8 @@ log_handler(const gchar * log_domain, "<big><b>%s</b></big>\n\n%s", (log_level & G_LOG_FLAG_FATAL) ? - "Fatal Error" : - "Warning", message); + _("Fatal Error") : + _("Warning"), message); gtk_dialog_run(GTK_DIALOG(dialog)); gtk_widget_destroy(dialog); @@ -363,7 +369,9 @@ void parameters_init(int *argc, char ***argv, ProgramParameters * param) static gboolean show_version = FALSE; static gboolean list_modules = FALSE; static gboolean autoload_deps = FALSE; + static gboolean run_xmlrpc_server = FALSE; static gchar *report_format = NULL; + static gchar *run_benchmark = NULL; static gchar **use_modules = NULL; static GOptionEntry options[] = { @@ -372,42 +380,56 @@ void parameters_init(int *argc, char ***argv, ProgramParameters * param) .short_name = 'r', .arg = G_OPTION_ARG_NONE, .arg_data = &create_report, - .description = "creates a report and prints to standard output"}, + .description = N_("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)"}, + .description = N_("chooses a report format (text, html)")}, + { + .long_name = "run-benchmark", + .short_name = 'b', + .arg = G_OPTION_ARG_STRING, + .arg_data = &run_benchmark, + .description = N_("run benchmark; requires benchmark.so to be loaded")}, { .long_name = "list-modules", .short_name = 'l', .arg = G_OPTION_ARG_NONE, .arg_data = &list_modules, - .description = "lists modules"}, + .description = N_("lists modules")}, { .long_name = "load-module", .short_name = 'm', .arg = G_OPTION_ARG_STRING_ARRAY, .arg_data = &use_modules, - .description = "specify module to load"}, + .description = N_("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"}, + .description = N_("automatically load module dependencies")}, +#ifdef HAS_LIBSOUP + { + .long_name = "xmlrpc-server", + .short_name = 'x', + .arg = G_OPTION_ARG_NONE, + .arg_data = &run_xmlrpc_server, + .description = N_("run in XML-RPC server mode")}, +#endif /* HAS_LIBSOUP */ { .long_name = "version", .short_name = 'v', .arg = G_OPTION_ARG_NONE, .arg_data = &show_version, - .description = "shows program version and quit"}, + .description = N_("shows program version and quit")}, {NULL} }; GOptionContext *ctx; - ctx = g_option_context_new("- System Profiler and Benchmark tool"); + 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); @@ -417,8 +439,8 @@ void parameters_init(int *argc, char ***argv, ProgramParameters * param) g_option_context_free(ctx); if (*argc >= 2) { - g_print("Unrecognized arguments.\n" - "Try ``%s --help'' for more information.\n", *(argv)[0]); + g_print(_("Unrecognized arguments.\n" + "Try ``%s --help'' for more information.\n"), *(argv)[0]); exit(1); } @@ -427,7 +449,9 @@ void parameters_init(int *argc, char ***argv, ProgramParameters * param) param->show_version = show_version; param->list_modules = list_modules; param->use_modules = use_modules; + param->run_benchmark = run_benchmark; param->autoload_deps = autoload_deps; + param->run_xmlrpc_server = run_xmlrpc_server; param->argv0 = *(argv)[0]; if (report_format && g_str_equal(report_format, "html")) @@ -463,11 +487,11 @@ void open_url(gchar * url) }; gint i = 0; gchar *browser = (gchar *)g_getenv("BROWSER"); - + if (!browser || *browser == '\0') { browser = (gchar *)browsers[i++]; } - + do { gchar *cmdline = g_strdup_printf("%s '%s'", browser, url); @@ -477,15 +501,15 @@ void open_url(gchar * url) } g_free(cmdline); - + browser = (gchar *)browsers[i++]; } while (browser); - g_warning("Couldn't find a Web browser to open URL %s.", url); + 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 *strreplacechr(gchar * string, gchar * replace, gchar new_char) { gchar *s; for (s = string; *s; s++) @@ -495,6 +519,17 @@ gchar *strreplace(gchar * string, gchar * replace, gchar new_char) return string; } +gchar *strreplace(gchar *string, gchar *replace, gchar *replacement) +{ + gchar **tmp, *ret; + + tmp = g_strsplit(string, replace, 0); + ret = g_strjoinv(replacement, tmp); + g_strfreev(tmp); + + return ret; +} + static GHashTable *__module_methods = NULL; static void module_register_methods(ShellModule * module) @@ -509,17 +544,19 @@ static void module_register_methods(ShellModule * module) if (g_module_symbol (module->dll, "hi_exported_methods", (gpointer) & get_methods)) { ShellModuleMethod *methods; - + for (methods = get_methods(); methods->name; methods++) { ShellModuleMethod method = *methods; gchar *name = g_path_get_basename(g_module_name(module->dll)); + gchar *simple_name = strreplace(name, "lib", ""); - strend(name, '.'); + strend(simple_name, '.'); - method_name = g_strdup_printf("%s::%s", name, method.name); + method_name = g_strdup_printf("%s::%s", simple_name, method.name); g_hash_table_insert(__module_methods, method_name, method.function); g_free(name); + g_free(simple_name); } } @@ -534,8 +571,7 @@ gchar *module_call_method(gchar * method) } function = g_hash_table_lookup(__module_methods, method); - return function ? g_strdup(function()) : - g_strdup_printf("{Unknown method: \"%s\"}", method); + return function ? g_strdup(function()) : NULL; } /* FIXME: varargs? */ @@ -548,8 +584,77 @@ gchar *module_call_method_param(gchar * method, gchar * parameter) } function = g_hash_table_lookup(__module_methods, method); - return function ? g_strdup(function(parameter)) : - g_strdup_printf("{Unknown method: \"%s\"}", method); + return function ? g_strdup(function(parameter)) : NULL; +} + +static gboolean remove_module_methods(gpointer key, gpointer value, gpointer data) +{ + return g_str_has_prefix(key, data); +} + +static void module_unload(ShellModule * module) +{ + GSList *entry; + + if (module->dll) { + gchar *name; + + if (module->deinit) { + DEBUG("cleaning up module \"%s\"", module->name); + module->deinit(); + } else { + DEBUG("module \"%s\" does not need cleanup", module->name); + } + + name = g_path_get_basename(g_module_name(module->dll)); + g_hash_table_foreach_remove(__module_methods, remove_module_methods, name); + + g_module_close(module->dll); + g_free(name); + } + + g_free(module->name); + g_object_unref(module->icon); + + for (entry = module->entries; entry; entry = entry->next) { + ShellModuleEntry *e = (ShellModuleEntry *)entry->data; + + g_source_remove_by_user_data(e); + g_free(e); + } + + g_slist_free(module->entries); + g_free(module); +} + + +void module_unload_all(void) +{ + Shell *shell; + GSList *module, *merge_id; + + shell = shell_get_main_shell(); + + sync_manager_clear_entries(); + shell_clear_timeouts(shell); + shell_clear_tree_models(shell); + shell_clear_field_updates(); + shell_set_title(shell, NULL); + + for (module = shell->tree->modules; module; module = module->next) { + module_unload((ShellModule *)module->data); + } + + for (merge_id = shell->merge_ids; merge_id; merge_id = merge_id->next) { + gtk_ui_manager_remove_ui(shell->ui_manager, + GPOINTER_TO_INT(merge_id->data)); + } + g_slist_free(shell->tree->modules); + g_slist_free(shell->merge_ids); + + shell->merge_ids = NULL; + shell->tree->modules = NULL; + shell->selected = NULL; } static ShellModule *module_load(gchar * filename) @@ -560,22 +665,26 @@ static ShellModule *module_load(gchar * filename) module = g_new0(ShellModule, 1); if (params.gui_running) { - gchar *tmpicon; + gchar *tmpicon, *dot, *simple_name; tmpicon = g_strdup(filename); - gchar *dot = g_strrstr(tmpicon, "." G_MODULE_SUFFIX); + dot = g_strrstr(tmpicon, "." G_MODULE_SUFFIX); *dot = '\0'; - tmp = g_strdup_printf("%s.png", tmpicon); + simple_name = strreplace(tmpicon, "lib", ""); + + tmp = g_strdup_printf("%s.png", simple_name); module->icon = icon_cache_get_pixbuf(tmp); g_free(tmp); g_free(tmpicon); + g_free(simple_name); } tmp = g_build_filename(params.path_lib, "modules", filename, NULL); module->dll = g_module_open(tmp, G_MODULE_BIND_LAZY); + DEBUG("gmodule resource for ``%s'' is %p", tmp, module->dll); g_free(tmp); if (module->dll) { @@ -586,16 +695,14 @@ static ShellModule *module_load(gchar * filename) 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)) { + 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)) { + DEBUG("cannot find needed symbols; is ``%s'' a real module?", filename); goto failed; } - if (g_module_symbol - (module->dll, "hi_module_init", (gpointer) & init)) { + if (g_module_symbol(module->dll, "hi_module_init", (gpointer) & init)) { + DEBUG("initializing module ``%s''", filename); init(); } @@ -605,6 +712,13 @@ static ShellModule *module_load(gchar * filename) module->weight = weight_func ? weight_func() : 0; module->name = name_func(); + g_module_symbol(module->dll, "hi_module_get_about", + (gpointer) & (module->aboutfunc)); + g_module_symbol(module->dll, "hi_module_deinit", + (gpointer) & (module->deinit)); + g_module_symbol(module->dll, "hi_module_get_summary", + (gpointer) & (module->summaryfunc)); + entries = get_module_entries(); while (entries[i].name) { ShellModuleEntry *entry = g_new0(ShellModuleEntry, 1); @@ -612,6 +726,7 @@ static ShellModule *module_load(gchar * filename) if (params.gui_running) { entry->icon = icon_cache_get_pixbuf(entries[i].icon); } + entry->icon_file = entries[i].icon; g_module_symbol(module->dll, "hi_more_info", (gpointer) & (entry->morefunc)); @@ -620,20 +735,23 @@ static ShellModule *module_load(gchar * filename) g_module_symbol(module->dll, "hi_note_func", (gpointer) & (entry->notefunc)); - entry->name = entries[i].name; + entry->name = _(entries[i].name); //gettext unname N_() in computer.c line 67 etc... entry->scan_func = entries[i].scan_callback; entry->func = entries[i].callback; entry->number = i; + entry->flags = entries[i].flags; module->entries = g_slist_append(module->entries, entry); i++; } + DEBUG("registering methods for module ``%s''", filename); module_register_methods(module); } else { + DEBUG("cannot g_module_open(``%s''). permission problem?", filename); failed: - DEBUG("loading module %s failed", filename); + DEBUG("loading module %s failed: %s", filename, g_module_error()); g_free(module->name); g_free(module); @@ -666,6 +784,7 @@ static gint module_cmp(gconstpointer m1, gconstpointer m2) return a->weight - b->weight; } +#if 0 static void module_entry_free(gpointer data, gpointer user_data) { ShellModuleEntry *entry = (ShellModuleEntry *) data; @@ -677,27 +796,12 @@ static void module_entry_free(gpointer data, gpointer user_data) g_free(entry); } } - -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); -} +#endif 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(); + if (module->aboutfunc) { + return module->aboutfunc(); } return NULL; @@ -748,7 +852,7 @@ static GSList *modules_check_deps(GSList * modules) GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, - "Module \"%s\" depends on module \"%s\", load it?", + _("Module \"%s\" depends on module \"%s\", load it?"), module->name, deps[i]); gtk_dialog_add_buttons(GTK_DIALOG(dialog), @@ -771,7 +875,7 @@ static GSList *modules_check_deps(GSList * modules) gtk_widget_destroy(dialog); } else { - g_error("Module \"%s\" depends on module \"%s\".", + g_error(_("Module \"%s\" depends on module \"%s\"."), module->name, deps[i]); } } @@ -782,6 +886,12 @@ static GSList *modules_check_deps(GSList * modules) return modules; } + +GSList *modules_get_list() +{ + return modules_list; +} + static GSList *modules_load(gchar ** module_list) { GDir *dir; @@ -810,17 +920,18 @@ static GSList *modules_load(gchar ** module_list) 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.", + (_("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."); + (_("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); + modules_list = g_slist_sort(modules, module_cmp); + return modules_list; } GSList *modules_load_selected(void) @@ -956,9 +1067,7 @@ void tree_view_save_image(gchar * filename) static gboolean __idle_free_do(gpointer ptr) { - if (ptr) { - g_free(ptr); - } + g_free(ptr); return FALSE; } @@ -991,7 +1100,7 @@ void module_entry_scan_all_except(ModuleEntry * entries, gint except_entry) if (i == except_entry) continue; - text = g_strdup_printf("Scanning: %s...", entry.name); + text = g_strdup_printf(_("Scanning: %s..."), _(entry.name)); shell_status_update(text); g_free(text); @@ -1001,7 +1110,7 @@ void module_entry_scan_all_except(ModuleEntry * entries, gint except_entry) } shell_view_set_enabled(TRUE); - shell_status_update("Done."); + shell_status_update(_("Done.")); } void module_entry_scan_all(ModuleEntry * entries) @@ -1011,6 +1120,7 @@ void module_entry_scan_all(ModuleEntry * entries) void module_entry_reload(ShellModuleEntry * module_entry) { + if (module_entry->scan_func) { module_entry->scan_func(TRUE); } @@ -1023,18 +1133,40 @@ void module_entry_scan(ShellModuleEntry * module_entry) } } +gchar *module_entry_get_field(ShellModuleEntry * module_entry, gchar * field) +{ + if (module_entry->fieldfunc) { + return module_entry->fieldfunc(field); + } + + return NULL; +} + gchar *module_entry_function(ShellModuleEntry * module_entry) { if (module_entry->func) { - return g_strdup(module_entry->func()); + return module_entry->func(); + } + + return NULL; +} + +gchar *module_entry_get_moreinfo(ShellModuleEntry * module_entry, gchar * field) +{ + if (module_entry->morefunc) { + return module_entry->morefunc(field); } - return g_strdup("[Error]\n" "Invalid module="); + return NULL; } const gchar *module_entry_get_note(ShellModuleEntry * module_entry) { - return module_entry->notefunc(module_entry->number); + if (module_entry->notefunc) { + return module_entry->notefunc(module_entry->number); + } + + return NULL; } gchar *h_strdup_cprintf(const gchar * format, gchar * source, ...) @@ -1112,14 +1244,14 @@ h_sysfs_read_float(gchar *endpoint, gchar *entry) { gchar *tmp, *buffer; gfloat return_value = 0.0f; - + tmp = g_build_filename(endpoint, entry, NULL); if (g_file_get_contents(tmp, &buffer, NULL, NULL)) return_value = atof(buffer); - + g_free(tmp); g_free(buffer); - + return return_value; } @@ -1128,14 +1260,14 @@ h_sysfs_read_int(gchar *endpoint, gchar *entry) { gchar *tmp, *buffer; gint return_value = 0; - + tmp = g_build_filename(endpoint, entry, NULL); if (g_file_get_contents(tmp, &buffer, NULL, NULL)) return_value = atoi(buffer); - + g_free(tmp); g_free(buffer); - + return return_value; } @@ -1143,18 +1275,130 @@ gchar * h_sysfs_read_string(gchar *endpoint, gchar *entry) { gchar *tmp, *return_value; - + tmp = g_build_filename(endpoint, entry, NULL); if (!g_file_get_contents(tmp, &return_value, NULL, NULL)) { g_free(return_value); - + return_value = NULL; } else { return_value = g_strstrip(return_value); } - + g_free(tmp); - + return return_value; } +static GHashTable *_moreinfo = NULL; + +void +moreinfo_init(void) +{ + if (G_UNLIKELY(_moreinfo)) { + DEBUG("moreinfo already initialized"); + return; + } + DEBUG("initializing moreinfo"); + _moreinfo = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); +} + +void +moreinfo_shutdown(void) +{ + if (G_UNLIKELY(!_moreinfo)) { + DEBUG("moreinfo not initialized"); + return; + } + DEBUG("shutting down moreinfo"); + g_hash_table_destroy(_moreinfo); + _moreinfo = NULL; +} + +void +moreinfo_add_with_prefix(gchar *prefix, gchar *key, gchar *value) +{ + if (G_UNLIKELY(!_moreinfo)) { + DEBUG("moreinfo not initialized"); + return; + } + + if (prefix) { + gchar *hashkey = g_strconcat(prefix, ":", key, NULL); + g_hash_table_insert(_moreinfo, hashkey, value); + return; + } + + g_hash_table_insert(_moreinfo, g_strdup(key), value); +} + +void +moreinfo_add(gchar *key, gchar *value) +{ + moreinfo_add_with_prefix(NULL, key, value); +} + +static gboolean +_moreinfo_del_cb(gpointer key, gpointer value, gpointer data) +{ + return g_str_has_prefix(key, data); +} + +void +moreinfo_del_with_prefix(gchar *prefix) +{ + if (G_UNLIKELY(!_moreinfo)) { + DEBUG("moreinfo not initialized"); + return; + } + + g_hash_table_foreach_remove(_moreinfo, _moreinfo_del_cb, prefix); +} + +void +moreinfo_clear(void) +{ + if (G_UNLIKELY(!_moreinfo)) { + DEBUG("moreinfo not initialized"); + return; + } + h_hash_table_remove_all(_moreinfo); +} + +gchar * +moreinfo_lookup_with_prefix(gchar *prefix, gchar *key) +{ + if (G_UNLIKELY(!_moreinfo)) { + DEBUG("moreinfo not initialized"); + return 0; + } + + if (prefix) { + gchar *lookup_key = g_strconcat(prefix, ":", key, NULL); + gchar *result = g_hash_table_lookup(_moreinfo, lookup_key); + g_free(lookup_key); + return result; + } + + return g_hash_table_lookup(_moreinfo, key); +} + +gchar * +moreinfo_lookup(gchar *key) +{ + return moreinfo_lookup_with_prefix(NULL, key); +} + +#if !GLIB_CHECK_VERSION(2,44,0) +gboolean g_strv_contains(const gchar * const * strv, const gchar *str) { + /* g_strv_contains() requires glib>2.44 + * fallback for older versions */ + gint i = 0; + while(strv[i] != NULL) { + if (g_strcmp0(strv[i], str) == 0) + return 1; + i++; + } + return 0; +} +#endif diff --git a/vendor.c b/hardinfo/vendor.c index 0897341a..86dba97a 100644 --- a/vendor.c +++ b/hardinfo/vendor.c @@ -85,6 +85,10 @@ static const Vendor vendors[] = { {"OTi", "Ours Technology", "www.oti.com.tw"}, {"BENQ", "BenQ", "www.benq.com"}, {"Acer", "Acer", "www.acer.com"}, + {"QUANTUM", "Quantum", "www.quantum.com"}, + {"Kingston", "Kingston", "www.kingston.com"}, + {"Chicony", "Chicony", "www.chicony.com.tw"}, + {"Genius", "Genius", "www.genius.ru"}, /* BIOS manufacturers */ {"American Megatrends", "American Megatrends", "www.ami.com"}, {"Award", "Award Software International", "www.award-bios.com"}, @@ -155,7 +159,6 @@ void vendor_init(void) const gchar *vendor_get_name(const gchar * id) { GSList *vendor; - int i; if (!id) { return NULL; @@ -175,7 +178,6 @@ const gchar *vendor_get_name(const gchar * id) const gchar *vendor_get_url(const gchar * id) { GSList *vendor; - int i; if (!id) { return NULL; diff --git a/includes/alpha/processor-platform.h b/includes/alpha/processor-platform.h new file mode 100644 index 00000000..2ff3a728 --- /dev/null +++ b/includes/alpha/processor-platform.h @@ -0,0 +1,28 @@ +/* + * HardInfo - Displays System Information + * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@hardinfo.org> + * + * 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 __PROCESSOR_PLATFORM_H__ +#define __PROCESSOR_PLATFORM_H__ + +struct _Processor { + gchar *model_name; + gfloat bogomips, cpu_mhz; + gchar *strmodel; +}; + +#endif /* __PROCESSOR_PLATFORM_H__ */ diff --git a/arch/linux/common/loadavg.h b/includes/arm/processor-platform.h index ce2d8775..290b9a62 100644 --- a/arch/linux/common/loadavg.h +++ b/includes/arm/processor-platform.h @@ -16,32 +16,26 @@ * 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 __PROCESSOR_PLATFORM_H__ +#define __PROCESSOR_PLATFORM_H__ - procloadavg = fopen("/proc/loadavg", "r"); - (void)fscanf(procloadavg, "%f %f %f", &(li->load1), &(li->load5), - &(li->load15)); - fclose(procloadavg); +struct _Processor { + gchar *model_name; + gchar *decoded_name; + gchar *flags; + gfloat bogomips; - return li; -} + gfloat cpu_mhz; /* for devices.c, identical to cpukhz_max/1000 */ + gint cpukhz_max, cpukhz_min, cpukhz_cur; /* for arm/processor.c */ + gint id; -static gchar * -computer_get_formatted_loadavg() -{ - LoadInfo *li; - gchar *tmp; + gchar *cpu_implementer; + gchar *cpu_architecture; + gchar *cpu_variant; + gchar *cpu_part; + gchar *cpu_revision; - li = computer_get_loadinfo(); + gint mode; +}; - tmp = - g_strdup_printf("%.2f, %.2f, %.2f", li->load1, li->load5, - li->load15); - - g_free(li); - return tmp; -} +#endif /* __PROCESSOR_PLATFORM_H__ */ diff --git a/includes/benchmark.h b/includes/benchmark.h new file mode 100644 index 00000000..8047d5c6 --- /dev/null +++ b/includes/benchmark.h @@ -0,0 +1,33 @@ +#ifndef __BENCHMARK_H__ +#define __BENCHMARK_H__ + +#include "hardinfo.h" + +extern ProgramParameters params; + +enum { + BENCHMARK_BLOWFISH, + BENCHMARK_CRYPTOHASH, + BENCHMARK_FIB, + BENCHMARK_NQUEENS, + BENCHMARK_FFT, + BENCHMARK_RAYTRACE, + BENCHMARK_GUI, + BENCHMARK_N_ENTRIES +} BenchmarkEntries; + +void benchmark_bfish(void); +void benchmark_cryptohash(void); +void benchmark_fft(void); +void benchmark_fib(void); +void benchmark_fish(void); +void benchmark_gui(void); +void benchmark_nqueens(void); +void benchmark_raytrace(void); + +gdouble benchmark_parallel_for(guint start, guint end, + gpointer callback, gpointer callback_data); + +extern gdouble bench_results[BENCHMARK_N_ENTRIES]; + +#endif /* __BENCHMARK_H__ */
\ No newline at end of file diff --git a/binreloc.h b/includes/binreloc.h index 3bf48bc6..3bf48bc6 100644 --- a/binreloc.h +++ b/includes/binreloc.h diff --git a/blowfish.h b/includes/blowfish.h index 3f33e945..3f33e945 100644 --- a/blowfish.h +++ b/includes/blowfish.h diff --git a/callbacks.h b/includes/callbacks.h index 88165f97..d53e1861 100644 --- a/callbacks.h +++ b/includes/callbacks.h @@ -32,8 +32,14 @@ void cb_side_pane(); void cb_toolbar(); void cb_open_web_page(); void cb_open_online_docs(); +void cb_open_online_docs_context(); void cb_sync_manager(); void cb_report_bug(); void cb_donate(); +void cb_connect_to(); +void cb_manage_hosts(); +void cb_connect_host(GtkAction * action); +void cb_local_computer(); +void cb_act_as_server(); #endif /* __CALLBACKS_H__ */ diff --git a/computer.h b/includes/computer.h index b2874c69..c23acab6 100644 --- a/computer.h +++ b/includes/computer.h @@ -18,11 +18,14 @@ #ifndef __COMPUTER_H__ #define __COMPUTER_H__ +#include "hardinfo.h" + #define DB_PREFIX "/etc/" static struct { gchar *file, *codename; } distro_db[] = { + { DB_PREFIX "fatdog-version", "fatdog" }, { DB_PREFIX "debian_version", "deb" }, { DB_PREFIX "slackware-version", "slk" }, { DB_PREFIX "mandrake-release", "mdk" }, @@ -41,9 +44,12 @@ static struct { { DB_PREFIX "SuSE-release", "suse" }, { DB_PREFIX "sun-release", "sun" }, { DB_PREFIX "zenwalk-version", "zen" }, + { DB_PREFIX "DISTRO_SPECS", "ppy" }, { DB_PREFIX "puppyversion", "ppy" }, { DB_PREFIX "distro-release", "fl" }, - /* + { DB_PREFIX "vine-release", "vine" }, + { DB_PREFIX "PartedMagic-version", "pmag" }, + /* * RedHat must be the *last* one to be checked, since * some distros (like Mandrake) includes a redhat-relase * file too. @@ -116,31 +122,14 @@ struct _Computer { gchar *date_time; }; -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; -}; - struct _OperatingSystem { gchar *kernel; gchar *libc; - gchar *gcc; gchar *distrocode, *distro; gchar *hostname; gchar *language; gchar *homedir; - gchar *compiled_date; + gchar *kernel_version; gchar *languages; @@ -148,6 +137,8 @@ struct _OperatingSystem { gchar *username; gchar *boots; + + gchar *entropy_avail; }; struct _MemoryInfo { @@ -174,4 +165,26 @@ struct _MemoryInfo { continue; \ } +extern gchar *users; +extern gchar *groups; +extern gchar *fs_list; +extern GHashTable *_module_hash_table; +extern Computer *computer; +extern gchar *module_list; + +gchar *computer_get_formatted_loadavg(); +gchar *computer_get_formatted_uptime(); +gchar *computer_get_alsacards(Computer * computer); +gchar *computer_get_entropy_avail(); + +OperatingSystem *computer_get_os(void); +AlsaInfo *computer_get_alsainfo(void); +MemoryInfo *computer_get_memory(void); +UptimeInfo *computer_get_uptime(void); +DisplayInfo *computer_get_display(void); + +void scan_modules_do(void); +void scan_filesystems(void); +void scan_users_do(void); + #endif /* __COMPUTER_H__ */ diff --git a/includes/devices.h b/includes/devices.h new file mode 100644 index 00000000..09c1c36f --- /dev/null +++ b/includes/devices.h @@ -0,0 +1,95 @@ +#ifndef __DEVICES_H__ +#define __DEVICES_H__ + +#include "hardinfo.h" +#include "processor-platform.h" + +typedef struct _Processor Processor; + +#define WALK_UNTIL(x) while((*buf != '\0') && (*buf != x)) buf++ + +#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; \ + } + + +/* Processor */ +GSList *processor_scan(void); +void get_processor_strfamily(Processor * processor); +void cpu_flags_init(void); +gchar *processor_get_capabilities_from_flags(gchar * strflags); +gchar *processor_get_detailed_info(Processor * processor); +gchar *processor_get_info(GSList * processors); + +/* Memory */ +void init_memory_labels(void); +void scan_memory_do(void); + +/* Printers */ +void init_cups(void); + +/* Battery */ +void scan_battery_do(void); + +/* PCI */ +void scan_pci_do(void); + +/* Printers */ +void scan_printers_do(void); + +/* Sensors */ +void scan_sensors_do(void); +void sensors_init(void); +void sensors_shutdown(void); + +#if defined(ARCH_x86) || defined(ARCH_x86_64) +/* SPD */ +void scan_spd_do(void); +#endif /* ARCH_x86 */ + +extern gchar *battery_list; +extern gchar *input_icons; +extern gchar *input_list; +extern gchar *lginterval; +extern gchar *meminfo; +extern gchar *pci_list; +extern gchar *printer_icons; +extern gchar *printer_list; +extern gchar *sensors; +extern gchar *storage_icons; +extern gchar *storage_list; +extern gchar *usb_list; +extern GHashTable *memlabels; +extern GHashTable *_pci_devices; +extern GHashTable *sensor_compute; +extern GHashTable *sensor_labels; +extern GModule *cups; + +#if defined(ARCH_x86) || defined(ARCH_x86_64) +extern gchar *dmi_info; +extern gchar *spd_info; +#endif + +#endif /* __DEVICES_H__ */ diff --git a/includes/egg-markdown.h b/includes/egg-markdown.h new file mode 100644 index 00000000..4475b9f0 --- /dev/null +++ b/includes/egg-markdown.h @@ -0,0 +1,84 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- + * + * Copyright (C) 2008 Richard Hughes <richard@hughsie.com> + * Copyright (C) 2009 Leandro Pereira <leandro@hardinfo.org> + * + * Licensed under the GNU General Public License Version 2 + * + * 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; either version 2 of the License, or + * (at your option) any later version. + * + * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef __EGG_MARKDOWN_H +#define __EGG_MARKDOWN_H + +#include <glib-object.h> + +G_BEGIN_DECLS + +#define EGG_TYPE_MARKDOWN (egg_markdown_get_type ()) +#define EGG_MARKDOWN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), EGG_TYPE_MARKDOWN, EggMarkdown)) +#define EGG_MARKDOWN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), EGG_TYPE_MARKDOWN, EggMarkdownClass)) +#define EGG_IS_MARKDOWN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), EGG_TYPE_MARKDOWN)) +#define EGG_IS_MARKDOWN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), EGG_TYPE_MARKDOWN)) +#define EGG_MARKDOWN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), EGG_TYPE_MARKDOWN, EggMarkdownClass)) +#define EGG_MARKDOWN_ERROR (egg_markdown_error_quark ()) +#define EGG_MARKDOWN_TYPE_ERROR (egg_markdown_error_get_type ()) + +#define EGG_MARKDOWN_MAX_LINE_LENGTH 2048 + +typedef struct EggMarkdownPrivate EggMarkdownPrivate; + +typedef struct +{ + GObject parent; + EggMarkdownPrivate *priv; +} EggMarkdown; + +typedef struct +{ + GObjectClass parent_class; + void (* active_changed) (EggMarkdown *self, + gboolean active); +} EggMarkdownClass; + +typedef enum { + EGG_MARKDOWN_OUTPUT_TEXT, + EGG_MARKDOWN_OUTPUT_PANGO, + EGG_MARKDOWN_OUTPUT_HTML, + EGG_MARKDOWN_OUTPUT_UNKNOWN +} EggMarkdownOutput; + +GType egg_markdown_get_type (void); +EggMarkdown *egg_markdown_new (void); +gboolean egg_markdown_set_output (EggMarkdown *self, + EggMarkdownOutput output); +gboolean egg_markdown_set_max_lines (EggMarkdown *self, + gint max_lines); +gboolean egg_markdown_set_smart_quoting (EggMarkdown *self, + gboolean smart_quoting); +gboolean egg_markdown_set_escape (EggMarkdown *self, + gboolean escape); +gboolean egg_markdown_set_autocode (EggMarkdown *self, + gboolean autocode); +gchar *egg_markdown_parse (EggMarkdown *self, + const gchar *text); +void egg_markdown_clear (EggMarkdown *self); +gchar *egg_markdown_get_link_uri (EggMarkdown *self, + const gint link_id); + +G_END_DECLS + +#endif /* __EGG_MARKDOWN_H */ + diff --git a/expr.h b/includes/expr.h index 4bda6b72..4bda6b72 100644 --- a/expr.h +++ b/includes/expr.h diff --git a/includes/fftbench.h b/includes/fftbench.h new file mode 100644 index 00000000..7c0afc3d --- /dev/null +++ b/includes/fftbench.h @@ -0,0 +1,19 @@ +#ifndef __FFTBENCH_H__ +#define __FFTBENCH_H__ + +#include <glib.h> + +typedef struct _FFTBench FFTBench; + +struct _FFTBench { + double **a, *b, *r; + int *p; +}; + +FFTBench *fft_bench_new(void); +void fft_bench_run(FFTBench *fftbench); +void fft_bench_free(FFTBench *fftbench); + +#endif /* __FFTBENCH_H__ */ + + diff --git a/includes/guibench.h b/includes/guibench.h new file mode 100644 index 00000000..d24403bc --- /dev/null +++ b/includes/guibench.h @@ -0,0 +1,24 @@ +/* + * HardInfo - Displays System Information + * Copyright (C) 2003-2009 Leandro A. F. Pereira <leandro@hardinfo.org> + * + * 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 __GUIBENCH_H__ +#define __GUIBENCH_H__ + +double guibench(void); + +#endif /* __GUIBENCH_H__ */
\ No newline at end of file diff --git a/hardinfo.h b/includes/hardinfo.h index 9f52f633..70329ac7 100644 --- a/hardinfo.h +++ b/includes/hardinfo.h @@ -20,7 +20,19 @@ #define __HARDINFO_H__ #include <gtk/gtk.h> -#include <shell.h> +#include "config.h" +#include "shell.h" +#include "vendor.h" +#include <libintl.h> +#include <locale.h> +#define _(STRING) gettext(STRING) +#define N_(STRING) (STRING) + +typedef enum { + MODULE_FLAG_NONE = 0, + MODULE_FLAG_NO_REMOTE = 1<<0, + MODULE_FLAG_HAS_HELP = 1<<1, +} ModuleEntryFlags; typedef struct _ModuleEntry ModuleEntry; typedef struct _ModuleAbout ModuleAbout; @@ -33,10 +45,12 @@ struct _ProgramParameters { gboolean gui_running; gboolean list_modules; gboolean autoload_deps; - + gboolean run_xmlrpc_server; + gint report_format; - + gchar **use_modules; + gchar *run_benchmark; gchar *path_lib; gchar *path_data; gchar *argv0; @@ -54,6 +68,7 @@ struct _ModuleEntry { gchar *icon; gpointer callback; gpointer scan_callback; + guint32 flags; }; struct _ModuleAbout { @@ -67,7 +82,8 @@ struct _ModuleAbout { inline void remove_quotes(gchar *str); inline char *strend(gchar *str, gchar chr); inline void remove_linefeed(gchar *str); -gchar *strreplace(gchar *string, gchar *replace, gchar new_char); +gchar *strreplacechr(gchar *string, gchar *replace, gchar new_char); +gchar *strreplace(gchar *string, gchar *replace, gchar *replacement); /* Widget utility functions */ void widget_set_cursor(GtkWidget *widget, GdkCursorType cursor_type); @@ -89,13 +105,14 @@ gpointer __idle_free(gpointer ptr, gchar *f, gint l); #define idle_free(p) __idle_free(p, __FILE__, __LINE__) #endif /* RELEASE == 1 */ - gchar *find_program(gchar *program_name); inline gchar *size_human_readable(gfloat size); void nonblock_sleep(guint msec); void open_url(gchar *url); +GSList *modules_get_list(void); GSList *modules_load_selected(void); GSList *modules_load_all(void); +void module_unload_all(void); ModuleAbout *module_get_about(ShellModule *module); gchar *seconds_to_string(unsigned int seconds); @@ -103,13 +120,14 @@ gchar *h_strdup_cprintf(const gchar *format, gchar *source, ...); gchar *h_strconcat(gchar *string1, ...); void h_hash_table_remove_all (GHashTable *hash_table); - 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); +gchar *module_entry_get_field(ShellModuleEntry * module_entry, gchar * field); +gchar *module_entry_get_moreinfo(ShellModuleEntry * module_entry, gchar * field); /* BinReloc stuff */ gboolean binreloc_init(gboolean try_hardcoded); @@ -131,4 +149,22 @@ gchar *h_sysfs_read_string(gchar *endpoint, gchar *entry); #define SCAN_START() static gboolean scanned = FALSE; if (reload) scanned = FALSE; if (scanned) return; #define SCAN_END() scanned = TRUE; +#define _CONCAT(a,b) a ## b +#define CONCAT(a,b) _CONCAT(a,b) + +void moreinfo_init(void); +void moreinfo_shutdown(void); +void moreinfo_add_with_prefix(gchar *prefix, gchar *key, gchar *value); +void moreinfo_add(gchar *key, gchar *value); +void moreinfo_del_with_prefix(gchar *prefix); +void moreinfo_clear(void); +gchar *moreinfo_lookup_with_prefix(gchar *prefix, gchar *key); +gchar *moreinfo_lookup(gchar *key); + +#if !GLIB_CHECK_VERSION(2,44,0) + /* g_strv_contains() requires glib>2.44 + * fallback for older versions in hardinfo/util.c */ +gboolean g_strv_contains(const gchar * const * strv, const gchar *str); +#endif + #endif /* __HARDINFO_H__ */ diff --git a/includes/help-viewer.h b/includes/help-viewer.h new file mode 100644 index 00000000..688ff325 --- /dev/null +++ b/includes/help-viewer.h @@ -0,0 +1,43 @@ +/* + * HelpViewer - Simple Help file browser + * Copyright (C) 2009 Leandro A. F. Pereira <leandro@hardinfo.org> + * + * 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 __HELP_VIEWER_H__ +#define __HELP_VIEWER_H__ + +typedef struct _HelpViewer HelpViewer; + +struct _HelpViewer { + GtkWidget *window; + GtkWidget *status_bar; + + GtkWidget *btn_back, *btn_forward; + GtkWidget *text_view; + GtkWidget *text_search; + + gchar *current_file; + gchar *help_directory; + + GSList *back_stack, *forward_stack; +}; + +HelpViewer *help_viewer_new(const gchar *help_dir, const gchar *help_file); +void help_viewer_open_page(HelpViewer *help_viewer, const gchar *page); +void help_viewer_destroy(HelpViewer *help_viewer); + +#endif /* __HELP_VIEWER_H__ */ + diff --git a/includes/ia64/processor-platform.h b/includes/ia64/processor-platform.h new file mode 100644 index 00000000..1e30c5fc --- /dev/null +++ b/includes/ia64/processor-platform.h @@ -0,0 +1,29 @@ +/* + * HardInfo - Displays System Information + * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@hardinfo.org> + * + * 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 __PROCESSOR_PLATFORM_H__ +#define __PROCESSOR_PLATFORM_H__ + +struct _Processor { + gchar *model_name; + gchar *vendor_id; + gfloat bogomips, cpu_mhz; + gchar *strmodel; +}; + +#endif /* __PROCESSOR_PLATFORM_H__ */ diff --git a/iconcache.h b/includes/iconcache.h index 97f59a82..97f59a82 100644 --- a/iconcache.h +++ b/includes/iconcache.h diff --git a/loadgraph.h b/includes/loadgraph.h index 3a53f793..1eae976f 100644 --- a/loadgraph.h +++ b/includes/loadgraph.h @@ -24,6 +24,12 @@ #include <stdlib.h> #include <gtk/gtk.h> #include <math.h> +/*#include <libintl.h> +#include <locale.h> +#define _(STRING) gettext(STRING) +#define N_(STRING) (STRING)*/ + + typedef struct _LoadGraph LoadGraph; diff --git a/includes/m68k/processor-platform.h b/includes/m68k/processor-platform.h new file mode 100644 index 00000000..40bd2f96 --- /dev/null +++ b/includes/m68k/processor-platform.h @@ -0,0 +1,29 @@ +/* + * HardInfo - Displays System Information + * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@hardinfo.org> + * + * 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 __PROCESSOR_PLATFORM_H__ +#define __PROCESSOR_PLATFORM_H__ + +struct _Processor { + gchar *model_name; + gfloat bogomips, cpu_mhz; + + gchar *has_fpu; +}; + +#endif /* __PROCESSOR_PLATFORM_H__ */ diff --git a/includes/markdown-text-view.h b/includes/markdown-text-view.h new file mode 100644 index 00000000..648ea39c --- /dev/null +++ b/includes/markdown-text-view.h @@ -0,0 +1,70 @@ +/* + * Markdown Text View + * GtkTextView subclass that supports Markdown syntax + * + * Copyright (C) 2009 Leandro Pereira <leandro@hardinfo.org> + * Portions Copyright (C) 2007-2008 Richard Hughes <richard@hughsie.com> + * Portions Copyright (C) GTK+ Team (based on hypertext textview demo) + * + * Licensed under the GNU General Public License Version 2 + * + * 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; either version 2 of the License, or + * (at your option) any later version. + * + * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +#ifndef __MARKDOWN_TEXTVIEW_H__ +#define __MARKDOWN_TEXTVIEW_H__ + +#include <gtk/gtk.h> +#include "egg-markdown.h" + +G_BEGIN_DECLS +#define TYPE_MARKDOWN_TEXTVIEW (markdown_textview_get_type()) +#define MARKDOWN_TEXTVIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), TYPE_MARKDOWN_TEXTVIEW, MarkdownTextView)) +#define MARKDOWN_TEXTVIEW_CLASS(obj) (G_TYPE_CHECK_CLASS_CAST((obj), MARKDOWN_TEXTVIEW, MarkdownTextViewClass)) +#define IS_MARKDOWN_TEXTVIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), TYPE_MARKDOWN_TEXTVIEW)) +#define IS_MARKDOWN_TEXTVIEW_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((obj), TYPE_MARKDOWN_TEXTVIEW)) +#define MARKDOWN_TEXTVIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), TYPE_MARKDOWN_TEXTVIEW, MarkdownTextViewClass)) + +typedef struct _MarkdownTextView MarkdownTextView; +typedef struct _MarkdownTextViewClass MarkdownTextViewClass; + +struct _MarkdownTextView { + GtkTextView parent; + + EggMarkdown *markdown; + gboolean hovering_over_link; + gchar *image_directory; +}; + +struct _MarkdownTextViewClass { + GtkTextViewClass parent_class; + + void (*link_clicked) (MarkdownTextView *text_view, gchar *uri); + void (*hovering_over_link) (MarkdownTextView *text_view, gchar *uri); + void (*hovering_over_text) (MarkdownTextView *text_view); + void (*file_load_complete) (MarkdownTextView *text_view, gchar *file); +}; + +GtkWidget *markdown_textview_new(); +gboolean markdown_textview_load_file(MarkdownTextView * textview, + const gchar * file_name); +gboolean markdown_textview_set_text(MarkdownTextView * textview, + const gchar * text); +void markdown_textview_clear(MarkdownTextView * textview); +void markdown_textview_set_image_directory(MarkdownTextView * self, + const gchar * directory); +GType markdown_textview_get_type(); +G_END_DECLS + +#endif /* __MARKDOWN_TEXTVIEW_H__ */ diff --git a/menu.h b/includes/menu.h index 361b2323..3c804008 100644 --- a/menu.h +++ b/includes/menu.h @@ -20,6 +20,7 @@ #include <shell.h> + void menu_init(Shell *shell); #endif /* __MENU_H__ */ diff --git a/includes/mips/processor-platform.h b/includes/mips/processor-platform.h new file mode 100644 index 00000000..9bdae18b --- /dev/null +++ b/includes/mips/processor-platform.h @@ -0,0 +1,28 @@ +/* + * HardInfo - Displays System Information + * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@hardinfo.org> + * + * 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 __PROCESSOR_PLATFORM_H__ +#define __PROCESSOR_PLATFORM_H__ + +struct _Processor { + gchar *model_name; + gchar *vendor_id; + gfloat bogomips, cpu_mhz; +}; + +#endif /* __PROCESSOR_PLATFORM_H__ */ diff --git a/includes/network.h b/includes/network.h new file mode 100644 index 00000000..1e71126e --- /dev/null +++ b/includes/network.h @@ -0,0 +1,13 @@ +#ifndef __NETWORK_H__ +#define __NETWORK_H__ + +#include "hardinfo.h" + +extern gchar *smb_shares_list; +extern gchar *nfs_shares_list; +extern gchar *network_interfaces; +extern gchar *network_icons; + +void scan_net_interfaces(void); + +#endif /* __NETWORK_H__ */
\ No newline at end of file diff --git a/nqueens.h b/includes/nqueens.h index a4be93f0..a4be93f0 100644 --- a/nqueens.h +++ b/includes/nqueens.h diff --git a/includes/parisc/processor-platform.h b/includes/parisc/processor-platform.h new file mode 100644 index 00000000..bfe8c45c --- /dev/null +++ b/includes/parisc/processor-platform.h @@ -0,0 +1,33 @@ +/* + * HardInfo - Displays System Information + * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@hardinfo.org> + * + * 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 __PROCESSOR_PLATFORM_H__ +#define __PROCESSOR_PLATFORM_H__ + +struct _Processor { + gchar *model_name; + gchar *vendor_id; + gchar *flags; + gfloat bogomips, cpu_mhz; + + gchar *has_fpu; + + gchar *strmodel; +}; + +#endif /* __PROCESSOR_PLATFORM_H__ */ diff --git a/includes/ppc/processor-platform.h b/includes/ppc/processor-platform.h new file mode 100644 index 00000000..90095750 --- /dev/null +++ b/includes/ppc/processor-platform.h @@ -0,0 +1,29 @@ +/* + * HardInfo - Displays System Information + * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@hardinfo.org> + * + * 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 __PROCESSOR_PLATFORM_H__ +#define __PROCESSOR_PLATFORM_H__ + +struct _Processor { + gchar *model_name; + gchar *vendor_id; + gint cache_size; + gfloat bogomips, cpu_mhz; +}; + +#endif /* __PROCESSOR_PLATFORM_H__ */ diff --git a/includes/remote.h b/includes/remote.h new file mode 100644 index 00000000..6a988a3b --- /dev/null +++ b/includes/remote.h @@ -0,0 +1,29 @@ +/* + * Remote Client + * HardInfo - Displays System Information + * Copyright (C) 2003-2009 Leandro A. F. Pereira <leandro@hardinfo.org> + * + * 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 __REMOTE_H__ +#define __REMOTE_H__ + +void remote_disconnect_all(gboolean ssh); +gboolean remote_connect_host(gchar * hostname); +void connect_dialog_show(GtkWidget * parent); +void host_manager_show(GtkWidget * parent); + +#endif /* __REMOTE_H__ */ + diff --git a/report.h b/includes/report.h index 782621cb..782621cb 100644 --- a/report.h +++ b/includes/report.h diff --git a/includes/s390/processor-platform.h b/includes/s390/processor-platform.h new file mode 100644 index 00000000..511fae6b --- /dev/null +++ b/includes/s390/processor-platform.h @@ -0,0 +1,28 @@ +/* + * HardInfo - Displays System Information + * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@hardinfo.org> + * + * 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 __PROCESSOR_PLATFORM_H__ +#define __PROCESSOR_PLATFORM_H__ + +struct _Processor { + gchar *vendor_id, *model_name; + gint cache_size; + gfloat bogomips, cpu_mhz; +}; + +#endif /* __PROCESSOR_PLATFORM_H__ */ diff --git a/includes/sh/processor-platform.h b/includes/sh/processor-platform.h new file mode 100644 index 00000000..9bdae18b --- /dev/null +++ b/includes/sh/processor-platform.h @@ -0,0 +1,28 @@ +/* + * HardInfo - Displays System Information + * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@hardinfo.org> + * + * 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 __PROCESSOR_PLATFORM_H__ +#define __PROCESSOR_PLATFORM_H__ + +struct _Processor { + gchar *model_name; + gchar *vendor_id; + gfloat bogomips, cpu_mhz; +}; + +#endif /* __PROCESSOR_PLATFORM_H__ */ diff --git a/sha1.h b/includes/sha1.h index 573ff8ac..573ff8ac 100644 --- a/sha1.h +++ b/includes/sha1.h diff --git a/shell.h b/includes/shell.h index 56b7765f..2eb9e6d2 100644 --- a/shell.h +++ b/includes/shell.h @@ -19,12 +19,15 @@ #define __SHELL_H__ #include <gtk/gtk.h> -#include <loadgraph.h> + +#include "loadgraph.h" +#include "help-viewer.h" typedef struct _Shell Shell; typedef struct _ShellTree ShellTree; typedef struct _ShellInfoTree ShellInfoTree; typedef struct _ShellNote ShellNote; +typedef struct _ShellSummary ShellSummary; typedef struct _ShellModule ShellModule; typedef struct _ShellModuleMethod ShellModuleMethod; @@ -49,13 +52,15 @@ typedef enum { SHELL_VIEW_LOAD_GRAPH, SHELL_VIEW_PROGRESS, SHELL_VIEW_PROGRESS_DUAL, + SHELL_VIEW_SUMMARY, SHELL_VIEW_N_VIEWS } ShellViewType; typedef enum { TREE_COL_PBUF, TREE_COL_NAME, - TREE_COL_DATA, + TREE_COL_MODULE_ENTRY, + TREE_COL_MODULE, TREE_COL_SEL, TREE_NCOL } ShellTreeColumns; @@ -74,23 +79,38 @@ typedef enum { struct _Shell { GtkWidget *window, *vbox; GtkWidget *status, *progress; + GtkWidget *remote_label; GtkWidget *notebook; GtkWidget *hpaned, *vpaned; ShellTree *tree; ShellInfoTree *info, *moreinfo; + ShellModule *selected_module; ShellModuleEntry *selected; ShellNote *note; + ShellSummary *summary; LoadGraph *loadgraph; GtkActionGroup *action_group; GtkUIManager *ui_manager; + GSList *merge_ids; ShellViewType view_type; gboolean normalize_percentage; gint _pulses; ShellOrderType _order_type; + + GKeyFile *hosts; + HelpViewer *help_viewer; +}; + +struct _ShellSummary { + GtkWidget *header; + GtkWidget *scroll; + GtkWidget *view; + + GSList *items; }; struct _ShellTree { @@ -112,7 +132,7 @@ struct _ShellInfoTree { }; struct _ShellNote { - GtkWidget *frame; + GtkWidget *event_box; GtkWidget *label; }; @@ -120,6 +140,10 @@ struct _ShellModule { gchar *name; GdkPixbuf *icon; GModule *dll; + + gpointer (*aboutfunc) (); + gchar *(*summaryfunc) (); + void (*deinit) (); guchar weight; @@ -134,15 +158,17 @@ struct _ShellModuleMethod { struct _ShellModuleEntry { gchar *name; GdkPixbuf *icon; + gchar *icon_file; gboolean selected; gint number; + guint32 flags; gchar *(*func) (); void (*scan_func) (); gchar *(*fieldfunc) (gchar * entry); - gchar *(*morefunc) (gchar * entry); - gchar *(*notefunc) (gint entry); + gchar *(*morefunc) (gchar * entry); + gchar *(*notefunc) (gint entry); }; struct _ShellFieldUpdate { @@ -182,4 +208,18 @@ void shell_status_set_enabled(gboolean setting); void shell_view_set_enabled(gboolean setting); +void shell_clear_timeouts(Shell *shell); +void shell_clear_tree_models(Shell *shell); +void shell_clear_field_updates(void); +void shell_set_title(Shell *shell, char *subtitle); + +void shell_add_modules_to_gui(gpointer _shell_module, gpointer _shell_tree); + +void shell_save_hosts_file(void); +void shell_update_remote_menu(void); + +void shell_set_remote_label(Shell *shell, gchar *label); + #endif /* __SHELL_H__ */ + + diff --git a/socket.h b/includes/socket.h index 7c44837e..7c44837e 100644 --- a/socket.h +++ b/includes/socket.h diff --git a/includes/sparc/processor-platform.h b/includes/sparc/processor-platform.h new file mode 100644 index 00000000..bcf4c782 --- /dev/null +++ b/includes/sparc/processor-platform.h @@ -0,0 +1,28 @@ +/* + * HardInfo - Displays System Information + * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@hardinfo.org> + * + * 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 __PROCESSOR_PLATFORM_H__ +#define __PROCESSOR_PLATFORM_H__ + +struct _Processor { + gchar *model_name; + gchar *has_fpu; + gfloat cpu_mhz; +}; + +#endif /* __PROCESSOR_PLATFORM_H__ */ diff --git a/includes/ssh-conn.h b/includes/ssh-conn.h new file mode 100644 index 00000000..b1b0a9ca --- /dev/null +++ b/includes/ssh-conn.h @@ -0,0 +1,66 @@ +/* + Remote Client + HardInfo - Displays System Information + Copyright (C) 2003-2009 Leandro A. F. Pereira <leandro@hardinfo.org> + + Based on ssh-method.c from GnomeVFS + Copyright (C) 1999 Free Software Foundation + Original author: Ian McKellar <yakk@yakk.net> + + The Gnome Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The Gnome Library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the Gnome Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ +#ifndef __SSH_CONN_H__ +#define __SSH_CONN_H__ + +#include "config.h" +#ifdef HAS_LIBSOUP +#include <libsoup/soup.h> + +typedef struct _SSHConn SSHConn; + +typedef enum { + SSH_CONN_OK, + SSH_CONN_NO_URI, + SSH_CONN_UNKNOWN_PROTOCOL, + SSH_CONN_UNKNOWN_ERROR, + SSH_CONN_CANNOT_SPAWN_SSH, + SSH_CONN_BAD_PARAMS, + SSH_CONN_PERMISSION_DENIED, + SSH_CONN_HOST_KEY_CHECK_FAIL, + SSH_CONN_REFUSED, + SSH_CONN_INVALID_USER_PASS, +} SSHConnResponse; + +struct _SSHConn { + SoupURI *uri; + int fd_read, fd_write, fd_error; + GPid pid; + gchar *askpass_path; + + gint exit_status; +}; + +SSHConnResponse ssh_new(SoupURI * uri, + SSHConn ** conn_return, gchar * command); +void ssh_close(SSHConn * conn); + +int ssh_write(SSHConn * conn, + gconstpointer buffer, gint num_bytes, gint * bytes_written); +int ssh_read(gint fd, gpointer buffer, gint num_bytes, gint * bytes_read); + +const char *ssh_conn_errors[10]; +#endif /* HAS_LIBSOUP */ +#endif /* __SSH_CONN_H__ */ diff --git a/stock.h b/includes/stock.h index f8c61275..706e5c51 100644 --- a/stock.h +++ b/includes/stock.h @@ -25,6 +25,7 @@ #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" +#define HI_STOCK_SERVER "hi-stock-server" void stock_icons_init(void); void stock_icon_register(gchar *filename, gchar *stock_id); diff --git a/syncmanager.h b/includes/syncmanager.h index 360c012a..ae0ed267 100644 --- a/syncmanager.h +++ b/includes/syncmanager.h @@ -35,7 +35,8 @@ struct _SyncEntry { }; void sync_manager_add_entry(SyncEntry *entry); -void sync_manager_show(void); +void sync_manager_clear_entries(void); +void sync_manager_show(GtkWidget *parent); gint sync_manager_count_entries(void); #endif /* __SYNCMANAGER_H__ */ diff --git a/includes/test-utils.h b/includes/test-utils.h new file mode 100644 index 00000000..21cac6b5 --- /dev/null +++ b/includes/test-utils.h @@ -0,0 +1,24 @@ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "libsoup/soup-types.h" + +void test_init (int argc, char **argv, GOptionEntry *entries); +void test_cleanup (void); + +extern int debug_level, errors; +extern gboolean expect_warning; +void debug_printf (int level, const char *format, ...) G_GNUC_PRINTF (2, 3); + +#ifdef HAVE_APACHE +void apache_init (void); +void apache_cleanup (void); +#endif + +SoupSession *soup_test_session_new (GType type, ...); +void soup_test_session_abort_unref (SoupSession *session); + +SoupServer *soup_test_server_new (gboolean in_own_thread); +SoupServer *soup_test_server_new_ssl (gboolean in_own_thread); + diff --git a/uidefs.h b/includes/uidefs.h index 333c9ce5..3bb1c88f 100644 --- a/uidefs.h +++ b/includes/uidefs.h @@ -1,40 +1,47 @@ #ifndef __UIDEFS_H__ #define __UIDEFS_H__ +#include "config.h" + +#if RELEASE +#define DEBUG_TOOLBAR_ITEMS +#else /* !RELEASE */ +#define DEBUG_TOOLBAR_ITEMS "<separator/>" \ + "<toolitem name=\"ReportBug\" action=\"ReportBugAction\" />" +#endif /* !RELEASE */ + +#ifdef HAS_LIBSOUP +#define SYNC_MANAGER_ITEMS " <separator/>" \ +" <menuitem name=\"SyncManager\" action=\"SyncManagerAction\" />" + +#else /* !HAS_LIBSOUP */ +#define SYNC_MANAGER_ITEMS +#endif /* !HAS_LIBSOUP */ + char *uidefs_str = "<ui>" \ " <menubar>" \ " <menu name=\"InformationMenu\" action=\"InformationMenuAction\">" \ -/*" <menuitem name=\"Open\" action=\"OpenAction\" />" \ -" <menuitem name=\"ConnectTo\" action=\"ConnectToAction\" />" \ -" <separator/>" \*/ " <menuitem name=\"Report\" action=\"ReportAction\" />" \ -/*" <separator/>" \ */ " <menuitem name=\"Copy\" action=\"CopyAction\" />" \ +SYNC_MANAGER_ITEMS /* * Save Image is not ready for prime time. Yet. * "<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/>"\ " <separator name=\"LastSep\"/>" \ +" <menuitem name=\"Refresh\" action=\"RefreshAction\"/>" \ " </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>" \ @@ -45,8 +52,10 @@ char *uidefs_str = "<ui>" \ " <placeholder name=\"ToolItems\">" \ " <toolitem name=\"Refresh\" action=\"RefreshAction\"/>" \ " <separator/>" \ -" <toolitem name=\"Copy\" action=\"CopyAction\"/>" \ " <toolitem name=\"Report\" action=\"ReportAction\"/>" \ +" <toolitem name=\"Copy\" action=\"CopyAction\"/>" \ +" <separator/>" \ +DEBUG_TOOLBAR_ITEMS \ " </placeholder>" \ " </toolbar>" \ "</ui>"; diff --git a/vendor.h b/includes/vendor.h index 778e2ea3..778e2ea3 100644 --- a/vendor.h +++ b/includes/vendor.h diff --git a/includes/x86/processor-platform.h b/includes/x86/processor-platform.h new file mode 100644 index 00000000..bc27b620 --- /dev/null +++ b/includes/x86/processor-platform.h @@ -0,0 +1,56 @@ +/* + * HardInfo - Displays System Information + * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@hardinfo.org> + * + * 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 __PROCESSOR_PLATFORM_H__ +#define __PROCESSOR_PLATFORM_H__ + +typedef struct _ProcessorCache ProcessorCache; + +struct _ProcessorCache { + gint level; + gint number_of_sets; + gint physical_line_partition; + gint size; + gchar *type; + gint ways_of_associativity; +}; + +struct _Processor { + gchar *model_name; + gchar *vendor_id; + gchar *flags; + gchar *bugs; + gchar *pm; /* power management features */ + gint cache_size; + gfloat bogomips; + + gfloat cpu_mhz; /* for devices.c, identical to cpukhz_max/1000 */ + gint cpukhz_max, cpukhz_min, cpukhz_cur; /* for arm/processor.c */ + + gchar *has_fpu; + gchar *bug_fdiv, *bug_hlt, *bug_f00f, *bug_coma; + + gint model, family, stepping; + gchar *strmodel; + + gint id; + + GSList *cache; +}; + +#endif /* __PROCESSOR_PLATFORM_H__ */ diff --git a/includes/x86_64 b/includes/x86_64 new file mode 120000 index 00000000..de1ff735 --- /dev/null +++ b/includes/x86_64 @@ -0,0 +1 @@ +./x86
\ No newline at end of file diff --git a/includes/xmlrpc-client.h b/includes/xmlrpc-client.h new file mode 100644 index 00000000..32fad08c --- /dev/null +++ b/includes/xmlrpc-client.h @@ -0,0 +1,43 @@ +/* + * XMLRPC Client + * HardInfo - Displays System Information + * Copyright (C) 2003-2009 Leandro A. F. Pereira <leandro@hardinfo.org> + * + * 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 __XMLRPC_CLIENT_H__ +#define __XMLRPC_CLIENT_H__ + +#include "config.h" + +#ifdef HAS_LIBSOUP +#include <libsoup/soup.h> + +void xmlrpc_init(void); +gint xmlrpc_get_integer(gchar *addr, + gchar *method, + const gchar *param_types, + ...); +gchar *xmlrpc_get_string(gchar *addr, + gchar *method, + const gchar *param_types, + ...); +GValueArray *xmlrpc_get_array(gchar *addr, + gchar *method, + const gchar *param_types, + ...); +#endif /* HAS_LIBSOUP */ + +#endif /* __XMLRPC_CLIENT_H__ */ diff --git a/includes/xmlrpc-server.h b/includes/xmlrpc-server.h new file mode 100644 index 00000000..e608b711 --- /dev/null +++ b/includes/xmlrpc-server.h @@ -0,0 +1,25 @@ +/* + * HardInfo - Displays System Information + * Copyright (C) 2003-2009 Leandro A. F. Pereira <leandro@hardinfo.org> + * + * 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 __XMLRPC_SERVER_H__ +#define __XMLRPC_SERVER_H__ + +void xmlrpc_server_start(GMainLoop *main_loop); +void xmlrpc_server_init(void); + +#endif /* __XMLRPC_SERVER_H__ */ + diff --git a/modules/benchmark.c b/modules/benchmark.c new file mode 100644 index 00000000..94997df8 --- /dev/null +++ b/modules/benchmark.c @@ -0,0 +1,663 @@ +/* + * HardInfo - Displays System Information + * Copyright (C) 2003-2009 Leandro A. F. Pereira <leandro@hardinfo.org> + * + * 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 <hardinfo.h> +#include <iconcache.h> +#include <shell.h> +#include <config.h> +#include <syncmanager.h> + +#include <sys/time.h> +#include <sys/resource.h> + +#include <sys/types.h> +#include <signal.h> + +#include "benchmark.h" + +void scan_fft(gboolean reload); +void scan_raytr(gboolean reload); +void scan_bfsh(gboolean reload); +void scan_cryptohash(gboolean reload); +void scan_fib(gboolean reload); +void scan_nqueens(gboolean reload); +void scan_gui(gboolean reload); + +gchar *callback_fft(); +gchar *callback_raytr(); +gchar *callback_bfsh(); +gchar *callback_fib(); +gchar *callback_cryptohash(); +gchar *callback_nqueens(); +gchar *callback_gui(); + +static ModuleEntry entries[] = { + {N_("CPU Blowfish"), "blowfish.png", callback_bfsh, scan_bfsh, MODULE_FLAG_NONE}, + {N_("CPU CryptoHash"), "cryptohash.png", callback_cryptohash, scan_cryptohash, MODULE_FLAG_NONE}, + {N_("CPU Fibonacci"), "nautilus.png", callback_fib, scan_fib, MODULE_FLAG_NONE}, + {N_("CPU N-Queens"), "nqueens.png", callback_nqueens, scan_nqueens, MODULE_FLAG_NONE}, + {N_("FPU FFT"), "fft.png", callback_fft, scan_fft, MODULE_FLAG_NONE}, + {N_("FPU Raytracing"), "raytrace.png", callback_raytr, scan_raytr, MODULE_FLAG_NONE}, + {N_("GPU Drawing"), "module.png", callback_gui, scan_gui, MODULE_FLAG_NO_REMOTE}, + {NULL} +}; + +static gboolean sending_benchmark_results = FALSE; + +typedef struct _ParallelBenchTask ParallelBenchTask; + +struct _ParallelBenchTask { + gint thread_number; + guint start, end; + gpointer data, callback; +}; + +static gpointer benchmark_parallel_for_dispatcher(gpointer data) +{ + ParallelBenchTask *pbt = (ParallelBenchTask *)data; + gpointer (*callback)(unsigned int start, unsigned int end, void *data, gint thread_number); + gpointer return_value = NULL; + + if ((callback = pbt->callback)) { + DEBUG("this is thread %p; items %d -> %d, data %p", g_thread_self(), + pbt->start, pbt->end, pbt->data); + return_value = callback(pbt->start, pbt->end, pbt->data, pbt->thread_number); + DEBUG("this is thread %p; return value is %p", g_thread_self(), return_value); + } else { + DEBUG("this is thread %p; callback is NULL and it should't be!", g_thread_self()); + } + + g_free(pbt); + + return return_value; +} + +gdouble benchmark_parallel_for(guint start, guint end, + gpointer callback, gpointer callback_data) { + gchar *temp; + guint n_cores, iter_per_core, iter, thread_number = 0; + gdouble elapsed_time; + GSList *threads = NULL, *t; + GTimer *timer; + + timer = g_timer_new(); + + temp = module_call_method("devices::getProcessorCount"); + n_cores = temp ? atoi(temp) : 1; + g_free(temp); + + while (n_cores > 0) { + iter_per_core = (end - start) / n_cores; + + if (iter_per_core == 0) { + DEBUG("not enough items per core; disabling one"); + n_cores--; + } else { + break; + } + } + + DEBUG("processor has %d cores; processing %d elements (%d per core)", + n_cores, (end - start), iter_per_core); + + g_timer_start(timer); + for (iter = start; iter < end; iter += iter_per_core) { + ParallelBenchTask *pbt = g_new0(ParallelBenchTask, 1); + GThread *thread; + + DEBUG("launching thread %d", 1 + (iter / iter_per_core)); + + pbt->thread_number = thread_number++; + pbt->start = iter == 0 ? 0 : iter; + pbt->end = iter + iter_per_core - 1; + pbt->data = callback_data; + pbt->callback = callback; + + if (pbt->end > end) + pbt->end = end; + + thread = g_thread_new("dispatcher", + (GThreadFunc)benchmark_parallel_for_dispatcher, pbt); + threads = g_slist_prepend(threads, thread); + + DEBUG("thread %d launched as context %p", thread_number, thread); + } + + DEBUG("waiting for all threads to finish"); + for (t = threads; t; t = t->next) { + DEBUG("waiting for thread with context %p", t->data); + g_thread_join((GThread *)t->data); + } + + g_timer_stop(timer); + elapsed_time = g_timer_elapsed(timer, NULL); + + g_slist_free(threads); + g_timer_destroy(timer); + + DEBUG("finishing; all threads took %f seconds to finish", elapsed_time); + + return elapsed_time; +} + +static gchar *clean_cpuname(gchar *cpuname) +{ + gchar *ret = NULL, *tmp; + gchar *remove[] = { + "(R)", "(r)", "(TM)", "(tm)", "Processor", + "Technology", "processor", "CPU", + "cpu", "Genuine", "Authentic", NULL + }; + gint i; + + ret = g_strdup(cpuname); + for (i = 0; remove[i]; i++) { + tmp = strreplace(ret, remove[i], ""); + g_free(ret); + ret = tmp; + } + + ret = strend(ret, '@'); + ret = g_strstrip(ret); + + tmp = g_strdup(ret); + g_free(ret); + + return tmp; +} + +static gchar *__benchmark_include_results(gdouble result, + const gchar * benchmark, + ShellOrderType order_type) +{ + GKeyFile *conf; + gchar **machines; + gchar *path, *results = g_strdup(""), *return_value, *processor_frequency; + int i; + + conf = g_key_file_new(); + + 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, *cleaned_machine; + + value = g_key_file_get_value(conf, benchmark, machines[i], NULL); + cleaned_machine = clean_cpuname(machines[i]); + results = h_strconcat(results, cleaned_machine, "=", value, "\n", NULL); + + g_free(value); + g_free(cleaned_machine); + } + + g_strfreev(machines); + g_free(path); + g_key_file_free(conf); + + if (result > 0.0f) { + processor_frequency = module_call_method("devices::getProcessorFrequency"); + return_value = g_strdup_printf(_("[$ShellParam$]\n" + "Zebra=1\n" + "OrderType=%d\n" + "ViewType=3\n" + "ColumnTitle$Extra1=CPU Clock\n" + "ColumnTitle$Progress=Results\n" + "ColumnTitle$TextValue=CPU\n" + "ShowColumnHeaders=true\n" + "[%s]\n" + "<big><b>This Machine</b></big>=%.3f|%s MHz\n" + "%s"), order_type, benchmark, result, processor_frequency, results); + g_free(processor_frequency); + } else { + return_value = g_strdup_printf(_("[$ShellParam$]\n" + "Zebra=1\n" + "OrderType=%d\n" + "ViewType=3\n" + "ColumnTitle$Extra1=CPU Clock\n" + "ColumnTitle$Progress=Results\n" + "ColumnTitle$TextValue=CPU\n" + "ShowColumnHeaders=true\n" + "[%s]\n" + "%s"), order_type, benchmark, results); + } + return return_value; +} + + + +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); +} + +gdouble bench_results[BENCHMARK_N_ENTRIES]; + +gchar *callback_gui() +{ + return benchmark_include_results_reverse(bench_results[BENCHMARK_GUI], + "GPU Drawing"); +} + +gchar *callback_fft() +{ + return benchmark_include_results(bench_results[BENCHMARK_FFT], + "FPU FFT"); +} + +gchar *callback_nqueens() +{ + return benchmark_include_results(bench_results[BENCHMARK_NQUEENS], + "CPU N-Queens"); +} + +gchar *callback_raytr() +{ + return benchmark_include_results(bench_results[BENCHMARK_RAYTRACE], + "FPU Raytracing"); +} + +gchar *callback_bfsh() +{ + return benchmark_include_results(bench_results[BENCHMARK_BLOWFISH], + "CPU Blowfish"); +} + +gchar *callback_cryptohash() +{ + return benchmark_include_results_reverse(bench_results[BENCHMARK_CRYPTOHASH], + "CPU CryptoHash"); +} + +gchar *callback_fib() +{ + return benchmark_include_results(bench_results[BENCHMARK_FIB], + "CPU Fibonacci"); +} + +typedef struct _BenchmarkDialog BenchmarkDialog; +struct _BenchmarkDialog { + GtkWidget *dialog; + double result; +}; + +static gboolean do_benchmark_handler(GIOChannel *source, + GIOCondition condition, + gpointer data) +{ + BenchmarkDialog *bench_dialog = (BenchmarkDialog*)data; + GIOStatus status; + gchar *result; + gchar *buffer; + float float_result; + + status = g_io_channel_read_line(source, &result, NULL, NULL, NULL); + if (status != G_IO_STATUS_NORMAL) { + DEBUG("error while reading benchmark result"); + + bench_dialog->result = -1.0f; + gtk_widget_destroy(bench_dialog->dialog); + return FALSE; + } + + float_result = strtof(result, &buffer); + if (buffer == result) { + DEBUG("error while converting floating point value"); + bench_dialog->result = -1.0f; + } else { + bench_dialog->result = float_result; + } + + gtk_widget_destroy(bench_dialog->dialog); + g_free(result); + + return FALSE; +} + +static void do_benchmark(void (*benchmark_function)(void), int entry) +{ + int old_priority = 0; + + if (params.gui_running && !sending_benchmark_results) { + gchar *argv[] = { params.argv0, "-b", entries[entry].name, + "-m", "benchmark.so", "-a", NULL }; + GPid bench_pid; + gint bench_stdout; + GtkWidget *bench_dialog; + GtkWidget *bench_image; + BenchmarkDialog *benchmark_dialog; + GSpawnFlags spawn_flags = G_SPAWN_STDERR_TO_DEV_NULL; + gchar *bench_status; + + bench_status = g_strdup_printf(_("Benchmarking: <b>%s</b>."), entries[entry].name); + + shell_view_set_enabled(FALSE); + shell_status_update(bench_status); + + g_free(bench_status); + + bench_image = icon_cache_get_image("benchmark.png"); + gtk_widget_show(bench_image); + + bench_dialog = gtk_message_dialog_new(GTK_WINDOW(shell_get_main_shell()->window), + GTK_DIALOG_MODAL, + GTK_MESSAGE_INFO, + GTK_BUTTONS_NONE, + _("Benchmarking. Please do not move your mouse " \ + "or press any keys.")); + g_object_set_data(G_OBJECT(bench_dialog), "result", "0.0"); + gtk_dialog_add_buttons(GTK_DIALOG(bench_dialog), + _("Cancel"), GTK_RESPONSE_ACCEPT, NULL); + gtk_message_dialog_set_image(GTK_MESSAGE_DIALOG(bench_dialog), bench_image); + + while (gtk_events_pending()) { + gtk_main_iteration(); + } + + benchmark_dialog = g_new0(BenchmarkDialog, 1); + benchmark_dialog->dialog = bench_dialog; + benchmark_dialog->result = -1.0f; + + if (!g_path_is_absolute(params.argv0)) { + spawn_flags |= G_SPAWN_SEARCH_PATH; + } + + if (g_spawn_async_with_pipes(NULL, + argv, NULL, + spawn_flags, + NULL, NULL, + &bench_pid, + NULL, &bench_stdout, NULL, + NULL)) { + GIOChannel *channel; + guint watch_id; + + DEBUG("spawning benchmark; pid=%d", bench_pid); + + channel = g_io_channel_unix_new(bench_stdout); + watch_id = g_io_add_watch(channel, G_IO_IN, do_benchmark_handler, + benchmark_dialog); + + switch (gtk_dialog_run(GTK_DIALOG(bench_dialog))) { + case GTK_RESPONSE_NONE: + DEBUG("benchmark finished"); + break; + case GTK_RESPONSE_ACCEPT: + DEBUG("cancelling benchmark"); + + gtk_widget_destroy(bench_dialog); + g_source_remove(watch_id); + kill(bench_pid, SIGINT); + } + + bench_results[entry] = benchmark_dialog->result; + + g_io_channel_unref(channel); + shell_view_set_enabled(TRUE); + shell_status_set_enabled(TRUE); + g_free(benchmark_dialog); + + shell_status_update(_("Done.")); + + return; + } + + gtk_widget_destroy(bench_dialog); + g_free(benchmark_dialog); + shell_status_set_enabled(TRUE); + shell_status_update(_("Done.")); + } + + setpriority(PRIO_PROCESS, 0, -20); + benchmark_function(); + setpriority(PRIO_PROCESS, 0, old_priority); +} + +void scan_gui(gboolean reload) +{ + SCAN_START(); + + if (params.run_benchmark) { + int argc = 0; + + ui_init(&argc, NULL); + } + + if (params.gui_running || params.run_benchmark) { + do_benchmark(benchmark_gui, BENCHMARK_GUI); + } else { + bench_results[BENCHMARK_GUI] = 0.0f; + } + SCAN_END(); +} + +void scan_fft(gboolean reload) +{ + SCAN_START(); + do_benchmark(benchmark_fft, BENCHMARK_FFT); + SCAN_END(); +} + +void scan_nqueens(gboolean reload) +{ + SCAN_START(); + do_benchmark(benchmark_nqueens, BENCHMARK_NQUEENS); + SCAN_END(); +} + +void scan_raytr(gboolean reload) +{ + SCAN_START(); + do_benchmark(benchmark_raytrace, BENCHMARK_RAYTRACE); + SCAN_END(); +} + +void scan_bfsh(gboolean reload) +{ + SCAN_START(); + do_benchmark(benchmark_fish, BENCHMARK_BLOWFISH); + SCAN_END(); +} + +void scan_cryptohash(gboolean reload) +{ + SCAN_START(); + do_benchmark(benchmark_cryptohash, BENCHMARK_CRYPTOHASH); + SCAN_END(); +} + +void scan_fib(gboolean reload) +{ + SCAN_START(); + do_benchmark(benchmark_fib, BENCHMARK_FIB); + SCAN_END(); +} + +const gchar *hi_note_func(gint entry) +{ + switch (entry) { + case BENCHMARK_CRYPTOHASH: + return _("Results in MiB/second. Higher is better."); + + case BENCHMARK_GUI: + return _("Results in HIMarks. Higher is better."); + + case BENCHMARK_FFT: + case BENCHMARK_RAYTRACE: + case BENCHMARK_BLOWFISH: + case BENCHMARK_FIB: + case BENCHMARK_NQUEENS: + return _("Results in seconds. Lower is better."); + } + + return NULL; +} + +gchar *hi_module_get_name(void) +{ + return g_strdup(_("Benchmarks")); +} + +guchar hi_module_get_weight(void) +{ + return 240; +} + +ModuleEntry *hi_module_get_entries(void) +{ + return entries; +} + +ModuleAbout *hi_module_get_about(void) +{ + static ModuleAbout ma[] = { + { + .author = "Leandro A. F. Pereira", + .description = N_("Perform tasks and compare with other systems"), + .version = VERSION, + .license = "GNU GPL version 2"} + }; + + return ma; +} + +static gchar *get_benchmark_results() +{ + gint i; + void (*scan_callback) (gboolean rescan); + + sending_benchmark_results = TRUE; + + gchar *machine = module_call_method("devices::getProcessorName"); + gchar *machineclock = module_call_method("devices::getProcessorFrequency"); + gchar *machineram = module_call_method("devices::getMemoryTotal"); + gchar *result = g_strdup_printf("[param]\n" + "machine=%s\n" + "machineclock=%s\n" + "machineram=%s\n" + "nbenchmarks=%zu\n", + machine, + machineclock, + machineram, + G_N_ELEMENTS(entries) - 1); + for (i = 0; i < G_N_ELEMENTS(entries); i++) { + scan_callback = entries[i].scan_callback; + if (!scan_callback) + continue; + + if (bench_results[i] < 0.0) { + /* benchmark was cancelled */ + scan_callback(TRUE); + } else { + scan_callback(FALSE); + } + + result = h_strdup_cprintf("[bench%d]\n" + "name=%s\n" + "value=%f\n", + result, + i, entries[i].name, bench_results[i]); + } + + g_free(machine); + g_free(machineclock); + g_free(machineram); + + sending_benchmark_results = FALSE; + + return result; +} + +static gchar *run_benchmark(gchar *name) +{ + int i; + + DEBUG("name = %s", name); + + for (i = 0; entries[i].name; i++) { + if (g_str_equal(entries[i].name, name)) { + void (*scan_callback)(gboolean rescan); + + if ((scan_callback = entries[i].scan_callback)) { + scan_callback(FALSE); + + return g_strdup_printf("%f", bench_results[i]); + } + } + } + + return NULL; +} + +ShellModuleMethod *hi_exported_methods(void) +{ + static ShellModuleMethod m[] = { + {"runBenchmark", run_benchmark}, + {NULL} + }; + + return m; +} + +void hi_module_init(void) +{ + static SyncEntry se[] = { + { + .fancy_name = N_("Send benchmark results"), + .name = "SendBenchmarkResults", + .save_to = NULL, + .get_data = get_benchmark_results}, + { + .fancy_name = N_("Receive benchmark results"), + .name = "RecvBenchmarkResults", + .save_to = "benchmark.conf", + .get_data = NULL} + }; + + sync_manager_add_entry(&se[0]); + sync_manager_add_entry(&se[1]); + + int i; + for (i = 0; i < G_N_ELEMENTS(entries) - 1; i++) { + bench_results[i] = -1.0f; + } +} + +gchar **hi_module_get_dependencies(void) +{ + static gchar *deps[] = { "devices.so", NULL }; + + return deps; +} + diff --git a/blowfish.c b/modules/benchmark/blowfish.c index 034315ab..feadc430 100644 --- a/blowfish.c +++ b/modules/benchmark/blowfish.c @@ -1,71 +1,73 @@ -/*
-blowfish.c: C implementation of the Blowfish algorithm.
-
-Copyright (C) 1997 by Paul Kocher
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-This library 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
-Lesser General Public License for more details.
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-
-
-
-COMMENTS ON USING THIS CODE:
-
-Normal usage is as follows:
- [1] Allocate a BLOWFISH_CTX. (It may be too big for the stack.)
- [2] Call Blowfish_Init with a pointer to your BLOWFISH_CTX, a pointer to
- the key, and the number of bytes in the key.
- [3] To encrypt a 64-bit block, call Blowfish_Encrypt with a pointer to
- BLOWFISH_CTX, a pointer to the 32-bit left half of the plaintext
- and a pointer to the 32-bit right half. The plaintext will be
- overwritten with the ciphertext.
- [4] Decryption is the same as encryption except that the plaintext and
- ciphertext are reversed.
-
-Warning #1: The code does not check key lengths. (Caveat encryptor.)
-Warning #2: Beware that Blowfish keys repeat such that "ab" = "abab".
-Warning #3: It is normally a good idea to zeroize the BLOWFISH_CTX before
- freeing it.
-Warning #4: Endianness conversions are the responsibility of the caller.
- (To encrypt bytes on a little-endian platforms, you'll probably want
- to swap bytes around instead of just casting.)
-Warning #5: Make sure to use a reasonable mode of operation for your
- application. (If you don't know what CBC mode is, see Warning #7.)
-Warning #6: This code is susceptible to timing attacks.
-Warning #7: Security engineering is risky and non-intuitive. Have someone
- check your work. If you don't know what you are doing, get help.
-
-
-This is code is fast enough for most applications, but is not optimized for
-speed.
-
-If you require this code under a license other than LGPL, please ask. (I
-can be located using your favorite search engine.) Unfortunately, I do not
-have time to provide unpaid support for everyone who uses this code.
-
- -- Paul Kocher
-*/
-
-#include "blowfish.h"
-
-#define N 16
+/* +blowfish.c: C implementation of the Blowfish algorithm. + +Copyright (C) 1997 by Paul Kocher + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. +This library 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 +Lesser General Public License for more details. +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + + + +COMMENTS ON USING THIS CODE: + +Normal usage is as follows: + [1] Allocate a BLOWFISH_CTX. (It may be too big for the stack.) + [2] Call Blowfish_Init with a pointer to your BLOWFISH_CTX, a pointer to + the key, and the number of bytes in the key. + [3] To encrypt a 64-bit block, call Blowfish_Encrypt with a pointer to + BLOWFISH_CTX, a pointer to the 32-bit left half of the plaintext + and a pointer to the 32-bit right half. The plaintext will be + overwritten with the ciphertext. + [4] Decryption is the same as encryption except that the plaintext and + ciphertext are reversed. + +Warning #1: The code does not check key lengths. (Caveat encryptor.) +Warning #2: Beware that Blowfish keys repeat such that "ab" = "abab". +Warning #3: It is normally a good idea to zeroize the BLOWFISH_CTX before + freeing it. +Warning #4: Endianness conversions are the responsibility of the caller. + (To encrypt bytes on a little-endian platforms, you'll probably want + to swap bytes around instead of just casting.) +Warning #5: Make sure to use a reasonable mode of operation for your + application. (If you don't know what CBC mode is, see Warning #7.) +Warning #6: This code is susceptible to timing attacks. +Warning #7: Security engineering is risky and non-intuitive. Have someone + check your work. If you don't know what you are doing, get help. + + +This is code is fast enough for most applications, but is not optimized for +speed. + +If you require this code under a license other than LGPL, please ask. (I +can be located using your favorite search engine.) Unfortunately, I do not +have time to provide unpaid support for everyone who uses this code. + + -- Paul Kocher +*/ + +#include "hardinfo.h" +#include "benchmark.h" +#include "blowfish.h" + +#define N 16 static const unsigned long ORIG_P[16 + 2] = { 0x243F6A88L, 0x85A308D3L, 0x13198A2EL, 0x03707344L, 0xA4093822L, 0x299F31D0L, 0x082EFA98L, 0xEC4E6C89L, 0x452821E6L, 0x38D01377L, 0xBE5466CFL, 0x34E90C6CL, 0xC0AC29B7L, - 0xC97C50DDL, 0x3F84D5B5L, 0xB5470917L, 0x9216D5D9L, 0x8979FB1BL
+ 0xC97C50DDL, 0x3F84D5B5L, 0xB5470917L, 0x9216D5D9L, 0x8979FB1BL }; -static const unsigned long ORIG_S[4][256] = {
+static const unsigned long ORIG_S[4][256] = { {0xD1310BA6L, 0x98DFB5ACL, 0x2FFD72DBL, 0xD01ADFB7L, 0xB8E1AFEDL, 0x6A267E96L, 0xBA7C9045L, 0xF12C7F99L, 0x24A19947L, 0xB3916CF7L, 0x0801F2E2L, 0x858EFC16L, 0x636920D8L, 0x71574E69L, 0xA458FEA3L, @@ -381,7 +383,7 @@ static const unsigned long ORIG_S[4][256] = { 0x85CBFE4EL, 0x8AE88DD8L, 0x7AAAF9B0L, 0x4CF9AA7EL, 0x1948C25CL, 0x02FB8A8CL, 0x01C36AE4L, 0xD6EBE1F9L, 0x90D4F869L, 0xA65CDEA0L, 0x3F09252DL, 0xC208E69FL, 0xB74E6132L, 0xCE77E25BL, 0x578FDFE3L, - 0x3AC372E6L}
+ 0x3AC372E6L} }; static unsigned long F(BLOWFISH_CTX * ctx, unsigned long x) @@ -438,14 +440,14 @@ void Blowfish_Decrypt(BLOWFISH_CTX * ctx, unsigned long *xl, for (i = N + 1; i > 1; --i) { Xl = Xl ^ ctx->P[i]; Xr = F(ctx, Xl) ^ Xr; -
- /* Exchange Xl and Xr */
+ + /* Exchange Xl and Xr */ temp = Xl; Xl = Xr; Xr = temp; } -
- /* Exchange Xl and Xr */
+ + /* Exchange Xl and Xr */ temp = Xl; Xl = Xr; Xr = temp; @@ -490,4 +492,42 @@ void Blowfish_Init(BLOWFISH_CTX * ctx, unsigned char *key, int keyLen) } } -
+static gpointer +parallel_blowfish(unsigned int start, unsigned int end, void *data, gint thread_number) +{ + BLOWFISH_CTX ctx; + unsigned int i; + unsigned long L, R; + + L = 0xBEBACAFE; + R = 0xDEADBEEF; + + for (i = start; i <= end; i++) { + Blowfish_Init(&ctx, (unsigned char*)data, 65536); + Blowfish_Encrypt(&ctx, &L, &R); + Blowfish_Decrypt(&ctx, &L, &R); + } + + return NULL; +} + +void +benchmark_fish(void) +{ + gchar *tmpsrc; + gchar *bdata_path; + + bdata_path = g_build_filename(params.path_data, "benchmark.data", NULL); + if (!g_file_get_contents(bdata_path, &tmpsrc, NULL, NULL)) { + bench_results[BENCHMARK_BLOWFISH] = -1.0f; + g_free(bdata_path); + return; + } + + shell_view_set_enabled(FALSE); + shell_status_update("Performing Blowfish benchmark..."); + + bench_results[BENCHMARK_BLOWFISH] = benchmark_parallel_for(0, 50000, parallel_blowfish, tmpsrc); + g_free(bdata_path); + g_free(tmpsrc); +} diff --git a/arch/common/cryptohash.h b/modules/benchmark/cryptohash.c index 9897bb6b..d97e85c7 100644 --- a/arch/common/cryptohash.h +++ b/modules/benchmark/cryptohash.c @@ -16,8 +16,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include <md5.h> -#include <sha1.h> +#include "md5.h" +#include "sha1.h" +#include "benchmark.h" static void inline md5_step(char *data, glong srclen) { @@ -39,12 +40,12 @@ static void inline sha1_step(char *data, glong srclen) SHA1Final(checksum, &ctx); } -static gpointer cryptohash_for(unsigned int start, unsigned int end, void *data, GTimer *timer) +static gpointer cryptohash_for(unsigned int start, unsigned int end, void *data, gint thread_number) { unsigned int i; for (i = start; i <= end; i++) { - if (i % 2 == 0) { + if (i & 1) { md5_step(data, 65536); } else { sha1_step(data, 65536); @@ -54,7 +55,7 @@ static gpointer cryptohash_for(unsigned int start, unsigned int end, void *data, return NULL; } -static void +void benchmark_cryptohash(void) { gdouble elapsed = 0; diff --git a/arch/common/nqueens.h b/modules/benchmark/drawing.c index 2a233722..67a2c264 100644 --- a/arch/common/nqueens.h +++ b/modules/benchmark/drawing.c @@ -16,30 +16,14 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include <nqueens.h> +#include "benchmark.h" +#include "guibench.h" -static gpointer nqueens_for(unsigned int start, unsigned int end, void *data, GTimer *timer) +void +benchmark_gui(void) { - unsigned int i; - - for (i = start; i <= end; i++) { - nqueens(0); - } - - return NULL; -} - -static void -benchmark_nqueens(void) -{ - gdouble elapsed = 0; - shell_view_set_enabled(FALSE); - shell_status_update("Running N-Queens benchmark..."); + shell_status_update("Running drawing benchmark..."); - elapsed = benchmark_parallel_for(0, 10, nqueens_for, NULL); - - bench_results[BENCHMARK_NQUEENS] = elapsed; + bench_results[BENCHMARK_GUI] = guibench(); } - - diff --git a/fbench.c b/modules/benchmark/fbench.c index 20f01a35..b5afc1bc 100644 --- a/fbench.c +++ b/modules/benchmark/fbench.c @@ -7,7 +7,7 @@ John Walker December 1980 By John Walker - http://www.fourmilab.ch/ + https://www.fourmilab.ch/ This program may be used, distributed, and modified freely as long as the origin information is preserved. @@ -214,7 +214,7 @@ 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, + 0.0883 0.2166 Silicon Graphics Indigo², MIPS R4400, 175 Mhz, "-O3". 0.0351 0.0561 Dell Dimension XPS R100, Pentium II 400 MHz, @@ -271,7 +271,7 @@ 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 +static 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 @@ -280,7 +280,7 @@ int itercount; /* The iteration counter for the main loop #ifndef ITERATIONS #define ITERATIONS 1000 #endif -int niter = ITERATIONS; /* Iteration counter */ +static int niter = ITERATIONS; /* Iteration counter */ #if 0 static char *refarr[] = { /* Reference results. These happen to diff --git a/arch/common/fft.h b/modules/benchmark/fft.c index 62daa9fe..7c5889c8 100644 --- a/arch/common/fft.h +++ b/modules/benchmark/fft.c @@ -16,32 +16,52 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include <fftbench.h> +#include "hardinfo.h" +#include "benchmark.h" +#include "fftbench.h" -static gpointer fft_for(unsigned int start, unsigned int end, void *data, GTimer *timer) +static gpointer fft_for(unsigned int start, unsigned int end, void *data, gint thread_number) { unsigned int i; + FFTBench **benches = (FFTBench **)data; + FFTBench *fftbench = (FFTBench *)(benches[thread_number]); for (i = start; i <= end; i++) { - fft_bench_start(); + fft_bench_run(fftbench); } return NULL; } -static void +void benchmark_fft(void) { gdouble elapsed = 0; + int n_cores, i; + gchar *temp; + FFTBench **benches; shell_view_set_enabled(FALSE); shell_status_update("Running FFT benchmark..."); - fft_bench_init(); - elapsed = benchmark_parallel_for(0, 4, fft_for, NULL); - fft_bench_finish(); + /* Pre-allocate all benchmarks */ + temp = module_call_method("devices::getProcessorCount"); + n_cores = temp ? atoi(temp) : 1; + g_free(temp); + benches = g_new0(FFTBench *, n_cores); + for (i = 0; i < n_cores; i++) { + benches[i] = fft_bench_new(); + } + + /* Run the benchmark */ + elapsed = benchmark_parallel_for(0, 4, fft_for, benches); + + /* Free up the memory */ + for (i = 0; i < n_cores; i++) { + fft_bench_free(benches[i]); + } + g_free(benches); + bench_results[BENCHMARK_FFT] = elapsed; } - - diff --git a/fftbench.c b/modules/benchmark/fftbench.c index 597c5693..89fd5a73 100644 --- a/fftbench.c +++ b/modules/benchmark/fftbench.c @@ -16,7 +16,7 @@ transform to the seat, too. Actual benchmark results can be found at: - http://www.coyotegulch.com + http://scottrobertladd.net/coyotegulch/ Please do not use this information or algorithm in any way that might upset the balance of the universe or otherwise cause a disturbance in @@ -30,6 +30,8 @@ #include <stdbool.h> #include <stdio.h> +#include "fftbench.h" + // embedded random number generator; ala Park and Miller static long seed = 1325; static const long IA = 16807; @@ -61,13 +63,16 @@ static const int N = 800; static const int NM1 = 799; // N - 1 static const int NP1 = 801; // N + 1 -static int *lup_decompose(double **a) +static void lup_decompose(FFTBench *fftbench) { int i, j, k, k2, t; - double p, temp; + double p, temp, **a; int *perm = (int *) malloc(sizeof(double) * N); - + + fftbench->p = perm; + a = fftbench->a; + for (i = 0; i < N; ++i) perm[i] = i; @@ -85,7 +90,7 @@ static int *lup_decompose(double **a) // check for invalid a if (p == 0.0) - return NULL; + return; // exchange rows t = perm[k]; @@ -105,17 +110,19 @@ static int *lup_decompose(double **a) a[i][j] -= a[i][k] * a[k][j]; } } - - return perm; } -static double *lup_solve(double **a, int *perm, double *b) +static double *lup_solve(FFTBench *fftbench) { int i, j, j2; double sum, u; double *y = (double *) malloc(sizeof(double) * N); double *x = (double *) malloc(sizeof(double) * N); + + double **a = fftbench->a; + double *b = fftbench->b; + int *perm = fftbench->p; for (i = 0; i < N; ++i) { y[i] = 0.0; @@ -156,46 +163,50 @@ static double *lup_solve(double **a, int *perm, double *b) return x; } -static double **a, *b, *r; -static int *p; - -void fft_bench_init(void) +FFTBench *fft_bench_new(void) { + FFTBench *fftbench; int i, j; + + fftbench = g_new0(FFTBench, 1); // generate test data - a = (double **) malloc(sizeof(double *) * N); + fftbench->a = (double **) malloc(sizeof(double *) * N); for (i = 0; i < N; ++i) { - a[i] = (double *) malloc(sizeof(double) * N); + fftbench->a[i] = (double *) malloc(sizeof(double) * N); for (j = 0; j < N; ++j) - a[i][j] = random_double(); + fftbench->a[i][j] = random_double(); } - b = (double *) malloc(sizeof(double) * N); + fftbench->b = (double *) malloc(sizeof(double) * N); for (i = 0; i < N; ++i) - b[i] = random_double(); + fftbench->b[i] = random_double(); + return fftbench; } -void fft_bench_start(void) +void fft_bench_run(FFTBench *fftbench) { - p = lup_decompose(a); - r = lup_solve(a, p, b); + lup_decompose(fftbench); + double *x = lup_solve(fftbench); + free(x); } -void fft_bench_finish(void) +void fft_bench_free(FFTBench *fftbench) { int i; // clean up for (i = 0; i < N; ++i) - free(a[i]); + free(fftbench->a[i]); - free(a); - free(b); - free(p); - free(r); + free(fftbench->a); + free(fftbench->b); + free(fftbench->p); + free(fftbench->r); + + g_free(fftbench); } diff --git a/arch/common/fib.h b/modules/benchmark/fib.c index 6a216afe..0f88be59 100644 --- a/arch/common/fib.h +++ b/modules/benchmark/fib.c @@ -16,6 +16,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "benchmark.h" + static gulong fib(gulong n) { @@ -26,7 +28,7 @@ fib(gulong n) return fib(n - 1) + fib(n - 2); } -static void +void benchmark_fib(void) { GTimer *timer = g_timer_new(); diff --git a/modules/benchmark/guibench.c b/modules/benchmark/guibench.c new file mode 100644 index 00000000..b9573278 --- /dev/null +++ b/modules/benchmark/guibench.c @@ -0,0 +1,353 @@ +/* + * HardInfo - Displays System Information + * Copyright (C) 2003-2009 Leandro A. F. Pereira <leandro@hardinfo.org> + * + * 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 <gtk/gtk.h> + +#include "iconcache.h" +#include "config.h" + +#define N_ITERATIONS 100000 +#define PHRASE "I \342\231\245 HardInfo" + +typedef double (*BenchCallback)(GtkWindow *window); + +static double test_lines(GtkWindow *window); +static double test_shapes(GtkWindow *window); +static double test_filled_shapes(GtkWindow *window); +static double test_text(GtkWindow *window); +static double test_icons(GtkWindow *window); + +/* +Results on a AMD Athlon 3200+ (Barton), 1GB RAM, +nVidia Geforce 6200 with nvidia Xorg driver, +running Linux 2.6.28, Xorg 1.6.0, Ubuntu 9.04 +desktop, GNOME 2.26.1, composite enabled. + +Test Time Iter/Sec +Line Drawing 3.9570 25271.7663 +Shape Drawing 22.2499 4494.4065 +Filled Shape Drawing 4.0377 24766.2806 +Text Drawing 59.1565 1690.4309 +Icon Blitting 51.720941 1933.4528 + +Results are normalized according to these values. +A guibench() result of 1000.0 is roughly equivalent +to this same setup. +*/ + +static struct { + BenchCallback callback; + gchar *title; + gdouble weight; +} tests[] = { + { test_lines, "Line Drawing", 25271.77 }, + { test_shapes, "Shape Drawing", 4494.49 }, + { test_filled_shapes, "Filled Shape Drawing", 24766.28 }, + { test_text, "Text Drawing", 1690.43 }, + { test_icons, "Icon Blitting", 1933.45 }, + { NULL, NULL } +}; + +static gchar *phrase = NULL; + +static gboolean keypress_event(GtkWidget *widget, GdkEventKey *event, gpointer user_data) +{ + const int magic[] = { 0x1b, 0x33, 0x3a, 0x35, 0x51 }; + const int states[] = { 0xff52, 0xff52, 0xff54, 0xff54, + 0xff51, 0xff53, 0xff51, 0xff53, + 0x62, 0x61 }; + static int state = 0; + + if (event->keyval == states[state]) { + state++; + } else { + state = 0; + } + + if (state == G_N_ELEMENTS(states)) { + int i; + + for (i = 0; i < G_N_ELEMENTS(magic); i++) { + phrase[i + 6] = magic[i] ^ (states[i] & (states[i] >> 8)); + } + + state = 0; + } + + return FALSE; +} + +static double test_icons(GtkWindow *window) +{ + GdkPixbuf *pixbufs[3]; + GdkGC *gc; + GRand *rand; + GTimer *timer; + double time; + GdkWindow *gdk_window = GTK_WIDGET(window)->window; + int icons; + + gdk_window_clear(gdk_window); + + rand = g_rand_new(); + gc = gdk_gc_new(GDK_DRAWABLE(gdk_window)); + timer = g_timer_new(); + + pixbufs[0] = icon_cache_get_pixbuf("logo.png"); + pixbufs[1] = icon_cache_get_pixbuf("syncmanager.png"); + pixbufs[2] = icon_cache_get_pixbuf("report-large.png"); + + g_timer_start(timer); + for (icons = N_ITERATIONS; icons >= 0; icons--) { + int x, y; + + x = g_rand_int_range(rand, 0, 800); + y = g_rand_int_range(rand, 0, 600); + + gdk_draw_pixbuf(GDK_DRAWABLE(gdk_window), gc, + pixbufs[icons % G_N_ELEMENTS(pixbufs)], + 0, 0, x, y, 48, 48, + GDK_RGB_DITHER_NONE, 0, 0); + + while (gtk_events_pending()) { + gtk_main_iteration(); + } + } + g_timer_stop(timer); + + time = g_timer_elapsed(timer, NULL); + + g_rand_free(rand); + gdk_gc_destroy(gc); + g_timer_destroy(timer); + + return time; +} + +static double test_text(GtkWindow *window) +{ + GRand *rand; + GTimer *timer; + GdkGC *gc; + double time; + PangoLayout *layout; + PangoFontDescription *font; + GdkWindow *gdk_window = GTK_WIDGET(window)->window; + int strings; + + gdk_window_clear(gdk_window); + + rand = g_rand_new(); + gc = gdk_gc_new(GDK_DRAWABLE(gdk_window)); + timer = g_timer_new(); + + font = pango_font_description_new(); + layout = pango_layout_new(gtk_widget_get_pango_context(GTK_WIDGET(window))); + pango_layout_set_text(layout, phrase, -1); + + g_timer_start(timer); + for (strings = N_ITERATIONS; strings >= 0; strings--) { + int x, y, size; + + x = g_rand_int_range(rand, 0, 800); + y = g_rand_int_range(rand, 0, 600); + size = g_rand_int_range(rand, 1, 96) * PANGO_SCALE; + + pango_font_description_set_size(font, size); + pango_layout_set_font_description(layout, font); + gdk_draw_layout(GDK_DRAWABLE(gdk_window), gc, x, y, layout); + + gdk_rgb_gc_set_foreground(gc, strings << 8); + + while (gtk_events_pending()) { + gtk_main_iteration(); + } + + } + g_timer_stop(timer); + + time = g_timer_elapsed(timer, NULL); + + g_rand_free(rand); + gdk_gc_destroy(gc); + g_timer_destroy(timer); + g_object_unref(layout); + pango_font_description_free(font); + + return time; +} + +static double test_filled_shapes(GtkWindow *window) +{ + GRand *rand; + GTimer *timer; + GdkGC *gc; + double time; + GdkWindow *gdk_window = GTK_WIDGET(window)->window; + int lines; + + gdk_window_clear(gdk_window); + + rand = g_rand_new(); + gc = gdk_gc_new(GDK_DRAWABLE(gdk_window)); + timer = g_timer_new(); + + g_timer_start(timer); + for (lines = N_ITERATIONS; lines >= 0; lines--) { + int x1, y1; + + x1 = g_rand_int_range(rand, 0, 800); + y1 = g_rand_int_range(rand, 0, 600); + + gdk_rgb_gc_set_foreground(gc, lines << 8); + + gdk_draw_rectangle(GDK_DRAWABLE(gdk_window), gc, TRUE, + x1, y1, + g_rand_int_range(rand, 0, 400), + g_rand_int_range(rand, 0, 300)); + + while (gtk_events_pending()) { + gtk_main_iteration(); + } + } + g_timer_stop(timer); + + time = g_timer_elapsed(timer, NULL); + + g_rand_free(rand); + gdk_gc_destroy(gc); + g_timer_destroy(timer); + + return time; +} + +static double test_shapes(GtkWindow *window) +{ + GRand *rand; + GTimer *timer; + GdkGC *gc; + double time; + GdkWindow *gdk_window = GTK_WIDGET(window)->window; + int lines; + + gdk_window_clear(gdk_window); + + rand = g_rand_new(); + gc = gdk_gc_new(GDK_DRAWABLE(gdk_window)); + timer = g_timer_new(); + + g_timer_start(timer); + for (lines = N_ITERATIONS; lines >= 0; lines--) { + int x1, y1; + + x1 = g_rand_int_range(rand, 0, 800); + y1 = g_rand_int_range(rand, 0, 600); + + gdk_rgb_gc_set_foreground(gc, lines << 8); + + gdk_draw_rectangle(GDK_DRAWABLE(gdk_window), gc, FALSE, + x1, y1, + g_rand_int_range(rand, 0, 400), + g_rand_int_range(rand, 0, 300)); + while (gtk_events_pending()) { + gtk_main_iteration(); + } + } + g_timer_stop(timer); + + time = g_timer_elapsed(timer, NULL); + + g_rand_free(rand); + gdk_gc_destroy(gc); + g_timer_destroy(timer); + + return time; +} + +static double test_lines(GtkWindow *window) +{ + GRand *rand; + GTimer *timer; + GdkGC *gc; + double time; + GdkWindow *gdk_window = GTK_WIDGET(window)->window; + int lines; + + gdk_window_clear(gdk_window); + + rand = g_rand_new(); + gc = gdk_gc_new(GDK_DRAWABLE(gdk_window)); + timer = g_timer_new(); + + g_timer_start(timer); + for (lines = N_ITERATIONS; lines >= 0; lines--) { + int x1, y1, x2, y2; + + x1 = g_rand_int_range(rand, 0, 800); + y1 = g_rand_int_range(rand, 0, 600); + x2 = g_rand_int_range(rand, 0, 800); + y2 = g_rand_int_range(rand, 0, 600); + + gdk_draw_line(GDK_DRAWABLE(gdk_window), gc, x1, y1, x2, y2); + gdk_rgb_gc_set_foreground(gc, lines << 8); + + while (gtk_events_pending()) { + gtk_main_iteration(); + } + } + g_timer_stop(timer); + + time = g_timer_elapsed(timer, NULL); + + g_rand_free(rand); + gdk_gc_destroy(gc); + g_timer_destroy(timer); + + return time; +} + +double guibench(void) +{ + GtkWidget *window; + gdouble score = 0.0f; + gint i; + + phrase = g_strdup(PHRASE); + + window = gtk_window_new(GTK_WINDOW_TOPLEVEL); + gtk_widget_set_size_request(window, 800, 600); + gtk_window_set_title(GTK_WINDOW(window), "guibench"); + + gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER_ALWAYS); + gtk_widget_show(window); + + g_signal_connect(window, "key-press-event", G_CALLBACK(keypress_event), NULL); + + for (i = 0; tests[i].title; i++) { + double time; + + gtk_window_set_title(GTK_WINDOW(window), tests[i].title); + time = tests[i].callback(GTK_WINDOW(window)); + score += (N_ITERATIONS / time) / tests[i].weight; + } + + gtk_widget_destroy(window); + g_free(phrase); + + return (score / i) * 1000.0f; +} diff --git a/md5.c b/modules/benchmark/md5.c index 70f39c45..f4032ddd 100644 --- a/md5.c +++ b/modules/benchmark/md5.c @@ -173,7 +173,7 @@ struct MD5Context *ctx; putu32(ctx->buf[1], digest + 4); putu32(ctx->buf[2], digest + 8); putu32(ctx->buf[3], digest + 12); - memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */ + memset(ctx, 0, sizeof(*ctx)); /* In case it's sensitive */ } #ifndef ASM_MD5 diff --git a/nqueens.c b/modules/benchmark/nqueens.c index 838731c4..a32ed8c1 100644 --- a/nqueens.c +++ b/modules/benchmark/nqueens.c @@ -6,6 +6,9 @@ #include <stdbool.h> #include <stdlib.h> +#include "hardinfo.h" +#include "benchmark.h" + #define QUEENS 11 int row[QUEENS]; @@ -35,3 +38,29 @@ int nqueens(int y) return 0; } + +static gpointer nqueens_for(unsigned int start, unsigned int end, void *data, gint thread_number) +{ + unsigned int i; + + for (i = start; i <= end; i++) { + nqueens(0); + } + + return NULL; +} + +void +benchmark_nqueens(void) +{ + gdouble elapsed = 0; + + shell_view_set_enabled(FALSE); + shell_status_update("Running N-Queens benchmark..."); + + elapsed = benchmark_parallel_for(0, 10, nqueens_for, NULL); + + bench_results[BENCHMARK_NQUEENS] = elapsed; +} + + diff --git a/arch/common/raytrace.h b/modules/benchmark/raytrace.c index 7fdc5e21..2ee36a93 100644 --- a/arch/common/raytrace.h +++ b/modules/benchmark/raytrace.c @@ -16,10 +16,12 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "benchmark.h" + void fbench(); /* fbench.c */ static gpointer -parallel_raytrace(unsigned int start, unsigned int end, gpointer data) +parallel_raytrace(unsigned int start, unsigned int end, gpointer data, gint thread_number) { unsigned int i; @@ -30,7 +32,7 @@ parallel_raytrace(unsigned int start, unsigned int end, gpointer data) return NULL; } -static void +void benchmark_raytrace(void) { gdouble elapsed = 0; diff --git a/sha1.c b/modules/benchmark/sha1.c index b94ce254..b94ce254 100644 --- a/sha1.c +++ b/modules/benchmark/sha1.c diff --git a/modules/computer.c b/modules/computer.c new file mode 100644 index 00000000..eda405e8 --- /dev/null +++ b/modules/computer.c @@ -0,0 +1,716 @@ +/* + * HardInfo - Displays System Information + * Copyright (C) 2003-2008 Leandro A. F. Pereira <leandro@hardinfo.org> + * + * 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 <stdlib.h> +#include <string.h> +#include <gtk/gtk.h> +#include <config.h> +#include <time.h> +#include <string.h> +#include <sys/stat.h> + +#include <hardinfo.h> +#include <iconcache.h> +#include <shell.h> + +#include <vendor.h> + +#include "computer.h" + +/* Callbacks */ +gchar *callback_summary(); +gchar *callback_os(); +gchar *callback_modules(); +gchar *callback_boots(); +gchar *callback_locales(); +gchar *callback_fs(); +gchar *callback_display(); +gchar *callback_network(); +gchar *callback_users(); +gchar *callback_groups(); +gchar *callback_env_var(); +#if GLIB_CHECK_VERSION(2,14,0) +gchar *callback_dev(); +#endif /* GLIB_CHECK_VERSION(2,14,0) */ + +/* 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_display(gboolean reload); +void scan_network(gboolean reload); +void scan_users(gboolean reload); +void scan_groups(gboolean reload); +void scan_env_var(gboolean reload); +#if GLIB_CHECK_VERSION(2,14,0) +void scan_dev(gboolean reload); +#endif /* GLIB_CHECK_VERSION(2,14,0) */ + +static ModuleEntry entries[] = { + {N_("Summary"), "summary.png", callback_summary, scan_summary, MODULE_FLAG_NONE}, + {N_("Operating System"), "os.png", callback_os, scan_os, MODULE_FLAG_NONE}, + {N_("Kernel Modules"), "module.png", callback_modules, scan_modules, MODULE_FLAG_NONE}, + {N_("Boots"), "boot.png", callback_boots, scan_boots, MODULE_FLAG_NONE}, + {N_("Languages"), "language.png", callback_locales, scan_locales, MODULE_FLAG_NONE}, + {N_("Filesystems"), "dev_removable.png", callback_fs, scan_fs, MODULE_FLAG_NONE}, + {N_("Display"), "monitor.png", callback_display, scan_display, MODULE_FLAG_NONE}, + {N_("Environment Variables"), "environment.png", callback_env_var, scan_env_var, MODULE_FLAG_NONE}, +#if GLIB_CHECK_VERSION(2,14,0) + {N_("Development"), "devel.png", callback_dev, scan_dev, MODULE_FLAG_NONE}, +#endif /* GLIB_CHECK_VERSION(2,14,0) */ + {N_("Users"), "users.png", callback_users, scan_users, MODULE_FLAG_NONE}, + {N_("Groups"), "users.png", callback_groups, scan_groups, MODULE_FLAG_NONE}, + {NULL}, +}; + +gchar *module_list = NULL; +Computer *computer = NULL; + +gchar *hi_more_info(gchar * entry) +{ + gchar *info = moreinfo_lookup_with_prefix("COMP", entry); + + if (info) + return g_strdup(info); + + return g_strdup_printf("[%s]", entry); +} + +gchar *hi_get_field(gchar * field) +{ + gchar *tmp; + + if (g_str_equal(field, _("Memory"))) { + MemoryInfo *mi = computer_get_memory(); + tmp = g_strdup_printf(_("%dMB (%dMB used)"), mi->total, mi->used); + g_free(mi); + } 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); + + 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 if (g_str_equal(field, _("Available entropy in /dev/random"))) { + tmp = computer_get_entropy_avail(); + } else { + tmp = g_strdup_printf("Unknown field: %s", field); + } + return tmp; +} + +void scan_summary(gboolean reload) +{ + SCAN_START(); + module_entry_scan_all_except(entries, 0); + 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(); +} + +void scan_fs(gboolean reload) +{ + SCAN_START(); + scan_filesystems(); + SCAN_END(); +} + +void scan_display(gboolean reload) +{ + SCAN_START(); + computer->display = computer_get_display(); + SCAN_END(); +} + +void scan_users(gboolean reload) +{ + SCAN_START(); + scan_users_do(); + SCAN_END(); +} + +void scan_groups(gboolean reload) +{ + SCAN_START(); + scan_groups_do(); + SCAN_END(); +} + +#if GLIB_CHECK_VERSION(2,14,0) +static gchar *dev_list = NULL; +void scan_dev(gboolean reload) +{ + SCAN_START(); + + int i; + struct { + gchar *compiler_name; + gchar *version_command; + gchar *regex; + gboolean stdout; + } detect_lang[] = { + { N_("Scripting Languages"), NULL, FALSE }, + { N_("CPython"), "python -V", "\\d+\\.\\d+\\.\\d+", TRUE }, + { N_("Perl"), "perl -v", "\\d+\\.\\d+\\.\\d+", TRUE }, + { N_("PHP"), "php --version", "\\d+\\.\\d+\\.\\S+", TRUE}, + { N_("Ruby"), "ruby --version", "\\d+\\.\\d+\\.\\d+", TRUE }, + { N_("Bash"), "bash --version", "\\d+\\.\\d+\\.\\S+", TRUE}, + { N_("Compilers"), NULL, FALSE }, + { N_("C (GCC)"), "gcc -v", "\\d+\\.\\d+\\.\\d+", FALSE }, + { N_("C (Clang)"), "clang -v", "\\d+\\.\\d+", FALSE }, + { N_("D (dmd)"), "dmd --help", "\\d+\\.\\d+", TRUE }, + { N_("Java"), "javac -version", "\\d+\\.\\d+\\.\\d+", FALSE }, + { N_("CSharp (Mono, old)"), "mcs --version", "\\d+\\.\\d+\\.\\d+\\.\\d+", TRUE }, + { N_("CSharp (Mono)"), "gmcs --version", "\\d+\\.\\d+\\.\\d+\\.\\d+", TRUE }, + { N_("Vala"), "valac --version", "\\d+\\.\\d+\\.\\d+", TRUE }, + { N_("Haskell (GHC)"), "ghc -v", "\\d+\\.\\d+\\.\\d+", FALSE }, + { N_("FreePascal"), "fpc -iV", "\\d+\\.\\d+\\.?\\d*", TRUE }, + { N_("Go"), "go version", "\\d+\\.\\d+\\.?\\d* ", TRUE }, + { N_("Tools"), NULL, FALSE }, + { N_("make"), "make --version", "\\d+\\.\\d+", TRUE }, + { N_("GDB"), "gdb --version", "\\d+\\.\\S+", TRUE }, + { N_("strace"), "strace -V", "\\d+\\.\\d+\\.?\\d*", TRUE }, + { N_("valgrind"), "valgrind --version", "\\d+\\.\\d+\\.\\S+", TRUE }, + { N_("QMake"), "qmake --version", "\\d+\\.\\S+", TRUE}, + { N_("CMake"), "cmake --version", "\\d+\\.\\d+\\.?\\d*", TRUE}, + }; + + g_free(dev_list); + + dev_list = g_strdup(""); + + for (i = 0; i < G_N_ELEMENTS(detect_lang); i++) { + gchar *version = NULL; + gchar *output; + gchar *temp; + GRegex *regex; + GMatchInfo *match_info; + gboolean found; + + if (!detect_lang[i].regex) { + dev_list = h_strdup_cprintf("[%s]\n", dev_list, detect_lang[i].compiler_name); + continue; + } + + if (detect_lang[i].stdout) { + found = g_spawn_command_line_sync(detect_lang[i].version_command, &output, NULL, NULL, NULL); + } else { + found = g_spawn_command_line_sync(detect_lang[i].version_command, NULL, &output, NULL, NULL); + } + + if (found) { + regex = g_regex_new(detect_lang[i].regex, 0, 0, NULL); + + g_regex_match(regex, output, 0, &match_info); + if (g_match_info_matches(match_info)) { + version = g_match_info_fetch(match_info, 0); + } + + g_match_info_free(match_info); + g_regex_unref(regex); + g_free(output); + } + + if (version) { + dev_list = h_strdup_cprintf("%s=%s\n", dev_list, detect_lang[i].compiler_name, version); + g_free(version); + } else { + dev_list = h_strdup_cprintf(_("%s=Not found\n"), dev_list, detect_lang[i].compiler_name); + } + + temp = g_strdup_printf(_("Detecting version: %s"), + detect_lang[i].compiler_name); + shell_status_update(temp); + g_free(temp); + } + + SCAN_END(); +} + +gchar *callback_dev() +{ + return g_strdup_printf(_("[$ShellParam$]\n" + "ColumnTitle$TextValue=Program\n" + "ColumnTitle$Value=Version\n" + "ShowColumnHeaders=true\n" + "%s"), dev_list); +} +#endif /* GLIB_CHECK_VERSION(2,14,0) */ + +/* Table based off imvirt by Thomas Liske <liske@ibh.de> + Copyright (c) 2008 IBH IT-Service GmbH under GPLv2. */ +gchar *computer_get_virtualization() +{ + gboolean found = FALSE; + gint i, j; + gchar *files[] = { + "/proc/scsi/scsi", + "/proc/cpuinfo", + "/var/log/dmesg", + NULL + }; + const static struct { + gchar *str; + gchar *vmtype; + } vm_types[] = { + /* VMware */ + { "VMware", "Virtual (VMware)" }, + { ": VMware Virtual IDE CDROM Drive", "Virtual (VMware)" }, + /* QEMU */ + { "QEMU", "Virtual (QEMU)" }, + { "QEMU Virtual CPU", "Virtual (QEMU)" }, + { ": QEMU HARDDISK", "Virtual (QEMU)" }, + { ": QEMU CD-ROM", "Virtual (QEMU)" }, + /* Generic Virtual Machine */ + { ": Virtual HD,", "Virtual (Unknown)" }, + { ": Virtual CD,", "Virtual (Unknown)" }, + /* Virtual Box */ + { "VBOX", "Virtual (VirtualBox)" }, + { ": VBOX HARDDISK", "Virtual (VirtualBox)" }, + { ": VBOX CD-ROM", "Virtual (VirtualBox)" }, + /* Xen */ + { "Xen virtual console", "Virtual (Xen)" }, + { "Xen reported: ", "Virtual (Xen)" }, + { "xen-vbd: registered block device", "Virtual (Xen)" }, + /* Generic */ + { " hypervisor", "Virtual (hypervisor present)"} , + { NULL } + }; + + DEBUG("Detecting virtual machine"); + + if (g_file_test("/proc/xen", G_FILE_TEST_EXISTS)) { + DEBUG("/proc/xen found; assuming Xen"); + return g_strdup("Xen"); + } + + for (i = 0; files[i+1]; i++) { + gchar buffer[512]; + FILE *file; + + if ((file = fopen(files[i], "r"))) { + while (!found && fgets(buffer, 512, file)) { + for (j = 0; vm_types[j+1].str; j++) { + if (strstr(buffer, vm_types[j].str)) { + found = TRUE; + break; + } + } + } + + fclose(file); + + if (found) { + DEBUG("%s found (by reading file %s)", + vm_types[j].vmtype, files[i]); + return g_strdup(vm_types[j].vmtype); + } + } + + } + + DEBUG("no virtual machine detected; assuming physical machine"); + + return g_strdup(_("Physical machine")); +} + +gchar *callback_summary() +{ + gchar *processor_name, *alsa_cards; + gchar *input_devices, *printers; + gchar *storage_devices, *summary; + gchar *virt; + + processor_name = module_call_method("devices::getProcessorName"); + alsa_cards = computer_get_alsacards(computer); + input_devices = module_call_method("devices::getInputDevices"); + printers = module_call_method("devices::getPrinters"); + storage_devices = module_call_method("devices::getStorageDevices"); + virt = computer_get_virtualization(); + + summary = g_strdup_printf(_("[$ShellParam$]\n" + "UpdateInterval$Memory=1000\n" + "UpdateInterval$Date/Time=1000\n" + "#ReloadInterval=5000\n" + "[Computer]\n" + "Processor=%s\n" + "Memory=...\n" + "Machine Type=%s\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" + "\n%s\n" + "[Input Devices]\n%s\n" + "\n%s\n" + "\n%s\n"), + processor_name, + virt, + computer->os->distro, + computer->os->username, + computer->display->width, + computer->display->height, + computer->display->ogl_renderer, + computer->display->vendor, + alsa_cards, + input_devices, printers, storage_devices); + + g_free(processor_name); + g_free(alsa_cards); + g_free(input_devices); + g_free(printers); + g_free(storage_devices); + g_free(virt); + + return summary; +} + +gchar *callback_os() +{ + return g_strdup_printf(_("[$ShellParam$]\n" + "UpdateInterval$Uptime=10000\n" + "UpdateInterval$Load Average=1000\n" + "UpdateInterval$Available entropy in /dev/random=1000\n" + "[Version]\n" + "Kernel=%s\n" + "Version=%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=...\n" + "Available entropy in /dev/random=..."), + computer->os->kernel, + computer->os->kernel_version, + computer->os->libc, + computer->os->distro, + computer->os->hostname, + computer->os->username, + computer->os->language, + computer->os->homedir, + computer->os->desktop); +} + +gchar *callback_modules() +{ + return g_strdup_printf(_("[Loaded Modules]\n" + "%s" + "[$ShellParam$]\n" + "ViewType=1\n" + "ColumnTitle$TextValue=Name\n" + "ColumnTitle$Value=Description\n" + "ShowColumnHeaders=true\n"), module_list); +} + +gchar *callback_boots() +{ + return g_strdup_printf(_("[$ShellParam$]\n" + "ColumnTitle$TextValue=Date & Time\n" + "ColumnTitle$Value=Kernel Version\n" + "ShowColumnHeaders=true\n" + "\n" + "%s"), computer->os->boots); +} + +gchar *callback_locales() +{ + return g_strdup_printf(_("[$ShellParam$]\n" + "ViewType=1\n" + "ColumnTitle$TextValue=Language Code\n" + "ColumnTitle$Value=Name\n" + "ShowColumnHeaders=true\n" + "[Available Languages]\n" + "%s"), computer->os->languages); +} + +gchar *callback_fs() +{ + return g_strdup_printf(_("[$ShellParam$]\n" + "ViewType=4\n" + "ReloadInterval=5000\n" + "Zebra=1\n" + "NormalizePercentage=false\n" + "ColumnTitle$Extra1=Mount Point\n" + "ColumnTitle$Progress=Usage\n" + "ColumnTitle$TextValue=Device\n" + "ShowColumnHeaders=true\n" + "[Mounted File Systems]\n%s\n"), fs_list); +} + +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 ? _("Y_es") : _("No")); +} + +gchar *callback_users() +{ + return g_strdup_printf("[$ShellParam$]\n" + "ReloadInterval=10000\n" + "ViewType=1\n" + "[Users]\n" + "%s\n", users); +} + +gchar *callback_groups() +{ + return g_strdup_printf(_("[$ShellParam$]\n" + "ReloadInterval=10000\n" + "ColumnTitle$TextValue=Name\n" + "ColumnTitle$Value=Group ID\n" + "ShowColumnHeaders=true\n" + "[Groups]\n" + "%s\n"), groups); +} + +gchar *get_os_kernel(void) +{ + scan_os(FALSE); + return g_strdup(computer->os->kernel); +} + +gchar *get_os(void) +{ + scan_os(FALSE); + return g_strdup(computer->os->distro); +} + +gchar *get_display_summary(void) +{ + scan_display(FALSE); + + return g_strdup_printf("%dx%d\n" + "%s\n" + "%s", + computer->display->width, + computer->display->height, + computer->display->ogl_renderer, + computer->display->vendor); +} + +gchar *get_kernel_module_description(gchar *module) +{ + gchar *description; + + if (!_module_hash_table) { + scan_modules(FALSE); + } + + description = g_hash_table_lookup(_module_hash_table, module); + if (!description) { + return NULL; + } + + return g_strdup(description); +} + +gchar *get_audio_cards(void) +{ + if (!computer->alsa) { + computer->alsa = computer_get_alsainfo(); + } + + return computer_get_alsacards(computer); +} + +ShellModuleMethod *hi_exported_methods(void) +{ + static ShellModuleMethod m[] = { + {"getOSKernel", get_os_kernel}, + {"getOS", get_os}, + {"getDisplaySummary", get_display_summary}, + {"getAudioCards", get_audio_cards}, + {"getKernelModuleDescription", get_kernel_module_description}, + {NULL} + }; + + return m; +} + +ModuleEntry *hi_module_get_entries(void) +{ + return entries; +} + +gchar *hi_module_get_name(void) +{ + return g_strdup(_("Computer")); +} + +guchar hi_module_get_weight(void) +{ + return 80; +} + +gchar **hi_module_get_dependencies(void) +{ + static gchar *deps[] = { "devices.so", NULL }; + + return deps; +} + +gchar *hi_module_get_summary(void) +{ + return g_strdup("[Operating System]\n" + "Icon=os.png\n" + "Method=computer::getOS\n" + "[CPU]\n" + "Icon=processor.png\n" + "Method=devices::getProcessorName\n" + "[RAM]\n" + "Icon=memory.png\n" + "Method=devices::getMemoryTotal\n" + "[Motherboard]\n" + "Icon=module.png\n" + "Method=devices::getMotherboard\n" + "[Graphics]\n" + "Icon=monitor.png\n" + "Method=computer::getDisplaySummary\n" + "[Storage]\n" + "Icon=hdd.png\n" + "Method=devices::getStorageDevices\n" + "[Printers]\n" + "Icon=printer.png\n" + "Method=devices::getPrinters\n" + "[Audio]\n" + "Icon=audio.png\n" + "Method=computer::getAudioCards\n"); +} + +void hi_module_deinit(void) +{ + if (computer->os) { + g_free(computer->os->kernel); + g_free(computer->os->libc); + g_free(computer->os->distrocode); + g_free(computer->os->distro); + g_free(computer->os->hostname); + g_free(computer->os->language); + g_free(computer->os->homedir); + g_free(computer->os->kernel_version); + g_free(computer->os->languages); + g_free(computer->os->desktop); + g_free(computer->os->username); + g_free(computer->os->boots); + g_free(computer->os); + } + + if (computer->display) { + g_free(computer->display->ogl_vendor); + g_free(computer->display->ogl_renderer); + g_free(computer->display->ogl_version); + g_free(computer->display->display_name); + g_free(computer->display->vendor); + g_free(computer->display->version); + g_free(computer->display->extensions); + g_free(computer->display->monitors); + g_free(computer->display); + } + + if (computer->alsa) { + g_slist_free(computer->alsa->cards); + g_free(computer->alsa); + } + + g_free(computer->date_time); + g_free(computer); + + moreinfo_del_with_prefix("COMP"); +} + +void hi_module_init(void) +{ + computer = g_new0(Computer, 1); +} + +ModuleAbout *hi_module_get_about(void) +{ + static ModuleAbout ma[] = { + { + .author = "Leandro A. F. Pereira", + .description = N_("Gathers high-level computer information"), + .version = VERSION, + .license = "GNU GPL version 2"} + }; + + return ma; +} + diff --git a/arch/linux/common/alsa.h b/modules/computer/alsa.c index ddd58edd..e1e7b946 100644 --- a/arch/linux/common/alsa.h +++ b/modules/computer/alsa.c @@ -16,18 +16,21 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "hardinfo.h" +#include "computer.h" + gchar * computer_get_alsacards(Computer * computer) { GSList *p; - gchar *tmp = g_strdup(""); + gchar *tmp = g_strdup(_("[Audio Devices]\n")); gint n = 0; if (computer->alsa) { for (p = computer->alsa->cards; p; p = p->next) { AlsaCard *ac = (AlsaCard *) p->data; - tmp = h_strdup_cprintf("Audio Adapter#%d=%s\n", + tmp = h_strdup_cprintf(_("Audio Adapter#%d=%s\n"), tmp, ++n, ac->friendly_name); } } @@ -35,7 +38,7 @@ computer_get_alsacards(Computer * computer) return tmp; } -static AlsaInfo * +AlsaInfo * computer_get_alsainfo(void) { AlsaInfo *ai; diff --git a/arch/linux/common/boots.h b/modules/computer/boots.c index 8a3c11fa..478e89ac 100644 --- a/arch/linux/common/boots.h +++ b/modules/computer/boots.c @@ -16,6 +16,11 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include <stdio.h> +#include <string.h> +#include "hardinfo.h" +#include "computer.h" + void scan_boots_real(void) { @@ -25,7 +30,7 @@ scan_boots_real(void) scan_os(FALSE); if (!computer->os->boots) - computer->os->boots = g_strdup("[Boots]\n"); + computer->os->boots = g_strdup(_("[Boots]\n")); else return; @@ -39,7 +44,7 @@ scan_boots_real(void) while (*buf) { if (*buf == ' ' && *(buf + 1) == ' ') { - strcpy(buf, buf + 1); + memmove(buf, buf + 1, strlen(buf) + 1); buf--; } else { diff --git a/arch/common/display.h b/modules/computer/display.c index 075a0a24..2c98b144 100644 --- a/arch/common/display.h +++ b/modules/computer/display.c @@ -16,6 +16,11 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include <string.h> + +#include "hardinfo.h" +#include "computer.h" + static void get_glx_info(DisplayInfo *di) { @@ -114,7 +119,7 @@ get_x11_info(DisplayInfo *di) gdk_screen_get_monitor_geometry(screen, i, &rect); - di->monitors = h_strdup_cprintf("Monitor %d=%dx%d pixels\n", + di->monitors = h_strdup_cprintf(_("Monitor %d=%dx%d pixels\n"), di->monitors, i, rect.width, rect.height); } } else { @@ -122,7 +127,7 @@ get_x11_info(DisplayInfo *di) } } -static DisplayInfo * +DisplayInfo * computer_get_display(void) { DisplayInfo *di = g_new0(DisplayInfo, 1); diff --git a/arch/common/environment.h b/modules/computer/environment.c index c78c4a73..2a8d235c 100644 --- a/arch/common/environment.h +++ b/modules/computer/environment.c @@ -16,6 +16,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "hardinfo.h" +#include "computer.h" + static gchar *_env = NULL; void scan_env_var(gboolean reload) { @@ -26,7 +29,7 @@ void scan_env_var(gboolean reload) g_free(_env); - _env = g_strdup("[Environment Variables]\n"); + _env = g_strdup(_("[Environment Variables]\n")); for (i = 0, envlist = g_listenv(); envlist[i]; i++) { _env = h_strdup_cprintf("%s=%s\n", _env, envlist[i], g_getenv(envlist[i])); @@ -38,5 +41,5 @@ void scan_env_var(gboolean reload) gchar *callback_env_var(void) { - return _env; + return g_strdup(_env); } diff --git a/arch/linux/common/filesystem.h b/modules/computer/filesystem.c index 1eff0818..a7162777 100644 --- a/arch/linux/common/filesystem.h +++ b/modules/computer/filesystem.c @@ -19,17 +19,15 @@ * Copyright (C) 2005 Jean-Baptiste jb_dul@yahoo.com * Distributed under the terms of GNU GPL 2. */ -#include <sys/vfs.h> -static gchar *fs_list = NULL; +#include <string.h> +#include <sys/vfs.h> +#include "hardinfo.h" +#include "computer.h" -static gboolean -remove_filesystem_entries(gpointer key, gpointer value, gpointer data) -{ - return g_str_has_prefix(key, "FS"); -} +gchar *fs_list = NULL; -static void +void scan_filesystems(void) { FILE *mtab; @@ -39,7 +37,7 @@ scan_filesystems(void) g_free(fs_list); fs_list = g_strdup(""); - g_hash_table_foreach_remove(moreinfo, remove_filesystem_entries, NULL); + moreinfo_del_with_prefix("COMP:FS"); mtab = fopen("/etc/mtab", "r"); if (!mtab) @@ -72,13 +70,8 @@ scan_filesystems(void) *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], "#", '_'); + strreplacechr(tmp[0], "#", '_'); strhash = g_strdup_printf("[%s]\n" "Filesystem=%s\n" "Mounted As=%s\n" @@ -91,7 +84,9 @@ scan_filesystems(void) strstr(tmp[3], "rw") ? "Read-Write" : "Read-Only", tmp[1], strsize, strused, stravail); - g_hash_table_insert(moreinfo, g_strdup_printf("FS%d", ++count), strhash); + gchar *key = g_strdup_printf("FS%d", ++count); + moreinfo_add_with_prefix("COMP", key, strhash); + g_free(key); fs_list = h_strdup_cprintf("$FS%d$%s=%.2f %% (%s of %s)|%s\n", fs_list, diff --git a/modules/computer/groups.c b/modules/computer/groups.c new file mode 100644 index 00000000..244b8000 --- /dev/null +++ b/modules/computer/groups.c @@ -0,0 +1,45 @@ +/* + * HardInfo - Displays System Information + * Copyright (C) 2012 Leandro A. F. Pereira <leandro@hardinfo.org> + * + * 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 <sys/types.h> +#include <grp.h> +#include "hardinfo.h" +#include "computer.h" + +gchar *groups = NULL; + +void +scan_groups_do(void) +{ + struct group *group_; + + setgrent(); + group_ = getgrent(); + if (!group_) + return; + + g_free(groups); + groups = g_strdup(""); + + while (group_) { + groups = h_strdup_cprintf("%s=%d\n", groups, group_->gr_name, group_->gr_gid); + group_ = getgrent(); + } + + endgrent(); +} diff --git a/arch/common/languages.h b/modules/computer/languages.c index c1839ee9..5877c41c 100644 --- a/arch/common/languages.h +++ b/modules/computer/languages.c @@ -16,13 +16,18 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include <string.h> + +#include "hardinfo.h" +#include "computer.h" + void scan_languages(OperatingSystem * os) { FILE *locale; gchar buf[512], *retval = NULL; - locale = popen("locale -va", "r"); + locale = popen("locale -va && echo", "r"); if (!locale) return; @@ -84,7 +89,7 @@ scan_languages(OperatingSystem * os) FIELD(date), FIELD(codeset)); #undef FIELD - g_hash_table_insert(moreinfo, g_strdup(name), currlocale); + moreinfo_add_with_prefix("COMP", name, currlocale); g_free(title); g_free(source); diff --git a/modules/computer/loadavg.c b/modules/computer/loadavg.c new file mode 100644 index 00000000..7311dbf0 --- /dev/null +++ b/modules/computer/loadavg.c @@ -0,0 +1,68 @@ +/* + * HardInfo - Displays System Information + * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@hardinfo.org> + * + * 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 "hardinfo.h" +#include "computer.h" + +static gboolean +computer_get_loadinfo(LoadInfo *li) +{ + FILE *procloadavg; + char buf[64]; + int ret; + + procloadavg = fopen("/proc/loadavg", "r"); + if (!procloadavg) + return FALSE; + + if (!fgets(buf, sizeof(buf), procloadavg)) { + fclose(procloadavg); + return FALSE; + } + + ret = sscanf(buf, "%f %f %f", &li->load1, &li->load5, &li->load15); + if (ret != 3) { + size_t len = strlen(buf); + size_t i; + + for (i = 0; i < len; i++) { + if (buf[i] == '.') + buf[i] = ','; + } + + ret = sscanf(buf, "%f %f %f", &li->load1, &li->load5, &li->load15); + } + + fclose(procloadavg); + + return ret == 3; +} + +gchar * +computer_get_formatted_loadavg() +{ + LoadInfo li; + + if (!computer_get_loadinfo(&li)) + return g_strdup(_("Couldn't obtain load average")); + + return g_strdup_printf("%.2f, %.2f, %.2f", li.load1, li.load5, + li.load15); +} diff --git a/arch/linux/common/memory.h b/modules/computer/memory.c index c87359b9..3d320e8a 100644 --- a/arch/linux/common/memory.h +++ b/modules/computer/memory.c @@ -16,7 +16,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -static MemoryInfo * +#include "hardinfo.h" +#include "computer.h" + +MemoryInfo * computer_get_memory(void) { MemoryInfo *mi; diff --git a/arch/linux/common/modules.h b/modules/computer/modules.c index 78fb9de3..bbc05f42 100644 --- a/arch/linux/common/modules.h +++ b/modules/computer/modules.c @@ -16,6 +16,11 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include <string.h> + +#include "hardinfo.h" +#include "computer.h" + #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])); \ @@ -23,15 +28,9 @@ continue; \ } -static gboolean -remove_module_devices(gpointer key, gpointer value, gpointer data) -{ - return g_str_has_prefix(key, "MOD"); -} - -static GHashTable *_module_hash_table = NULL; +GHashTable *_module_hash_table = NULL; -static void +void scan_modules_do(void) { FILE *lsmod; @@ -42,14 +41,14 @@ scan_modules_do(void) _module_hash_table = g_hash_table_new(g_str_hash, g_str_equal); } - if (module_list) { - g_free(module_list); - } + g_free(module_list); module_list = NULL; - g_hash_table_foreach_remove(moreinfo, remove_module_devices, NULL); + moreinfo_del_with_prefix("COMP:MOD"); lsmod_path = find_program("lsmod"); + if (!lsmod_path) + return; lsmod = popen(lsmod_path, "r"); if (!lsmod) { g_free(lsmod_path); @@ -155,7 +154,8 @@ scan_modules_do(void) g_free(deps); } - g_hash_table_insert(moreinfo, hashkey, strmodule); + moreinfo_add_with_prefix("COMP", hashkey, strmodule); + g_free(hashkey); g_free(license); g_free(description); diff --git a/arch/linux/common/os.h b/modules/computer/os.c index f3c2c2d8..3caf6c26 100644 --- a/arch/linux/common/os.h +++ b/modules/computer/os.c @@ -16,79 +16,51 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -static gchar * -get_default_gcc_version(void) -{ - char *buf; - - if (g_spawn_command_line_sync("gcc -v", - NULL, - &buf, - NULL, - NULL)) { - char *return_value; - - if (!(return_value = strstr(buf, "gcc "))) { - goto err; - } - - return_value = strstr(return_value, " ") + 1; - return_value = strstr(return_value, " ") + 1; - - return_value = g_strdup_printf("GNU C Compiler version %s", return_value); - - g_free(buf); - - return return_value; - } - -err: - return g_strdup("Unknown"); -} +#include <string.h> +#include <sys/utsname.h> +#include "hardinfo.h" +#include "computer.h" static gchar * get_libc_version(void) { FILE *libc; gchar buf[256], *tmp, *p; - - libc = popen("/lib/libc.so.6", "r"); + char *libc_paths[] = { + "/lib/ld-uClibc.so.0", "/lib64/ld-uClibc.so.0", + "/lib/libc.so.6", "/lib64/libc.so.6" + }; + int i; + + for (i=0; i < 4; i++) { + if (g_file_test(libc_paths[i], G_FILE_TEST_EXISTS)) break; + } + switch (i) { + case 0: case 1: return g_strdup("uClibc Library"); + case 2: case 3: break; // gnu libc, continue processing + default: goto err; + } + + libc = popen(libc_paths[i], "r"); if (!libc) goto err; - + (void)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)", + + return g_strdup_printf(_("GNU C Library version %s (%sstable)"), strchr(tmp, ' ') + 1, - strstr(buf, " stable ") ? "" : "un"); + 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"); - - (void)fgets(buf, 512, procversion); - fclose(procversion); - - return g_strdup(buf); + return g_strdup(_("Unknown")); } - #include <gdk/gdkx.h> void @@ -105,7 +77,7 @@ detect_desktop_environment(OperatingSystem * os) obtain the version. */ version = popen("gnome-about --gnome-version", "r"); if (version) { - (void)fscanf(version, "Version: %s", vers); + (void)fscanf(version, _("Version: %s"), vers); if (pclose(version)) goto unknown; } else { @@ -136,32 +108,51 @@ detect_desktop_environment(OperatingSystem * os) os->desktop = g_strdup_printf("KDE %s", vers); } else { unknown: + os->desktop = NULL; + if (!g_getenv("DISPLAY")) { - os->desktop = g_strdup("Terminal"); + os->desktop = g_strdup(_("Terminal")); } else { GdkScreen *screen = gdk_screen_get_default(); - + 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 */ + /* 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)", + } else if ((tmp = g_getenv("XDG_CURRENT_DESKTOP"))) { + os->desktop = g_strdup(tmp); + if ((tmp = g_getenv("DESKTOP_SESSION")) && !g_str_equal(os->desktop, tmp)) { + g_free(os->desktop); + os->desktop = g_strdup(tmp); + } + } + + if (!os->desktop) { + os->desktop = g_strdup_printf(_("Unknown (Window Manager: %s)"), windowman); } } else { - os->desktop = g_strdup("Unknown"); + os->desktop = g_strdup(_("Unknown")); } } } } -static OperatingSystem * +gchar * +computer_get_entropy_avail(void) +{ + gint bits = h_sysfs_read_int("/proc/sys/kernel/random", "entropy_avail"); + if (bits < 200) + return g_strdup_printf("%d bits (low)", bits); + if (bits < 3000) + return g_strdup_printf("%d bits (medium)", bits); + return g_strdup_printf("%d bits (healthy)", bits); +} + +OperatingSystem * computer_get_os(void) { struct utsname utsbuf; @@ -170,8 +161,6 @@ computer_get_os(void) 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)) { @@ -186,56 +175,72 @@ computer_get_os(void) 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; - } + } else if (g_file_test("/etc/arch-release", G_FILE_TEST_EXISTS)) { + os->distrocode = g_strdup("arch"); + os->distro = g_strdup("Arch Linux"); + } else { + 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"); - (void)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); - } - } - - if (g_str_equal(distro_db[i].codename, "ppy")) { - gchar *tmp; - - tmp = g_strdup_printf("Puppy Linux %.2f", atof(os->distro) / 100.0); - g_free(os->distro); - os->distro = tmp; - } - - os->distrocode = g_strdup(distro_db[i].codename); - - 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"); + if (distro_ver) { + (void)fgets(buf, 128, distro_ver); + fclose(distro_ver); + } else { + continue; + } + + 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); + } + } + + if (g_str_equal(distro_db[i].codename, "ppy")) { + gchar *tmp; + tmp = g_strdup_printf("Puppy Linux"); + g_free(os->distro); + os->distro = tmp; + } + + if (g_str_equal(distro_db[i].codename, "fatdog")) { + gchar *tmp; + tmp = g_strdup_printf("Fatdog64 [%.10s]", os->distro); + g_free(os->distro); + os->distro = tmp; + } + + os->distrocode = g_strdup(distro_db[i].codename); + + break; + } + } } + os->distro = g_strstrip(os->distro); + /* Kernel and hostname info */ uname(&utsbuf); + os->kernel_version = g_strdup(utsbuf.version); os->kernel = g_strdup_printf("%s %s (%s)", utsbuf.sysname, utsbuf.release, utsbuf.machine); os->hostname = g_strdup(utsbuf.nodename); @@ -244,9 +249,10 @@ computer_get_os(void) os->username = g_strdup_printf("%s (%s)", g_get_user_name(), g_get_real_name()); os->libc = get_libc_version(); - os->gcc = get_default_gcc_version(); scan_languages(os); detect_desktop_environment(os); + os->entropy_avail = computer_get_entropy_avail(); + return os; } diff --git a/arch/linux/common/uptime.h b/modules/computer/uptime.c index 8fdc3a27..8eb563fa 100644 --- a/arch/linux/common/uptime.h +++ b/modules/computer/uptime.c @@ -15,8 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "hardinfo.h" +#include "computer.h" -static UptimeInfo * +UptimeInfo * computer_get_uptime(void) { UptimeInfo *ui = g_new0(UptimeInfo, 1); @@ -39,7 +41,7 @@ computer_get_uptime(void) return ui; } -static gchar * +gchar * computer_get_formatted_uptime() { UptimeInfo *ui; diff --git a/modules/computer/users.c b/modules/computer/users.c new file mode 100644 index 00000000..e8f891ac --- /dev/null +++ b/modules/computer/users.c @@ -0,0 +1,60 @@ +/* + * HardInfo - Displays System Information + * Copyright (C) 2003-2009 Leandro A. F. Pereira <leandro@hardinfo.org> + * + * 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 <pwd.h> +#include "hardinfo.h" +#include "computer.h" + +gchar *users = NULL; + +void +scan_users_do(void) +{ + struct passwd *passwd_; + passwd_ = getpwent(); + if (!passwd_) + return; + + if (users) { + g_free(users); + moreinfo_del_with_prefix("COMP:USER"); + } + + users = g_strdup(""); + + while (passwd_) { + gchar *key = g_strdup_printf("USER%s", passwd_->pw_name); + gchar *val = g_strdup_printf("[User Information]\n" + "User ID=%d\n" + "Group ID=%d\n" + "Home directory=%s\n" + "Default shell=%s\n", + (gint) passwd_->pw_uid, + (gint) passwd_->pw_gid, + passwd_->pw_dir, + passwd_->pw_shell); + moreinfo_add_with_prefix("COMP", key, val); + + strend(passwd_->pw_gecos, ','); + users = h_strdup_cprintf("$%s$%s=%s\n", users, key, passwd_->pw_name, passwd_->pw_gecos); + passwd_ = getpwent(); + g_free(key); + } + + endpwent(); +} diff --git a/modules/devices.c b/modules/devices.c new file mode 100644 index 00000000..87bb8a80 --- /dev/null +++ b/modules/devices.c @@ -0,0 +1,613 @@ +/* + * HardInfo - Displays System Information + * Copyright (C) 2003-2007 Leandro A. F. Pereira <leandro@hardinfo.org> + * + * 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 __USE_XOPEN +#define __USE_XOPEN +#endif /* __USE_XOPEN */ + +#ifndef _XOPEN_SOURCE +#define _XOPEN_SOURCE +#endif /* _XOPEN_SOURCE */ + +#include <gtk/gtk.h> +#include <config.h> +#include <string.h> + +#include <hardinfo.h> +#include <shell.h> +#include <iconcache.h> +#include <syncmanager.h> + +#include <expr.h> +#include <socket.h> + +#include "devices.h" + +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(); +#if defined(ARCH_x86) || defined(ARCH_x86_64) +gchar *callback_dmi(); +gchar *callback_spd(); +#endif +gchar *callback_device_resources(); + +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); +#if defined(ARCH_x86) || defined(ARCH_x86_64) +void scan_dmi(gboolean reload); +void scan_spd(gboolean reload); +#endif +void scan_device_resources(gboolean reload); + +gboolean root_required_for_resources(void); + +gchar *hi_more_info(gchar *entry); + +enum { + ENTRY_PROCESSOR, + ENTRY_MEMORY, + ENTRY_PCI, + ENTRY_USB, + ENTRY_PRINTERS, + ENTRY_BATTERY, + ENTRY_SENSORS, + ENTRY_INPUT, + ENTRY_STORAGE, + ENTRY_DMI, + ENTRY_SPD, + ENTRY_RESOURCES +}; + +static ModuleEntry entries[] = { + [ENTRY_PROCESSOR] = {N_("Processor"), "processor.png", callback_processors, scan_processors, MODULE_FLAG_NONE}, + [ENTRY_MEMORY] = {N_("Memory"), "memory.png", callback_memory, scan_memory, MODULE_FLAG_NONE}, + [ENTRY_PCI] = {N_("PCI Devices"), "devices.png", callback_pci, scan_pci, MODULE_FLAG_NONE}, + [ENTRY_USB] = {N_("USB Devices"), "usb.png", callback_usb, scan_usb, MODULE_FLAG_NONE}, + [ENTRY_PRINTERS] = {N_("Printers"), "printer.png", callback_printers, scan_printers, MODULE_FLAG_NONE}, + [ENTRY_BATTERY] = {N_("Battery"), "battery.png", callback_battery, scan_battery, MODULE_FLAG_NONE}, + [ENTRY_SENSORS] = {N_("Sensors"), "therm.png", callback_sensors, scan_sensors, MODULE_FLAG_NONE}, + [ENTRY_INPUT] = {N_("Input Devices"), "inputdevices.png", callback_input, scan_input, MODULE_FLAG_NONE}, + [ENTRY_STORAGE] = {N_("Storage"), "hdd.png", callback_storage, scan_storage, MODULE_FLAG_NONE}, +#if defined(ARCH_x86) || defined(ARCH_x86_64) + [ENTRY_DMI] = {N_("DMI"), "computer.png", callback_dmi, scan_dmi, MODULE_FLAG_NONE}, + [ENTRY_SPD] = {N_("Memory SPD"), "memory.png", callback_spd, scan_spd, MODULE_FLAG_NONE}, +#endif /* x86 or x86_64 */ + [ENTRY_RESOURCES] = {N_("Resources"), "resources.png", callback_device_resources, scan_device_resources, MODULE_FLAG_NONE}, + {NULL} +}; + +static GSList *processors = NULL; +gchar *printer_list = NULL; +gchar *printer_icons = NULL; +gchar *pci_list = NULL; +gchar *input_list = NULL; +gchar *storage_list = NULL; +gchar *battery_list = NULL; +gchar *meminfo = NULL; +gchar *lginterval = NULL; + +#include <vendor.h> + +gchar *get_processor_name(void) +{ + scan_processors(FALSE); + + Processor *p = (Processor *) processors->data; + + 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; + } +} + +gchar *get_storage_devices(void) +{ + scan_storage(FALSE); + + return storage_list; +} + +gchar *get_printers(void) +{ + scan_printers(FALSE); + + return printer_list; +} + +gchar *get_input_devices(void) +{ + scan_input(FALSE); + + return input_list; +} + +gchar *get_processor_count(void) +{ + scan_processors(FALSE); + + return g_strdup_printf("%d", g_slist_length(processors)); +} + +gchar *get_processor_frequency(void) +{ + Processor *p; + + scan_processors(FALSE); + + p = (Processor *)processors->data; + if (p->cpu_mhz == 0.0f) { + return g_strdup(N_("Unknown")); + } else { + return g_strdup_printf("%.0f", p->cpu_mhz); + } +} + +gchar *get_pci_device_description(gchar *pci_id) +{ + gchar *description; + + if (!_pci_devices) { + scan_pci(FALSE); + } + + if ((description = g_hash_table_lookup(_pci_devices, pci_id))) { + return g_strdup(description); + } + + return NULL; +} + +gchar *get_memory_total(void) +{ + scan_memory(FALSE); + return moreinfo_lookup ("DEV:Total Memory"); //hi_more_info(N_("Total Memory")); +} + +/* information table from: http://elinux.org/RPi_HardwareHistory */ +static struct { + char *value, *intro, *model, *pcb, *mem, *mfg; +} rpi_boardinfo[] = { +/* Value Introduction Model Name PCB rev. Memory Manufacturer * + * Raspberry Pi %s */ + { "Beta", "Q1 2012", "B (Beta)", "?", "256MB", "(Beta board)" }, + { "0002", "Q1 2012", "B", "1.0", "256MB", "?" }, + { "0003", "Q3 2012", "B (ECN0001)", "1.0", "256MB", "(Fuses mod and D14 removed)" }, + { "0004", "Q3 2012", "B", "2.0", "256MB", "Sony" }, + { "0005", "Q4 2012", "B", "2.0", "256MB", "Qisda" }, + { "0006", "Q4 2012", "B", "2.0", "256MB", "Egoman" }, + { "0007", "Q1 2013", "A", "2.0", "256MB", "Egoman" }, + { "0008", "Q1 2013", "A", "2.0", "256MB", "Sony" }, + { "0009", "Q1 2013", "A", "2.0", "256MB", "Qisda" }, + { "000d", "Q4 2012", "B", "2.0", "512MB", "Egoman" }, + { "000e", "Q4 2012", "B", "2.0", "512MB", "Sony" }, + { "000f", "Q4 2012", "B", "2.0", "512MB", "Qisda" }, + { "0010", "Q3 2014", "B+", "1.0", "512MB", "Sony" }, + { "0011", "Q2 2014", "Compute Module 1", "1.0", "512MB", "Sony" }, + { "0012", "Q4 2014", "A+", "1.1", "256MB", "Sony" }, + { "0013", "Q1 2015", "B+", "1.2", "512MB", "?" }, + { "0014", "Q2 2014", "Compute Module 1", "1.0", "512MB", "Embest" }, + { "0015", "?", "A+", "1.1", "256MB/512MB", "Embest" }, + { "a01040", "Unknown", "2 Model B", "1.0", "1GB", "Sony" }, + { "a01041", "Q1 2015", "2 Model B", "1.1", "1GB", "Sony" }, + { "a21041", "Q1 2015", "2 Model B", "1.1", "1GB", "Embest" }, + { "a22042", "Q3 2016", "2 Model B", "1.2", "1GB", "Embest" }, /* (with BCM2837) */ + { "900021", "Q3 2016", "A+", "1.1", "512MB", "Sony" }, + { "900032", "Q2 2016?", "B+", "1.2", "512MB", "Sony" }, + { "900092", "Q4 2015", "Zero", "1.2", "512MB", "Sony" }, + { "900093", "Q2 2016", "Zero", "1.3", "512MB", "Sony" }, + { "920093", "Q4 2016?", "Zero", "1.3", "512MB", "Embest" }, + { "9000c1", "Q1 2017", "Zero W", "1.1", "512MB", "Sony" }, + { "a02082", "Q1 2016", "3 Model B", "1.2", "1GB", "Sony" }, + { "a020a0", "Q1 2017", "Compute Module 3 or CM3 Lite", "1.0", "1GB", "Sony" }, + { "a22082", "Q1 2016", "3 Model B", "1.2", "1GB", "Embest" }, + { "a32082", "Q4 2016", "3 Model B", "1.2", "1GB", "Sony Japan" }, + { NULL, NULL, NULL, NULL, NULL, NULL } +}; + +static gchar *rpi_get_boardname(void) { + int i = 0, c = 0; + gchar *ret = NULL; + gchar *soc = NULL; + gchar *revision = NULL; + int overvolt = 0; + FILE *cpuinfo; + gchar buffer[128]; + + cpuinfo = fopen("/proc/cpuinfo", "r"); + if (!cpuinfo) + return NULL; + while (fgets(buffer, 128, cpuinfo)) { + gchar **tmp = g_strsplit(buffer, ":", 2); + tmp[0] = g_strstrip(tmp[0]); + tmp[1] = g_strstrip(tmp[1]); + get_str("Revision", revision); + get_str("Hardware", soc); + } + fclose(cpuinfo); + + if (revision == NULL || soc == NULL) { + g_free(soc); + g_free(revision); + return NULL; + } + + if (g_str_has_prefix(revision, "1000")) + overvolt = 1; + + while (rpi_boardinfo[i].value != NULL) { + if (overvolt) + /* +4 to ignore the 1000 prefix */ + c = g_strcmp0(revision+4, rpi_boardinfo[i].value); + else + c = g_strcmp0(revision, rpi_boardinfo[i].value); + + if (c == 0) { + ret = g_strdup_printf("Raspberry Pi %s (%s) pcb-rev:%s soc:%s mem:%s mfg-by:%s%s", + rpi_boardinfo[i].model, rpi_boardinfo[i].intro, + rpi_boardinfo[i].pcb, soc, + rpi_boardinfo[i].mem, rpi_boardinfo[i].mfg, + (overvolt) ? " (over-volted)" : "" ); + break; + } + i++; + } + g_free(soc); + g_free(revision); + return ret; +} + +gchar *get_motherboard(void) +{ + char *board_name, *board_vendor; +#if defined(ARCH_x86) || defined(ARCH_x86_64) + scan_dmi(FALSE); + + board_name = moreinfo_lookup("DEV:DMI:Board:Name"); + board_vendor = moreinfo_lookup("DEV:DMI:Board:Vendor"); + + if (board_name && board_vendor && *board_name && *board_vendor) + return g_strconcat(board_vendor, " ", board_name, NULL); + else if (board_name && *board_name) + return g_strconcat(board_name, _(" (vendor unknown)"), NULL); + else if (board_vendor && *board_vendor) + return g_strconcat(board_vendor, _(" (model unknown)"), NULL); +#else + /* use device tree "model" */ + if (g_file_get_contents("/proc/device-tree/model", &board_vendor, NULL, NULL)) { + + /* if a raspberry pi, try and get a more detailed name */ + if (g_str_has_prefix(board_vendor, "Raspberry Pi")) { + board_name = rpi_get_boardname(); + if (board_name != NULL) { + g_free(board_vendor); + return board_name; + } + } + + return board_vendor; + } +#endif + + return g_strdup(_("Unknown")); +} + +ShellModuleMethod *hi_exported_methods(void) +{ + static ShellModuleMethod m[] = { + {"getProcessorCount", get_processor_count}, + {"getProcessorName", get_processor_name}, + {"getProcessorFrequency", get_processor_frequency}, + {"getMemoryTotal", get_memory_total}, + {"getStorageDevices", get_storage_devices}, + {"getPrinters", get_printers}, + {"getInputDevices", get_input_devices}, + {"getPCIDeviceDescription", get_pci_device_description}, + {"getMotherboard", get_motherboard}, + {NULL} + }; + + return m; +} + +gchar *hi_more_info(gchar * entry) +{ + gchar *info = moreinfo_lookup_with_prefix("DEV", entry); + + if (info) + return g_strdup(info); + + return g_strdup("?"); +} + +gchar *hi_get_field(gchar * field) +{ + gchar *info = moreinfo_lookup_with_prefix("DEV", field); + + if (info) + return g_strdup(info); + + return g_strdup(field); +} + +#if defined(ARCH_x86) || defined(ARCH_x86_64) +void scan_dmi(gboolean reload) +{ + SCAN_START(); + __scan_dmi(); + SCAN_END(); +} + +void scan_spd(gboolean reload) +{ + SCAN_START(); + scan_spd_do(); + SCAN_END(); +} +#endif + +void scan_processors(gboolean reload) +{ + SCAN_START(); + if (!processors) + processors = processor_scan(); + SCAN_END(); +} + +void scan_memory(gboolean reload) +{ + SCAN_START(); + scan_memory_do(); + SCAN_END(); +} + +void scan_battery(gboolean reload) +{ + SCAN_START(); + scan_battery_do(); + SCAN_END(); +} + +void scan_pci(gboolean reload) +{ + SCAN_START(); + scan_pci_do(); + SCAN_END(); +} + +void scan_sensors(gboolean reload) +{ + SCAN_START(); + scan_sensors_do(); + SCAN_END(); +} + +void scan_printers(gboolean reload) +{ + SCAN_START(); + scan_printers_do(); + 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 *callback_processors() +{ + return processor_get_info(processors); +} + +#if defined(ARCH_x86) || defined(ARCH_x86_64) +gchar *callback_dmi() +{ + return g_strdup(dmi_info); +} + +gchar *callback_spd() +{ + return g_strdup(spd_info); +} +#endif + +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); +} + +gchar *callback_printers() +{ + return g_strdup_printf("%s\n" + "[$ShellParam$]\n" + "ViewType=1\n" + "ReloadInterval=5000\n" + "%s", printer_list, printer_icons); +} + +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_strdup_printf("[Input Devices]\n" + "%s" + "[$ShellParam$]\n" + "ViewType=1\n" + "ReloadInterval=5000\n%s", input_list, + input_icons); +} + +gchar *callback_usb() +{ + 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_module_get_name(void) +{ + return g_strdup(_("Devices")); +} + +guchar hi_module_get_weight(void) +{ + return 85; +} + +void hi_module_init(void) +{ + if (!g_file_test("/usr/share/misc/pci.ids", G_FILE_TEST_EXISTS)) { + static SyncEntry se = { + .fancy_name = N_("Update PCI ID listing"), + .name = "GetPCIIds", + .save_to = "pci.ids", + .get_data = NULL + }; + + sync_manager_add_entry(&se); + } + +#if defined(ARCH_x86) || defined(ARCH_x86_64) + { + static SyncEntry se = { + .fancy_name = N_("Update CPU feature database"), + .name = "RecvCPUFlags", + .save_to = "cpuflags.conf", + .get_data = NULL + }; + + sync_manager_add_entry(&se); + } +#endif /* defined(ARCH_x86) */ + + init_memory_labels(); + init_cups(); + sensors_init(); +} + +void hi_module_deinit(void) +{ + moreinfo_del_with_prefix("DEV"); + sensors_shutdown(); + g_hash_table_destroy(memlabels); + g_module_close(cups); +} + +ModuleAbout *hi_module_get_about(void) +{ + static ModuleAbout ma[] = { + { + .author = "Leandro A. F. Pereira", + .description = N_("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; +} + +const gchar *hi_note_func(gint entry) +{ + if (entry == ENTRY_RESOURCES) { + if (root_required_for_resources()) { + return g_strdup_printf(_("Resource information requires superuser privileges")); + } + } + return NULL; +} diff --git a/arch/linux/alpha/processor.h b/modules/devices/alpha/processor.c index 1e5b014c..f55526f7 100644 --- a/arch/linux/alpha/processor.h +++ b/modules/devices/alpha/processor.c @@ -16,14 +16,11 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -struct _Processor { - gchar *model_name; - gfloat bogomips, cpu_mhz; - gchar *strmodel; -}; +#include "hardinfo.h" +#include "devices.h" -static GSList * -__scan_processors(void) +GSList * +processor_scan(void) { Processor *processor; FILE *cpuinfo; @@ -59,7 +56,7 @@ __scan_processors(void) return g_slist_append(NULL, processor); } -static gchar * +gchar * processor_get_info(GSList *processors) { Processor *processor = (Processor *)processors->data; diff --git a/modules/devices/arm/arm_data.c b/modules/devices/arm/arm_data.c new file mode 100644 index 00000000..246cb643 --- /dev/null +++ b/modules/devices/arm/arm_data.c @@ -0,0 +1,215 @@ +/* + * rpiz - https://github.com/bp0/rpiz + * Copyright (C) 2017 Burt P. <pburt0@gmail.com> + * + * 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; either version 2 + * of the License, or (at your option) any later version. + * + * 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 Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include "arm_data.h" + +/* sources: + * https://unix.stackexchange.com/a/43563 + * git:linux/arch/arm/kernel/setup.c + * git:linux/arch/arm64/kernel/cpuinfo.c + */ +static struct { + char *name, *meaning; +} tab_flag_meaning[] = { + /* arm/hw_cap */ + { "swp", "SWP instruction (atomic read-modify-write)" }, + { "half", "Half-word loads and stores" }, + { "thumb", "Thumb (16-bit instruction set)" }, + { "26bit", "26-Bit Model (Processor status register folded into program counter)" }, + { "fastmult", "32x32->64-bit multiplication" }, + { "fpa", "Floating point accelerator" }, + { "vfp", "VFP (early SIMD vector floating point instructions)" }, + { "edsp", "DSP extensions (the 'e' variant of the ARM9 CPUs, and all others above)" }, + { "java", "Jazelle (Java bytecode accelerator)" }, + { "iwmmxt", "SIMD instructions similar to Intel MMX" }, + { "crunch", "MaverickCrunch coprocessor (if kernel support enabled)" }, + { "thumbee", "ThumbEE" }, + { "neon", "Advanced SIMD/NEON on AArch32" }, + { "evtstrm", "kernel event stream using generic architected timer" }, + { "vfpv3", "VFP version 3" }, + { "vfpv3d16", "VFP version 3 with 16 D-registers" }, + { "vfpv4", "VFP version 4 with fast context switching" }, + { "vfpd32", "VFP with 32 D-registers" }, + { "tls", "TLS register" }, + { "idiva", "SDIV and UDIV hardware division in ARM mode" }, + { "idivt", "SDIV and UDIV hardware division in Thumb mode" }, + { "lpae", "40-bit Large Physical Address Extension" }, + /* arm/hw_cap2 */ + { "pmull", "64x64->128-bit F2m multiplication (arch>8)" }, + { "aes", "Crypto:AES (arch>8)" }, + { "sha1", "Crypto:SHA1 (arch>8)" }, + { "sha2", "Crypto:SHA2 (arch>8)" }, + { "crc32", "CRC32 checksum instructions (arch>8)" }, + /* arm64/hw_cap */ + { "fp", "" }, + { "asimd", "Advanced SIMD/NEON on AArch64 (arch>8)" }, + { "atomics", "" }, + { "fphp", "" }, + { "asimdhp", "" }, + { "cpuid", "" }, + { "asimdrdm", "" }, + { "jscvt", "" }, + { "fcma", "" }, + { "lrcpc", "" }, + + { NULL, NULL}, +}; + +static struct { + int code; char *name; +} tab_arm_implementer[] = { + { 0x41, "ARM" }, + { 0x44, "Intel (formerly DEC) StrongARM" }, + { 0x4e, "nVidia" }, + { 0x54, "Texas Instruments" }, + { 0x56, "Marvell" }, + { 0x69, "Intel XScale" }, + { 0, NULL}, +}; + +static struct { + /* source: t = tested, d = official docs, f = web */ + int code; char *part_desc; +} tab_arm_arm_part[] = { /* only valid for implementer 0x41 ARM */ + /*d */ { 0x920, "ARM920" }, + /*d */ { 0x926, "ARM926" }, + /*d */ { 0x946, "ARM946" }, + /*d */ { 0x966, "ARM966" }, + /*d */ { 0xb02, "ARM11 MPCore" }, + /*d */ { 0xb36, "ARM1136" }, + /*d */ { 0xb56, "ARM1156" }, + /*dt*/ { 0xb76, "ARM1176" }, + /*dt*/ { 0xc05, "Cortex-A5" }, + /*d */ { 0xc07, "Cortex-A7 MPCore" }, + /*dt*/ { 0xc08, "Cortex-A8" }, + /*dt*/ { 0xc09, "Cortex-A9" }, + /*d */ { 0xc0e, "Cortex-A17 MPCore" }, + /*d */ { 0xc0f, "Cortex-A15" }, + /*d */ { 0xd01, "Cortex-A32" }, + /*dt*/ { 0xd03, "Cortex-A53" }, + /*d */ { 0xd04, "Cortex-A35" }, + /*d */ { 0xd07, "Cortex-A57 MPCore" }, + /*d */ { 0xd08, "Cortex-A72" }, + /*d */ { 0xd09, "Cortex-A73" }, + { 0, NULL}, +}; + +static char all_flags[1024] = ""; + +#define APPEND_FLAG(f) strcat(all_flags, f); strcat(all_flags, " "); +const char *arm_flag_list() { + int i = 0, built = 0; + built = strlen(all_flags); + if (!built) { + while(tab_flag_meaning[i].name != NULL) { + APPEND_FLAG(tab_flag_meaning[i].name); + i++; + } + } + return all_flags; +} + +const char *arm_flag_meaning(const char *flag) { + int i = 0; + if (flag) + while(tab_flag_meaning[i].name != NULL) { + if (strcmp(tab_flag_meaning[i].name, flag) == 0) + return tab_flag_meaning[i].meaning; + i++; + } + return NULL; +} + +static int code_match(int c0, const char* code1) { + int c1; + if (code1 == NULL) return 0; + c1 = strtol(code1, NULL, 0); + return (c0 == c1) ? 1 : 0; +} + +const char *arm_implementer(const char *code) { + int i = 0; + if (code) + while(tab_arm_implementer[i].code) { + if (code_match(tab_arm_implementer[i].code, code)) + return tab_arm_implementer[i].name; + i++; + } + return NULL; +} + +const char *arm_part(const char *imp_code, const char *part_code) { + int i = 0; + if (imp_code && part_code) { + if (code_match(0x41, imp_code)) { + /* 0x41=ARM parts */ + while(tab_arm_arm_part[i].code) { + if (code_match(tab_arm_arm_part[i].code, part_code)) + return tab_arm_arm_part[i].part_desc; + i++; + } + } + } + return NULL; +} + +char *arm_decoded_name(const char *imp, const char *part, const char *var, const char *rev, const char *arch, const char *model_name) { + char *dnbuff; + char *imp_name = NULL, *part_desc = NULL; + int r = 0, p = 0; + dnbuff = malloc(256); + if (dnbuff) { + memset(dnbuff, 0, 256); + + if (imp && arch && part && rev) { + /* http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0395b/CIHCAGHH.html + * variant and revision can be rendered r{variant}p{revision} */ + r = strtol(var, NULL, 0); + p = strtol(rev, NULL, 0); + imp_name = (char*) arm_implementer(imp); + part_desc = (char*) arm_part(imp, part); + if (imp_name || part_desc) { + sprintf(dnbuff, "%s %s r%dp%d (arch:%s)", + (imp_name) ? imp_name : imp, + (part_desc) ? part_desc : part, + r, p, arch); + } else { + /* fallback for now */ + sprintf(dnbuff, "%s [imp:%s part:%s r%dp%d arch:%s]", + model_name, + (imp_name) ? imp_name : imp, + (part_desc) ? part_desc : part, + r, p, arch); + } + } else { + /* prolly not ARM arch at all */ + if (model_name) + sprintf(dnbuff, "%s", model_name); + else { + free(dnbuff); + return NULL; + } + } + } + return dnbuff; +} diff --git a/modules/devices/arm/arm_data.h b/modules/devices/arm/arm_data.h new file mode 100644 index 00000000..4d1d4cf9 --- /dev/null +++ b/modules/devices/arm/arm_data.h @@ -0,0 +1,38 @@ +/* + * rpiz - https://github.com/bp0/rpiz + * Copyright (C) 2017 Burt P. <pburt0@gmail.com> + * + * 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; either version 2 + * of the License, or (at your option) any later version. + * + * 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 Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef _ARMDATA_H_ +#define _ARMDATA_H_ + +/* table lookups */ +const char *arm_implementer(const char *code); +const char *arm_part(const char *imp_code, const char *part_code); + +/* cpu_implementer, cpu_part, cpu_variant, cpu_revision, cpu_architecture from /proc/cpuinfo + * model_name is returned as a fallback if not enough data is known */ +char *arm_decoded_name( + const char *imp, const char *part, const char *var, const char *rev, + const char *arch, const char *model_name); + +/* cpu flags from /proc/cpuinfo */ +const char *arm_flag_list(void); /* list of all known flags */ +const char *arm_flag_meaning(const char *flag); /* lookup flag meaning */ + +#endif diff --git a/modules/devices/arm/processor.c b/modules/devices/arm/processor.c new file mode 100644 index 00000000..c94f41e5 --- /dev/null +++ b/modules/devices/arm/processor.c @@ -0,0 +1,340 @@ +/* + * HardInfo - Displays System Information + * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@hardinfo.org> + * + * 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 "hardinfo.h" +#include "devices.h" + +#include "arm_data.h" +#include "arm_data.c" + +enum { + ARM_A32 = 0, + ARM_A64 = 1, + ARM_A32_ON_A64 = 2, +}; + +static const gchar *arm_mode_str[] = { + "A32", + "A64", + "A32 on A64", +}; + +GHashTable *cpu_flags = NULL; /* FIXME: when is it freed? */ + +static void +populate_cpu_flags_list_internal() +{ + int i; + gchar **afl, *fm; + + cpu_flags = g_hash_table_new(g_str_hash, g_str_equal); + afl = g_strsplit(arm_flag_list(), " ", 0); + while(afl[i] != NULL) { + fm = (char *)arm_flag_meaning(afl[i]); + if (g_strcmp0(afl[i], "") != 0) + g_hash_table_insert(cpu_flags, afl[i], (fm) ? fm : ""); + i++; + } +} + +static gint get_cpu_int(const gchar* file, gint cpuid) { + gchar *tmp0 = NULL; + gchar *tmp1 = NULL; + gint ret = 0; + + tmp0 = g_strdup_printf("/sys/devices/system/cpu/cpu%d/%s", cpuid, file); + g_file_get_contents(tmp0, &tmp1, NULL, NULL); + if (tmp1) + ret = atol(tmp1); + g_free(tmp0); + g_free(tmp1); + return ret; +} + +int processor_has_flag(gchar * strflags, gchar * strflag) +{ + gchar **flags; + gint ret = 0; + if (strflags == NULL || strflag == NULL) + return 0; + flags = g_strsplit(strflags, " ", 0); + ret = g_strv_contains((const gchar * const *)flags, strflag); + g_strfreev(flags); + return ret; +} + +#define PROC_CPUINFO "/proc/cpuinfo" + +GSList * +processor_scan(void) +{ + GSList *procs = NULL; + Processor *processor = NULL; + FILE *cpuinfo; + gchar buffer[128]; + gchar *rep_pname = NULL; + gchar *tmpfreq_str = NULL; + GSList *pi = NULL; + + cpuinfo = fopen(PROC_CPUINFO, "r"); + if (!cpuinfo) + return NULL; + +#define CHECK_FOR(k) (g_str_has_prefix(tmp[0], k)) + 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]); + } else { + g_strfreev(tmp); + continue; + } + + get_str("Processor", rep_pname); + + if ( CHECK_FOR("processor") ) { + /* finish previous */ + if (processor) { + procs = g_slist_append(procs, processor); + } + + /* start next */ + processor = g_new0(Processor, 1); + processor->id = atol(tmp[1]); + + if (rep_pname) + processor->model_name = g_strdup(rep_pname); + + g_strfreev(tmp); + continue; + } + + if (!processor && + ( CHECK_FOR("model name") + || CHECK_FOR("Features") + || CHECK_FOR("BogoMIPS") ) ) { + + /* single proc/core may not have "processor : n" */ + processor = g_new0(Processor, 1); + processor->id = 0; + + if (rep_pname) + processor->model_name = g_strdup(rep_pname); + } + + if (processor) { + get_str("model name", processor->model_name); + get_str("Features", processor->flags); + get_float("BogoMIPS", processor->bogomips); + + get_str("CPU implementer", processor->cpu_implementer); + get_str("CPU architecture", processor->cpu_architecture); + get_str("CPU variant", processor->cpu_variant); + get_str("CPU part", processor->cpu_part); + get_str("CPU revision", processor->cpu_revision); + } + g_strfreev(tmp); + } + + if (processor) + procs = g_slist_append(procs, processor); + + g_free(rep_pname); + fclose(cpuinfo); + + /* re-duplicate missing data for /proc/cpuinfo variant that de-duplicated it */ +#define REDUP(f) if (dproc->f && !processor->f) processor->f = g_strdup(dproc->f); + Processor *dproc; + GSList *l; + l = procs = g_slist_reverse(procs); + while (l) { + processor = l->data; + if (processor->flags) { + dproc = processor; + } else if (dproc) { + REDUP(flags); + REDUP(cpu_implementer); + REDUP(cpu_architecture); + REDUP(cpu_variant); + REDUP(cpu_part); + REDUP(cpu_revision); + } + l = g_slist_next(l); + } + procs = g_slist_reverse(procs); + + /* data not from /proc/cpuinfo */ + for (pi = procs; pi; pi = pi->next) { + processor = (Processor *) pi->data; + + /* strings can't be null or segfault later */ +#define UNKIFNULL(f) if (processor->f == NULL) processor->f = g_strdup("(Unknown)"); +#define EMPIFNULL(f) if (processor->f == NULL) processor->f = g_strdup(""); + UNKIFNULL(model_name); + EMPIFNULL(flags); + UNKIFNULL(cpu_implementer); + UNKIFNULL(cpu_architecture); + UNKIFNULL(cpu_variant); + UNKIFNULL(cpu_part); + UNKIFNULL(cpu_revision); + + processor->decoded_name = arm_decoded_name( + processor->cpu_implementer, processor->cpu_part, + processor->cpu_variant, processor->cpu_revision, + processor->cpu_architecture, processor->model_name); + + /* freq */ + processor->cpukhz_cur = get_cpu_int("cpufreq/scaling_cur_freq", processor->id); + processor->cpukhz_min = get_cpu_int("cpufreq/scaling_min_freq", processor->id); + processor->cpukhz_max = get_cpu_int("cpufreq/scaling_max_freq", processor->id); + if (processor->cpukhz_max) + processor->cpu_mhz = processor->cpukhz_max / 1000; + else + processor->cpu_mhz = 0.0f; + + /* mode */ + processor->mode = ARM_A32; + if ( processor_has_flag(processor->flags, "pmull") + || processor_has_flag(processor->flags, "crc32") ) { +#ifdef __aarch64__ + processor->mode = ARM_A64; +#else + processor->mode = ARM_A32_ON_A64; +#endif + } + } + + return procs; +} + +gchar *processor_get_capabilities_from_flags(gchar * strflags) +{ + gchar **flags, **old; + gchar *tmp = NULL; + gint j = 0; + + if (!cpu_flags) + populate_cpu_flags_list_internal(); + + flags = g_strsplit(strflags, " ", 0); + old = flags; + + while (flags[j]) { + gchar *meaning = g_hash_table_lookup(cpu_flags, flags[j]); + + if (meaning) { + tmp = h_strdup_cprintf("%s=%s\n", tmp, flags[j], meaning); + } else { + tmp = h_strdup_cprintf("%s=\n", tmp, flags[j]); + } + j++; + } + if (tmp == NULL || g_strcmp0(tmp, "") == 0) + tmp = g_strdup_printf("%s=%s\n", "empty", _("Empty List")); + + g_strfreev(old); + return tmp; +} + +gchar * +processor_get_detailed_info(Processor *processor) +{ + gchar *tmp_flags, *tmp_imp, *tmp_part, *ret; + tmp_flags = processor_get_capabilities_from_flags(processor->flags); + tmp_imp = (char*)arm_implementer(processor->cpu_implementer); + tmp_part = (char *)arm_part(processor->cpu_implementer, processor->cpu_part); + ret = g_strdup_printf("[Processor]\n" + "Linux Name=%s\n" + "Decoded Name=%s\n" + "Mode=%s\n" + "BogoMips=%.2f\n" + "Endianesss=" +#if G_BYTE_ORDER == G_LITTLE_ENDIAN + "Little Endian" +#else + "Big Endian" +#endif + "\n" + "[Frequency Scaling]\n" + "Minimum=%d kHz\n" + "Maximum=%d kHz\n" + "Current=%d kHz\n" + "[ARM]\n" + "Implementer=[%s] %s\n" + "Part=[%s] %s\n" + "Architecture=%s\n" + "Variant=%s\n" + "Revision=%s\n" + "[Capabilities]\n" + "%s" + "%s", + processor->model_name, + processor->decoded_name, + arm_mode_str[processor->mode], + processor->bogomips, + processor->cpukhz_min, + processor->cpukhz_max, + processor->cpukhz_cur, + processor->cpu_implementer, (tmp_imp) ? tmp_imp : "", + processor->cpu_part, (tmp_part) ? tmp_part : "", + processor->cpu_architecture, + processor->cpu_variant, + processor->cpu_revision, + tmp_flags, + ""); + g_free(tmp_flags); + return ret; +} + +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); + moreinfo_add_with_prefix("DEV", hashkey, + processor_get_detailed_info(processor)); + g_free(hashkey); + } + + 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/arch/linux/common/battery.h b/modules/devices/battery.c index d378fdef..cbcebb12 100644 --- a/arch/linux/common/battery.h +++ b/modules/devices/battery.c @@ -16,8 +16,12 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include <string.h> #include <time.h> +#include "hardinfo.h" +#include "devices.h" + const struct { gchar *key, *name; } ups_fields[] = { @@ -56,8 +60,7 @@ __scan_battery_apcupsd(void) int i; apcaccess_path = find_program("apcaccess"); - - if ((apcaccess = popen(apcaccess_path, "r"))) { + if (apcaccess_path && (apcaccess = popen(apcaccess_path, "r"))) { /* first line isn't important */ if (fgets(buffer, 512, apcaccess)) { /* allocate the key, value hash table */ @@ -106,6 +109,7 @@ __scan_battery_acpi(void) gchar *model = NULL, *serial = NULL, *type = NULL; gchar *state = NULL, *rate = NULL; gchar *remaining = NULL; + gchar *manufacturer = NULL; acpi_path = g_strdup("/proc/acpi/battery"); if (g_file_test(acpi_path, G_FILE_TEST_EXISTS)) { @@ -136,6 +140,7 @@ __scan_battery_acpi(void) GET_STR("model number", model); GET_STR("serial number", serial); GET_STR("battery type", type); + GET_STR("OEM info", manufacturer); g_strfreev(tmp); } @@ -159,21 +164,33 @@ __scan_battery_acpi(void) } fclose(f); + + const gchar *url = vendor_get_url(manufacturer); + if (url) { + char *tmp = g_strdup_printf("%s (%s)", vendor_get_name(manufacturer), url); + g_free(manufacturer); + manufacturer = tmp; + } if (g_str_equal(present, "yes")) { - charge_rate = atof(remaining) / atof(capacity); - - battery_list = h_strdup_cprintf("\n[Battery: %s]\n" + if (remaining && capacity) + charge_rate = atof(remaining) / atof(capacity); + else + charge_rate = 0; + + battery_list = h_strdup_cprintf(_("\n[Battery: %s]\n" "State=%s (load: %s)\n" "Capacity=%s / %s (%.2f%%)\n" "Battery Technology=%s (%s)\n" + "Manufacturer=%s\n" "Model Number=%s\n" - "Serial Number=%s\n", + "Serial Number=%s\n"), battery_list, entry, state, rate, remaining, capacity, charge_rate * 100.0, technology, type, + manufacturer, model, serial); } @@ -188,9 +205,10 @@ __scan_battery_acpi(void) g_free(state); g_free(remaining); g_free(rate); + g_free(manufacturer); present = capacity = technology = type = \ - model = serial = state = remaining = rate = NULL; + model = serial = state = remaining = rate = manufacturer = NULL; } g_dir_close(acpi); @@ -200,6 +218,86 @@ __scan_battery_acpi(void) g_free(acpi_path); } +static gchar * +read_contents(const gchar *base, const gchar *key) +{ + gchar *value; + gchar *path; + + path = g_strdup_printf("%s/%s", base, key); + if (!path) + return NULL; + + if (!g_file_get_contents(path, &value, NULL, NULL)) { + free(path); + return NULL; + } + + free(path); + return g_strchomp(value); +} + +static void +__scan_battery_sysfs_add_battery(const gchar *name) +{ + gchar *path = g_strdup_printf("/sys/class/power_supply/%s", name); + gchar *status, *capacity, *capacity_level, *technology, *manufacturer, + *model_name, *serial_number; + + if (!path) + return; + + status = read_contents(path, "status"); + capacity = read_contents(path, "capacity"); + capacity_level = read_contents(path, "capacity_level"); + technology = read_contents(path, "technology"); + manufacturer = read_contents(path, "manufacturer"); + model_name = read_contents(path, "model_name"); + serial_number = read_contents(path, "serial_number"); + + battery_list = h_strdup_cprintf(_("\n[Battery: %s]\n" + "State=%s\n" + "Capacity=%s / %s\n" + "Battery Technology=%s\n" + "Manufacturer=%s\n" + "Model Number=%s\n" + "Serial Number=%s\n"), + battery_list, + name, + status, + capacity, capacity_level, + technology, + manufacturer, + model_name, + serial_number); + + free(status); + free(capacity); + free(capacity_level); + free(technology); + free(manufacturer); + free(model_name); + free(serial_number); +} + +static void +__scan_battery_sysfs(void) +{ + GDir *dir; + const gchar *entry; + + dir = g_dir_open("/sys/class/power_supply", 0, NULL); + if (!dir) + return; + + while ((entry = g_dir_read_name(dir))) { + if (g_str_has_prefix(entry, "BAT")) + __scan_battery_sysfs_add_battery(entry); + } + + g_dir_close(dir); +} + static void __scan_battery_apm(void) { @@ -245,23 +343,23 @@ __scan_battery_apm(void) } if (stotal && sremaining) { - battery_list = h_strdup_cprintf("\n[Battery (APM)]\n" + battery_list = h_strdup_cprintf(_("\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", + "APM BIOS version=%s\n"), battery_list, percentage, sremaining, stotal, ac_status[ac_bat], apm_drv_ver, apm_bios_ver); } else { - battery_list = h_strdup_cprintf("\n[Battery (APM)]\n" + battery_list = h_strdup_cprintf(_("\n[Battery (APM)]\n" "Charge=%d%%\n" "Using=%s\n" "APM driver version=%s\n" - "APM BIOS version=%s\n", + "APM BIOS version=%s\n"), battery_list, percentage, ac_status[ac_bat], @@ -270,14 +368,13 @@ __scan_battery_apm(void) } } -static void -__scan_battery(void) +void +scan_battery_do(void) { - if (battery_list) { - g_free(battery_list); - } + g_free(battery_list); battery_list = g_strdup(""); + __scan_battery_sysfs(); __scan_battery_acpi(); __scan_battery_apm(); __scan_battery_apcupsd(); @@ -285,7 +382,7 @@ __scan_battery(void) if (*battery_list == '\0') { g_free(battery_list); - battery_list = g_strdup("[No batteries]\n" - "No batteries found on this system=\n"); + battery_list = g_strdup(_("[No batteries]\n" + "No batteries found on this system=\n")); } } diff --git a/arch/linux/common/devmemory.h b/modules/devices/devmemory.c index e3921cdd..7131536c 100644 --- a/arch/linux/common/devmemory.h +++ b/modules/devices/devmemory.c @@ -16,9 +16,12 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -static GHashTable *memlabels; +#include <string.h> +#include "devices.h" -static void __scan_memory() +GHashTable *memlabels = NULL; + +void scan_memory_do(void) { gchar **keys, *tmp; static gint offset = -1; @@ -28,8 +31,12 @@ static void __scan_memory() /* gah. linux 2.4 adds three lines of data we don't need in /proc/meminfo */ gchar *os_kernel = module_call_method("computer::getOSKernel"); - offset = strstr(os_kernel, "Linux 2.4") ? 3 : 0; - g_free(os_kernel); + if (os_kernel) { + offset = strstr(os_kernel, "Linux 2.4") ? 3 : 0; + g_free(os_kernel); + } else { + offset = 0; + } } g_file_get_contents("/proc/meminfo", &meminfo, NULL, NULL); @@ -57,7 +64,7 @@ static void __scan_memory() newkeys[0] = g_strdup(tmp); } - g_hash_table_replace(moreinfo, g_strdup(newkeys[0]), g_strdup(newkeys[1])); + moreinfo_add_with_prefix("DEV", newkeys[0], g_strdup(newkeys[1])); tmp = g_strconcat(meminfo, newkeys[0], "=", newkeys[1], "\n", NULL); g_free(meminfo); @@ -73,21 +80,21 @@ static void __scan_memory() g_strfreev(keys); } -static void __init_memory_labels(void) +void init_memory_labels(void) { - static struct { + static const 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" }, + { "MemTotal", N_("Total Memory") }, + { "MemFree", N_("Free Memory") }, + { "SwapCached", N_("Cached Swap") }, + { "HighTotal", N_("High Memory") }, + { "HighFree", N_("Free High Memory") }, + { "LowTotal", N_("Low Memory") }, + { "LowFree", N_("Free Low Memory") }, + { "SwapTotal", N_("Virtual Memory") }, + { "SwapFree", N_("Free Virtual Memory") }, { NULL }, }; gint i; @@ -95,6 +102,7 @@ static void __init_memory_labels(void) 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); + g_hash_table_insert(memlabels, proc2real[i].proc_label, + _(proc2real[i].real_label)); } } diff --git a/arch/linux/common/dmi.h b/modules/devices/dmi.c index 7c5e6e6f..61cea65d 100644 --- a/arch/linux/common/dmi.h +++ b/modules/devices/dmi.c @@ -20,6 +20,8 @@ */ #include <unistd.h> #include <sys/types.h> + +#include "devices.h" typedef struct _DMIInfo DMIInfo; @@ -30,21 +32,28 @@ struct _DMIInfo { }; DMIInfo dmi_info_table[] = { - { "$BIOS", NULL, NULL }, - { "Date", "/sys/class/dmi/id/bios_date", "bios-release-date" }, - { "Vendor", "/sys/class/dmi/id/bios_vendor", "bios-vendor" }, - { "Version", "/sys/class/dmi/id/bios_version", "bios-version" }, - { "$Board", NULL, NULL }, - { "Name", "/sys/class/dmi/id/board_name", "baseboard-product-name" }, - { "Vendor", "/sys/class/dmi/id/board_vendor", "baseboard-manufacturer" }, + { "$BIOS", NULL, NULL }, + { "Date", "/sys/class/dmi/id/bios_date", "bios-release-date" }, + { "Vendor", "/sys/class/dmi/id/bios_vendor", "bios-vendor" }, + { "Version", "/sys/class/dmi/id/bios_version", "bios-version" }, + { "$Board", NULL, NULL }, + { "Name", "/sys/class/dmi/id/board_name", "baseboard-product-name" }, + { "Vendor", "/sys/class/dmi/id/board_vendor", "baseboard-manufacturer" }, }; -static gchar *dmi_info = NULL; +gchar *dmi_info = NULL; + +static void add_to_moreinfo(const char *group, const char *key, char *value) +{ + char *new_key = g_strconcat("DMI:", group, ":", key, NULL); + moreinfo_add_with_prefix("DEV", new_key, g_strdup(g_strstrip(value))); +} gboolean dmi_get_info_dmidecode() { FILE *dmi_pipe; gchar buffer[256]; + const gchar *group; DMIInfo *info; gboolean dmi_failed = FALSE; gint i; @@ -58,8 +67,8 @@ gboolean dmi_get_info_dmidecode() info = &dmi_info_table[i]; if (*(info->name) == '$') { - dmi_info = h_strdup_cprintf("[%s]\n", dmi_info, - (info->name) + 1); + group = info->name + 1; + dmi_info = h_strdup_cprintf("[%s]\n", dmi_info, group); } else { gchar *temp; @@ -75,6 +84,8 @@ gboolean dmi_get_info_dmidecode() dmi_failed = TRUE; break; } + + add_to_moreinfo(group, info->name, buffer); const gchar *url = vendor_get_url(buffer); if (url) { @@ -119,6 +130,7 @@ gboolean dmi_get_info_sys() { FILE *dmi_file; gchar buffer[256]; + const gchar *group = NULL; DMIInfo *info; gboolean dmi_failed = FALSE; gint i; @@ -132,15 +144,14 @@ gboolean dmi_get_info_sys() info = &dmi_info_table[i]; if (*(info->name) == '$') { - dmi_info = h_strdup_cprintf("[%s]\n", dmi_info, - (info->name) + 1); - } else { - if (!info->file) - continue; - + group = info->name + 1; + dmi_info = h_strdup_cprintf("[%s]\n", dmi_info, group); + } else if (group && info->file) { if ((dmi_file = fopen(info->file, "r"))) { (void)fgets(buffer, 256, dmi_file); fclose(dmi_file); + + add_to_moreinfo(group, info->name, buffer); const gchar *url = vendor_get_url(buffer); if (url) { diff --git a/arch/linux/ia64/processor.h b/modules/devices/ia64/processor.c index d3d41519..55e5e3a8 100644 --- a/arch/linux/ia64/processor.h +++ b/modules/devices/ia64/processor.c @@ -16,15 +16,11 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -struct _Processor { - gchar *model_name; - gchar *vendor_id; - gfloat bogomips, cpu_mhz; - gchar *strmodel; -}; +#include "hardinfo.h" +#include "devices.h" -static GSList * -__scan_processors(void) +GSList * +processor_scan(void) { Processor *processor; FILE *cpuinfo; @@ -58,7 +54,7 @@ __scan_processors(void) return g_slist_append(NULL, processor); } -static gchar * +gchar * processor_get_info(GSList *processors) { Processor *processor = (Processor *)processors->data; diff --git a/arch/linux/common/inputdevices.h b/modules/devices/inputdevices.c index 20e4289c..d3f8847f 100644 --- a/arch/linux/common/inputdevices.h +++ b/modules/devices/inputdevices.c @@ -16,13 +16,12 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -static gchar *input_icons = NULL; +#include <string.h> -static gboolean -remove_input_devices(gpointer key, gpointer value, gpointer data) -{ - return g_str_has_prefix(key, "INP"); -} +#include "hardinfo.h" +#include "devices.h" + +gchar *input_icons = NULL; static struct { char *name; @@ -39,9 +38,9 @@ void __scan_input_devices(void) { FILE *dev; - gchar buffer[128]; + gchar buffer[1024]; gchar *tmp, *name = NULL, *phys = NULL; - gint bus, vendor, product, version; + gint bus = 0, vendor = 0, product = 0, version = 0; int d = 0, n = 0; dev = fopen("/proc/bus/input/devices", "r"); @@ -49,19 +48,20 @@ __scan_input_devices(void) return; if (input_list) { - g_hash_table_foreach_remove(moreinfo, remove_input_devices, NULL); + moreinfo_del_with_prefix("DEV:INP"); g_free(input_list); g_free(input_icons); } input_list = g_strdup(""); input_icons = g_strdup(""); - while (fgets(buffer, 128, dev)) { + while (fgets(buffer, sizeof(buffer), dev)) { tmp = buffer; switch (*tmp) { case 'N': - name = g_strdup(tmp + strlen("N: Name=")); + tmp = strreplacechr(tmp + strlen("N: Name="), "=", ':'); + name = g_strdup(tmp); remove_quotes(name); break; case 'P': @@ -82,7 +82,7 @@ __scan_input_devices(void) d = 4; //INPUT_UNKNOWN; break; case '\n': - if (strstr(name, "PC Speaker")) { + if (name && strstr(name, "PC Speaker")) { d = 3; // INPUT_PCSPKR } @@ -118,17 +118,18 @@ __scan_input_devices(void) "Version=0x%x\n", strhash, product, version); - if (phys[1] != 0) { + if (phys && phys[1] != 0) { strhash = h_strdup_cprintf("Connected to=%s\n", strhash, phys); } - if (strstr(phys,"ir")) { + if (phys && strstr(phys, "ir")) { strhash = h_strdup_cprintf("InfraRed port=yes\n", strhash); } - g_hash_table_insert(moreinfo, tmp, strhash); + moreinfo_add_with_prefix("DEV", tmp, strhash); + g_free(tmp); g_free(phys); g_free(name); diff --git a/arch/linux/m68k/processor.h b/modules/devices/m68k/processor.c index 6fbd8293..d9902428 100644 --- a/arch/linux/m68k/processor.h +++ b/modules/devices/m68k/processor.c @@ -16,15 +16,11 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -struct _Processor { - gchar *model_name; - gfloat bogomips, cpu_mhz; +#include "hardinfo.h" +#include "devices.h" - gchar *has_fpu; -}; - -static GSList * -__scan_processors(void) +GSList * +processor_scan(void) { Processor *processor; FILE *cpuinfo; @@ -61,7 +57,7 @@ __scan_processors(void) return g_slist_append(NULL, processor); } -static gchar * +gchar * processor_get_info(GSList *processors) { Processor *processor = (Processor *)processors->data; diff --git a/arch/linux/mips/processor.h b/modules/devices/mips/processor.c index cd10bd7a..86c9b958 100644 --- a/arch/linux/mips/processor.h +++ b/modules/devices/mips/processor.c @@ -16,14 +16,11 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -struct _Processor { - gchar *model_name; - gchar *vendor_id; - gfloat bogomips, cpu_mhz; -}; +#include "hardinfo.h" +#include "devices.h" -static GSList * -__scan_processors(void) +GSList * +processor_scan(void) { Processor *processor; FILE *cpuinfo; @@ -54,7 +51,7 @@ __scan_processors(void) return g_slist_append(NULL, processor); } -static gchar * +gchar * processor_get_info(GSList *processors) { Processor *processor = (Processor *)processors->data; diff --git a/arch/linux/parisc/processor.h b/modules/devices/parisc/processor.c index 1712e523..83672126 100644 --- a/arch/linux/parisc/processor.h +++ b/modules/devices/parisc/processor.c @@ -16,19 +16,11 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -struct _Processor { - gchar *model_name; - gchar *vendor_id; - gchar *flags; - gfloat bogomips, cpu_mhz; +#include "hardinfo.h" +#include "devices.h" - gchar *has_fpu; - - gchar *strmodel; -}; - -static GSList * -__scan_processors(void) +GSList * +processors_scan(void) { Processor *processor; FILE *cpuinfo; @@ -65,7 +57,7 @@ __scan_processors(void) return g_slist_append(NULL, processor); } -static gchar * +gchar * processor_get_info(GSList *processors) { Processor *processor = (Processor *)processors->data; diff --git a/arch/linux/common/pci.h b/modules/devices/pci.c index 73d87c7f..91ff914d 100644 --- a/arch/linux/common/pci.h +++ b/modules/devices/pci.c @@ -26,10 +26,15 @@ * copies of information scattered everywhere like we do today). */ +#include <string.h> + +#include "hardinfo.h" +#include "devices.h" + GHashTable *_pci_devices = NULL; void -__scan_pci(void) +scan_pci_do(void) { FILE *lspci; gchar buffer[256], *buf, *strhash = NULL, *strdevice = NULL; @@ -161,7 +166,8 @@ __scan_pci(void) gpointer start, end; if (strdevice != NULL && strhash != NULL) { - g_hash_table_insert(moreinfo, strhash, strdevice); + moreinfo_add_with_prefix("DEV", strhash, strdevice); + g_free(strhash); g_free(category); g_free(name); } @@ -186,10 +192,6 @@ __scan_pci(void) 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"; @@ -234,7 +236,8 @@ pci_error: pci_list = g_strconcat(pci_list, "No PCI devices found=\n", NULL); } else if (strhash) { /* insert the last device */ - g_hash_table_insert(moreinfo, strhash, strdevice); + moreinfo_add_with_prefix("DEV", strhash, strdevice); + g_free(strhash); g_free(category); g_free(name); } diff --git a/arch/linux/ppc/processor.h b/modules/devices/ppc/processor.c index 863b2eb7..a7988f97 100644 --- a/arch/linux/ppc/processor.h +++ b/modules/devices/ppc/processor.c @@ -16,15 +16,11 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -struct _Processor { - gchar *model_name; - gchar *vendor_id; - gint cache_size; - gfloat bogomips, cpu_mhz; -}; +#include "hardinfo.h" +#include "devices.h" -static GSList * -__scan_processors(void) +GSList * +processor_scan(void) { Processor *processor; FILE *cpuinfo; @@ -63,7 +59,7 @@ __scan_processors(void) return g_slist_append(NULL, processor); } -static gchar * +gchar * processor_get_info(GSList *processors) { Processor *processor = (Processor *)processors->data; diff --git a/arch/common/printers.h b/modules/devices/printers.c index 2f221252..77b52a43 100644 --- a/arch/common/printers.h +++ b/modules/devices/printers.c @@ -20,6 +20,8 @@ #include <stdlib.h> #include <time.h> +#include "devices.h" + typedef struct _CUPSDest CUPSDest; typedef struct _CUPSOption CUPSOption; @@ -38,16 +40,11 @@ static int (*cups_dests_get) (CUPSDest **dests) = NULL; static int (*cups_dests_free) (int num_dests, CUPSDest *dests) = NULL; static gboolean cups_init = FALSE; -static gboolean -remove_printer_devices(gpointer key, gpointer value, gpointer data) -{ - return g_str_has_prefix(key, "PRN"); -} +GModule *cups; -static void -__init_cups(void) +void +init_cups(void) { - static GModule *cups = NULL; const char *libcups[] = { "libcups", "libcups.so", "libcups.so.1", "libcups.so.2", NULL }; if (!(cups_dests_get && cups_dests_free)) { @@ -81,42 +78,42 @@ gchar *__cups_callback_ptype(gchar *strvalue) gchar *output = g_strdup("\n"); if (value & 0x0004) - output = h_strdup_cprintf("\342\232\254 Can do black and white printing=\n", output); + output = h_strdup_cprintf(_("\342\232\254 Can do black and white printing=\n"), output); if (value & 0x0008) - output = h_strdup_cprintf("\342\232\254 Can do color printing=\n", output); + output = h_strdup_cprintf(_("\342\232\254 Can do color printing=\n"), output); if (value & 0x0010) - output = h_strdup_cprintf("\342\232\254 Can do duplexing=\n", output); + output = h_strdup_cprintf(_("\342\232\254 Can do duplexing=\n"), output); if (value & 0x0020) - output = h_strdup_cprintf("\342\232\254 Can do staple output=\n", output); + output = h_strdup_cprintf(_("\342\232\254 Can do staple output=\n"), output); if (value & 0x0040) - output = h_strdup_cprintf("\342\232\254 Can do copies=\n", output); + output = h_strdup_cprintf(_("\342\232\254 Can do copies=\n"), output); if (value & 0x0080) - output = h_strdup_cprintf("\342\232\254 Can collate copies=\n", output); + output = h_strdup_cprintf(_("\342\232\254 Can collate copies=\n"), output); if (value & 0x80000) - output = h_strdup_cprintf("\342\232\254 Printer is rejecting jobs=\n", output); + output = h_strdup_cprintf(_("\342\232\254 Printer is rejecting jobs=\n"), output); if (value & 0x1000000) - output = h_strdup_cprintf("\342\232\254 Printer was automatically discovered and added=\n", output); + output = h_strdup_cprintf(_("\342\232\254 Printer was automatically discovered and added=\n"), output); return output; } else { - return g_strdup("Unknown"); + return g_strdup(_("Unknown")); } } gchar *__cups_callback_state(gchar *value) { if (!value) { - return g_strdup("Unknown"); + return g_strdup(_("Unknown")); } if (g_str_equal(value, "3")) { - return g_strdup("Idle"); + return g_strdup(_("Idle")); } else if (g_str_equal(value, "4")) { - return g_strdup("Printing a Job"); + return g_strdup(_("Printing a Job")); } else if (g_str_equal(value, "5")) { - return g_strdup("Stopped"); + return g_strdup(_("Stopped")); } else { - return g_strdup("Unknown"); + return g_strdup(_("Unknown")); } } @@ -131,16 +128,16 @@ gchar *__cups_callback_state_change_time(gchar *value) return g_strdup(buf); } else { - return g_strdup("Unknown"); + return g_strdup(_("Unknown")); } } gchar *__cups_callback_boolean(gchar *value) { if (value) { - return g_strdup(g_str_equal(value, "1") ? "Yes" : "No"); + return g_strdup(g_str_equal(value, "1") ? _("Yes") : _("No")); } else { - return g_strdup("Unknown"); + return g_strdup(_("Unknown")); } } @@ -177,28 +174,31 @@ const struct { }; void -__scan_printers(void) +scan_printers_do(void) { int num_dests, i, j; CUPSDest *dests; gchar *prn_id, *prn_moreinfo; g_free(printer_list); + g_free(printer_icons); if (!cups_init) { - __init_cups(); + init_cups(); - printer_list = g_strdup("[Printers]\n" - "No suitable CUPS library found="); + printer_icons = g_strdup(""); + printer_list = g_strdup(_("[Printers]\n" + "No suitable CUPS library found=")); return; } /* remove old devices from global device table */ - g_hash_table_foreach_remove(moreinfo, remove_printer_devices, NULL); + moreinfo_del_with_prefix("DEV:PRN"); num_dests = cups_dests_get(&dests); if (num_dests > 0) { - printer_list = g_strdup_printf("[Printers (CUPS)]\n"); + printer_list = g_strdup_printf(_("[Printers (CUPS)]\n")); + printer_icons = g_strdup(""); for (i = 0; i < num_dests; i++) { GHashTable *options; @@ -217,6 +217,10 @@ __scan_printers(void) prn_id, dests[i].name, dests[i].is_default ? "<i>Default</i>" : ""); + printer_icons = h_strdup_cprintf("\nIcon$%s$%s=printer.png", + printer_icons, + prn_id, + dests[i].name); prn_moreinfo = g_strdup(""); for (j = 0; j < G_N_ELEMENTS(cups_fields); j++) { @@ -234,9 +238,9 @@ __scan_printers(void) } else { if (temp) { /* FIXME Do proper escaping */ - temp = g_strdup(strreplace(temp, "&=", ' ')); + temp = g_strdup(strreplacechr(temp, "&=", ' ')); } else { - temp = g_strdup("Unknown"); + temp = g_strdup(_("Unknown")); } } @@ -249,13 +253,14 @@ __scan_printers(void) } } - g_hash_table_insert(moreinfo, prn_id, prn_moreinfo); + moreinfo_add_with_prefix("DEV", prn_id, prn_moreinfo); + g_free(prn_id); g_hash_table_destroy(options); } cups_dests_free(num_dests, dests); } else { - printer_list = g_strdup("[Printers]\n" - "No printers found=\n"); + printer_list = g_strdup(_("[Printers]\n" + "No printers found=\n")); } } diff --git a/arch/linux/common/resources.h b/modules/devices/resources.c index 20db65e9..15cb8f21 100644 --- a/arch/linux/common/resources.h +++ b/modules/devices/resources.c @@ -16,7 +16,12 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -gchar *_resources = NULL; +#include <string.h> + +#include "devices.h" + +static gchar *_resources = NULL; +static gboolean _require_root = FALSE; #if GLIB_CHECK_VERSION(2,14,0) static GRegex *_regex_pci = NULL, @@ -38,12 +43,12 @@ static gchar *_resource_obtain_name(gchar *name) if (g_regex_match(_regex_pci, name, 0, NULL)) { temp = module_call_method_param("devices::getPCIDeviceDescription", name); if (temp) { - return temp; + return g_strdup_printf("<b><small>PCI</small></b> %s", (gchar *)idle_free(temp)); } } else if (g_regex_match(_regex_module, name, 0, NULL)) { temp = module_call_method_param("computer::getKernelModuleDescription", name); if (temp) { - return temp; + return g_strdup_printf("<b><small>Module</small></b> %s", (gchar *)idle_free(temp)); } } @@ -62,6 +67,7 @@ void scan_device_resources(gboolean reload) FILE *io; gchar buffer[256]; gint i; + gint zero_to_zero_addr = 0; struct { gchar *file; @@ -83,6 +89,9 @@ void scan_device_resources(gboolean reload) gchar **temp = g_strsplit(buffer, ":", 2); gchar *name = _resource_obtain_name(temp[1]); + if (strstr(temp[0], "0000-0000")) + zero_to_zero_addr++; + _resources = h_strdup_cprintf("<tt>%s</tt>=%s\n", _resources, temp[0], name); @@ -93,11 +102,18 @@ void scan_device_resources(gboolean reload) fclose(io); } } - + + _require_root = zero_to_zero_addr > 16; + SCAN_END(); } gchar *callback_device_resources(void) { - return _resources; + return g_strdup(_resources); +} + +gboolean root_required_for_resources(void) +{ + return _require_root; } diff --git a/arch/linux/s390/processor.h b/modules/devices/s390/processor.c index 25dab8ca..99f1c8bd 100644 --- a/arch/linux/s390/processor.h +++ b/modules/devices/s390/processor.c @@ -16,14 +16,11 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -struct _Processor { - gchar *vendor_id, *model_name; - gint cache_size; - gfloat bogomips, cpu_mhz; -}; +#include "hardinfo.h" +#include "devices.h" -static GSList * -__scan_processors(void) +GSList * +processor_scan(void) { Processor *processor; FILE *cpuinfo; @@ -59,7 +56,7 @@ __scan_processors(void) return g_slist_append(NULL, processor); } -static gchar * +gchar * processor_get_info(GSList *processors) { Processor *processor = (Processor *)processors->data; diff --git a/arch/linux/common/sensors.h b/modules/devices/sensors.c index 17637764..84e89361 100644 --- a/arch/linux/common/sensors.h +++ b/modules/devices/sensors.c @@ -16,9 +16,16 @@ * 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; +#include <string.h> + +#include "devices.h" +#include "expr.h" +#include "hardinfo.h" +#include "socket.h" + +gchar *sensors = NULL; +GHashTable *sensor_compute = NULL; +GHashTable *sensor_labels = NULL; static void read_sensor_labels(gchar * driver) { @@ -27,10 +34,6 @@ static void read_sensor_labels(gchar * driver) 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); - /* Try to open lm-sensors config file sensors3.conf */ conf = fopen("/etc/sensors3.conf", "r"); @@ -147,114 +150,167 @@ static float adjust_sensor(gchar * name, float value) return math_postfix_eval(postfix, value); } +static char *get_sensor_path(int number, const char *prefix) +{ + return g_strdup_printf("/sys/class/hwmon/hwmon%d/%s", number, prefix); +} -static void read_sensors_hwmon(void) +static char *determine_driver_for_hwmon_path(char *path) { - int hwmon, count; - gchar *path_hwmon, *path_sensor, *tmp, *driver, *name, *mon; - hwmon = 0; + char *tmp, *driver; - 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_strdup_printf("%s/device/driver", path); + driver = g_file_read_link(tmp, NULL); + g_free(tmp); - tmp = g_path_get_basename(driver); - g_free(driver); - driver = tmp; + if (driver) { + tmp = g_path_get_basename(driver); + g_free(driver); + driver = tmp; + } else { + tmp = g_strdup_printf("%s/device", path); + driver = g_file_read_link(tmp, NULL); + g_free(tmp); + } - if (!sensor_labels) { - read_sensor_labels(driver); - } + if (!driver) { + tmp = g_strdup_printf("%s/name", path); + if (!g_file_get_contents(tmp, &driver, NULL, NULL)) { + driver = g_strdup("unknown"); + } else { + driver = g_strstrip(driver); + } + g_free(tmp); + } - 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; - } + return driver; +} - mon = g_strdup_printf("fan%d", count); - name = get_sensor_label(mon); - if (!g_str_equal(name, "ignore")) { - sensors = h_strdup_cprintf("%s=%.0fRPM\n", - sensors, name, - adjust_sensor(mon, atof(tmp))); - } +struct HwmonSensor { + const char *friendly_name; + const char *path_format; + const char *key_format; + const char *value_format; + const float adjust_ratio; + const int begin_at; +}; - g_free(name); - g_free(mon); - g_free(tmp); - g_free(path_sensor); - } +static const struct HwmonSensor hwmon_sensors[] = { + { "Cooling Fans", "%s/fan%d_input", "fan%d", "%s (%s)=%.0fRPM\n", 1.0, 1 }, + { "Temperature", "%s/temp%d_input", "temp%d", "%s (%s)=%.2f\302\260C\n", 1000.0, 1 }, + { "Voltage Values", "%s/in%d_input", "in%d", "%s (%s)=%.3fV\n", 1000.0, 0 }, + { NULL, NULL, NULL, NULL, 0.0, 0 }, +}; - 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; - } +static const char *hwmon_prefix[] = { "device", "", NULL }; - mon = g_strdup_printf("temp%d", count); - name = get_sensor_label(mon); - if (!g_str_equal(name, "ignore")) { - sensors = h_strdup_cprintf("%s=%.2f\302\260C\n", - sensors, name, - adjust_sensor(mon, - atof(tmp) / - 1000.0)); - } +static void read_sensors_hwmon(void) +{ + int hwmon, count; + gchar *path_hwmon, *path_sensor, *tmp, *driver, *name, *mon; + const char **prefix; + + for (prefix = hwmon_prefix; *prefix; prefix++) { + hwmon = 0; + path_hwmon = get_sensor_path(hwmon, *prefix); + while (path_hwmon && g_file_test(path_hwmon, G_FILE_TEST_EXISTS)) { + const struct HwmonSensor *sensor; + + driver = determine_driver_for_hwmon_path(path_hwmon); + DEBUG("hwmon%d has driver=%s", hwmon, driver); + + if (!sensor_labels) { + read_sensor_labels(driver); + } + + for (sensor = hwmon_sensors; sensor->friendly_name; sensor++) { + char *output = NULL; + DEBUG("current sensor type=%s", sensor->friendly_name); + + for (count = sensor->begin_at;; count++) { + path_sensor = g_strdup_printf(sensor->path_format, path_hwmon, count); + DEBUG("should be reading from %s", path_sensor); + if (!g_file_get_contents(path_sensor, &tmp, NULL, NULL)) { + g_free(path_sensor); + if (count<256) + continue; // brute-force find all + else + break; + } + + mon = g_strdup_printf(sensor->key_format, count); + name = get_sensor_label(mon); + if (!g_str_equal(name, "ignore")) { + output = h_strdup_cprintf(sensor->value_format, + output, name, driver, + adjust_sensor(mon, + atof(tmp) / sensor->adjust_ratio)); + } + + g_free(tmp); + g_free(mon); + g_free(name); + g_free(path_sensor); + } + + if (output) { + sensors = g_strconcat(sensors, "[", sensor->friendly_name, "]\n", output, "\n", NULL); + g_free(output); + } + } + + g_free(path_hwmon); + g_free(driver); + + path_hwmon = get_sensor_path(++hwmon, *prefix); + } - g_free(tmp); - g_free(name); - g_free(path_sensor); - g_free(mon); + g_free(path_hwmon); } +} - 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; - } +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; + gchar *temp = g_strdup(""); + + 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); + temp = h_strdup_cprintf("\n%s=%d\302\260C\n", + temp, entry, temperature); - mon = g_strdup_printf("in%d", count); - name = get_sensor_label(mon); - if (!g_str_equal(name, "ignore")) { - sensors = h_strdup_cprintf("%s=%.3fV\n", - sensors, name, - adjust_sensor(mon, - atof(tmp) / - 1000.0)); + g_free(contents); + } } - g_free(tmp); - g_free(mon); - g_free(name); - g_free(path_sensor); - } + if (*temp != '\0') + sensors = + h_strdup_cprintf("\n[ACPI Thermal Zone]\n%s", + sensors, temp); - g_free(path_hwmon); - g_free(driver); - path_hwmon = - g_strdup_printf("/sys/class/hwmon/hwmon%d/device/", ++hwmon); + g_dir_close(tz); + } } - g_free(path_hwmon); - } -static void read_sensors_acpi(void) +static void read_sensors_sys_thermal(void) { - const gchar *path_tz = "/proc/acpi/thermal_zone"; + const gchar *path_tz = "/sys/class/thermal"; if (g_file_test(path_tz, G_FILE_TEST_EXISTS)) { GDir *tz; @@ -263,19 +319,18 @@ static void read_sensors_acpi(void) const gchar *entry; gchar *temp = g_strdup(""); - while ((entry = g_dir_read_name(tz))) { gchar *path = - g_strdup_printf("%s/%s/temperature", path_tz, entry); + g_strdup_printf("%s/%s/temp", path_tz, entry); gchar *contents; if (g_file_get_contents(path, &contents, NULL, NULL)) { int temperature; - sscanf(contents, "temperature: %d C", &temperature); + sscanf(contents, "%d", &temperature); - temp = h_strdup_cprintf("\n%s=%d\302\260C\n", - temp, entry, temperature); + temp = h_strdup_cprintf("\n%s=%.2f\302\260C\n", + temp, entry, (1.0*temperature/1000)); g_free(contents); } @@ -283,7 +338,7 @@ static void read_sensors_acpi(void) if (*temp != '\0') sensors = - h_strdup_cprintf("\n[ACPI Thermal Zone]\n%s", + h_strdup_cprintf("\n[ACPI Thermal Zone (sysfs)]\n%s", sensors, temp); g_dir_close(tz); @@ -320,14 +375,13 @@ static void read_sensors_hddtemp(void) if ((s = sock_connect("127.0.0.1", 7634))) { while (!len) len = sock_read(s, buffer, sizeof(buffer)); - sock_close(s); + sock_close(s); if (len > 2 && buffer[0] == '|' && buffer[1] == '/') { gchar **disks; int i; - if (old) - g_free(old); + g_free(old); old = g_strdup("[Hard Disk Temperature]\n"); @@ -361,17 +415,30 @@ static void read_sensors_hddtemp(void) } } -static void __scan_sensors(void) +void scan_sensors_do(void) { - if (sensors) - g_free(sensors); + g_free(sensors); sensors = g_strdup(""); read_sensors_hwmon(); read_sensors_acpi(); + read_sensors_sys_thermal(); read_sensors_omnibook(); read_sensors_hddtemp(); /* FIXME: Add support for ibm acpi and more sensors */ } + +void sensors_init(void) +{ + 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); +} + +void sensors_shutdown(void) +{ + g_hash_table_destroy(sensor_labels); + g_hash_table_destroy(sensor_compute); +} diff --git a/arch/linux/sh/processor.h b/modules/devices/sh/processor.c index de33ee91..cbd9a60a 100644 --- a/arch/linux/sh/processor.h +++ b/modules/devices/sh/processor.c @@ -16,14 +16,11 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -struct _Processor { - gchar *model_name; - gchar *vendor_id; - gfloat bogomips, cpu_mhz; -}; +#include "hardinfo.h" +#include "devices.h" -static GSList * -__scan_processors(void) +GSList * +processor_scan(void) { Processor *processor; FILE *cpuinfo; @@ -54,7 +51,7 @@ __scan_processors(void) return g_slist_append(NULL, processor); } -static gchar * +gchar * processor_get_info(GSList *processors) { Processor *processor = (Processor *)processors->data; diff --git a/arch/linux/sparc/processor.h b/modules/devices/sparc/processor.c index 0272c963..594117a7 100644 --- a/arch/linux/sparc/processor.h +++ b/modules/devices/sparc/processor.c @@ -16,14 +16,11 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -struct _Processor { - gchar *model_name; - gchar *has_fpu; - gfloat cpu_mhz; -}; +#include "hardinfo.h" +#include "devices.h" -static GSList * -__scan_processors(void) +GSList * +processor_scan(void) { Processor *processor; FILE *cpuinfo; @@ -54,7 +51,7 @@ __scan_processors(void) return g_slist_append(NULL, processor); } -static gchar * +gchar * processor_get_info(GSList *processors) { Processor *processor = (Processor *)processors->data; diff --git a/modules/devices/spd-decode.c b/modules/devices/spd-decode.c new file mode 100644 index 00000000..ac1dd52b --- /dev/null +++ b/modules/devices/spd-decode.c @@ -0,0 +1,1509 @@ +/* + * spd-decode.c + * Copyright (c) 2010 Leandro A. F. Pereira + * + * Based on decode-dimms.pl + * Copyright 1998, 1999 Philip Edelbrock <phil@netroedge.com> + * modified by Christian Zuckschwerdt <zany@triq.net> + * modified by Burkart Lingner <burkart@bollchen.de> + * + * 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; either version 2 of the License, or + * (at your option) any later version. + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <ctype.h> +#include <math.h> +#include <stdio.h> +#include <sys/stat.h> + +#include "hardinfo.h" +#include "devices.h" + +typedef enum { + UNKNOWN, + DIRECT_RAMBUS, + RAMBUS, + FPM_DRAM, + EDO, + PIPELINED_NIBBLE, + SDR_SDRAM, + MULTIPLEXED_ROM, + DDR_SGRAM, + DDR_SDRAM, + DDR2_SDRAM, + DDR3_SDRAM +} RamType; + +char *spd_info = NULL; + +static const char *ram_types[] = { + "Unknown", + "Direct Rambus", + "Rambus", + "FPM DRAM", + "EDO", + "Pipelined Nibble", + "SDR SDRAM", + "Multiplexed ROM", + "DDR SGRAM", + "DDR SDRAM", + "DDR2 SDRAM", + "DDR3 SDRAM" +}; + +static const char *vendors1[] = { "AMD", "AMI", "Fairchild", "Fujitsu", + "GTE", "Harris", "Hitachi", "Inmos", + "Intel", "I.T.T.", "Intersil", + "Monolithic Memories", + "Mostek", + "Freescale (former Motorola)", + "National", "NEC", + "RCA", "Raytheon", + "Conexant (Rockwell)", "Seeq", + "NXP (former Signetics, Philips Semi.)", + "Synertek", + "Texas Instruments", "Toshiba", + "Xicor", "Zilog", "Eurotechnique", + "Mitsubishi", + "Lucent (AT&T)", "Exel", "Atmel", + "SGS/Thomson", + "Lattice Semi.", "NCR", + "Wafer Scale Integration", "IBM", + "Tristar", "Visic", + "Intl. CMOS Technology", "SSSI", + "MicrochipTechnology", "Ricoh Ltd.", + "VLSI", "Micron Technology", + "Hyundai Electronics", + "OKI Semiconductor", "ACTEL", + "Sharp", + "Catalyst", "Panasonic", "IDT", + "Cypress", + "DEC", "LSI Logic", + "Zarlink (former Plessey)", "UTMC", + "Thinking Machine", "Thomson CSF", + "Integrated CMOS (Vertex)", + "Honeywell", + "Tektronix", "Sun Microsystems", + "SST", "ProMos/Mosel Vitelic", + "Infineon (former Siemens)", + "Macronix", "Xerox", "Plus Logic", + "SunDisk", "Elan Circuit Tech.", + "European Silicon Str.", + "Apple Computer", + "Xilinx", "Compaq", + "Protocol Engines", "SCI", + "Seiko Instruments", "Samsung", + "I3 Design System", "Klic", + "Crosspoint Solutions", + "Alliance Semiconductor", "Tandem", + "Hewlett-Packard", + "Intg. Silicon Solutions", + "Brooktree", "New Media", + "MHS Electronic", + "Performance Semi.", + "Winbond Electronic", + "Kawasaki Steel", + "Bright Micro", + "TECMAR", "Exar", "PCMCIA", + "LG Semi (former Goldstar)", + "Northern Telecom", "Sanyo", + "Array Microsystems", + "Crystal Semiconductor", + "Analog Devices", "PMC-Sierra", + "Asparix", "Convex Computer", + "Quality Semiconductor", + "Nimbus Technology", "Transwitch", + "Micronas (ITT Intermetall)", + "Cannon", "Altera", "NEXCOM", + "QUALCOMM", + "Sony", "Cray Research", + "AMS(Austria Micro)", "Vitesse", + "Aster Electronics", + "Bay Networks (Synoptic)", + "Zentrum or ZMD", + "TRW", + "Thesys", "Solbourne Computer", + "Allied-Signal", "Dialog", + "Media Vision", + "Level One Communication" +}; + +static const char *vendors2[] = { "Cirrus Logic", + "National Instruments", + "ILC Data Device", + "Alcatel Mietec", + "Micro Linear", + "Univ. of NC", + "JTAG Technologies", + "BAE Systems", + "Nchip", + "Galileo Tech", + "Bestlink Systems", + "Graychip", + "GENNUM", + "VideoLogic", + "Robert Bosch", + "Chip Express", + "DATARAM", + "United Microelec Corp.", + "TCSI", + "Smart Modular", + "Hughes Aircraft", + "Lanstar Semiconductor", + "Qlogic", "Kingston", + "Music Semi", + "Ericsson Components", + "SpaSE", + "Eon Silicon Devices", + "Programmable Micro Corp", + "DoD", + "Integ. Memories Tech.", + "Corollary Inc.", + "Dallas Semiconductor", + "Omnivision", + "EIV(Switzerland)", + "Novatel Wireless", + "Zarlink (former Mitel)", + "Clearpoint", + "Cabletron", + "STEC (former Silicon Technology)", + "Vanguard", + "Hagiwara Sys-Com", + "Vantis", "Celestica", + "Century", + "Hal Computers", + "Rohm Company Ltd.", + "Juniper Networks", + "Libit Signal Processing", + "Mushkin Enhanced Memory", + "Tundra Semiconductor", + "Adaptec Inc.", + "LightSpeed Semi.", + "ZSP Corp.", + "AMIC Technology", + "Adobe Systems", + "Dynachip", + "PNY Electronics", + "Newport Digital", + "MMC Networks", + "T Square", + "Seiko Epson", + "Broadcom", + "Viking Components", + "V3 Semiconductor", + "Flextronics (former Orbit)", + "Suwa Electronics", + "Transmeta", + "Micron CMS", + "American Computer & Digital Components Inc", + "Enhance 3000 Inc", + "Tower Semiconductor", + "CPU Design", + "Price Point", + "Maxim Integrated Product", + "Tellabs", + "Centaur Technology", + "Unigen Corporation", + "Transcend Information", + "Memory Card Technology", + "CKD Corporation Ltd.", + "Capital Instruments, Inc.", + "Aica Kogyo, Ltd.", + "Linvex Technology", + "MSC Vertriebs GmbH", + "AKM Company, Ltd.", + "Dynamem, Inc.", + "NERA ASA", + "GSI Technology", + "Dane-Elec (C Memory)", + "Acorn Computers", + "Lara Technology", + "Oak Technology, Inc.", + "Itec Memory", + "Tanisys Technology", + "Truevision", + "Wintec Industries", + "Super PC Memory", + "MGV Memory", + "Galvantech", + "Gadzoox Nteworks", + "Multi Dimensional Cons.", + "GateField", + "Integrated Memory System", + "Triscend", "XaQti", + "Goldenram", + "Clear Logic", + "Cimaron Communications", + "Nippon Steel Semi. Corp.", + "Advantage Memory", + "AMCC", + "LeCroy", + "Yamaha Corporation", + "Digital Microwave", + "NetLogic Microsystems", + "MIMOS Semiconductor", + "Advanced Fibre", + "BF Goodrich Data.", + "Epigram", + "Acbel Polytech Inc.", + "Apacer Technology", + "Admor Memory", + "FOXCONN", + "Quadratics Superconductor", + "3COM", +}; + +static const char *vendors3[] = { "Camintonn Corporation", "ISOA Incorporated", + "Agate Semiconductor", "ADMtek Incorporated", + "HYPERTEC", "Adhoc Technologies", "MOSAID Technologies", + "Ardent Technologies", + "Switchcore", "Cisco Systems, Inc.", "Allayer Technologies", + "WorkX AG", + "Oasis Semiconductor", "Novanet Semiconductor", "E-M Solutions", + "Power General", + "Advanced Hardware Arch.", "Inova Semiconductors GmbH", "Telocity", + "Delkin Devices", + "Symagery Microsystems", "C-Port Corporation", + "SiberCore Technologies", "Southland Microsystems", + "Malleable Technologies", "Kendin Communications", + "Great Technology Microcomputer", "Sanmina Corporation", + "HADCO Corporation", "Corsair", "Actrans System Inc.", + "ALPHA Technologies", + "Silicon Laboratories, Inc. (Cygnal)", "Artesyn Technologies", + "Align Manufacturing", "Peregrine Semiconductor", + "Chameleon Systems", "Aplus Flash Technology", "MIPS Technologies", + "Chrysalis ITS", + "ADTEC Corporation", "Kentron Technologies", "Win Technologies", + "Tachyon Semiconductor (former ASIC Designs Inc.)", + "Extreme Packet Devices", "RF Micro Devices", "Siemens AG", + "Sarnoff Corporation", + "Itautec Philco SA", "Radiata Inc.", "Benchmark Elect. (AVEX)", + "Legend", + "SpecTek Incorporated", "Hi/fn", "Enikia Incorporated", + "SwitchOn Networks", + "AANetcom Incorporated", "Micro Memory Bank", "ESS Technology", + "Virata Corporation", + "Excess Bandwidth", "West Bay Semiconductor", "DSP Group", + "Newport Communications", + "Chip2Chip Incorporated", "Phobos Corporation", + "Intellitech Corporation", "Nordic VLSI ASA", + "Ishoni Networks", "Silicon Spice", "Alchemy Semiconductor", + "Agilent Technologies", + "Centillium Communications", "W.L. Gore", "HanBit Electronics", + "GlobeSpan", + "Element 14", "Pycon", "Saifun Semiconductors", "Sibyte, Incorporated", + "MetaLink Technologies", "Feiya Technology", "I & C Technology", + "Shikatronics", + "Elektrobit", "Megic", "Com-Tier", "Malaysia Micro Solutions", + "Hyperchip", "Gemstone Communications", "Anadigm (former Anadyne)", + "3ParData", + "Mellanox Technologies", "Tenx Technologies", "Helix AG", "Domosys", + "Skyup Technology", "HiNT Corporation", "Chiaro", + "MDT Technologies GmbH (former MCI Computer GMBH)", + "Exbit Technology A/S", "Integrated Technology Express", "AVED Memory", + "Legerity", + "Jasmine Networks", "Caspian Networks", "nCUBE", + "Silicon Access Networks", + "FDK Corporation", "High Bandwidth Access", "MultiLink Technology", + "BRECIS", + "World Wide Packets", "APW", "Chicory Systems", "Xstream Logic", + "Fast-Chip", "Zucotto Wireless", "Realchip", "Galaxy Power", + "eSilicon", "Morphics Technology", "Accelerant Networks", + "Silicon Wave", + "SandCraft", "Elpida" +}; + +static const char *vendors4[] = { "Solectron", "Optosys Technologies", + "Buffalo (former Melco)", + "TriMedia Technologies", + "Cyan Technologies", "Global Locate", + "Optillion", + "Terago Communications", + "Ikanos Communications", + "Princeton Technology", + "Nanya Technology", + "Elite Flash Storage", + "Mysticom", "LightSand Communications", + "ATI Technologies", + "Agere Systems", + "NeoMagic", "AuroraNetics", "Golden Empire", + "Mushkin", + "Tioga Technologies", "Netlist", "TeraLogic", + "Cicada Semiconductor", + "Centon Electronics", "Tyco Electronics", + "Magis Works", "Zettacom", + "Cogency Semiconductor", "Chipcon AS", + "Aspex Technology", + "F5 Networks", + "Programmable Silicon Solutions", + "ChipWrights", + "Acorn Networks", + "Quicklogic", + "Kingmax Semiconductor", "BOPS", "Flasys", + "BitBlitz Communications", + "eMemory Technology", "Procket Networks", + "Purple Ray", + "Trebia Networks", + "Delta Electronics", "Onex Communications", + "Ample Communications", + "Memory Experts Intl", + "Astute Networks", "Azanda Network Devices", + "Dibcom", "Tekmos", + "API NetWorks", "Bay Microsystems", + "Firecron Ltd", + "Resonext Communications", + "Tachys Technologies", "Equator Technology", + "Concept Computer", + "SILCOM", + "3Dlabs", "c't Magazine", "Sanera Systems", + "Silicon Packets", + "Viasystems Group", "Simtek", + "Semicon Devices Singapore", + "Satron Handelsges", + "Improv Systems", "INDUSYS GmbH", "Corrent", + "Infrant Technologies", + "Ritek Corp", "empowerTel Networks", + "Hypertec", + "Cavium Networks", + "PLX Technology", "Massana Design", + "Intrinsity", + "Valence Semiconductor", + "Terawave Communications", + "IceFyre Semiconductor", "Primarion", + "Picochip Designs Ltd", + "Silverback Systems", + "Jade Star Technologies", + "Pijnenburg Securealink", + "TakeMS International AG", + "Cambridge Silicon Radio", + "Swissbit", "Nazomi Communications", + "eWave System", + "Rockwell Collins", "Picocel Co., Ltd.", + "Alphamosaic Ltd", + "Sandburst", + "SiCon Video", "NanoAmp Solutions", + "Ericsson Technology", + "PrairieComm", + "Mitac International", "Layer N Networks", + "MtekVision", + "Allegro Networks", + "Marvell Semiconductors", + "Netergy Microelectronic", "NVIDIA", + "Internet Machines", + "Peak Electronics", + "Litchfield Communication", + "Accton Technology", + "Teradiant Networks", + "Europe Technologies", "Cortina Systems", + "RAM Components", + "Raqia Networks", + "ClearSpeed", "Matsushita Battery", + "Xelerated", + "SimpleTech", + "Utron Technology", "Astec International", + "AVM gmbH", + "Redux Communications", + "Dot Hill Systems", "TeraChip" +}; + +static const char *vendors5[] = { "T-RAM Incorporated", + "Innovics Wireless", "Teknovus", "KeyEye Communications", + "Runcom Technologies", "RedSwitch", "Dotcast", + "Silicon Mountain Memory", + "Signia Technologies", "Pixim", "Galazar Networks", + "White Electronic Designs", + "Patriot Scientific", "Neoaxiom Corporation", "3Y Power Technology", + "Europe Technologies", + "Potentia Power Systems", "C-guys Incorporated", + "Digital Communications Technology Incorporated", + "Silicon-Based Technology", + "Fulcrum Microsystems", "Positivo Informatica Ltd", + "XIOtech Corporation", "PortalPlayer", + "Zhiying Software", "Direct2Data", "Phonex Broadband", + "Skyworks Solutions", + "Entropic Communications", "Pacific Force Technology", "Zensys A/S", + "Legend Silicon Corp.", + "sci-worx GmbH", "SMSC (former Oasis Silicon Systems)", + "Renesas Technology", "Raza Microelectronics", + "Phyworks", "MediaTek", "Non-cents Productions", "US Modular", + "Wintegra Ltd", "Mathstar", "StarCore", "Oplus Technologies", + "Mindspeed", "Just Young Computer", "Radia Communications", "OCZ", + "Emuzed", "LOGIC Devices", "Inphi Corporation", "Quake Technologies", + "Vixel", "SolusTek", "Kongsberg Maritime", "Faraday Technology", + "Altium Ltd.", "Insyte", "ARM Ltd.", "DigiVision", + "Vativ Technologies", "Endicott Interconnect Technologies", "Pericom", + "Bandspeed", + "LeWiz Communications", "CPU Technology", "Ramaxel Technology", + "DSP Group", + "Axis Communications", "Legacy Electronics", "Chrontel", + "Powerchip Semiconductor", + "MobilEye Technologies", "Excel Semiconductor", "A-DATA Technology", + "VirtualDigm", + "G Skill Intl", "Quanta Computer", "Yield Microelectronics", + "Afa Technologies", + "KINGBOX Technology Co. Ltd.", "Ceva", "iStor Networks", + "Advance Modules", + "Microsoft", "Open-Silicon", "Goal Semiconductor", + "ARC International", + "Simmtec", "Metanoia", "Key Stream", "Lowrance Electronics", + "Adimos", "SiGe Semiconductor", "Fodus Communications", + "Credence Systems Corp.", + "Genesis Microchip Inc.", "Vihana, Inc.", "WIS Technologies", + "GateChange Technologies", + "High Density Devices AS", "Synopsys", "Gigaram", + "Enigma Semiconductor Inc.", + "Century Micro Inc.", "Icera Semiconductor", + "Mediaworks Integrated Systems", "O'Neil Product Development", + "Supreme Top Technology Ltd.", "MicroDisplay Corporation", + "Team Group Inc.", "Sinett Corporation", + "Toshiba Corporation", "Tensilica", "SiRF Technology", "Bacoc Inc.", + "SMaL Camera Technologies", "Thomson SC", "Airgo Networks", + "Wisair Ltd.", + "SigmaTel", "Arkados", "Compete IT gmbH Co. KG", + "Eudar Technology Inc.", + "Focus Enhancements", "Xyratex" +}; + +static const char *vendors6[] = { "Specular Networks", + "Patriot Memory", + "U-Chip Technology Corp.", + "Silicon Optix", + "Greenfield Networks", + "CompuRAM GmbH", "Stargen, Inc.", + "NetCell Corporation", + "Excalibrus Technologies Ltd", + "SCM Microsystems", + "Xsigo Systems, Inc.", + "CHIPS & Systems Inc", + "Tier 1 Multichip Solutions", + "CWRL Labs", "Teradici", + "Gigaram, Inc.", + "g2 Microsystems", + "PowerFlash Semiconductor", + "P.A. Semi, Inc.", + "NovaTech Solutions, S.A.", + "c2 Microsystems, Inc.", + "Level5 Networks", + "COS Memory AG", + "Innovasic Semiconductor", + "02IC Co. Ltd", "Tabula, Inc.", + "Crucial Technology", + "Chelsio Communications", + "Solarflare Communications", + "Xambala Inc.", "EADS Astrium", + "ATO Semicon Co. Ltd.", + "Imaging Works, Inc.", + "Astute Networks, Inc.", "Tzero", + "Emulex", + "Power-One", "Pulse~LINK Inc.", + "Hon Hai Precision Industry", + "White Rock Networks Inc.", + "Telegent Systems USA, Inc.", + "Atrua Technologies, Inc.", + "Acbel Polytech Inc.", + "eRide Inc.", + "ULi Electronics Inc.", + "Magnum Semiconductor Inc.", + "neoOne Technology, Inc.", + "Connex Technology, Inc.", + "Stream Processors, Inc.", + "Focus Enhancements", + "Telecis Wireless, Inc.", + "uNav Microelectronics", + "Tarari, Inc.", "Ambric, Inc.", + "Newport Media, Inc.", "VMTS", + "Enuclia Semiconductor, Inc.", + "Virtium Technology Inc.", + "Solid State System Co., Ltd.", + "Kian Tech LLC", + "Artimi", + "Power Quotient International", + "Avago Technologies", + "ADTechnology", "Sigma Designs", + "SiCortex, Inc.", + "Ventura Technology Group", + "eASIC", "M.H.S. SAS", + "Micro Star International", + "Rapport Inc.", + "Makway International", + "Broad Reach Engineering Co.", + "Semiconductor Mfg Intl Corp", + "SiConnect", "FCI USA Inc.", + "Validity Sensors", + "Coney Technology Co. Ltd.", + "Spans Logic", "Neterion Inc.", + "Qimonda", + "New Japan Radio Co. Ltd.", + "Velogix", "Montalvo Systems", + "iVivity Inc.", + "Walton Chaintech", + "AENEON", + "Lorom Industrial Co. Ltd.", + "Radiospire Networks", + "Sensio Technologies, Inc.", + "Nethra Imaging", + "Hexon Technology Pte Ltd", + "CompuStocx (CSX)", + "Methode Electronics, Inc.", + "Connect One Ltd.", + "Opulan Technologies", + "Septentrio NV", + "Goldenmars Technology Inc.", + "Kreton Corporation", + "Cochlear Ltd.", + "Altair Semiconductor", + "NetEffect, Inc.", + "Spansion, Inc.", + "Taiwan Semiconductor Mfg", + "Emphany Systems Inc.", + "ApaceWave Technologies", + "Mobilygen Corporation", "Tego", + "Cswitch Corporation", + "Haier (Beijing) IC Design Co.", + "MetaRAM", + "Axel Electronics Co. Ltd.", + "Tilera Corporation", + "Aquantia", + "Vivace Semiconductor", + "Redpine Signals", "Octalica", + "InterDigital Communications", + "Avant Technology", + "Asrock, Inc.", "Availink", + "Quartics, Inc.", + "Element CXI", + "Innovaciones Microelectronicas", + "VeriSilicon Microelectronics", + "W5 Networks" +}; + +static const char *vendors7[] = { "MOVEKING", "Mavrix Technology, Inc.", + "CellGuide Ltd.", "Faraday Technology", + "Diablo Technologies, Inc.", "Jennic", "Octasic", + "Molex Incorporated", + "3Leaf Networks", + "Bright Micron Technology", "Netxen", "NextWave Broadband Inc.", + "DisplayLink", "ZMOS Technology", + "Tec-Hill", "Multigig, Inc.", "Amimon", "Euphonic Technologies, Inc.", + "BRN Phoenix", + "InSilica", "Ember Corporation", "Avexir Technologies Corporation", + "Echelon Corporation", + "Edgewater Computer Systems", "XMOS Semiconductor Ltd.", + "GENUSION, Inc.", "Memory Corp NV", + "SiliconBlue Technologies", "Rambus Inc." +}; + +static const char **vendors[7] = { vendors1, vendors2, vendors3, vendors4, vendors5, vendors6, + vendors7 +}; + +/* + * We consider that no data was written to this area of the SPD EEPROM if + * all bytes read 0x00 or all bytes read 0xff + */ +static int spd_written(unsigned char *bytes, int len) +{ + do { + if (*bytes == 0x00 || *bytes == 0xFF) + return 1; + } while (--len && bytes++); + + return 0; +} + +static int parity(int value) +{ + value ^= value >> 16; + value ^= value >> 8; + value ^= value >> 4; + value &= 0xf; + + return (0x6996 >> value) & 1; +} + +static void decode_sdr_module_size(unsigned char *bytes, int *size) +{ + int i, k = 0; + + i = (bytes[3] & 0x0f) + (bytes[4] & 0x0f) - 17; + if (bytes[5] <= 8 && bytes[17] <= 8) { + k = bytes[5] * bytes[17]; + } + + if (i > 0 && i <= 12 && k > 0) { + if (size) { + *size = (1 << i) * k; + } + } else { + if (size) { + *size = -1; + } + } +} + +static void decode_sdr_module_timings(unsigned char *bytes, float *tcl, float *trcd, float *trp, float *tras) +{ + float cas[3], ctime; + int i, j; + + for (i = 0, j = 0; j < 7; j++) { + if (bytes[18] & 1 << j) { + cas[i++] = j + 1; + } + } + + ctime = (bytes[9] >> 4 + bytes[9] & 0xf) * 0.1; + + if (trcd) { + *trcd = ceil(bytes[29] / ctime); + } + if (trp) { + *trp = ceil(bytes[27] / ctime); + } + if (tras) { + *tras = ceil(bytes[30] / ctime); + } + if (tcl) { + *tcl = cas[i]; + } +} + +static void decode_sdr_module_row_address_bits(unsigned char *bytes, char **bits) +{ + char *temp; + + switch (bytes[3]) { + case 0: + temp = "Undefined"; + break; + case 1: + temp = "1/16"; + break; + case 2: + temp = "2/27"; + break; + case 3: + temp = "3/18"; + break; + default: + /* printf("%d\n", bytes[3]); */ + temp = "Unknown"; + } + + if (bits) { + *bits = temp; + } +} + +static void decode_sdr_module_col_address_bits(unsigned char *bytes, char **bits) +{ + char *temp; + + switch (bytes[4]) { + case 0: + temp = "Undefined"; + break; + case 1: + temp = "1/16"; + break; + case 2: + temp = "2/17"; + break; + case 3: + temp = "3/18"; + break; + default: + /*printf("%d\n", bytes[4]); */ + temp = "Unknown"; + } + + if (bits) { + *bits = temp; + } +} + +static void decode_sdr_module_number_of_rows(unsigned char *bytes, int *rows) +{ + if (rows) { + *rows = bytes[5]; + } +} + +static void decode_sdr_module_data_with(unsigned char *bytes, int *width) +{ + if (width) { + if (bytes[7] > 1) { + *width = 0; + } else { + *width = (bytes[7] * 0xff) + bytes[6]; + } + } +} + +static void decode_sdr_module_interface_signal_levels(unsigned char *bytes, char **signal_levels) +{ + char *temp; + + switch (bytes[8]) { + case 0: + temp = "5.0 Volt/TTL"; + break; + case 1: + temp = "LVTTL"; + break; + case 2: + temp = "HSTL 1.5"; + break; + case 3: + temp = "SSTL 3.3"; + break; + case 4: + temp = "SSTL 2.5"; + break; + case 255: + temp = "New Table"; + break; + default: + temp = "Undefined"; + } + + if (signal_levels) { + *signal_levels = temp; + } +} + +static void decode_sdr_module_configuration_type(unsigned char *bytes, char **module_config_type) +{ + char *temp; + + switch (bytes[11]) { + case 0: + temp = "No parity"; + break; + case 1: + temp = "Parity"; + break; + case 2: + temp = "ECC"; + break; + default: + temp = "Undefined"; + } + + if (module_config_type) { + *module_config_type = temp; + } +} + +static void decode_sdr_module_refresh_type(unsigned char *bytes, char **refresh_type) +{ + char *temp; + + if (bytes[12] & 0x80) { + temp = "Self refreshing"; + } else { + temp = "Not self refreshing"; + } + + if (refresh_type) { + *refresh_type = temp; + } +} + +static void decode_sdr_module_refresh_rate(unsigned char *bytes, char **refresh_rate) +{ + char *temp; + + switch (bytes[12] & 0x7f) { + case 0: + temp = "Normal (15.625us)"; + break; + case 1: + temp = "Reduced (3.9us)"; + break; + case 2: + temp = "Reduced (7.8us)"; + break; + case 3: + temp = "Extended (31.3us)"; + break; + case 4: + temp = "Extended (62.5us)"; + break; + case 5: + temp = "Extended (125us)"; + break; + default: + temp = "Undefined"; + } + + if (refresh_rate) { + *refresh_rate = temp; + } +} + +static gchar *decode_sdr_sdram(unsigned char *bytes, int *size) +{ + int rows, data_width; + float tcl, trcd, trp, tras; + char *row_address_bits, *col_address_bits, *signal_level; + char *module_config_type, *refresh_type, *refresh_rate; + + decode_sdr_module_size(bytes, size); + decode_sdr_module_timings(bytes, &tcl, &trcd, &trp, &tras); + decode_sdr_module_row_address_bits(bytes, &row_address_bits); + decode_sdr_module_col_address_bits(bytes, &col_address_bits); + decode_sdr_module_number_of_rows(bytes, &rows); + decode_sdr_module_data_with(bytes, &data_width); + decode_sdr_module_interface_signal_levels(bytes, &signal_level); + decode_sdr_module_configuration_type(bytes, &module_config_type); + decode_sdr_module_refresh_type(bytes, &refresh_type); + decode_sdr_module_refresh_rate(bytes, &refresh_rate); + + /* TODO: + - RAS to CAS delay + - Supported CAS latencies + - Supported CS latencies + - Supported WE latencies + - Cycle Time / Access time + - SDRAM module attributes + - SDRAM device attributes + - Row densities + - Other misc stuff + */ + + return g_strdup_printf("[Module Information]\n" + "Module type=SDR\n" + "SPD revision=%d\n" + "Row address bits=%s\n" + "Column address bits=%s\n" + "Number of rows=%d\n" + "Data width=%d bits\n" + "Interface signal levels=%s\n" + "Configuration type=%s\n" + "Refresh=%s (%s)\n" + "[Timings]\n" + "tCL=%.2f\n" + "tRCD=%.2f\n" + "tRP=%.2f\n" + "tRAS=%.2f\n", + bytes[62], + row_address_bits, col_address_bits, rows, + data_width, signal_level, module_config_type, + refresh_type, refresh_rate, tcl, trcd, trp, tras); +} + +static void decode_ddr_module_speed(unsigned char *bytes, float *ddrclk, int *pcclk) +{ + float temp, clk; + int tbits, pc; + + temp = (bytes[9] >> 4) + (bytes[9] & 0xf) * 0.1; + clk = 2 * (1000 / temp); + tbits = (bytes[7] * 256) + bytes[6]; + + if (bytes[11] == 2 || bytes[11] == 1) { + tbits -= 8; + } + + pc = clk * tbits / 8; + if (pc % 100 > 50) { + pc += 100; + } + pc -= pc % 100; + + if (ddrclk) + *ddrclk = (int) clk; + + if (pcclk) + *pcclk = pc; +} + +static void decode_ddr_module_size(unsigned char *bytes, int *size) +{ + int i, k; + + i = (bytes[3] & 0x0f) + (bytes[4] & 0x0f) - 17; + k = (bytes[5] <= 8 && bytes[17] <= 8) ? bytes[5] * bytes[17] : 0; + + if (i > 0 && i <= 12 && k > 0) { + if (size) { + *size = (1 << i) * k; + } + } else { + if (size) { + *size = -1; + } + } +} + +static void *decode_ddr_module_timings(unsigned char *bytes, float *tcl, float *trcd, float *trp, float *tras) +{ + float ctime; + float highest_cas = 0; + int i; + + for (i = 0; i < 7; i++) { + if (bytes[18] & (1 << i)) { + highest_cas = 1 + i * 0.5f; + } + } + + ctime = (bytes[9] >> 4) + (bytes[9] & 0xf) * 0.1; + + if (trcd) { + *trcd = (bytes[29] >> 2) + ((bytes[29] & 3) * 0.25); + *trcd = ceil(*trcd / ctime); + } + + if (trp) { + *trp = (bytes[27] >> 2) + ((bytes[27] & 3) * 0.25); + *trp = ceil(*trp / ctime); + } + + if (tras) { + *tras = bytes[30]; + *tras = ceil(*tras / ctime); + } + + if (tcl) { + *tcl = highest_cas; + } +} + +static gchar *decode_ddr_sdram(unsigned char *bytes, int *size) +{ + float ddr_clock; + float tcl, trcd, trp, tras; + int pc_speed; + + decode_ddr_module_speed(bytes, &ddr_clock, &pc_speed); + decode_ddr_module_size(bytes, size); + decode_ddr_module_timings(bytes, &tcl, &trcd, &trp, &tras); + + return g_strdup_printf("[Module Information]\n" + "Module type=DDR %.2fMHz (PC%d)\n" + "SPD revision=%d.%d\n" + "[Timings]\n" + "tCL=%.2f\n" + "tRCD=%.2f\n" + "tRP=%.2f\n" + "tRAS=%.2f\n", ddr_clock, pc_speed, bytes[62] >> 4, bytes[62] & 0xf, tcl, trcd, trp, tras); +} + +static float decode_ddr2_module_ctime(unsigned char byte) +{ + float ctime; + + ctime = (byte >> 4); + byte &= 0xf; + + if (byte <= 9) { + ctime += byte * 0.1; + } else if (byte == 10) { + ctime += 0.25; + } else if (byte == 11) { + ctime += 0.33; + } else if (byte == 12) { + ctime += 0.66; + } else if (byte == 13) { + ctime += 0.75; + } + + return ctime; +} + +static void decode_ddr2_module_speed(unsigned char *bytes, float *ddr_clock, int *pc2_speed) +{ + float ctime; + float ddrclk; + int tbits, pcclk; + + ctime = decode_ddr2_module_ctime(bytes[9]); + ddrclk = 2 * (1000 / ctime); + + tbits = (bytes[7] * 256) + bytes[6]; + if (bytes[11] & 0x03) { + tbits -= 8; + } + + pcclk = ddrclk * tbits / 8; + pcclk -= pcclk % 100; + + if (ddr_clock) { + *ddr_clock = (int) ddrclk; + } + if (pc2_speed) { + *pc2_speed = pcclk; + } +} + +static void decode_ddr2_module_size(unsigned char *bytes, int *size) +{ + int i, k; + + i = (bytes[3] & 0x0f) + (bytes[4] & 0x0f) - 17; + k = ((bytes[5] & 0x7) + 1) * bytes[17]; + + if (i > 0 && i <= 12 && k > 0) { + if (*size) { + *size = ((1 << i) * k); + } + } else { + if (*size) { + *size = 0; + } + } +} + +static void decode_ddr2_module_timings(unsigned char *bytes, float *trcd, float *trp, float *tras, float *tcl) +{ + float ctime; + float highest_cas = 0; + int i; + + for (i = 0; i < 7; i++) { + if (bytes[18] & (1 << i)) { + highest_cas = i; + } + } + + ctime = decode_ddr2_module_ctime(bytes[9]); + + if (trcd) { + *trcd = ceil(((bytes[29] >> 2) + ((bytes[29] & 3) * 0.25)) / ctime); + } + + if (trp) { + *trp = ceil(((bytes[27] >> 2) + ((bytes[27] & 3) * 0.25)) / ctime); + } + + if (tras) { + *tras = ceil(bytes[30] / ctime); + } + + if (tcl) { + *tcl = highest_cas; + } +} + +static gchar *decode_ddr2_sdram(unsigned char *bytes, int *size) +{ + float ddr_clock; + float trcd, trp, tras, tcl; + int pc2_speed; + + decode_ddr2_module_speed(bytes, &ddr_clock, &pc2_speed); + decode_ddr2_module_size(bytes, size); + decode_ddr2_module_timings(bytes, &trcd, &trp, &tras, &tcl); + + return g_strdup_printf("[Module Information]\n" + "Module type=DDR2 %.2f MHz (PC2-%d)\n" + "SPD revision=%d.%d\n" + "[Timings]\n" + "tCL=%.2f\n" + "tRCD=%.2f\n" + "tRP=%.2f\n" + "tRAS=%.2f\n", ddr_clock, pc2_speed, bytes[62] >> 4, bytes[62] & 0xf, tcl, trcd, trp, tras); +} + +static void decode_ddr3_module_speed(unsigned char *bytes, float *ddr_clock, int *pc3_speed) +{ + float ctime; + float ddrclk; + int tbits, pcclk; + float mtb = 0.125; + + if (bytes[10] == 1 && bytes[11] == 8) + mtb = 0.125; + if (bytes[10] == 1 && bytes[11] == 15) + mtb = 0.0625; + ctime = mtb * bytes[12]; + + ddrclk = 2 * (1000 / ctime); + + tbits = 64; + switch (bytes[8]) { + case 1: + tbits = 16; + break; + case 4: + tbits = 32; + break; + case 3: + case 0xb: + tbits = 64; + break; + } + + pcclk = ddrclk * tbits / 8; + pcclk -= pcclk % 100; + + if (ddr_clock) { + *ddr_clock = (int) ddrclk; + } + if (pc3_speed) { + *pc3_speed = pcclk; + } +} + +static void decode_ddr3_module_size(unsigned char *bytes, int *size) +{ + *size = 512 << bytes[4]; +} + +static void decode_ddr3_module_timings(unsigned char *bytes, float *trcd, float *trp, float *tras, float *tcl) +{ + float ctime; + float highest_cas = 0; + int i; + float mtb = 0.125; + + if (bytes[10] == 1 && bytes[11] == 8) + mtb = 0.125; + if (bytes[10] == 1 && bytes[11] == 15) + mtb = 0.0625; + ctime = mtb * bytes[12]; + + switch (bytes[14]) { + case 6: + highest_cas = 5; + break; + case 4: + highest_cas = 6; + break; + case 0xc: + highest_cas = 7; + break; + case 0x1e: + highest_cas = 8; + break; + } + if (trcd) { + *trcd = bytes[18] * mtb; + } + + if (trp) { + *trp = bytes[20] * mtb; + } + + if (tras) { + *tras = (bytes[22] + bytes[21] & 0xf) * mtb; + } + + if (tcl) { + *tcl = highest_cas; + } +} + +static void decode_ddr3_module_type(unsigned char *bytes, const char **type) +{ + switch (bytes[3]) { + case 0x00: + *type = "Undefined"; + break; + case 0x01: + *type = "RDIMM (Registered Long DIMM)"; + break; + case 0x02: + *type = "UDIMM (Unbuffered Long DIMM)"; + break; + case 0x03: + *type = "SODIMM (Small Outline DIMM)"; + break; + default: + *type = "Unknown"; + } +} + +static gchar *decode_ddr3_sdram(unsigned char *bytes, int *size) +{ + float ddr_clock; + float trcd, trp, tras, tcl; + int pc3_speed; + const char *type; + + decode_ddr3_module_speed(bytes, &ddr_clock, &pc3_speed); + decode_ddr3_module_size(bytes, size); + decode_ddr3_module_timings(bytes, &trcd, &trp, &tras, &tcl); + decode_ddr3_module_type(bytes, &type); + + return g_strdup_printf("[Module Information]\n" + "Module type=DDR3 %.2f MHz (PC3-%d)\n" + "SPD revision=%d.%d\n" + "Type=%s\n" + "[Timings]\n" + "tCL=%.2f\n" + "tRCD=%.3fns\n" + "tRP=%.3fns\n" + "tRAS=%.3fns\n", + ddr_clock, pc3_speed, + bytes[1] >> 4, bytes[1] & 0xf, + type, + tcl, + trcd, + trp, + tras); +} + +static void decode_ddr3_part_number(unsigned char *bytes, char *part_number) +{ + int i; + if (part_number) { + for (i = 128; i <= 145; i++) + *part_number++ = bytes[i]; + *part_number = '\0'; + } +} + +static void decode_ddr3_manufacturer(unsigned char *bytes, char **manufacturer) +{ + char *out = "Unknown"; + + end: + if (manufacturer) { + *manufacturer = out; + } +} + +static void decode_module_manufacturer(unsigned char *bytes, char **manufacturer) +{ + char *out = "Unknown"; + unsigned char first; + int ai = 0; + int len = 8; + unsigned char *initial = bytes; + + if (!spd_written(bytes, 8)) { + out = "Undefined"; + goto end; + } + + do { + ai++; + } while ((--len && (*bytes++ == 0x7f))); + first = *--bytes; + + if (ai == 0) { + out = "Invalid"; + goto end; + } + + if (parity(first) != 1) { + out = "Invalid"; + goto end; + } + + out = (char *) vendors[ai - 1][(first & 0x7f) - 1]; + + end: + if (manufacturer) { + *manufacturer = out; + } +} + +static void decode_module_part_number(unsigned char *bytes, char *part_number) +{ + if (part_number) { + bytes += 8 + 64; + + while (*bytes++ && *bytes >= 32 && *bytes < 127) { + *part_number++ = *bytes; + } + *part_number = '\0'; + } +} + +static int decode_ram_type(unsigned char *bytes) +{ + if (bytes[0] < 4) { + switch (bytes[2]) { + case 1: + return DIRECT_RAMBUS; + case 17: + return RAMBUS; + } + } else { + switch (bytes[2]) { + case 1: + return FPM_DRAM; + case 2: + return EDO; + case 3: + return PIPELINED_NIBBLE; + case 4: + return SDR_SDRAM; + case 5: + return MULTIPLEXED_ROM; + case 6: + return DDR_SGRAM; + case 7: + return DDR_SDRAM; + case 8: + return DDR2_SDRAM; + case 11: + return DDR3_SDRAM; + } + } + + return UNKNOWN; +} + +static void read_spd(char *spd_path, int offset, size_t size, int use_sysfs, unsigned char *bytes_out) +{ + if (use_sysfs) { + FILE *spd; + gchar *temp_path; + + temp_path = g_strdup_printf("%s/eeprom", spd_path); + if ((spd = fopen(temp_path, "rb"))) { + fseek(spd, offset, SEEK_SET); + fread(bytes_out, 1, size, spd); + fclose(spd); + } + + g_free(temp_path); + } else { + int i; + + for (i = 0; i <= 3; i++) { + FILE *spd; + char *temp_path; + + temp_path = g_strdup_printf("%s/%02x", spd_path, offset + i * 16); + if ((spd = fopen(temp_path, "rb"))) { + fread(bytes_out + i * 16, 1, 16, spd); + fclose(spd); + } + + g_free(temp_path); + } + } +} + +static gchar *decode_dimms(GSList * dimm_list, gboolean use_sysfs) +{ + GSList *dimm; + GString *output; + gint count = 0; + + output = g_string_new(""); + + for (dimm = dimm_list; dimm; dimm = dimm->next, count++) { + gchar *spd_path = (gchar *) dimm->data; + gchar *manufacturer; + gchar *detailed_info; + gchar *moreinfo_key; + gchar part_number[32]; + unsigned char bytes[256]; + int module_size; + RamType ram_type; + + shell_status_pulse(); + + read_spd(spd_path, 0, 256, use_sysfs, bytes); + ram_type = decode_ram_type(bytes); + + switch (ram_type) { + case DDR2_SDRAM: + detailed_info = decode_ddr2_sdram(bytes, &module_size); + decode_module_part_number(bytes, part_number); + decode_module_manufacturer(bytes + 64, &manufacturer); + break; + case DDR3_SDRAM: + detailed_info = decode_ddr3_sdram(bytes, &module_size); + decode_ddr3_part_number(bytes, part_number); + decode_ddr3_manufacturer(bytes, &manufacturer); + break; + case DDR_SDRAM: + detailed_info = decode_ddr_sdram(bytes, &module_size); + decode_module_part_number(bytes, part_number); + decode_module_manufacturer(bytes + 64, &manufacturer); + break; + case SDR_SDRAM: + detailed_info = decode_sdr_sdram(bytes, &module_size); + decode_module_part_number(bytes, part_number); + decode_module_manufacturer(bytes + 64, &manufacturer); + break; + default: + DEBUG("Unsupported EEPROM type: %s\n", ram_types[ram_type]); + continue; + } + + + + gchar *key = g_strdup_printf("MEM%d", count); + moreinfo_add_with_prefix("DEV", key, g_strdup(detailed_info)); + g_free(key); + g_string_append_printf(output, "$MEM%d$%d=%s|%d MB|%s\n", count, count, part_number, module_size, manufacturer); + + g_free(spd_path); + g_free(detailed_info); + } + + return g_string_free(output, FALSE); +} + +void scan_spd_do(void) +{ + GDir *dir = NULL; + GSList *dimm_list = NULL; + gboolean use_sysfs = FALSE; + gchar *dir_entry; + gchar *list; + + if (g_file_test("/sys/bus/i2c/drivers/eeprom", G_FILE_TEST_EXISTS)) { + dir = g_dir_open("/sys/bus/i2c/drivers/eeprom", 0, NULL); + use_sysfs = TRUE; + } else if (g_file_test("/proc/sys/dev/sensors", G_FILE_TEST_EXISTS)) { + dir = g_dir_open("/proc/sys/dev/sensors", 0, NULL); + } + + if (!dir) { + g_free(spd_info); + if (!g_file_test("/sys/module/eeprom", G_FILE_TEST_EXISTS)) { + spd_info = g_strdup(_("[SPD]\n" + "Please load the eeprom module to obtain information about memory SPD=\n" + "[$ShellParam$]\n" + "ReloadInterval=500\n")); + } else { + spd_info = g_strdup(_("[SPD]\n" "Reading memory SPD not supported on this system=\n")); + } + + return; + } + + while ((dir_entry = (char *) g_dir_read_name(dir))) { + if (use_sysfs && isdigit(dir_entry[0])) { + dimm_list = g_slist_prepend(dimm_list, g_strdup_printf("/sys/bus/i2c/drivers/eeprom/%s", dir_entry)); + } else if (g_str_has_prefix(dir_entry, "eeprom-")) { + dimm_list = g_slist_prepend(dimm_list, g_strdup_printf("/proc/sys/dev/sensors/%s", dir_entry)); + } + } + + g_dir_close(dir); + + list = decode_dimms(dimm_list, use_sysfs); + g_slist_free(dimm_list); + + g_free(spd_info); + spd_info = g_strdup_printf("[SPD]\n" + "%s\n" + "[$ShellParam$]\n" + "ViewType=1\n" + "ColumnTitle$TextValue=Bank\n" + "ColumnTitle$Extra1=Size\n" + "ColumnTitle$Extra2=Manufacturer\n" + "ColumnTitle$Value=Model\n" "ShowColumnHeaders=true\n", list); + g_free(list); +} diff --git a/modules/devices/storage.c b/modules/devices/storage.c new file mode 100644 index 00000000..0c393682 --- /dev/null +++ b/modules/devices/storage.c @@ -0,0 +1,371 @@ +/* + * HardInfo - Displays System Information + * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@hardinfo.org> + * + * 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 "hardinfo.h" +#include "devices.h" + +gchar *storage_icons = NULL; + +/* SCSI support by Pascal F.Martin <pascalmartin@earthlink.net> */ +void +__scan_scsi_devices(void) +{ + FILE *proc_scsi; + gchar buffer[256], *buf; + gint n = 0; + gint scsi_controller = 0; + gint scsi_channel = 0; + gint scsi_id = 0 ; + gint scsi_lun = 0; + gchar *vendor = NULL, *revision = NULL, *model = NULL; + gchar *scsi_storage_list; + + /* remove old devices from global device table */ + moreinfo_del_with_prefix("DEV:SCSI"); + + if (!g_file_test("/proc/scsi/scsi", G_FILE_TEST_EXISTS)) + return; + + scsi_storage_list = g_strdup(_("\n[SCSI Disks]\n")); + + if ((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)) { + buf[17] = '\0'; + buf[41] = '\0'; + buf[53] = '\0'; + + vendor = g_strdup(g_strstrip(buf + 8)); + model = g_strdup_printf("%s %s", vendor, g_strstrip(buf + 24)); + revision = g_strdup(g_strstrip(buf + 46)); + } else if (!strncmp(buf, "Type: ", 8)) { + char *p; + gchar *type = NULL, *icon = NULL; + + if (!(p = strstr(buf, "ANSI SCSI revision"))) { + p = strstr(buf, "ANSI SCSI revision"); + } + + 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", "cdrom"}, + { "CD-ROM", "CD-ROM", "cdrom"}, + { "Scanner", "Scanner", "scanner"}, + { "Flash Disk", "USB Flash Disk", "usbfldisk" }, + { NULL, "Generic", "scsi"} + }; + int i; + + if (model && strstr(model, "Flash Disk")) { + type = "Flash Disk"; + icon = "usbfldisk"; + } else { + for (i = 0; type2icon[i].type != NULL; i++) + if (g_str_equal(buf + 8, type2icon[i].type)) + break; + + type = type2icon[i].label; + icon = type2icon[i].icon; + } + } + + gchar *devid = g_strdup_printf("SCSI%d", n); + scsi_storage_list = h_strdup_cprintf("$%s$%s=\n", scsi_storage_list, devid, model); + storage_icons = h_strdup_cprintf("Icon$%s$%s=%s.png\n", storage_icons, devid, model, icon); + + gchar *strhash = g_strdup_printf(_("[Device Information]\n" + "Model=%s\n"), model); + + const gchar *url = vendor_get_url(model); + if (url) { + strhash = h_strdup_cprintf(_("Vendor=%s (%s)\n"), + strhash, + vendor_get_name(model), + url); + } else { + strhash = h_strdup_cprintf(_("Vendor=%s\n"), + strhash, + vendor_get_name(model)); + } + + strhash = h_strdup_cprintf(_("Type=%s\n" + "Revision=%s\n" + "[SCSI Controller]\n" + "Controller=scsi%d\n" + "Channel=%d\n" + "ID=%d\n" "LUN=%d\n"), + strhash, + type, + revision, + scsi_controller, + scsi_channel, + scsi_id, + scsi_lun); + moreinfo_add_with_prefix("DEV", devid, strhash); + g_free(devid); + + g_free(model); + g_free(revision); + g_free(vendor); + + scsi_controller = scsi_channel = scsi_id = scsi_lun = 0; + } + } + fclose(proc_scsi); + } + + if (n) { + storage_list = h_strconcat(storage_list, scsi_storage_list, NULL); + g_free(scsi_storage_list); + } +} + +void __scan_ide_devices(void) +{ + FILE *proc_ide; + gchar *device, iface, *model, *media, *pgeometry = NULL, *lgeometry = NULL; + gint n = 0, i = 0, cache, nn = 0; + gchar *capab = NULL, *speed = NULL, *driver = NULL, *ide_storage_list; + + /* remove old devices from global device table */ + moreinfo_del_with_prefix("DEV:IDE"); + + ide_storage_list = g_strdup(_("\n[IDE Disks]\n")); + + 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[128]; + + cache = 0; + + proc_ide = fopen(device, "r"); + if (!proc_ide) + continue; + + (void) fgets(buf, 128, 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"); + if (!proc_ide) { + free(model); + continue; + } + + (void) 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 = h_strdup_cprintf("\nCan %s#%d=%s\n", capab, ttmp[1], ++nn, ttmp[2]); + + g_strfreev(ttmp); + } else if (strstr(buf, "Buffer-Underrun-Free")) { + capab = + h_strdup_cprintf + ("\nSupports BurnProof=%s\n", capab, strstr(buf, "Does not") ? "No" : "Yes"); + } else if (strstr(buf, "multi-session")) { + capab = + h_strdup_cprintf + ("\nCan read multi-session CDs=%s\n", + capab, strstr(buf, "Does not") ? "No" : "Yes"); + } else if (strstr(buf, "audio CDs")) { + capab = + h_strdup_cprintf + ("\nCan play audio CDs=%s\n", capab, strstr(buf, "Does not") ? "No" : "Yes"); + } else if (strstr(buf, "PREVENT/ALLOW")) { + capab = + h_strdup_cprintf + ("\nCan lock media=%s\n", capab, strstr(buf, "Does not") ? "No" : "Yes"); + } + } else if ((strstr(buf, "read") + || strstr(buf, "write")) + && strstr(buf, "kB/s")) { + speed = + g_strconcat(speed ? speed : "", strreplacechr(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); + + device = g_strdup_printf("/proc/ide/hd%c/cache", iface); + if (g_file_test(device, G_FILE_TEST_EXISTS)) { + proc_ide = fopen(device, "r"); + if (proc_ide) { + (void) fscanf(proc_ide, "%d", &cache); + fclose(proc_ide); + } else { + cache = 0; + } + } + 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"); + if (proc_ide) { + (void) fgets(buf, 64, proc_ide); + for (tmp = buf; *tmp; tmp++) { + if (*tmp >= '0' && *tmp <= '9') + break; + } + + pgeometry = g_strdup(g_strstrip(tmp)); + + (void) 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); + } else { + pgeometry = g_strdup("Unknown"); + lgeometry = g_strdup("Unknown"); + } + + } + g_free(device); + + n++; + + gchar *devid = g_strdup_printf("IDE%d", n); + + ide_storage_list = h_strdup_cprintf("$%s$%s=\n", ide_storage_list, devid, model); + storage_icons = + h_strdup_cprintf("Icon$%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"), + model); + + const gchar *url = vendor_get_url(model); + + if (url) { + strhash = h_strdup_cprintf(_("Vendor=%s (%s)\n"), strhash, vendor_get_name(model), url); + } else { + strhash = h_strdup_cprintf(_("Vendor=%s\n"), strhash, vendor_get_name(model)); + } + + strhash = h_strdup_cprintf(_("Device Name=hd%c\n" + "Media=%s\n" "Cache=%dkb\n"), strhash, iface, media, cache); + if (driver) { + strhash = h_strdup_cprintf("%s\n", strhash, driver); + + g_free(driver); + driver = NULL; + } + + if (pgeometry && lgeometry) { + strhash = h_strdup_cprintf(_("[Geometry]\n" + "Physical=%s\n" "Logical=%s\n"), strhash, pgeometry, lgeometry); + + g_free(pgeometry); + pgeometry = NULL; + g_free(lgeometry); + lgeometry = NULL; + } + + if (capab) { + strhash = h_strdup_cprintf(_("[Capabilities]\n%s"), strhash, capab); + + g_free(capab); + capab = NULL; + } + + if (speed) { + strhash = h_strdup_cprintf(_("[Speeds]\n%s"), strhash, speed); + + g_free(speed); + speed = NULL; + } + + moreinfo_add_with_prefix("DEV", devid, strhash); + g_free(devid); + g_free(model); + } else { + g_free(device); + } + + iface++; + } + + if (n) { + storage_list = h_strconcat(storage_list, ide_storage_list, NULL); + g_free(ide_storage_list); + } +} diff --git a/modules/devices/usb.c b/modules/devices/usb.c new file mode 100644 index 00000000..3a93a3b6 --- /dev/null +++ b/modules/devices/usb.c @@ -0,0 +1,381 @@ +/* + * HardInfo - Displays System Information + * Copyright (C) 2003-2008 Leandro A. F. Pereira <leandro@hardinfo.org> + * + * 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 + */ +/* + * FIXME: + * - listing with sysfs does not generate device hierarchy + */ + +#include <string.h> + +#include "hardinfo.h" +#include "devices.h" + +gchar *usb_list = NULL; + +void __scan_usb_sysfs_add_device(gchar * endpoint, int n) +{ + gchar *manufacturer, *product, *mxpwr, *tmp, *strhash; + gint bus, classid, vendor, prodid; + gfloat version, speed; + + classid = h_sysfs_read_int(endpoint, "bDeviceClass"); + vendor = h_sysfs_read_int(endpoint, "idVendor"); + prodid = h_sysfs_read_int(endpoint, "idProduct"); + bus = h_sysfs_read_int(endpoint, "busnum"); + speed = h_sysfs_read_float(endpoint, "speed"); + version = h_sysfs_read_float(endpoint, "version"); + + if (!(mxpwr = h_sysfs_read_string(endpoint, "bMaxPower"))) { + mxpwr = g_strdup("0 mA"); + } + + if (!(manufacturer = h_sysfs_read_string(endpoint, "manufacturer"))) { + manufacturer = g_strdup("Unknown"); + } + + if (!(product = h_sysfs_read_string(endpoint, "product"))) { + if (classid == 9) { + product = g_strdup_printf("USB %.2f Hub", version); + } else { + product = g_strdup_printf("Unknown USB %.2f Device (class %d)", version, classid); + } + } + + const gchar *url = vendor_get_url(manufacturer); + if (url) { + tmp = g_strdup_printf("%s (%s)", vendor_get_name(manufacturer), url); + + g_free(manufacturer); + manufacturer = tmp; + } + + tmp = g_strdup_printf("USB%d", n); + usb_list = h_strdup_cprintf("$%s$%s=\n", usb_list, tmp, product); + + strhash = g_strdup_printf("[Device Information]\n" + "Product=%s\n" + "Manufacturer=%s\n" + "Speed=%.2fMbit/s\n" + "Max Current=%s\n" + "[Misc]\n" + "USB Version=%.2f\n" + "Class=0x%x\n" + "Vendor=0x%x\n" + "Product ID=0x%x\n" + "Bus=%d\n", + product, + manufacturer, + speed, + mxpwr, + version, classid, vendor, prodid, bus); + + moreinfo_add_with_prefix("DEV", tmp, strhash); + g_free(tmp); + g_free(manufacturer); + g_free(product); + g_free(mxpwr); +} + +gboolean __scan_usb_sysfs(void) +{ + GDir *sysfs; + gchar *filename; + const gchar *sysfs_path = "/sys/class/usb_endpoint"; + gint usb_device_number = 0; + + if (!(sysfs = g_dir_open(sysfs_path, 0, NULL))) { + return FALSE; + } + + if (usb_list) { + moreinfo_del_with_prefix("DEV:USB"); + g_free(usb_list); + } + usb_list = g_strdup("[USB Devices]\n"); + + while ((filename = (gchar *) g_dir_read_name(sysfs))) { + gchar *endpoint = + g_build_filename(sysfs_path, filename, "device", NULL); + gchar *temp; + + temp = g_build_filename(endpoint, "idVendor", NULL); + if (g_file_test(temp, G_FILE_TEST_EXISTS)) { + __scan_usb_sysfs_add_device(endpoint, ++usb_device_number); + } + + g_free(temp); + g_free(endpoint); + } + + g_dir_close(sysfs); + + return usb_device_number > 0; +} + +gboolean __scan_usb_procfs(void) +{ + FILE *dev; + gchar buffer[128]; + gchar *tmp, *manuf = NULL, *product = NULL, *mxpwr = NULL; + gint bus = 0, level = 0, port = 0, classid = 0, trash; + gint vendor = 0, prodid = 0; + gfloat ver = 0.0f, rev = 0.0f, speed = 0.0f; + int n = 0; + + dev = fopen("/proc/bus/usb/devices", "r"); + if (!dev) + return 0; + + if (usb_list) { + moreinfo_del_with_prefix("DEV:USB"); + g_free(usb_list); + } + usb_list = g_strdup("[USB Devices]\n"); + + 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 && *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 = h_strdup_cprintf("[%s#%d]\n", usb_list, product, n); + } else { /* everything else */ + usb_list = h_strdup_cprintf("$%s$%s=\n", usb_list, tmp, product); + + const gchar *url = vendor_get_url(manuf); + if (url) { + gchar *tmp = g_strdup_printf("%s (%s)", vendor_get_name(manuf), + url); + g_free(manuf); + manuf = tmp; + } + + gchar *strhash = g_strdup_printf("[Device Information]\n" "Product=%s\n", + product); + if (manuf && strlen(manuf)) + strhash = h_strdup_cprintf("Manufacturer=%s\n", strhash, manuf); + + strhash = h_strdup_cprintf("[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", + strhash, port, speed, mxpwr, ver, rev, classid, vendor, prodid, bus, level); + + moreinfo_add_with_prefix("DEV", tmp, strhash); + g_free(tmp); + } + + g_free(manuf); + g_free(product); + manuf = g_strdup(""); + product = g_strdup(""); + port = classid = 0; + } + } + + fclose(dev); + + return n > 0; +} + + +void __scan_usb_lsusb_add_device(char *buffer, int bufsize, FILE * lsusb, int usb_device_number) +{ + gint bus, device, vendor_id, product_id; + gchar *version = NULL, *product = NULL, *vendor = NULL, *dev_class = NULL, *int_class = NULL; + gchar *max_power = NULL, *name = NULL; + gchar *tmp, *strhash; + long position = 0; + + g_strstrip(buffer); + sscanf(buffer, "Bus %d Device %d: ID %x:%x", &bus, &device, &vendor_id, &product_id); + name = g_strdup(buffer + 33); + + for (fgets(buffer, bufsize, lsusb); position >= 0 && fgets(buffer, bufsize, lsusb); position = ftell(lsusb)) { + g_strstrip(buffer); + + if (g_str_has_prefix(buffer, "idVendor")) { + g_free(vendor); + vendor = g_strdup(buffer + 26); + } else if (g_str_has_prefix(buffer, "idProduct")) { + g_free(product); + product = g_strdup(buffer + 26); + } else if (g_str_has_prefix(buffer, "MaxPower")) { + g_free(max_power); + max_power = g_strdup(buffer + 9); + } else if (g_str_has_prefix(buffer, "bcdUSB")) { + g_free(version); + version = g_strdup(buffer + 7); + } else if (g_str_has_prefix(buffer, "bDeviceClass")) { + g_free(dev_class); + dev_class = g_strdup(buffer + 14); + } else if (g_str_has_prefix(buffer, "bInterfaceClass")) { + g_free(int_class); + int_class = g_strdup(buffer + 16); + } else if (g_str_has_prefix(buffer, "Bus ")) { + /* device separator */ + fseek(lsusb, position, SEEK_SET); + break; + } + } + + if (dev_class && strstr(dev_class, "0 (Defined at Interface level)")) { + g_free(dev_class); + if (int_class) { + dev_class = int_class; + } else { + dev_class = g_strdup("Unknown"); + } + } else + dev_class = g_strdup("Unknown"); + + tmp = g_strdup_printf("USB%d", usb_device_number); + usb_list = h_strdup_cprintf("$%s$%s=\n", usb_list, tmp, name); + + strhash = g_strdup_printf("[Device Information]\n" + "Product=%s\n" + "Manufacturer=%s\n" + "Max Current=%s\n" + "[Misc]\n" + "USB Version=%s\n" + "Class=%s\n" + "Vendor=0x%x\n" + "Product ID=0x%x\n" + "Bus=%d\n", + product ? g_strstrip(product) : "Unknown", + vendor ? g_strstrip(vendor) : "Unknown", + max_power ? g_strstrip(max_power) : "Unknown", + version ? g_strstrip(version) : "Unknown", + dev_class ? g_strstrip(dev_class) : "Unknown", vendor_id, product_id, bus); + + moreinfo_add_with_prefix("DEV", tmp, strhash); + g_free(vendor); + g_free(product); + g_free(max_power); + g_free(dev_class); + g_free(version); + g_free(tmp); + g_free(name); +} + +gboolean __scan_usb_lsusb(void) +{ + static gchar *lsusb_path = NULL; + int usb_device_number = 0; + FILE *lsusb; + FILE *temp_lsusb; + char buffer[512], *temp; + + if (!lsusb_path) { + if (!(lsusb_path = find_program("lsusb"))) { + DEBUG("lsusb not found"); + + return FALSE; + } + } + + temp = g_strdup_printf("%s -v | tr '[]' '()'", lsusb_path); + if (!(lsusb = popen(temp, "r"))) { + DEBUG("cannot run %s", lsusb_path); + + g_free(temp); + return FALSE; + } + + temp_lsusb = tmpfile(); + if (!temp_lsusb) { + DEBUG("cannot create temporary file for lsusb"); + pclose(lsusb); + return FALSE; + } + + while (fgets(buffer, sizeof(buffer), lsusb)) { + fputs(buffer, temp_lsusb); + } + + pclose(lsusb); + + // rewind file so we can read from it + fseek(temp_lsusb, 0, SEEK_SET); + + g_free(temp); + + if (usb_list) { + moreinfo_del_with_prefix("DEV:USB"); + g_free(usb_list); + } + usb_list = g_strdup("[USB Devices]\n"); + + while (fgets(buffer, sizeof(buffer), temp_lsusb)) { + if (g_str_has_prefix(buffer, "Bus ")) { + __scan_usb_lsusb_add_device(buffer, sizeof(buffer), temp_lsusb, ++usb_device_number); + } + } + + fclose(temp_lsusb); + + return usb_device_number > 0; +} + +void __scan_usb(void) +{ + if (!__scan_usb_procfs()) { + if (!__scan_usb_sysfs()) { + __scan_usb_lsusb(); + } + } +} diff --git a/arch/linux/x86/processor.h b/modules/devices/x86/processor.c index 97fa4555..7935a83d 100644 --- a/arch/linux/x86/processor.h +++ b/modules/devices/x86/processor.c @@ -16,40 +16,14 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -typedef struct _ProcessorCache ProcessorCache; - -struct _ProcessorCache { - gint level; - gint number_of_sets; - gint physical_line_partition; - gint size; - gchar *type; - gint ways_of_associativity; -}; - -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; - - GSList *cache; -}; +#include "hardinfo.h" +#include "devices.h" /* * This function is partly based on x86cpucaps * by Osamu Kayasono <jacobi@jcom.home.ne.jp> */ -static void get_processor_strfamily(Processor * processor) +void get_processor_strfamily(Processor * processor) { gint family = processor->family; gint model = processor->model; @@ -71,7 +45,7 @@ static void get_processor_strfamily(Processor * processor) } else if (model == 9) { processor->strmodel = g_strdup("Pentium M"); } else { - processor->strmodel = g_strdup("Pentium III/Pentium III Xeon/Celeron"); + processor->strmodel = g_strdup("Pentium III/Pentium III Xeon/Celeron/Core Duo/Core Duo 2"); } } else if (family > 6) { processor->strmodel = g_strdup("Pentium 4"); @@ -166,14 +140,14 @@ static gchar *__cache_get_info_as_string(Processor *processor) gchar *result = g_strdup(""); GSList *cache_list; ProcessorCache *cache; - + if (!processor->cache) { - return g_strdup("Cache information not available=\n"); + return g_strdup(_("Cache information not available=\n")); } - + for (cache_list = processor->cache; cache_list; cache_list = cache_list->next) { cache = (ProcessorCache *)cache_list->data; - + result = h_strdup_cprintf("Level %d (%s)=%d-way set-associative, %d sets, %dKB size\n", result, cache->level, @@ -182,27 +156,28 @@ static gchar *__cache_get_info_as_string(Processor *processor) cache->number_of_sets, cache->size); } - + return result; } -static void __cache_obtain_info(Processor *processor, gint processor_number) +static void __cache_obtain_info(Processor *processor) { ProcessorCache *cache; gchar *endpoint, *entry, *index; gint i; - + gint processor_number = processor->id; + endpoint = g_strdup_printf("/sys/devices/system/cpu/cpu%d/cache", processor_number); - + for (i = 0; ; i++) { cache = g_new0(ProcessorCache, 1); - + index = g_strdup_printf("index%d/", i); entry = g_strconcat(index, "type", NULL); cache->type = h_sysfs_read_string(endpoint, entry); g_free(entry); - + if (!cache->type) { g_free(cache); g_free(index); @@ -229,72 +204,145 @@ static void __cache_obtain_info(Processor *processor, gint processor_number) entry = g_strconcat(index, "ways_of_associativity", NULL); cache->ways_of_associativity = h_sysfs_read_int(endpoint, entry); g_free(entry); - + g_free(index); processor->cache = g_slist_append(processor->cache, cache); } -fail: +fail: g_free(endpoint); } -static GSList *__scan_processors(void) +int processor_has_flag(gchar * strflags, gchar * strflag) { - GSList *procs = NULL; - Processor *processor = NULL; - FILE *cpuinfo; - gchar buffer[256]; - gint processor_number = 0; - - cpuinfo = fopen("/proc/cpuinfo", "r"); - if (!cpuinfo) - return NULL; - - 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); - - __cache_obtain_info(processor, processor_number++); - } - - if (tmp[0] && tmp[1]) { - tmp[0] = g_strstrip(tmp[0]); - tmp[1] = g_strstrip(tmp[1]); + gchar **flags; + gint ret = 0; + if (strflags == NULL || strflag == NULL) + return 0; + flags = g_strsplit(strflags, " ", 0); + ret = g_strv_contains((const gchar * const *)flags, strflag); + g_strfreev(flags); + return ret; +} - 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); +static gint get_cpu_int(const gchar* file, gint cpuid) { + gchar *tmp0 = NULL; + gchar *tmp1 = NULL; + gint ret = 0; - get_str("fpu", processor->has_fpu); + tmp0 = g_strdup_printf("/sys/devices/system/cpu/cpu%d/%s", cpuid, file); + g_file_get_contents(tmp0, &tmp1, NULL, NULL); + if (tmp1) + ret = atol(tmp1); - 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); + g_free(tmp0); + g_free(tmp1); + return ret; +} - get_int("model", processor->model); - get_int("cpu family", processor->family); - get_int("stepping", processor->stepping); +GSList *processor_scan(void) +{ + GSList *procs = NULL, *l = NULL; + Processor *processor = NULL; + FILE *cpuinfo; + gchar buffer[512]; - get_int("processor", processor->id); - } - g_strfreev(tmp); + cpuinfo = fopen("/proc/cpuinfo", "r"); + if (!cpuinfo) + return NULL; + + while (fgets(buffer, 512, cpuinfo)) { + gchar **tmp = g_strsplit(buffer, ":", 2); + if (!tmp[1] || !tmp[0]) { + g_strfreev(tmp); + continue; + } + + tmp[0] = g_strstrip(tmp[0]); + tmp[1] = g_strstrip(tmp[1]); + + if (g_str_has_prefix(tmp[0], "processor")) { + /* finish previous */ + if (processor) + procs = g_slist_append(procs, processor); + + /* start next */ + processor = g_new0(Processor, 1); + processor->id = atol(tmp[1]); + g_strfreev(tmp); + continue; + } + + if (processor) { + get_str("model name", processor->model_name); + get_str("vendor_id", processor->vendor_id); + get_str("flags", processor->flags); + get_str("bugs", processor->bugs); + get_str("power management", processor->pm); + 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); } - if (processor) { - get_processor_strfamily(processor); - procs = g_slist_append(procs, processor); + /* finish last */ + if (processor) + procs = g_slist_append(procs, processor); + + for (l = procs; l; l = l->next) { + processor = (Processor *) l->data; + + get_processor_strfamily(processor); + __cache_obtain_info(processor); + + if (processor->bugs == NULL || g_strcmp0(processor->bugs, "") == 0) { + g_free(processor->bugs); + /* make bugs list on old kernels that don't offer one */ + processor->bugs = g_strdup_printf("%s%s%s%s%s%s%s%s%s%s", + /* the oldest bug workarounds indicated in /proc/cpuinfo */ + processor->bug_fdiv ? " fdiv" : "", + processor->bug_hlt ? " _hlt" : "", + processor->bug_f00f ? " f00f" : "", + processor->bug_coma ? " coma" : "", + /* these bug workarounds were reported as "features" in older kernels */ + processor_has_flag(processor->flags, "fxsave_leak") ? " fxsave_leak" : "", + processor_has_flag(processor->flags, "clflush_monitor") ? " clflush_monitor" : "", + processor_has_flag(processor->flags, "11ap") ? " 11ap" : "", + processor_has_flag(processor->flags, "tlb_mmatch") ? " tlb_mmatch" : "", + processor_has_flag(processor->flags, "apic_c1e") ? " apic_c1e" : "", + ""); /* just to make adding lines easier */ + g_strchug(processor->bugs); + } + + if (processor->pm == NULL || g_strcmp0(processor->pm, "") == 0) { + g_free(processor->pm); + /* make power management list on old kernels that don't offer one */ + processor->pm = g_strdup_printf("%s%s", + /* "hw_pstate" -> "hwpstate" */ + processor_has_flag(processor->flags, "hw_pstate") ? " hwpstate" : "", + ""); /* just to make adding lines easier */ + g_strchug(processor->pm); + } + + /* freq */ + processor->cpukhz_cur = get_cpu_int("cpufreq/scaling_cur_freq", processor->id); + processor->cpukhz_min = get_cpu_int("cpufreq/scaling_min_freq", processor->id); + processor->cpukhz_max = get_cpu_int("cpufreq/scaling_max_freq", processor->id); + if (processor->cpukhz_max) + processor->cpu_mhz = processor->cpukhz_max / 1000; } fclose(cpuinfo); @@ -303,10 +351,11 @@ static GSList *__scan_processors(void) } /* - * Sources: + * Sources: * - Linux' cpufeature.h * - http://gentoo-wiki.com/Cpuinfo * - Intel IA-32 Architecture Software Development Manual + * - https://unix.stackexchange.com/questions/43539/what-do-the-flags-in-proc-cpuinfo-mean */ static struct { char *name, *meaning; @@ -416,47 +465,181 @@ static struct { { "tpr", "Task Priority Register" }, { "vid", "Voltage Identifier" }, { "fid", "Frequency Identifier" }, + { "dtes64", "64-bit Debug Store" }, + { "monitor", "Monitor/Mwait support" }, + { "sse4_1", "Streaming SIMD Extension 4.1" }, + { "sse4_2", "Streaming SIMD Extension 4.2" }, + { "nopl", "NOPL instructions" }, + { "cxmmx", "Cyrix MMX extensions" }, + { "xtopology", "CPU topology enum extensions" }, + { "nonstop_tsc", "TSC does not stop in C states" }, + { "eagerfpu", "Non lazy FPU restor" }, + { "pclmulqdq", "Perform a Carry-Less Multiplication of Quadword instruction" }, + { "smx", "Safer mode: TXT (TPM support)" }, + { "pdcm", "Performance capabilities" }, + { "pcid", "Process Context Identifiers" }, + { "x2apic", "x2APIC" }, + { "popcnt", "Set bit count instructions" }, + { "aes", "Advanced Encryption Standard" }, + { "aes-ni", "Advanced Encryption Standard (New Instructions)" }, + { "xsave", "Save Processor Extended States" }, + { "avx", "Advanced Vector Instructions" }, + { NULL, NULL }, +}; + +static struct { + char *name, *meaning; +} bug_meaning[] = { + { "f00f", "Intel F00F bug" }, + { "fdiv", "FPU FDIV" }, + { "coma", "Cyrix 6x86 coma" }, + { "tlb_mmatch", "AMD Erratum 383" }, + { "apic_c1e", "AMD Erratum 400" }, + { "11ap", "Bad local APIC aka 11AP" }, + { "fxsave_leak", "FXSAVE leaks FOP/FIP/FOP" }, + { "clflush_monitor", "AAI65, CLFLUSH required before MONITOR" }, + { "sysret_ss_attrs", "SYSRET doesn't fix up SS attrs" }, + { "espfix", "IRET to 16-bit SS corrupts ESP/RSP high bits" }, + { "null_seg", "Nulling a selector preserves the base" }, /* see: detect_null_seg_behavior() */ + { "swapgs_fence","SWAPGS without input dep on GS" }, + { "monitor", "IPI required to wake up remote CPU" }, + { "amd_e400", "AMD Erratum 400" }, { NULL, NULL }, }; +/* from arch/x86/kernel/cpu/powerflags.h */ +static struct { + char *name, *meaning; +} pm_meaning[] = { + { "ts", "temperature sensor" }, + { "fid", "frequency id control" }, + { "vid", "voltage id control" }, + { "ttp", "thermal trip" }, + { "tm", "hardware thermal control" }, + { "stc", "software thermal control" }, + { "100mhzsteps", "100 MHz multiplier control" }, + { "hwpstate", "hardware P-state control" }, +/* { "", "tsc invariant mapped to constant_tsc" }, */ + { "cpb", "core performance boost" }, + { "eff_freq_ro", "Readonly aperf/mperf" }, + { "proc_feedback", "processor feedback interface" }, + { "acc_power", "accumulated power mechanism" }, + { NULL, NULL }, +}; + +GHashTable *cpu_flags = NULL; + +static void +populate_cpu_flags_list_internal() +{ + int i; + + DEBUG("using internal CPU flags database"); + + for (i = 0; flag_meaning[i].name != NULL; i++) { + g_hash_table_insert(cpu_flags, flag_meaning[i].name, + flag_meaning[i].meaning); + } + for (i = 0; bug_meaning[i].name != NULL; i++) { + g_hash_table_insert(cpu_flags, bug_meaning[i].name, + bug_meaning[i].meaning); + } + for (i = 0; pm_meaning[i].name != NULL; i++) { + g_hash_table_insert(cpu_flags, pm_meaning[i].name, + pm_meaning[i].meaning); + } +} + +void cpu_flags_init(void) +{ + gint i; + gchar *path; + + cpu_flags = g_hash_table_new(g_str_hash, g_str_equal); + + path = g_build_filename(g_get_home_dir(), ".hardinfo", "cpuflags.conf", NULL); + if (!g_file_test(path, G_FILE_TEST_EXISTS)) { + populate_cpu_flags_list_internal(); + } else { + GKeyFile *flags_file; + + DEBUG("using %s as CPU flags database", path); + + flags_file = g_key_file_new(); + if (g_key_file_load_from_file(flags_file, path, 0, NULL)) { + gchar **flag_keys; + + flag_keys = g_key_file_get_keys(flags_file, "flags", + NULL, NULL); + if (!flag_keys) { + DEBUG("error while using %s as CPU flags database, falling back to internal", + path); + populate_cpu_flags_list_internal(); + } else { + for (i = 0; flag_keys[i]; i++) { + gchar *meaning; + + meaning = g_key_file_get_string(flags_file, "flags", + flag_keys[i], NULL); + + g_hash_table_insert(cpu_flags, g_strdup(flag_keys[i]), meaning); + + /* can't free meaning */ + } + + g_strfreev(flag_keys); + } + } + + g_key_file_free(flags_file); + } + + g_free(path); +} + gchar *processor_get_capabilities_from_flags(gchar * strflags) { /* FIXME: - * - Separate between processor capabilities, additional instructions and whatnot. - * - Use binary search or something faster than this O(n) cruft + * - Separate between processor capabilities, additional instructions and whatnot. */ gchar **flags, **old; gchar *tmp = NULL; - gint i, j = 0; + gint j = 0; + + if (!cpu_flags) { + cpu_flags_init(); + } flags = g_strsplit(strflags, " ", 0); old = flags; while (flags[j]) { - gchar *meaning = ""; - for (i = 0; flag_meaning[i].name != NULL; i++) { - if (g_str_equal(flags[j], flag_meaning[i].name)) { - meaning = flag_meaning[i].meaning; - break; - } - } + gchar *meaning = g_hash_table_lookup(cpu_flags, flags[j]); - tmp = h_strdup_cprintf("%s=%s\n", tmp, flags[j], meaning); + if (meaning) { + tmp = h_strdup_cprintf("%s=%s\n", tmp, flags[j], meaning); + } else { + tmp = h_strdup_cprintf("%s=\n", tmp, flags[j]); + } j++; } + if (tmp == NULL || g_strcmp0(tmp, "") == 0) + tmp = g_strdup_printf("%s=%s\n", "empty", _("Empty List")); g_strfreev(old); return tmp; } -static gchar *processor_get_detailed_info(Processor * processor) +gchar *processor_get_detailed_info(Processor * processor) { - gchar *tmp, *ret, *cache_info; + gchar *tmp_flags, *tmp_bugs, *tmp_pm, *ret, *cache_info; - tmp = processor_get_capabilities_from_flags(processor->flags); + tmp_flags = processor_get_capabilities_from_flags(processor->flags); + tmp_bugs = processor_get_capabilities_from_flags(processor->bugs); + tmp_pm = processor_get_capabilities_from_flags(processor->pm); cache_info = __cache_get_info_as_string(processor); - - ret = g_strdup_printf("[Processor]\n" + + ret = g_strdup_printf(_("[Processor]\n" "Name=%s\n" "Family, model, stepping=%d, %d, %d (%s)\n" "Vendor=%s\n" @@ -465,16 +648,20 @@ static gchar *processor_get_detailed_info(Processor * processor) "Frequency=%.2fMHz\n" "BogoMIPS=%.2f\n" "Byte Order=%s\n" + "[Frequency Scaling]\n" + "Minimum=%d kHz\n" + "Maximum=%d kHz\n" + "Current=%d kHz\n" "[Features]\n" - "FDIV Bug=%s\n" - "HLT Bug=%s\n" - "F00F Bug=%s\n" - "Coma Bug=%s\n" "Has FPU=%s\n" "[Cache]\n" "%s\n" + "[Power Management]\n" + "%s" + "[Bugs]\n" + "%s" "[Capabilities]\n" - "%s", + "%s"), processor->model_name, processor->family, processor->model, @@ -488,20 +675,21 @@ static gchar *processor_get_detailed_info(Processor * processor) #else "Big Endian", #endif - processor->bug_fdiv ? processor->bug_fdiv : "no", - processor->bug_hlt ? processor->bug_hlt : "no", - processor->bug_f00f ? processor->bug_f00f : "no", - processor->bug_coma ? processor->bug_coma : "no", + processor->cpukhz_min, + processor->cpukhz_max, + processor->cpukhz_cur, processor->has_fpu ? processor->has_fpu : "no", cache_info, - tmp); - g_free(tmp); + tmp_pm, tmp_bugs, tmp_flags); + g_free(tmp_flags); + g_free(tmp_bugs); + g_free(tmp_pm); g_free(cache_info); - + return ret; } -static gchar *processor_get_info(GSList * processors) +gchar *processor_get_info(GSList * processors) { Processor *processor; @@ -514,14 +702,15 @@ static gchar *processor_get_info(GSList * processors) for (l = processors; l; l = l->next) { processor = (Processor *) l->data; - tmp = g_strdup_printf("%s$CPU%d$%s=%.2fMHz\n", + 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, + moreinfo_add_with_prefix("DEV", hashkey, processor_get_detailed_info(processor)); + g_free(hashkey); } ret = g_strdup_printf("[$ShellParam$]\n" @@ -529,7 +718,7 @@ static gchar *processor_get_info(GSList * processors) "[Processors]\n" "%s", tmp); g_free(tmp); - + return ret; } diff --git a/modules/devices/x86_64 b/modules/devices/x86_64 new file mode 120000 index 00000000..de1ff735 --- /dev/null +++ b/modules/devices/x86_64 @@ -0,0 +1 @@ +./x86
\ No newline at end of file diff --git a/network.c b/modules/network.c index d3397412..18f8ba65 100644 --- a/network.c +++ b/modules/network.c @@ -26,13 +26,16 @@ #include <sys/utsname.h> #include <sys/stat.h> +#include <sys/socket.h> +#include <netdb.h> + #include <hardinfo.h> #include <iconcache.h> #include <shell.h> #include <vendor.h> -static GHashTable *moreinfo = NULL; +#include "network.h" /* Callbacks */ gchar *callback_network(); @@ -53,24 +56,20 @@ void scan_arp(gboolean reload); void scan_statistics(gboolean reload); static ModuleEntry entries[] = { - {"Interfaces", "network-interface.png", callback_network, scan_network}, - {"IP Connections", "network-connections.png", callback_connections, scan_connections}, - {"Routing Table", "network.png", callback_route, scan_route}, - {"ARP Table", "module.png", callback_arp, scan_arp}, - {"DNS Servers", "dns.png", callback_dns, scan_dns}, - {"Statistics", "network-statistics.png", callback_statistics, scan_statistics}, - {"Shared Directories", "shares.png", callback_shares, scan_shares}, + {N_("Interfaces"), "network-interface.png", callback_network, scan_network, MODULE_FLAG_NONE}, + {N_("IP Connections"), "network-connections.png", callback_connections, scan_connections, MODULE_FLAG_NONE}, + {N_("Routing Table"), "network.png", callback_route, scan_route, MODULE_FLAG_NONE}, + {N_("ARP Table"), "module.png", callback_arp, scan_arp, MODULE_FLAG_NONE}, + {N_("DNS Servers"), "dns.png", callback_dns, scan_dns, MODULE_FLAG_NONE}, + {N_("Statistics"), "network-statistics.png", callback_statistics, scan_statistics, MODULE_FLAG_NONE}, + {N_("Shared Directories"), "shares.png", callback_shares, scan_shares, MODULE_FLAG_NONE}, {NULL}, }; -#include <arch/this/samba.h> -#include <arch/this/nfs.h> -#include <arch/this/net.h> - void scan_shares(gboolean reload) { SCAN_START(); - scan_samba_shared_directories(); + scan_samba(); scan_nfs_shared_directories(); SCAN_END(); } @@ -143,9 +142,27 @@ void scan_dns(gboolean reload) if ((resolv = fopen("/etc/resolv.conf", "r"))) { while (fgets(buffer, 256, resolv)) { if (g_str_has_prefix(buffer, "nameserver")) { - __nameservers = h_strdup_cprintf("%s=\n", - __nameservers, - g_strstrip(buffer + sizeof("nameserver"))); + gchar *ip; + struct sockaddr_in sa; + char hbuf[NI_MAXHOST]; + + ip = g_strstrip(buffer + sizeof("nameserver")); + + sa.sin_family = AF_INET; + sa.sin_addr.s_addr = inet_addr(ip); + + if (getnameinfo((struct sockaddr *)&sa, sizeof(sa), hbuf, sizeof(hbuf), NULL, 0, NI_NAMEREQD)) { + __nameservers = h_strdup_cprintf("%s=\n", + __nameservers, + ip); + } else { + __nameservers = h_strdup_cprintf("%s=%s\n", + __nameservers, + ip, hbuf); + + } + + shell_status_pulse(); } } fclose(resolv); @@ -231,7 +248,7 @@ void scan_arp(gboolean reload) g_strstrip(buffer + 41)); } - pclose(arp); + fclose(arp); } SCAN_END(); @@ -280,14 +297,14 @@ void scan_connections(gboolean reload) gchar *callback_arp() { - return g_strdup_printf("[ARP Table]\n" + return g_strdup_printf(_("[ARP Table]\n" "%s\n" "[$ShellParam$]\n" "ReloadInterval=3000\n" "ColumnTitle$TextValue=IP Address\n" "ColumnTitle$Value=Interface\n" "ColumnTitle$Extra1=MAC Address\n" - "ShowColumnHeaders=true\n", + "ShowColumnHeaders=true\n"), __arp_table); } @@ -301,13 +318,17 @@ gchar *callback_shares() gchar *callback_dns() { - return g_strdup_printf("[Name servers]\n" - "%s\n", __nameservers); + return g_strdup_printf(_("[Name servers]\n" + "%s\n" + "[$ShellParam$]\n" + "ColumnTitle$TextValue=IP Address\n" + "ColumnTitle$Value=Name\n" + "ShowColumnHeaders=true\n"), __nameservers); } gchar *callback_connections() { - return g_strdup_printf("[Connections]\n" + return g_strdup_printf(_("[Connections]\n" "%s\n" "[$ShellParam$]\n" "ReloadInterval=3000\n" @@ -315,13 +336,13 @@ gchar *callback_connections() "ColumnTitle$Value=Protocol\n" "ColumnTitle$Extra1=Foreign Address\n" "ColumnTitle$Extra2=State\n" - "ShowColumnHeaders=true\n", + "ShowColumnHeaders=true\n"), __connections); } gchar *callback_network() { - return g_strdup_printf("%s\n" + return g_strdup_printf(_("%s\n" "[$ShellParam$]\n" "ReloadInterval=3000\n" "ViewType=1\n" @@ -330,14 +351,14 @@ gchar *callback_network() "ColumnTitle$Extra1=Sent\n" "ColumnTitle$Extra2=Received\n" "ShowColumnHeaders=true\n" - "%s", + "%s"), network_interfaces, network_icons); } gchar *callback_route() { - return g_strdup_printf("[IP routing table]\n" + return g_strdup_printf(_("[IP routing table]\n" "%s\n" "[$ShellParam$]\n" "ViewType=0\n" @@ -346,7 +367,7 @@ gchar *callback_route() "ColumnTitle$Value=Interface\n" "ColumnTitle$Extra1=Flags\n" "ColumnTitle$Extra2=Mask\n" - "ShowColumnHeaders=true\n", + "ShowColumnHeaders=true\n"), __routing_table); } @@ -360,7 +381,7 @@ gchar *callback_statistics() gchar *hi_more_info(gchar * entry) { - gchar *info = (gchar *) g_hash_table_lookup(moreinfo, entry); + gchar *info = moreinfo_lookup_with_prefix("NET", entry); if (info) return g_strdup(info); @@ -375,7 +396,7 @@ ModuleEntry *hi_module_get_entries(void) gchar *hi_module_get_name(void) { - return g_strdup("Network"); + return g_strdup(_("Network")); } guchar hi_module_get_weight(void) @@ -385,8 +406,22 @@ guchar hi_module_get_weight(void) void hi_module_init(void) { - moreinfo = - g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); +} + +void hi_module_deinit(void) +{ + moreinfo_del_with_prefix("NET"); + + g_free(smb_shares_list); + g_free(nfs_shares_list); + g_free(network_interfaces); + g_free(network_icons); + + g_free(__statistics); + g_free(__nameservers); + g_free(__arp_table); + g_free(__routing_table); + g_free(__connections); } ModuleAbout *hi_module_get_about(void) @@ -394,7 +429,7 @@ ModuleAbout *hi_module_get_about(void) static ModuleAbout ma[] = { { .author = "Leandro A. F. Pereira", - .description = "Gathers information about this computer's network connection", + .description = N_("Gathers information about this computer's network connection"), .version = VERSION, .license = "GNU GPL version 2"} }; diff --git a/arch/linux/common/net.h b/modules/network/net.c index 755c6936..ebb0612a 100644 --- a/arch/linux/common/net.h +++ b/modules/network/net.c @@ -19,7 +19,8 @@ * Wireless Extension Example * http://www.krugle.org/examples/p-OZYzuisV6gyQIaTu/iwconfig.c */ -static gchar *network_interfaces = NULL, *network_icons = NULL; + +#include "config.h" #include <stdio.h> #include <unistd.h> @@ -41,6 +42,11 @@ static gchar *network_interfaces = NULL, *network_icons = NULL; #include <net/if.h> #endif /* HAS_LINUX_WE */ +#include "hardinfo.h" +#include "network.h" + +gchar *network_interfaces = NULL, *network_icons = NULL; + typedef struct _NetInfo NetInfo; struct _NetInfo { char name[16]; @@ -82,8 +88,8 @@ void get_wireless_info(int fd, NetInfo *netinfo) buf1 = strchr(buf1, ':') + 1; - if (strstr(buf1, ".")) { - sscanf(buf1, "%d %d. %d %d %d %d %d %d %d %d", + if (strchr(buf1, '.')) { + sscanf(buf1, "%d %d. %d. %d %d %d %d %d %d %d", &(netinfo->wi_status), &(netinfo->wi_quality_level), &(netinfo->wi_signal_level), @@ -115,21 +121,21 @@ void get_wireless_info(int fd, NetInfo *netinfo) wi_req.u.essid.length = IW_ESSID_MAX_SIZE + 1; wi_req.u.essid.flags = 0; - if ((r = ioctl(fd, SIOCGIWESSID, &wi_req) < 0)) { + if (ioctl(fd, SIOCGIWESSID, &wi_req) < 0) { strcpy(netinfo->wi_essid, ""); } else { netinfo->wi_essid[wi_req.u.essid.length] = '\0'; } /* obtain bit rate */ - if ((r = ioctl(fd, SIOCGIWRATE, &wi_req) < 0)) { + if (ioctl(fd, SIOCGIWRATE, &wi_req) < 0) { netinfo->wi_rate = 0; } else { netinfo->wi_rate = wi_req.u.bitrate.value; } /* obtain operation mode */ - if ((r = ioctl(fd, SIOCGIWMODE, &wi_req) < 0)) { + if (ioctl(fd, SIOCGIWMODE, &wi_req) < 0) { netinfo->wi_mode = 0; } else { if (wi_req.u.mode >= 0 && wi_req.u.mode < 6) { @@ -141,7 +147,7 @@ void get_wireless_info(int fd, NetInfo *netinfo) #if WIRELESS_EXT >= 10 /* obtain txpower */ - if ((r = ioctl(fd, SIOCGIWTXPOW, &wi_req) < 0)) { + if (ioctl(fd, SIOCGIWTXPOW, &wi_req) < 0) { netinfo->wi_has_txpower = FALSE; } else { netinfo->wi_has_txpower = TRUE; @@ -163,7 +169,7 @@ void get_net_info(char *if_name, NetInfo * netinfo) /* IPv4 */ ifr.ifr_addr.sa_family = AF_INET; - strcpy(netinfo->name, if_name); + strncpy(netinfo->name, if_name, sizeof(netinfo->name)); /* MTU */ strcpy(ifr.ifr_name, if_name); @@ -186,7 +192,7 @@ void get_net_info(char *if_name, NetInfo * netinfo) if (ioctl(fd, SIOCGIFADDR, &ifr) < 0) { netinfo->ip[0] = 0; } else { - sprintf(netinfo->ip, "%s", + snprintf(netinfo->ip, sizeof(netinfo->ip), "%s", inet_ntoa(((struct sockaddr_in *) &ifr.ifr_addr)-> sin_addr)); } @@ -196,7 +202,7 @@ void get_net_info(char *if_name, NetInfo * netinfo) if (ioctl(fd, SIOCGIFNETMASK, &ifr) < 0) { netinfo->mask[0] = 0; } else { - sprintf(netinfo->mask, "%s", + snprintf(netinfo->mask, sizeof(netinfo->mask), "%s", inet_ntoa(((struct sockaddr_in *) &ifr.ifr_addr)-> sin_addr)); } @@ -206,7 +212,7 @@ void get_net_info(char *if_name, NetInfo * netinfo) if (ioctl(fd, SIOCGIFBRDADDR, &ifr) < 0) { netinfo->broadcast[0] = 0; } else { - sprintf(netinfo->broadcast, "%s", + snprintf(netinfo->broadcast, sizeof(netinfo->broadcast), "%s", inet_ntoa(((struct sockaddr_in *) &ifr.ifr_addr)-> sin_addr)); } @@ -231,6 +237,7 @@ static struct { { "wlan", "Wireless", "wireless" }, { "ra", "Wireless", "wireless" }, { "wl", "Wireless", "wireless" }, + { "wmaster", "Wireless", "wireless" }, { "tun", "Virtual Point-to-Point (TUN)", "network" }, { "tap", "Ethernet (TAP)", "network" }, { "plip", "Parallel Line Internet Protocol", "network" }, @@ -243,6 +250,13 @@ static struct { { "pan", "Personal Area Network (PAN)", "bluetooth" }, { "bnep", "Bluetooth", "bluetooth" }, { "br", "Bridge Interface", "network" }, + { "ham", "Hamachi Virtual Personal Network", "network"}, + { "net", "Ethernet", "network-interface" }, + { "ifb", "Intermediate Functional Block", "network" }, + { "gre", "GRE Network Tunnel", "network" }, + { "msh", "Mesh Network", "wireless" }, + { "wmaster", "Wireless Master Interface", "wireless" }, + { "vboxnet", "VirtualBox Virtual Network Interface", "network" }, { NULL, "Unknown", "network" }, }; @@ -298,13 +312,9 @@ static void scan_net_interfaces_24(void) return; } - if (network_interfaces) { - g_free(network_interfaces); - } + g_free(network_interfaces); - if (network_icons) { - g_free(network_icons); - } + g_free(network_icons); network_interfaces = g_strdup("[Network Interfaces]\n"); network_icons = g_strdup(""); @@ -397,7 +407,7 @@ static void scan_net_interfaces_24(void) "Mode=%s\n" "Status=%d\n" "Link Quality=%d\n" - "Signal / Noise=%d / %d\n", + "Signal / Noise=%d dBm / %d dBm\n", detailed, ni.wi_essid, ni.wi_rate / 1000000, @@ -423,19 +433,20 @@ static void scan_net_interfaces_24(void) broadcast : "Not set"); } - g_hash_table_insert(moreinfo, devid, detailed); + moreinfo_add_with_prefix("NET", devid, detailed); + g_free(devid); } } fclose(proc_net); } -static void scan_net_interfaces(void) +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); + moreinfo_del_with_prefix("NET"); scan_net_interfaces_24(); } diff --git a/modules/network/nfs.c b/modules/network/nfs.c new file mode 100644 index 00000000..54bbfe0e --- /dev/null +++ b/modules/network/nfs.c @@ -0,0 +1,59 @@ +/* + * HardInfo - Displays System Information + * Copyright (C) 2003-2009 Leandro A. F. Pereira <leandro@hardinfo.org> + * + * 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 "hardinfo.h" +#include "network.h" + +gchar *nfs_shares_list = NULL; + +void +scan_nfs_shared_directories(void) +{ + FILE *exports; + gint count = 0; + gchar buf[512]; + + g_free(nfs_shares_list); + + nfs_shares_list = g_strdup(""); + + if ((exports = fopen("/etc/exports", "r"))) { + while (fgets(buf, 512, exports)) { + if (buf[0] != '/') + continue; + + strend(buf, ' '); + strend(buf, '\t'); + + nfs_shares_list = h_strdup_cprintf("%s=\n", + nfs_shares_list, buf); + count++; + } + + fclose(exports); + } + + if (!count) { + g_free(nfs_shares_list); + + nfs_shares_list = g_strdup("No NFS exports=\n"); + } +} + diff --git a/modules/network/samba.c b/modules/network/samba.c new file mode 100644 index 00000000..71ba6ab6 --- /dev/null +++ b/modules/network/samba.c @@ -0,0 +1,124 @@ +/* + * HardInfo - Displays System Information + * Copyright (C) 2003-2009 Leandro A. F. Pereira <leandro@hardinfo.org> + * + * 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 "hardinfo.h" +#include "network.h" + +gchar *smb_shares_list = NULL; + +void scan_samba_from_string(gchar *str, gsize length); +void scan_samba_usershares(void); + +void +scan_samba(void) +{ + gchar *str; + gsize length; + + if (smb_shares_list) { + g_free(smb_shares_list); + smb_shares_list = g_strdup(""); + } + + if (g_file_get_contents("/etc/samba/smb.conf", + &str, &length, NULL)) { + shell_status_update("Scanning SAMBA shares..."); + scan_samba_from_string(str, length); + g_free(str); + } + + scan_samba_usershares(); +} + +void +scan_samba_usershares(void) +{ + FILE *usershare_list; + + if ((usershare_list = popen("net usershare list", "r"))) { + char buffer[512]; + + shell_status_update("Scanning SAMBA user shares..."); + + while (fgets(buffer, 512, usershare_list)) { + gchar *usershare, *cmdline; + gsize length; + + cmdline = g_strdup_printf("net usershare info '%s'", + strend(buffer, '\n')); + if (g_spawn_command_line_sync(cmdline, + &usershare, NULL, + NULL, NULL)) { + length = strlen(usershare); + scan_samba_from_string(usershare, length); + g_free(usershare); + } + + g_free(cmdline); + + shell_status_pulse(); + } + + pclose(usershare_list); + } +} + +void +scan_samba_from_string(gchar *str, gsize length) +{ + GKeyFile *keyfile; + GError *error = NULL; + gchar **groups; + gint i = 0; + + keyfile = g_key_file_new(); + + gchar *_smbconf = str; + for (; *_smbconf; _smbconf++) + if (*_smbconf == ';') *_smbconf = '\0'; + + if (!g_key_file_load_from_data(keyfile, str, length, 0, &error)) { + smb_shares_list = g_strdup("Cannot parse smb.conf=\n"); + if (error) + g_error_free(error); + goto cleanup; + } + + groups = g_key_file_get_groups(keyfile, NULL); + while (groups[i]) { + shell_status_pulse(); + + if (g_key_file_has_key(keyfile, groups[i], "path", NULL)) { + gchar *path = g_key_file_get_string(keyfile, groups[i], "path", NULL); + smb_shares_list = h_strdup_cprintf("%s=%s\n", + smb_shares_list, + groups[i], path); + g_free(path); + } + + i++; + } + + g_strfreev(groups); + + cleanup: + g_key_file_free(keyfile); +} + diff --git a/modules/placeholder b/modules/placeholder deleted file mode 100644 index e69de29b..00000000 --- a/modules/placeholder +++ /dev/null diff --git a/pixmaps/about-modules.png b/pixmaps/about-modules.png Binary files differindex 0d49f9df..98086442 100644 --- a/pixmaps/about-modules.png +++ b/pixmaps/about-modules.png diff --git a/pixmaps/audio.png b/pixmaps/audio.png Binary files differindex 93d99aa4..cc0d9ec5 100644 --- a/pixmaps/audio.png +++ b/pixmaps/audio.png diff --git a/pixmaps/battery.png b/pixmaps/battery.png Binary files differindex ad456749..172c2389 100644 --- a/pixmaps/battery.png +++ b/pixmaps/battery.png diff --git a/pixmaps/benchmark.png b/pixmaps/benchmark.png Binary files differindex 927681cf..b807f11d 100644 --- a/pixmaps/benchmark.png +++ b/pixmaps/benchmark.png diff --git a/pixmaps/blowfish.png b/pixmaps/blowfish.png Binary files differindex 22c68614..54a9ba83 100644 --- a/pixmaps/blowfish.png +++ b/pixmaps/blowfish.png diff --git a/pixmaps/bluetooth.png b/pixmaps/bluetooth.png Binary files differindex 7f002131..4621658b 100644 --- a/pixmaps/bluetooth.png +++ b/pixmaps/bluetooth.png diff --git a/pixmaps/boot.png b/pixmaps/boot.png Binary files differindex aef0e91a..1151e48d 100644 --- a/pixmaps/boot.png +++ b/pixmaps/boot.png diff --git a/pixmaps/cdrom.png b/pixmaps/cdrom.png Binary files differindex af2c8261..52a23974 100644 --- a/pixmaps/cdrom.png +++ b/pixmaps/cdrom.png diff --git a/pixmaps/close.png b/pixmaps/close.png Binary files differindex 9b43c0a7..7d702c5b 100644 --- a/pixmaps/close.png +++ b/pixmaps/close.png diff --git a/pixmaps/compress.png b/pixmaps/compress.png Binary files differindex e5dee194..1c4530ba 100644 --- a/pixmaps/compress.png +++ b/pixmaps/compress.png diff --git a/pixmaps/computer.png b/pixmaps/computer.png Binary files differindex 8b3716cf..b00cb150 100644 --- a/pixmaps/computer.png +++ b/pixmaps/computer.png diff --git a/pixmaps/cryptohash.png b/pixmaps/cryptohash.png Binary files differindex e2eb5d29..b62f29ed 100644 --- a/pixmaps/cryptohash.png +++ b/pixmaps/cryptohash.png diff --git a/pixmaps/dev_removable.png b/pixmaps/dev_removable.png Binary files differindex f4873104..d6c91e49 100644 --- a/pixmaps/dev_removable.png +++ b/pixmaps/dev_removable.png diff --git a/pixmaps/devel.png b/pixmaps/devel.png Binary files differnew file mode 100644 index 00000000..8aeebd6e --- /dev/null +++ b/pixmaps/devel.png diff --git a/pixmaps/devices.png b/pixmaps/devices.png Binary files differindex 8ea7357b..c21504c6 100644 --- a/pixmaps/devices.png +++ b/pixmaps/devices.png diff --git a/pixmaps/dialog-information.png b/pixmaps/dialog-information.png Binary files differindex 07cf0102..83b69935 100644 --- a/pixmaps/dialog-information.png +++ b/pixmaps/dialog-information.png diff --git a/pixmaps/dialog-warning.png b/pixmaps/dialog-warning.png Binary files differindex 45b64a79..d5c4be43 100644 --- a/pixmaps/dialog-warning.png +++ b/pixmaps/dialog-warning.png diff --git a/pixmaps/dns.png b/pixmaps/dns.png Binary files differindex d4bfb82b..44dbb3fb 100644 --- a/pixmaps/dns.png +++ b/pixmaps/dns.png diff --git a/pixmaps/environment.png b/pixmaps/environment.png Binary files differindex ceb0fb99..2f580752 100644 --- a/pixmaps/environment.png +++ b/pixmaps/environment.png diff --git a/pixmaps/face-grin.png b/pixmaps/face-grin.png Binary files differindex d15cf2d4..cc45e7cf 100644 --- a/pixmaps/face-grin.png +++ b/pixmaps/face-grin.png diff --git a/pixmaps/fft.png b/pixmaps/fft.png Binary files differindex 3a44038c..ed16da14 100644 --- a/pixmaps/fft.png +++ b/pixmaps/fft.png diff --git a/pixmaps/hdd.png b/pixmaps/hdd.png Binary files differindex da413059..d0350343 100644 --- a/pixmaps/hdd.png +++ b/pixmaps/hdd.png diff --git a/pixmaps/home.png b/pixmaps/home.png Binary files differnew file mode 100644 index 00000000..74a83d04 --- /dev/null +++ b/pixmaps/home.png diff --git a/pixmaps/inputdevices.png b/pixmaps/inputdevices.png Binary files differindex 985bcde5..aea0f1d7 100644 --- a/pixmaps/inputdevices.png +++ b/pixmaps/inputdevices.png diff --git a/pixmaps/internet.png b/pixmaps/internet.png Binary files differindex a5889683..ca76ef6c 100644 --- a/pixmaps/internet.png +++ b/pixmaps/internet.png diff --git a/pixmaps/joystick.png b/pixmaps/joystick.png Binary files differindex 18f77392..368b1793 100644 --- a/pixmaps/joystick.png +++ b/pixmaps/joystick.png diff --git a/pixmaps/keyboard.png b/pixmaps/keyboard.png Binary files differindex 4a63e535..9d0eecf6 100644 --- a/pixmaps/keyboard.png +++ b/pixmaps/keyboard.png diff --git a/pixmaps/logo.png b/pixmaps/logo.png Binary files differindex 48d49419..9d0484a5 100644 --- a/pixmaps/logo.png +++ b/pixmaps/logo.png diff --git a/pixmaps/memory.png b/pixmaps/memory.png Binary files differindex 16a45b9f..25ffba99 100644 --- a/pixmaps/memory.png +++ b/pixmaps/memory.png diff --git a/pixmaps/modem.png b/pixmaps/modem.png Binary files differindex 8d1ea2b0..450e4039 100644 --- a/pixmaps/modem.png +++ b/pixmaps/modem.png diff --git a/pixmaps/module.png b/pixmaps/module.png Binary files differindex 2bb2adfc..7c389a20 100644 --- a/pixmaps/module.png +++ b/pixmaps/module.png diff --git a/pixmaps/monitor.png b/pixmaps/monitor.png Binary files differindex 58fc213e..fbe38d64 100644 --- a/pixmaps/monitor.png +++ b/pixmaps/monitor.png diff --git a/pixmaps/mouse.png b/pixmaps/mouse.png Binary files differindex c1bbc79d..8baa74dc 100644 --- a/pixmaps/mouse.png +++ b/pixmaps/mouse.png diff --git a/pixmaps/nautilus.png b/pixmaps/nautilus.png Binary files differindex 945d4d74..2eac9171 100644 --- a/pixmaps/nautilus.png +++ b/pixmaps/nautilus.png diff --git a/pixmaps/network-connections.png b/pixmaps/network-connections.png Binary files differindex 883a003b..0e9124a7 100644 --- a/pixmaps/network-connections.png +++ b/pixmaps/network-connections.png diff --git a/pixmaps/network-interface.png b/pixmaps/network-interface.png Binary files differindex 51c8b16f..0a765eb4 100644 --- a/pixmaps/network-interface.png +++ b/pixmaps/network-interface.png diff --git a/pixmaps/network-statistics.png b/pixmaps/network-statistics.png Binary files differindex 18a118a2..e9c6a8be 100644 --- a/pixmaps/network-statistics.png +++ b/pixmaps/network-statistics.png diff --git a/pixmaps/network.png b/pixmaps/network.png Binary files differindex caebd989..5f95ba3e 100644 --- a/pixmaps/network.png +++ b/pixmaps/network.png diff --git a/pixmaps/nqueens.png b/pixmaps/nqueens.png Binary files differindex 17499732..e33e857d 100644 --- a/pixmaps/nqueens.png +++ b/pixmaps/nqueens.png diff --git a/pixmaps/os.png b/pixmaps/os.png Binary files differindex 4decc893..2c07199b 100644 --- a/pixmaps/os.png +++ b/pixmaps/os.png diff --git a/pixmaps/printer.png b/pixmaps/printer.png Binary files differindex 3c3aa974..20861df9 100644 --- a/pixmaps/printer.png +++ b/pixmaps/printer.png diff --git a/pixmaps/processor.png b/pixmaps/processor.png Binary files differindex 7b2a3fb1..b5dfa01f 100644 --- a/pixmaps/processor.png +++ b/pixmaps/processor.png diff --git a/pixmaps/raytrace.png b/pixmaps/raytrace.png Binary files differindex 60bfc64a..9340a293 100644 --- a/pixmaps/raytrace.png +++ b/pixmaps/raytrace.png diff --git a/pixmaps/report-large.png b/pixmaps/report-large.png Binary files differindex 694c9211..d2dcafba 100644 --- a/pixmaps/report-large.png +++ b/pixmaps/report-large.png diff --git a/pixmaps/report.png b/pixmaps/report.png Binary files differindex dc566f59..40d5fc8a 100644 --- a/pixmaps/report.png +++ b/pixmaps/report.png diff --git a/pixmaps/resources.png b/pixmaps/resources.png Binary files differindex 308acb27..c23587bb 100644 --- a/pixmaps/resources.png +++ b/pixmaps/resources.png diff --git a/pixmaps/server-large.png b/pixmaps/server-large.png Binary files differnew file mode 100644 index 00000000..98799715 --- /dev/null +++ b/pixmaps/server-large.png diff --git a/pixmaps/server.png b/pixmaps/server.png Binary files differnew file mode 100644 index 00000000..3f7b69b7 --- /dev/null +++ b/pixmaps/server.png diff --git a/pixmaps/shares.png b/pixmaps/shares.png Binary files differindex 91ccf9b7..a05befe5 100644 --- a/pixmaps/shares.png +++ b/pixmaps/shares.png diff --git a/pixmaps/status-curr.png b/pixmaps/status-curr.png Binary files differdeleted file mode 100644 index 1ee5a29e..00000000 --- a/pixmaps/status-curr.png +++ /dev/null diff --git a/pixmaps/status-done.png b/pixmaps/status-done.png Binary files differdeleted file mode 100644 index fa39fd70..00000000 --- a/pixmaps/status-done.png +++ /dev/null diff --git a/pixmaps/summary.png b/pixmaps/summary.png Binary files differindex b66871a9..8451f99e 100644 --- a/pixmaps/summary.png +++ b/pixmaps/summary.png diff --git a/pixmaps/syncmanager-small.png b/pixmaps/syncmanager-small.png Binary files differindex 58f19c68..2a522619 100644 --- a/pixmaps/syncmanager-small.png +++ b/pixmaps/syncmanager-small.png diff --git a/pixmaps/syncmanager.png b/pixmaps/syncmanager.png Binary files differindex 9f019ac5..46da6412 100644 --- a/pixmaps/syncmanager.png +++ b/pixmaps/syncmanager.png diff --git a/pixmaps/therm.png b/pixmaps/therm.png Binary files differindex 73f80da6..8db7a2cc 100644 --- a/pixmaps/therm.png +++ b/pixmaps/therm.png diff --git a/pixmaps/usb.png b/pixmaps/usb.png Binary files differindex af28b288..d35176a4 100644 --- a/pixmaps/usb.png +++ b/pixmaps/usb.png diff --git a/pixmaps/users.png b/pixmaps/users.png Binary files differindex bced28cf..bf3cabb1 100644 --- a/pixmaps/users.png +++ b/pixmaps/users.png diff --git a/pixmaps/wireless.png b/pixmaps/wireless.png Binary files differindex 2d7851fa..c5a5bf92 100644 --- a/pixmaps/wireless.png +++ b/pixmaps/wireless.png diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt new file mode 100644 index 00000000..95dbdfea --- /dev/null +++ b/po/CMakeLists.txt @@ -0,0 +1,3 @@ +include(Translations) +add_translations_directory("hardinfo") +add_translations_catalog("hardinfo" ../shell/ ../modules/ ../hardinfo/ ../remote/ ../help-viewer/ )
\ No newline at end of file diff --git a/po/HOWTO.txt b/po/HOWTO.txt new file mode 100644 index 00000000..6773d6ea --- /dev/null +++ b/po/HOWTO.txt @@ -0,0 +1,2 @@ +update .pot : make pot in build/ +update .po files after .pot update : ? diff --git a/po/de.po b/po/de.po new file mode 100644 index 00000000..a74622ea --- /dev/null +++ b/po/de.po @@ -0,0 +1,1707 @@ +# German translations for PACKAGE package +# German translation for PACKAGE. +# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# Alexander Münch <git@thehacker.biz>, 2016. +# +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-06-10 10:11+0200\n" +"PO-Revision-Date: 2016-06-10 12:11+0200\n" +"Last-Translator: Alexander Münch <git@thehacker.biz>\n" +"Language-Team: German\n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 1.8.7.1\n" + +#: shell//callbacks.c:71 +#, c-format +msgid "Remote: <b>%s</b>" +msgstr "" + +#: shell//callbacks.c:117 +msgid "Disconnecting..." +msgstr "" + +#: shell//callbacks.c:120 +msgid "Unloading modules..." +msgstr "" + +#: shell//callbacks.c:123 +msgid "Loading local modules..." +msgstr "" + +#: shell//callbacks.c:130 shell//callbacks.c:162 shell//shell.c:314 +#: shell//shell.c:816 shell//shell.c:1800 modules//benchmark.c:431 +#: modules//benchmark.c:439 hardinfo//util.c:1112 +msgid "Done." +msgstr "Fertig." + +#: shell//callbacks.c:142 +msgid "Save Image" +msgstr "" + +#: shell//callbacks.c:158 +msgid "Saving image..." +msgstr "" + +#: shell//callbacks.c:236 +msgid "No context help available." +msgstr "" + +#: shell//callbacks.c:318 +#, c-format +msgid "%s Module" +msgstr "" + +#: shell//callbacks.c:325 +#, c-format +msgid "" +"Written by %s\n" +"Licensed under %s" +msgstr "" +"Programmiert von %s\n" +"Lizenziert unter %s" + +#: shell//callbacks.c:339 +#, c-format +msgid "No about information is associated with the %s module." +msgstr "" + +#: shell//callbacks.c:353 +msgid "Author:" +msgstr "" + +#: shell//callbacks.c:356 +msgid "Contributors:" +msgstr "Mitwirkende:" + +#: shell//callbacks.c:360 +msgid "Based on work by:" +msgstr "" + +#: shell//callbacks.c:361 +msgid "MD5 implementation by Colin Plumb (see md5.c for details)" +msgstr "" + +#: shell//callbacks.c:362 +msgid "SHA1 implementation by Steve Reid (see sha1.c for details)" +msgstr "" + +#: shell//callbacks.c:363 +msgid "Blowfish implementation by Paul Kocher (see blowfich.c for details)" +msgstr "" + +#: shell//callbacks.c:364 +msgid "Raytracing benchmark by John Walker (see fbench.c for details)" +msgstr "" + +#: shell//callbacks.c:365 +msgid "FFT benchmark by Scott Robert Ladd (see fftbench.c for details)" +msgstr "" + +#: shell//callbacks.c:366 +msgid "Some code partly based on x86cpucaps by Osamu Kayasono" +msgstr "" + +#: shell//callbacks.c:367 +msgid "Vendor list based on GtkSysInfo by Pissens Sebastien" +msgstr "" + +#: shell//callbacks.c:368 +msgid "DMI support based on code by Stewart Adam" +msgstr "" + +#: shell//callbacks.c:369 +msgid "SCSI support based on code by Pascal F. Martin" +msgstr "" + +#: shell//callbacks.c:373 +msgid "Jakub Szypulka" +msgstr "Jakub Szypulka" + +#: shell//callbacks.c:374 +msgid "Tango Project" +msgstr "" + +#: shell//callbacks.c:375 +msgid "The GNOME Project" +msgstr "" + +#: shell//callbacks.c:376 +msgid "VMWare, Inc. (USB icon from VMWare Workstation 6)" +msgstr "" + +#: shell//callbacks.c:387 +msgid "System information and benchmark tool" +msgstr "System-Informationen und Benchmark-Werkzeug" + +#: shell//callbacks.c:392 +msgid "" +"HardInfo 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.\n" +"\n" +"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.\n" +"\n" +"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" +msgstr "" + +#: shell//menu.c:35 +msgid "_Information" +msgstr "_Informationen" + +#: shell//menu.c:36 +msgid "_Remote" +msgstr "" + +#: shell//menu.c:37 +msgid "_View" +msgstr "_Ansicht" + +#: shell//menu.c:38 +msgid "_Help" +msgstr "_Hilfe" + +#: shell//menu.c:39 +msgid "About _Modules" +msgstr "Ãœber _Module" + +#: shell//menu.c:43 +msgid "Generate _Report" +msgstr "_Bericht generieren" + +#: shell//menu.c:48 +msgid "_Network Updater..." +msgstr "_Netzwerk-Updater…" + +#: shell//menu.c:53 +msgid "_Open..." +msgstr "" + +#: shell//menu.c:58 +msgid "_Connect to..." +msgstr "" + +#: shell//menu.c:63 +msgid "_Manage hosts..." +msgstr "" + +#: shell//menu.c:68 +msgid "_Local computer" +msgstr "" + +#: shell//menu.c:73 +msgid "_Copy to Clipboard" +msgstr "In die Zwischenablage _kopieren" + +#: shell//menu.c:74 +msgid "Copy to clipboard" +msgstr "In die Zwischenablage kopieren" + +#: shell//menu.c:78 +msgid "_Save image as..." +msgstr "" + +#: shell//menu.c:83 +msgid "_Refresh" +msgstr "_Aktualisieren" + +#: shell//menu.c:88 +msgid "Contents" +msgstr "Inhalt" + +#: shell//menu.c:93 shell//shell.c:1794 shell//shell.c:1811 +msgid "Context help" +msgstr "Kontexthilfe" + +#: shell//menu.c:98 +msgid "_Open HardInfo Web Site" +msgstr "HardInfo-_Webseite öffnen" + +#: shell//menu.c:103 +msgid "_Report bug" +msgstr "Fehler _melden" + +#: shell//menu.c:108 +msgid "_Donate to the project" +msgstr "_Spende zum Projekt" + +#: shell//menu.c:113 +msgid "_About HardInfo" +msgstr "_Ãœber HardInfo" + +#: shell//menu.c:114 +msgid "Displays program version information" +msgstr "" + +#: shell//menu.c:118 +msgid "_Quit" +msgstr "_Beenden" + +#: shell//menu.c:125 +msgid "_Side Pane" +msgstr "_Seitenleiste" + +#: shell//menu.c:126 +msgid "Toggles side pane visibility" +msgstr "" + +#: shell//menu.c:129 +msgid "_Toolbar" +msgstr "_Symbolleiste" + +#: shell//menu.c:133 +msgid "_Accept connections" +msgstr "" + +#: shell//report.c:492 +msgid "Save File" +msgstr "Datei speichern" + +#: shell//report.c:616 +msgid "Cannot create ReportContext. Programming bug?" +msgstr "" + +#: shell//report.c:634 +msgid "Open the report with your web browser?" +msgstr "Den Bericht in deinem Webbrowser öffnen?" + +#: shell//report.c:662 +msgid "Generating report..." +msgstr "Generiere Bericht…" + +#: shell//report.c:672 +msgid "Report saved." +msgstr "Bericht gespeichert." + +#: shell//report.c:674 +msgid "Error while creating the report." +msgstr "Fehler beim Erzeugen des Berichts." + +#: shell//report.c:776 +msgid "Generate Report" +msgstr "Bericht generieren" + +#: shell//report.c:793 +msgid "" +"<big><b>Generate Report</b></big>\n" +"Please choose the information that you wish to view in your report:" +msgstr "" +"<big><b>Bericht generieren</b></big>\n" +"Bitte wähle die Informationen, die du in deinen Bereich einbeziehen möchtest:" + +#: shell//report.c:853 +msgid "Select _None" +msgstr "_Nichts auswählen" + +#: shell//report.c:860 +msgid "Select _All" +msgstr "_Alles auswählen" + +#: shell//report.c:878 +msgid "_Generate" +msgstr "_Generieren" + +#: shell//shell.c:407 +#, c-format +msgid "%s - System Information" +msgstr "%s - System-Informationen" + +#: shell//shell.c:412 +msgid "System Information" +msgstr "System-Informationen" + +#: shell//shell.c:803 +msgid "Loading modules..." +msgstr "" + +#: shell//shell.c:1654 +#, c-format +msgid "<b>%s → Summary</b>" +msgstr "<b>%s → Zusammenfassung</b>" + +#: shell//shell.c:1762 +msgid "Updating..." +msgstr "Aktualisiere…" + +#: shell//syncmanager.c:69 +msgid "" +"<big><b>Synchronize with Central Database</b></big>\n" +"The following information may be synchronized with the HardInfo central " +"database." +msgstr "" +"<big><b>Synchronisieren mit zentraler Datenbank</b></big>\n" +"Die folgenden Informationen können mit der zentralen HardInfo-Datenbank " +"synchronisiert werden." + +#: shell//syncmanager.c:72 +msgid "" +"<big><b>Synchronizing</b></big>\n" +"This may take some time." +msgstr "" +"<big><b>Synchronisiere</b></big>\n" +"Dies kann kurz dauern." + +#: shell//syncmanager.c:132 +msgid "" +"HardInfo was compiled without libsoup support. (Network Updater requires it.)" +msgstr "" + +#: shell//syncmanager.c:161 shell//syncmanager.c:185 +#, c-format +msgid "%s (error #%d)" +msgstr "%s (Fehlercode #%d)" + +#: shell//syncmanager.c:170 shell//syncmanager.c:194 +msgid "Could not parse XML-RPC response" +msgstr "" + +#: shell//syncmanager.c:267 +#, c-format +msgid "" +"Server says it supports API version %d, but this version of HardInfo only " +"supports API version %d." +msgstr "" + +#: shell//syncmanager.c:362 +msgid "Contacting HardInfo Central Database" +msgstr "Kontaktiere zentrale HardInfo-Datenbank" + +#: shell//syncmanager.c:363 +msgid "Cleaning up" +msgstr "Aufräumen" + +#: shell//syncmanager.c:480 +#, c-format +msgid "<s>%s</s> <i>(canceled)</i>" +msgstr "<s>%s</s> <i>(abgebrochen)</i>" + +#: shell//syncmanager.c:497 +#, c-format +msgid "<b><s>%s</s></b> <i>(failed)</i>" +msgstr "<b><s>%s</s></b> <i>(gescheitert)</i>" + +#: shell//syncmanager.c:509 +#, c-format +msgid "" +"Failed while performing \"%s\". Please file a bug report if this problem " +"persists. (Use the Help→Report bug option.)\n" +"\n" +"Details: %s" +msgstr "" + +#: shell//syncmanager.c:518 +#, c-format +msgid "" +"Failed while performing \"%s\". Please file a bug report if this problem " +"persists. (Use the Help→Report bug option.)" +msgstr "" + +#: shell//syncmanager.c:646 +msgid "Network Updater" +msgstr "Netzwerk-Updater" + +#: shell//syncmanager.c:727 +msgid "_Synchronize" +msgstr "_Synchronisieren" + +#: modules//benchmark.c:50 +msgid "CPU Blowfish" +msgstr "CPU Blowfish" + +#: modules//benchmark.c:51 +msgid "CPU CryptoHash" +msgstr "CPU Crypto-Hash" + +#: modules//benchmark.c:52 +msgid "CPU Fibonacci" +msgstr "CPU Fibonacci" + +#: modules//benchmark.c:53 +msgid "CPU N-Queens" +msgstr "CPU Damenproblem" + +#: modules//benchmark.c:54 +msgid "FPU FFT" +msgstr "FPU FFT" + +#: modules//benchmark.c:55 +msgid "FPU Raytracing" +msgstr "FPU Raytracing" + +#: modules//benchmark.c:56 +msgid "GPU Drawing" +msgstr "GPU Zeichnen" + +#: modules//benchmark.c:222 +#, c-format +msgid "" +"[$ShellParam$]\n" +"Zebra=1\n" +"OrderType=%d\n" +"ViewType=3\n" +"ColumnTitle$Extra1=CPU Clock\n" +"ColumnTitle$Progress=Results\n" +"ColumnTitle$TextValue=CPU\n" +"ShowColumnHeaders=true\n" +"[%s]\n" +"<big><b>This Machine</b></big>=%.3f|%s MHz\n" +"%s" +msgstr "" +"[$ShellParam$]\n" +"Zebra=1\n" +"OrderType=%d\n" +"ViewType=3\n" +"ColumnTitle$Extra1=CPU-Takt\n" +"ColumnTitle$Progress=Ergebnisse\n" +"ColumnTitle$TextValue=CPU\n" +"ShowColumnHeaders=true\n" +"[%s]\n" +"<big><b>Diese Maschine</b></big>=%.3f|%s MHz\n" +"%s" + +#: modules//benchmark.c:235 +#, c-format +msgid "" +"[$ShellParam$]\n" +"Zebra=1\n" +"OrderType=%d\n" +"ViewType=3\n" +"ColumnTitle$Extra1=CPU Clock\n" +"ColumnTitle$Progress=Results\n" +"ColumnTitle$TextValue=CPU\n" +"ShowColumnHeaders=true\n" +"[%s]\n" +"%s" +msgstr "" +"[$ShellParam$]\n" +"Zebra=1\n" +"OrderType=%d\n" +"ViewType=3\n" +"ColumnTitle$Extra1=CPU-Takt\n" +"ColumnTitle$Progress=Ergebnisse\n" +"ColumnTitle$TextValue=CPU\n" +"ShowColumnHeaders=true\n" +"[%s]\n" +"%s" + +#: modules//benchmark.c:363 +#, c-format +msgid "Benchmarking: <b>%s</b>." +msgstr "Benchmarke: <b>%s</b>." + +#: modules//benchmark.c:377 +msgid "Benchmarking. Please do not move your mouse or press any keys." +msgstr "Benchmarke. Bitte bewege den Mauszeiger nicht und drücke keine Tasten." + +#: modules//benchmark.c:381 +msgid "Cancel" +msgstr "Abbrechen" + +#: modules//benchmark.c:511 +msgid "Results in MiB/second. Higher is better." +msgstr "Ergebnisse in MiB/Sekunde. Höhere Werte sind besser." + +#: modules//benchmark.c:514 +msgid "Results in HIMarks. Higher is better." +msgstr "Ergebnisse in HIMarks. Höhere Werte sind besser." + +#: modules//benchmark.c:521 +msgid "Results in seconds. Lower is better." +msgstr "Ergebnisse in Sekunden. Niedrigere Werte sind besser." + +#: modules//benchmark.c:529 +msgid "Benchmarks" +msgstr "Benchmarks" + +#: modules//benchmark.c:547 +msgid "Perform tasks and compare with other systems" +msgstr "Erledigt Aufgaben und vergleicht die Ergebnisse mit anderen Systemen" + +#: modules//benchmark.c:634 +msgid "Send benchmark results" +msgstr "Ãœbermittle Benchmark-Ergebnisse" + +#: modules//benchmark.c:639 +msgid "Receive benchmark results" +msgstr "Lade Benchmark-Ergebnisse" + +#: modules//computer.c:68 +msgid "Summary" +msgstr "Zusammenfassung" + +#: modules//computer.c:69 +msgid "Operating System" +msgstr "Betriebssystem" + +#: modules//computer.c:70 +msgid "Kernel Modules" +msgstr "Kernel-Module" + +#: modules//computer.c:71 +msgid "Boots" +msgstr "Systemstarts" + +#: modules//computer.c:72 +msgid "Languages" +msgstr "Sprachen" + +#: modules//computer.c:73 +msgid "Filesystems" +msgstr "Dateisysteme" + +#: modules//computer.c:74 +msgid "Display" +msgstr "Anzeige" + +#: modules//computer.c:75 +msgid "Environment Variables" +msgstr "Umgebungsvariablen" + +#: modules//computer.c:77 +msgid "Development" +msgstr "Entwicklung" + +#: modules//computer.c:79 +msgid "Users" +msgstr "Benutzer" + +#: modules//computer.c:80 +msgid "Groups" +msgstr "Gruppen" + +#: modules//computer.c:104 +#, c-format +msgid "%dMB (%dMB used)" +msgstr "" + +#: modules//computer.c:200 +msgid "Scripting Languages" +msgstr "Script-Sprachen" + +#: modules//computer.c:201 +msgid "CPython" +msgstr "CPython" + +#: modules//computer.c:202 +msgid "Perl" +msgstr "Perl" + +#: modules//computer.c:203 +msgid "PHP" +msgstr "PHP" + +#: modules//computer.c:204 +msgid "Ruby" +msgstr "Ruby" + +#: modules//computer.c:205 +msgid "Bash" +msgstr "Bash" + +#: modules//computer.c:206 +msgid "Compilers" +msgstr "Compiler" + +#: modules//computer.c:207 +msgid "C (GCC)" +msgstr "C (GCC)" + +#: modules//computer.c:208 +msgid "C (Clang)" +msgstr "C (Clang)" + +#: modules//computer.c:209 +msgid "D (dmd)" +msgstr "D (dmd)" + +#: modules//computer.c:210 +msgid "Java" +msgstr "Java" + +#: modules//computer.c:211 +msgid "CSharp (Mono, old)" +msgstr "CSharp (Mono, old)" + +#: modules//computer.c:212 +msgid "CSharp (Mono)" +msgstr "CSharp (Mono)" + +#: modules//computer.c:213 +msgid "Vala" +msgstr "Vala" + +#: modules//computer.c:214 +msgid "Haskell (GHC)" +msgstr "Haskell (GHC)" + +#: modules//computer.c:215 +msgid "FreePascal" +msgstr "FreePascal" + +#: modules//computer.c:216 +msgid "Tools" +msgstr "Werkzeug-Programme" + +#: modules//computer.c:217 +msgid "make" +msgstr "make" + +#: modules//computer.c:218 +msgid "GDB" +msgstr "GDB" + +#: modules//computer.c:219 +msgid "strace" +msgstr "strace" + +#: modules//computer.c:220 +msgid "valgrind" +msgstr "valgrind" + +#: modules//computer.c:221 +msgid "QMake" +msgstr "QMake" + +#: modules//computer.c:264 +#, c-format +msgid "%s=Not found\n" +msgstr "%s=Nicht gefunden\n" + +#: modules//computer.c:267 +#, c-format +msgid "Detecting version: %s" +msgstr "" + +#: modules//computer.c:278 +#, c-format +msgid "" +"[$ShellParam$]\n" +"ColumnTitle$TextValue=Program\n" +"ColumnTitle$Value=Version\n" +"ShowColumnHeaders=true\n" +"%s" +msgstr "" +"[$ShellParam$]\n" +"ColumnTitle$TextValue=Programm\n" +"ColumnTitle$Value=Version\n" +"ShowColumnHeaders=true\n" +"%s" + +#: modules//computer.c:358 +msgid "Physical machine" +msgstr "Physikalische Maschine" + +#: modules//computer.c:375 +#, c-format +msgid "" +"[$ShellParam$]\n" +"UpdateInterval$Memory=1000\n" +"UpdateInterval$Date/Time=1000\n" +"#ReloadInterval=5000\n" +"[Computer]\n" +"Processor=%s\n" +"Memory=...\n" +"Machine Type=%s\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" +"\n" +"%s\n" +"[Input Devices]\n" +"%s\n" +"\n" +"%s\n" +"\n" +"%s\n" +msgstr "" +"[$ShellParam$]\n" +"UpdateInterval$Memory=1000\n" +"UpdateInterval$Date/Time=1000\n" +"#ReloadInterval=5000\n" +"[Computer]\n" +"Prozessor=%s\n" +"Memory=...\n" +"Maschinen-Typ=%s\n" +"Betriebssystem=%s\n" +"Benutzername=%s\n" +"Date/Time=...\n" +"[Anzeige]\n" +"Auflösung=%dx%d Pixel\n" +"OpenGL-Renderer=%s\n" +"X11-Hersteller=%s\n" +"\n" +"%s\n" +"[Eingabegeräte]\n" +"%s\n" +"\n" +"%s\n" +"\n" +"%s\n" + +#: modules//computer.c:417 +#, fuzzy, c-format +msgid "" +"[$ShellParam$]\n" +"UpdateInterval$Uptime=10000\n" +"UpdateInterval$Load Average=1000\n" +"[Version]\n" +"Kernel=%s\n" +"Version=%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=..." +msgstr "" +"[$ShellParam$]\n" +"UpdateInterval$Uptime=10000\n" +"UpdateInterval$Load Average=1000\n" +"[Version]\n" +"Kernel=%s\n" +"Version=%s\n" +"C-Library=%s\n" +"Distribution=%s\n" +"[Aktuelle Sitzung]\n" +"Computername=%s\n" +"Benutzername=%s\n" +"#Sprache=%s\n" +"Stammverzeichnis=%s\n" +"Desktop-Umgebung=%s\n" +"[Verschiedenes]\n" +"Uptime=...\n" +"Load Average=..." + +#: modules//computer.c:446 +#, c-format +msgid "" +"[Loaded Modules]\n" +"%s[$ShellParam$]\n" +"ViewType=1\n" +"ColumnTitle$TextValue=Name\n" +"ColumnTitle$Value=Description\n" +"ShowColumnHeaders=true\n" +msgstr "" +"[Geladene Module]\n" +"%s[$ShellParam$]\n" +"ViewType=1\n" +"ColumnTitle$TextValue=Name\n" +"ColumnTitle$Value=Beschreibung\n" +"ShowColumnHeaders=true\n" + +#: modules//computer.c:457 +#, c-format +msgid "" +"[$ShellParam$]\n" +"ColumnTitle$TextValue=Date & Time\n" +"ColumnTitle$Value=Kernel Version\n" +"ShowColumnHeaders=true\n" +"\n" +"%s" +msgstr "" +"[$ShellParam$]\n" +"ColumnTitle$TextValue=Datum & Uhrzeit\n" +"ColumnTitle$Value=Kernel-Version\n" +"ShowColumnHeaders=true\n" +"\n" +"%s" + +#: modules//computer.c:467 +#, c-format +msgid "" +"[$ShellParam$]\n" +"ViewType=1\n" +"ColumnTitle$TextValue=Language Code\n" +"ColumnTitle$Value=Name\n" +"ShowColumnHeaders=true\n" +"[Available Languages]\n" +"%s" +msgstr "" +"[$ShellParam$]\n" +"ViewType=1\n" +"ColumnTitle$TextValue=Sprach-Code\n" +"ColumnTitle$Value=Name\n" +"ShowColumnHeaders=true\n" +"[Available Languages]\n" +"%s" + +#: modules//computer.c:478 +#, c-format +msgid "" +"[$ShellParam$]\n" +"ViewType=4\n" +"ReloadInterval=5000\n" +"Zebra=1\n" +"NormalizePercentage=false\n" +"ColumnTitle$Extra1=Mount Point\n" +"ColumnTitle$Progress=Usage\n" +"ColumnTitle$TextValue=Device\n" +"ShowColumnHeaders=true\n" +"[Mounted File Systems]\n" +"%s\n" +msgstr "" +"[$ShellParam$]\n" +"ViewType=4\n" +"ReloadInterval=5000\n" +"Zebra=1\n" +"NormalizePercentage=false\n" +"ColumnTitle$Extra1=Mount-Punkt\n" +"ColumnTitle$Progress=Verwendung\n" +"ColumnTitle$TextValue=Gerät\n" +"ShowColumnHeaders=true\n" +"[Mounted File Systems]\n" +"%s\n" + +#: modules//computer.c:492 +#, c-format +msgid "" +"[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" +msgstr "" +"[Anzeige]\n" +"Auflösung=%dx%d Pixel\n" +"Hersteller=%s\n" +"Version=%s\n" +"[Bildschirme]\n" +"%s[Erweiterungen]\n" +"%s[OpenGL]\n" +"Hersteller=%s\n" +"Renderer=%s\n" +"Version=%s\n" +"Direct-Rendering=%s\n" + +#: modules//computer.c:514 +msgid "Y_es" +msgstr "_Ja" + +#: modules//computer.c:514 modules//devices/printers.c:138 +#: hardinfo//hardinfo.c:63 +msgid "No" +msgstr "Nein" + +#: modules//computer.c:528 +#, c-format +msgid "" +"[$ShellParam$]\n" +"ReloadInterval=10000\n" +"ColumnTitle$TextValue=Name\n" +"ColumnTitle$Value=Group ID\n" +"ShowColumnHeaders=true\n" +"[Groups]\n" +"%s\n" +msgstr "" +"[$ShellParam$]\n" +"ReloadInterval=10000\n" +"ColumnTitle$TextValue=Name\n" +"ColumnTitle$Value=Gruppen-ID\n" +"ShowColumnHeaders=true\n" +"[Gruppen]\n" +"%s\n" + +#: modules//computer.c:608 +msgid "Computer" +msgstr "Computer" + +#: modules//computer.c:702 +msgid "Gathers high-level computer information" +msgstr "Sammelt high-level Computer-Informationen" + +#: modules//computer/alsa.c:26 +msgid "[Audio Devices]\n" +msgstr "[Audio-Geräte]\n" + +#: modules//computer/alsa.c:33 +#, c-format +msgid "Audio Adapter#%d=%s\n" +msgstr "" + +#: modules//computer/boots.c:33 +msgid "[Boots]\n" +msgstr "[Systemstarts]\n" + +#: modules//computer/display.c:122 +#, c-format +msgid "Monitor %d=%dx%d pixels\n" +msgstr "Bildschirm %d=%dx%d Pixel\n" + +#: modules//computer/environment.c:32 +msgid "[Environment Variables]\n" +msgstr "[Umgebungsvariablen]\n" + +#: modules//computer/os.c:57 +#, c-format +msgid "GNU C Library version %s (%sstable)" +msgstr "" + +#: modules//computer/os.c:59 +msgid "un" +msgstr "" + +#: modules//computer/os.c:61 modules//computer/os.c:138 modules//devices.c:154 +#: modules//devices.c:197 modules//devices/printers.c:99 +#: modules//devices/printers.c:106 modules//devices/printers.c:116 +#: modules//devices/printers.c:131 modules//devices/printers.c:140 +#: modules//devices/printers.c:243 +msgid "Unknown" +msgstr "" + +#: modules//computer/os.c:80 +#, c-format +msgid "Version: %s" +msgstr "" + +#: modules//computer/os.c:114 +msgid "Terminal" +msgstr "" + +#: modules//computer/os.c:134 +#, c-format +msgid "Unknown (Window Manager: %s)" +msgstr "" + +#: modules//computer/os.c:174 +msgid "Unknown distribution" +msgstr "" + +#: modules//devices.c:74 +msgid "Processor" +msgstr "Prozessor" + +#: modules//devices.c:75 +msgid "Memory" +msgstr "Hauptspeicher" + +#: modules//devices.c:76 +msgid "PCI Devices" +msgstr "PCI-Geräte" + +#: modules//devices.c:77 +msgid "USB Devices" +msgstr "USB-Geräte" + +#: modules//devices.c:78 +msgid "Printers" +msgstr "Drucker" + +#: modules//devices.c:79 +msgid "Battery" +msgstr "Akku" + +#: modules//devices.c:80 +msgid "Sensors" +msgstr "Sensoren" + +#: modules//devices.c:81 +msgid "Input Devices" +msgstr "Eingabegeräte" + +#: modules//devices.c:82 +msgid "Storage" +msgstr "Speicher" + +#: modules//devices.c:84 +msgid "DMI" +msgstr "DMI" + +#: modules//devices.c:85 +msgid "Memory SPD" +msgstr "Hauptspeicher (SPD)" + +#: modules//devices.c:87 +msgid "Resources" +msgstr "Ressourcen" + +#: modules//devices.c:193 +msgid " (vendor unknown)" +msgstr " (unbekannter Hersteller)" + +#: modules//devices.c:195 +msgid " (model unknown)" +msgstr " (unbekanntes Modell)" + +#: modules//devices.c:412 +msgid "Devices" +msgstr "Geräte" + +#: modules//devices.c:424 +msgid "Update PCI ID listing" +msgstr "" + +#: modules//devices.c:436 +msgid "Update CPU feature database" +msgstr "" + +#: modules//devices.c:464 +msgid "Gathers information about hardware devices" +msgstr "Sammelt Informationen über die Hardware-Geräte" + +#: modules//devices/battery.c:181 +#, c-format +msgid "" +"\n" +"[Battery: %s]\n" +"State=%s (load: %s)\n" +"Capacity=%s / %s (%.2f%%)\n" +"Battery Technology=%s (%s)\n" +"Manufacturer=%s\n" +"Model Number=%s\n" +"Serial Number=%s\n" +msgstr "" +"\n" +"[Akku: %s]\n" +"Status=%s (load: %s)\n" +"Kapazität=%s / %s (%.2f%%)\n" +"Akku-Technologie=%s (%s)\n" +"Hersteller=%s\n" +"Modellnummer=%s\n" +"Seriennummer=%s\n" + +#: modules//devices/battery.c:258 +#, c-format +msgid "" +"\n" +"[Battery: %s]\n" +"State=%s\n" +"Capacity=%s / %s\n" +"Battery Technology=%s\n" +"Manufacturer=%s\n" +"Model Number=%s\n" +"Serial Number=%s\n" +msgstr "" +"\n" +"[Akku: %s]\n" +"Status=%s\n" +"Kapazität=%s / %s\n" +"Akku-Technologie=%s\n" +"Hersteller=%s\n" +"Modellnummer=%s\n" +"Seriennummer=%s\n" + +#: modules//devices/battery.c:346 +#, fuzzy, c-format +msgid "" +"\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" +msgstr "" +"\n" +"[Akku (APM)]\n" +"Ladung=%d%%\n" +"Verbleibende Ladung=%s von %s\n" +"Using=%s\n" +"APM Driver-Version=%s\n" +"APM BIOS-Version=%s\n" + +#: modules//devices/battery.c:358 +#, fuzzy, c-format +msgid "" +"\n" +"[Battery (APM)]\n" +"Charge=%d%%\n" +"Using=%s\n" +"APM driver version=%s\n" +"APM BIOS version=%s\n" +msgstr "" +"\n" +"[Akku (APM)]\n" +"Ladung=%d%%\n" +"Using=%s\n" +"APM Driver-Version=%s\n" +"APM BIOS-Version=%s\n" + +#: modules//devices/battery.c:385 +msgid "" +"[No batteries]\n" +"No batteries found on this system=\n" +msgstr "" +"[Keine Akkus]\n" +"Keine Akkus in diesem System gefunden=\n" + +#: modules//devices/printers.c:81 +msgid "⚬ Can do black and white printing=\n" +msgstr "⚬ Kann schwarz/weiß drucken=\n" + +#: modules//devices/printers.c:83 +msgid "⚬ Can do color printing=\n" +msgstr "⚬ Kann farbig drucken=\n" + +#: modules//devices/printers.c:85 +msgid "⚬ Can do duplexing=\n" +msgstr "⚬ Kann zweiseitig drucken (Duplexdruck)=\n" + +#: modules//devices/printers.c:87 +msgid "⚬ Can do staple output=\n" +msgstr "⚬ Kann Ausdrucke stapeln=\n" + +#: modules//devices/printers.c:89 +msgid "⚬ Can do copies=\n" +msgstr "⚬ Kann kopieren=\n" + +#: modules//devices/printers.c:91 +msgid "⚬ Can collate copies=\n" +msgstr "⚬ Kann Ausdruck sortieren=\n" + +#: modules//devices/printers.c:93 +msgid "⚬ Printer is rejecting jobs=\n" +msgstr "⚬ Drucker weist Aufträge zurück=\n" + +#: modules//devices/printers.c:95 +msgid "⚬ Printer was automatically discovered and added=\n" +msgstr "⚬ Drucker wurde automatisch entdeckt und hinzugefügt=\n" + +#: modules//devices/printers.c:110 +msgid "Idle" +msgstr "" + +#: modules//devices/printers.c:112 +msgid "Printing a Job" +msgstr "" + +#: modules//devices/printers.c:114 +msgid "Stopped" +msgstr "" + +#: modules//devices/printers.c:138 hardinfo//hardinfo.c:62 +#: hardinfo//hardinfo.c:63 +msgid "Yes" +msgstr "Ja" + +#: modules//devices/printers.c:190 +msgid "" +"[Printers]\n" +"No suitable CUPS library found=" +msgstr "" +"[Drucker]\n" +"Keine passende CUPS-Bibliothek gefunden=" + +#: modules//devices/printers.c:200 +msgid "[Printers (CUPS)]\n" +msgstr "[Drucker (CUPS)]\n" + +#: modules//devices/printers.c:263 +msgid "" +"[Printers]\n" +"No printers found=\n" +msgstr "" +"[Printers]\n" +"Keine Drucker gefunden=\n" + +#: modules//devices/storage.c:46 +msgid "" +"\n" +"[SCSI Disks]\n" +msgstr "" +"\n" +"[SCSI-Geräte]\n" + +#: modules//devices/storage.c:110 modules//devices/storage.c:297 +#, c-format +msgid "" +"[Device Information]\n" +"Model=%s\n" +msgstr "" +"[Geräte-Informationen]\n" +"Modell=%s\n" + +#: modules//devices/storage.c:115 modules//devices/storage.c:304 +#, c-format +msgid "Vendor=%s (%s)\n" +msgstr "Hersteller=%s (%s)\n" + +#: modules//devices/storage.c:120 modules//devices/storage.c:309 +#, c-format +msgid "Vendor=%s\n" +msgstr "Hersteller=%s\n" + +#: modules//devices/storage.c:125 +#, c-format +msgid "" +"Type=%s\n" +"Revision=%s\n" +"[SCSI Controller]\n" +"Controller=scsi%d\n" +"Channel=%d\n" +"ID=%d\n" +"LUN=%d\n" +msgstr "" + +#: modules//devices/storage.c:169 +msgid "" +"\n" +"[IDE Disks]\n" +msgstr "" +"\n" +"[IDE-Geräte]\n" + +#: modules//devices/storage.c:242 +#, c-format +msgid "Driver=%s\n" +msgstr "Treiber=%s\n" + +#: modules//devices/storage.c:314 +#, c-format +msgid "" +"Device Name=hd%c\n" +"Media=%s\n" +"Cache=%dkb\n" +msgstr "" + +#: modules//devices/storage.c:329 +#, c-format +msgid "" +"[Geometry]\n" +"Physical=%s\n" +"Logical=%s\n" +msgstr "" +"[Geometrie]\n" +"Physikalisch=%s\n" +"Logisch=%s\n" + +#: modules//devices/storage.c:341 +#, c-format +msgid "" +"[Capabilities]\n" +"%s" +msgstr "" +"[Fähigkeiten]\n" +"%s" + +#: modules//devices/storage.c:348 +#, c-format +msgid "" +"[Speeds]\n" +"%s" +msgstr "" +"[Geschwindigkeiten]\n" +"%s" + +#: modules//devices/x86/processor.c:145 modules//devices/x86_64/processor.c:145 +msgid "Cache information not available=\n" +msgstr "" + +#: modules//devices/x86/processor.c:484 modules//devices/x86_64/processor.c:484 +#, c-format +msgid "" +"[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" +"[Cache]\n" +"%s\n" +"[Capabilities]\n" +"%s" +msgstr "" +"[Prozessor]\n" +"Name=%s\n" +"Familie, Modell, Stufung=%d, %d, %d (%s)\n" +"Hersteller=%s\n" +"[Konfiguration]\n" +"Cache-Größe=%dkb\n" +"Taktfrequenz=%.2fMHz\n" +"BogoMIPS=%.2f\n" +"Byte-Reihenfolge=%s\n" +"[Funktionen]\n" +"FDIV-Bug=%s\n" +"HLT-Bug=%s\n" +"F00F-Bug=%s\n" +"Coma-Bug=%s\n" +"Hat FPU=%s\n" +"[Cache]\n" +"%s\n" +"[Fähigkeiten]\n" +"%s" + +#: modules//devices/x86/processor.c:542 modules//devices/x86_64/processor.c:542 +#, c-format +msgid "%s$CPU%d$%s=%.2fMHz\n" +msgstr "%s$CPU%d$%s=%.2fMHz\n" + +#: modules//network.c:59 +msgid "Interfaces" +msgstr "Schnittstellen" + +#: modules//network.c:60 +msgid "IP Connections" +msgstr "IP-Verbindungen" + +#: modules//network.c:61 +msgid "Routing Table" +msgstr "Routing-Tabelle" + +#: modules//network.c:62 +msgid "ARP Table" +msgstr "ARP-Tabelle" + +#: modules//network.c:63 +msgid "DNS Servers" +msgstr "DNS-Server" + +#: modules//network.c:64 +msgid "Statistics" +msgstr "Statistiken" + +#: modules//network.c:65 +msgid "Shared Directories" +msgstr "Freigegebene Verzeichnisse" + +#: modules//network.c:300 +#, c-format +msgid "" +"[ARP Table]\n" +"%s\n" +"[$ShellParam$]\n" +"ReloadInterval=3000\n" +"ColumnTitle$TextValue=IP Address\n" +"ColumnTitle$Value=Interface\n" +"ColumnTitle$Extra1=MAC Address\n" +"ShowColumnHeaders=true\n" +msgstr "" +"[ARP Table]\n" +"%s\n" +"[$ShellParam$]\n" +"ReloadInterval=3000\n" +"ColumnTitle$TextValue=IP-Adresse\n" +"ColumnTitle$Value=Schnittstelle\n" +"ColumnTitle$Extra1=MAC-Adresse\n" +"ShowColumnHeaders=true\n" + +#: modules//network.c:321 +#, c-format +msgid "" +"[Name servers]\n" +"%s\n" +"[$ShellParam$]\n" +"ColumnTitle$TextValue=IP Address\n" +"ColumnTitle$Value=Name\n" +"ShowColumnHeaders=true\n" +msgstr "" +"[DNS-Server]\n" +"%s\n" +"[$ShellParam$]\n" +"ColumnTitle$TextValue=IP-Adresse\n" +"ColumnTitle$Value=Name\n" +"ShowColumnHeaders=true\n" + +#: modules//network.c:331 +#, c-format +msgid "" +"[Connections]\n" +"%s\n" +"[$ShellParam$]\n" +"ReloadInterval=3000\n" +"ColumnTitle$TextValue=Local Address\n" +"ColumnTitle$Value=Protocol\n" +"ColumnTitle$Extra1=Foreign Address\n" +"ColumnTitle$Extra2=State\n" +"ShowColumnHeaders=true\n" +msgstr "" +"[Connections]\n" +"%s\n" +"[$ShellParam$]\n" +"ReloadInterval=3000\n" +"ColumnTitle$TextValue=Lokale Adresse\n" +"ColumnTitle$Value=Protokoll\n" +"ColumnTitle$Extra1=Fremde Adresse\n" +"ColumnTitle$Extra2=Status\n" +"ShowColumnHeaders=true\n" + +#: modules//network.c:345 +#, c-format +msgid "" +"%s\n" +"[$ShellParam$]\n" +"ReloadInterval=3000\n" +"ViewType=1\n" +"ColumnTitle$TextValue=Interface\n" +"ColumnTitle$Value=IP Address\n" +"ColumnTitle$Extra1=Sent\n" +"ColumnTitle$Extra2=Received\n" +"ShowColumnHeaders=true\n" +"%s" +msgstr "" +"%s\n" +"[$ShellParam$]\n" +"ReloadInterval=3000\n" +"ViewType=1\n" +"ColumnTitle$TextValue=Schnittstelle\n" +"ColumnTitle$Value=IP-Adresse\n" +"ColumnTitle$Extra1=Gesendet\n" +"ColumnTitle$Extra2=Empfangen\n" +"ShowColumnHeaders=true\n" +"%s" + +#: modules//network.c:361 +#, c-format +msgid "" +"[IP routing table]\n" +"%s\n" +"[$ShellParam$]\n" +"ViewType=0\n" +"ReloadInterval=3000\n" +"ColumnTitle$TextValue=Destination / Gateway\n" +"ColumnTitle$Value=Interface\n" +"ColumnTitle$Extra1=Flags\n" +"ColumnTitle$Extra2=Mask\n" +"ShowColumnHeaders=true\n" +msgstr "" +"[IP routing table]\n" +"%s\n" +"[$ShellParam$]\n" +"ViewType=0\n" +"ReloadInterval=3000\n" +"ColumnTitle$TextValue=Ziel / Vorgaberoute\n" +"ColumnTitle$Value=Schnittstelle\n" +"ColumnTitle$Extra1=Flags\n" +"ColumnTitle$Extra2=Netz-Maske\n" +"ShowColumnHeaders=true\n" + +#: modules//network.c:399 +msgid "Network" +msgstr "Netzwerk" + +#: modules//network.c:432 +msgid "Gathers information about this computer's network connection" +msgstr "Sammelt Informationen über die Netzwerk-Verbindung dieses Computers" + +#: hardinfo//hardinfo.c:54 +msgid "" +"Copyright (C) 2003-2009 Leandro A. F. Pereira. See COPYING for details.\n" +"\n" +msgstr "" + +#: hardinfo//hardinfo.c:56 +#, c-format +msgid "" +"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" +msgstr "" + +#: hardinfo//hardinfo.c:74 +#, c-format +msgid "" +"Failed to find runtime data.\n" +"\n" +"• Is HardInfo correctly installed?\n" +"• See if %s and %s exists and you have read permision." +msgstr "" + +#: hardinfo//hardinfo.c:81 +#, c-format +msgid "" +"Modules:\n" +"%-20s%-15s%-12s\n" +msgstr "" + +#: hardinfo//hardinfo.c:82 +msgid "File Name" +msgstr "" + +#: hardinfo//hardinfo.c:82 +msgid "Name" +msgstr "Name" + +#: hardinfo//hardinfo.c:82 +msgid "Version" +msgstr "" + +#: hardinfo//hardinfo.c:135 +#, c-format +msgid "Unknown benchmark ``%s'' or libbenchmark.so not loaded" +msgstr "" + +#: hardinfo//hardinfo.c:163 +msgid "Don't know what to do. Exiting." +msgstr "" + +#: hardinfo//util.c:104 hardinfo//util.c:107 hardinfo//util.c:112 +#, c-format +msgid "%d minute" +msgid_plural "%d minutes" +msgstr[0] "%d Minute" +msgstr[1] "%d Minuten" + +#: hardinfo//util.c:106 +#, c-format +msgid "%d hour, " +msgid_plural "%d hours, " +msgstr[0] "%d Stunde, " +msgstr[1] "%d Stunden, " + +#: hardinfo//util.c:110 +#, c-format +msgid "%d day, " +msgid_plural "%d days, " +msgstr[0] "%d Tag, " +msgstr[1] "%d Tage, " + +#: hardinfo//util.c:111 +#, c-format +msgid "%d hour and " +msgid_plural "%d hours and " +msgstr[0] "%d Stunde und " +msgstr[1] "%d Stunden und " + +#: hardinfo//util.c:118 +#, c-format +msgid "%.1f B" +msgstr "%.1f Byte(s)" + +#: hardinfo//util.c:120 +#, c-format +msgid "%.1f KiB" +msgstr "%.1f KiB" + +#: hardinfo//util.c:122 +#, c-format +msgid "%.1f MiB" +msgstr "%.1f MiB" + +#: hardinfo//util.c:124 +#, c-format +msgid "%.1f GiB" +msgstr "%.1f GiB" + +#: hardinfo//util.c:126 +#, c-format +msgid "%.1f TiB" +msgstr "%.1f TiB" + +#: hardinfo//util.c:128 +#, c-format +msgid "%.1f PiB" +msgstr "%.1f PiB" + +#: hardinfo//util.c:342 +msgid "Error" +msgstr "Fehler" + +#: hardinfo//util.c:342 hardinfo//util.c:358 +msgid "Warning" +msgstr "Warnung" + +#: hardinfo//util.c:357 +msgid "Fatal Error" +msgstr "Kritischer Fehler" + +#: hardinfo//util.c:382 +msgid "creates a report and prints to standard output" +msgstr "" + +#: hardinfo//util.c:388 +msgid "chooses a report format (text, html)" +msgstr "" + +#: hardinfo//util.c:394 +msgid "run benchmark; requires benchmark.so to be loaded" +msgstr "" + +#: hardinfo//util.c:400 +msgid "lists modules" +msgstr "" + +#: hardinfo//util.c:406 +msgid "specify module to load" +msgstr "" + +#: hardinfo//util.c:412 +msgid "automatically load module dependencies" +msgstr "" + +#: hardinfo//util.c:419 +msgid "run in XML-RPC server mode" +msgstr "" + +#: hardinfo//util.c:426 +msgid "shows program version and quit" +msgstr "" + +#: hardinfo//util.c:431 +msgid "- System Profiler and Benchmark tool" +msgstr "- System-Profiler und Benchmark-Werkzeug" + +#: hardinfo//util.c:441 +#, c-format +msgid "" +"Unrecognized arguments.\n" +"Try ``%s --help'' for more information.\n" +msgstr "" + +#: hardinfo//util.c:507 +#, c-format +msgid "Couldn't find a Web browser to open URL %s." +msgstr "Konnte keinen Web-Browser finden, um die URL %s zu öffnen." + +#: hardinfo//util.c:854 +#, c-format +msgid "Module \"%s\" depends on module \"%s\", load it?" +msgstr "" + +#: hardinfo//util.c:877 +#, c-format +msgid "Module \"%s\" depends on module \"%s\"." +msgstr "" + +#: hardinfo//util.c:922 +#, c-format +msgid "No module could be loaded. Check permissions on \"%s\" and try again." +msgstr "" + +#: hardinfo//util.c:926 +msgid "" +"No module could be loaded. Please use hardinfo -l to list all available " +"modules and try again with a valid module list." +msgstr "" + +#: hardinfo//util.c:1102 +#, c-format +msgid "Scanning: %s..." +msgstr "" diff --git a/po/es.po b/po/es.po new file mode 100644 index 00000000..4ba67e7a --- /dev/null +++ b/po/es.po @@ -0,0 +1,1676 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: hardinfo\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2013-01-05 17:29+0100\n" +"PO-Revision-Date: 2013-02-18 17:11-0300\n" +"Last-Translator: Fernando López <flopez@linti.unlp.edu.ar>\n" +"Language-Team: Fernando López <soportelihuen@linti.unlp.edu.ar>\n" +"Language: Spanish\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Language: Spanish\n" + +#: shell//report.c:492 +msgid "Save File" +msgstr "Guardar archivo" + +#: shell//report.c:616 +msgid "Cannot create ReportContext. Programming bug?" +msgstr "No se puede crear ReportContext. ¿Error del programa?" + +#: shell//report.c:634 +msgid "Open the report with your web browser?" +msgstr "¿Abrir el reporte en el navegador web?" + +#: shell//report.c:662 +msgid "Generating report..." +msgstr "Generando reporte..." + +#: shell//report.c:672 +msgid "Report saved." +msgstr "Reporte guardado." + +#: shell//report.c:674 +msgid "Error while creating the report." +msgstr "Error creando el reporte." + +#: shell//report.c:776 +msgid "Generate Report" +msgstr "Generar reporte" + +#: shell//report.c:793 +msgid "" +"<big><b>Generate Report</b></big>\n" +"Please choose the information that you wish to view in your report:" +msgstr "" +"<big><b>Generar reporte</b></big>\n" +"Por favor elija la información que desea ver en el reporte:" + +#: shell//report.c:853 +msgid "Select _None" +msgstr "_Deseleccionar todo" + +#: shell//report.c:860 +msgid "Select _All" +msgstr "_Seleccionar todo" + +#: shell//report.c:878 +msgid "_Generate" +msgstr "_Generar" + +#: shell//menu.c:35 +msgid "_Information" +msgstr "_Información" + +#: shell//menu.c:36 +msgid "_Remote" +msgstr "_Remoto" + +#: shell//menu.c:37 +msgid "_View" +msgstr "_Ver" + +#: shell//menu.c:38 +msgid "_Help" +msgstr "_Ayuda" + +#: shell//menu.c:39 +msgid "About _Modules" +msgstr "Acerca de los _módulos" + +#: shell//menu.c:43 +msgid "Generate _Report" +msgstr "Generar _reporte" + +#: shell//menu.c:48 +msgid "_Network Updater..." +msgstr "_Actualizador por red..." + +#: shell//menu.c:53 +msgid "_Open..." +msgstr "_Abrir..." + +#: shell//menu.c:58 +msgid "_Connect to..." +msgstr "_Conectar a..." + +#: shell//menu.c:63 +msgid "_Manage hosts..." +msgstr "_Configurar hosts..." + +#: shell//menu.c:68 +msgid "_Local computer" +msgstr "_Equipo local" + +#: shell//menu.c:73 +msgid "_Copy to Clipboard" +msgstr "_Copiar al portapapeles" + +#: shell//menu.c:74 +msgid "Copy to clipboard" +msgstr "Copiar al portapapeles" + +#: shell//menu.c:78 +msgid "_Save image as..." +msgstr "_Guardar imagen como..." + +#: shell//menu.c:83 +msgid "_Refresh" +msgstr "_Refrescar" + +#: shell//menu.c:88 +msgid "Contents" +msgstr "Contenidos" + +#: shell//menu.c:93 +#: shell//shell.c:1790 +#: shell//shell.c:1807 +msgid "Context help" +msgstr "Ayuda contextual" + +#: shell//menu.c:98 +msgid "_Open HardInfo Web Site" +msgstr "_Abrir sitio web de Hardinfo" + +#: shell//menu.c:103 +msgid "_Report bug" +msgstr "_Reportar un error" + +#: shell//menu.c:108 +msgid "_Donate to the project" +msgstr "_Donar al proyecto" + +#: shell//menu.c:113 +msgid "_About HardInfo" +msgstr "_Acerca de Hardinfo" + +#: shell//menu.c:114 +msgid "Displays program version information" +msgstr "Muestra la información de versión del programa" + +#: shell//menu.c:118 +msgid "_Quit" +msgstr "_Salir" + +#: shell//menu.c:125 +msgid "_Side Pane" +msgstr "_Panel lateral" + +#: shell//menu.c:126 +msgid "Toggles side pane visibility" +msgstr "Cambia la visibilidad del panel lateral" + +#: shell//menu.c:129 +msgid "_Toolbar" +msgstr "_Barra de herramientas" + +#: shell//menu.c:133 +msgid "_Accept connections" +msgstr "_Aceptar conexiones" + +#: shell//callbacks.c:71 +#, c-format +msgid "Remote: <b>%s</b>" +msgstr "Remoto: <b>%s</b>" + +#: shell//callbacks.c:117 +msgid "Disconnecting..." +msgstr "Desconectando..." + +#: shell//callbacks.c:120 +msgid "Unloading modules..." +msgstr "Descargando módulos..." + +#: shell//callbacks.c:123 +msgid "Loading local modules..." +msgstr "Cargando módulos locales..." + +#: shell//callbacks.c:130 +#: shell//callbacks.c:162 +#: shell//shell.c:314 +#: shell//shell.c:814 +#: shell//shell.c:1796 +#: modules//benchmark.c:431 +#: modules//benchmark.c:439 +#: hardinfo//util.c:1106 +msgid "Done." +msgstr "Hecho." + +#: shell//callbacks.c:142 +msgid "Save Image" +msgstr "Guardar imagen" + +#: shell//callbacks.c:158 +msgid "Saving image..." +msgstr "Guardando imagen" + +#: shell//callbacks.c:236 +msgid "No context help available." +msgstr "No hay ayuda contextual disponible" + +#: shell//callbacks.c:318 +#, c-format +msgid "%s Module" +msgstr "%s módulo" + +#: shell//callbacks.c:325 +#, c-format +msgid "" +"Written by %s\n" +"Licensed under %s" +msgstr "" +"Escrito por %s\n" +"Licencia %s" + +#: shell//callbacks.c:339 +#, c-format +msgid "No about information is associated with the %s module." +msgstr "No hay información \"acerca de\" asociada al módulo %s." + +#: shell//callbacks.c:353 +msgid "Author:" +msgstr "Autor:" + +#: shell//callbacks.c:356 +msgid "Contributors:" +msgstr "Contribuyentes:" + +#: shell//callbacks.c:360 +msgid "Based on work by:" +msgstr "Basado en el trabajo de:" + +#: shell//callbacks.c:361 +msgid "MD5 implementation by Colin Plumb (see md5.c for details)" +msgstr "Implementación de MD5 por Colin Plumb (ver md5.c para detalles)" + +#: shell//callbacks.c:362 +msgid "SHA1 implementation by Steve Reid (see sha1.c for details)" +msgstr "Implementación de SHA1 por Steve Reid (ver sha1.c para detalles)" + +#: shell//callbacks.c:363 +msgid "Blowfish implementation by Paul Kocher (see blowfich.c for details)" +msgstr "" +"Implementación de Blowfish por Paul Kocher (ver blowfich.c para detalles)" + +#: shell//callbacks.c:364 +msgid "Raytracing benchmark by John Walker (see fbench.c for details)" +msgstr "" +"Benchmark de trazado de rayos por John Walker (ver fbench.c para detalles)" + +#: shell//callbacks.c:365 +msgid "FFT benchmark by Scott Robert Ladd (see fftbench.c for details)" +msgstr "Benchmark de FFT por Scott Robert Ladd (ver fftbench.c para detalles)" + +#: shell//callbacks.c:366 +msgid "Some code partly based on x86cpucaps by Osamu Kayasono" +msgstr "Parte del código parcialmente basado en x86cpucaps por Osamu Kayasono" + +#: shell//callbacks.c:367 +msgid "Vendor list based on GtkSysInfo by Pissens Sebastien" +msgstr "Lista de proveedores basada en GtkSysInfo por Pissens Sebastien" + +#: shell//callbacks.c:368 +msgid "DMI support based on code by Stewart Adam" +msgstr "Soporte DMI basado en código de Stewart Adam" + +#: shell//callbacks.c:369 +msgid "SCSI support based on code by Pascal F. Martin" +msgstr "Soporte SCSI basado en código de Pascal F. Martin" + +#: shell//callbacks.c:373 +msgid "Jakub Szypulka" +msgstr "" + +#: shell//callbacks.c:374 +msgid "Tango Project" +msgstr "Proyecto Tango" + +#: shell//callbacks.c:375 +msgid "The GNOME Project" +msgstr "El proyecto GNOME" + +#: shell//callbacks.c:376 +msgid "VMWare, Inc. (USB icon from VMWare Workstation 6)" +msgstr "VMWare, Inc. (icono USB de VMWare Workstation 6)" + +#: shell//callbacks.c:387 +msgid "System information and benchmark tool" +msgstr "Herramienta de información del sistema y benchmark" + +#: shell//callbacks.c:392 +msgid "" +"HardInfo 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.\n" +"\n" +"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.\n" +"\n" +"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" +msgstr "" + +#: shell//shell.c:407 +#, c-format +msgid "%s - System Information" +msgstr "%s - Información del sistema" + +#: shell//shell.c:412 +msgid "System Information" +msgstr "Información del sistema" + +#: shell//shell.c:801 +msgid "Loading modules..." +msgstr "Cargando módulos..." + +#: shell//shell.c:1650 +#, c-format +msgid "<b>%s → Summary</b>" +msgstr "<b>%s → Resumen</b>" + +#: shell//shell.c:1758 +msgid "Updating..." +msgstr "Actualizando..." + +#: shell//syncmanager.c:69 +msgid "" +"<big><b>Synchronize with Central Database</b></big>\n" +"The following information may be synchronized with the HardInfo central " +"database." +msgstr "" +"<big><b>Sincronizar con base de datos central</b></big>\n" +"La siguiente información puede ser sincronizada con la base de datos " +"central de Hardinfo." + +#: shell//syncmanager.c:72 +msgid "" +"<big><b>Synchronizing</b></big>\n" +"This may take some time." +msgstr "" +"<big><b>Sincronizando</b></big>\n" +"Esto puede tomar algún tiempo." + +#: shell//syncmanager.c:132 +msgid "" +"HardInfo was compiled without libsoup support. (Network Updater requires it.)" +msgstr "" +"HardInfo fue compilado sin soporte para libsoup. (El actualizador por red lo " +"requiere.)" + +#: shell//syncmanager.c:161 +#: shell//syncmanager.c:185 +#, c-format +msgid "%s (error #%d)" +msgstr "%s (error #%d)" + +#: shell//syncmanager.c:170 +#: shell//syncmanager.c:194 +msgid "Could not parse XML-RPC response" +msgstr "No se pudo procesar la respuesta XML-RPC" + +#: shell//syncmanager.c:267 +#, c-format +msgid "" +"Server says it supports API version %d, but this version of HardInfo only " +"supports API version %d." +msgstr "" +"El servidor dice que soporta la versión de la API %d, pero esta versión de " +"HardInfo solo soporta la versión de la API %d." + +#: shell//syncmanager.c:362 +msgid "Contacting HardInfo Central Database" +msgstr "Contactando base de datos central de Hardinfo" + +#: shell//syncmanager.c:363 +msgid "Cleaning up" +msgstr "Limpiando" + +#: shell//syncmanager.c:480 +#, c-format +msgid "<s>%s</s> <i>(canceled)</i>" +msgstr "<s>%s</s> <i>(cancelado)</i>" + +#: shell//syncmanager.c:497 +#, c-format +msgid "<b><s>%s</s></b> <i>(failed)</i>" +msgstr "<b><s>%s</s></b> <i>(falló)</i>" + +#: shell//syncmanager.c:509 +#, c-format +msgid "" +"Failed while performing \"%s\". Please file a bug report if this problem " +"persists. (Use the Help→Report bug option.)\n" +"\n" +"Details: %s" +msgstr "" +"Falló realizando \"%s\". Por favor reporte el error si este problema " +"persiste. (Use la opción Ayuda→Reportar error.)\n" +"\n" +"Detalles: %s" + +#: shell//syncmanager.c:518 +#, c-format +msgid "" +"Failed while performing \"%s\". Please file a bug report if this problem " +"persists. (Use the Help→Report bug option.)" +msgstr "" +"Falló realizando \"%s\". Por favor reporte el error si este problema " +"persiste. (Use la opción Ayuda→Reportar error.)" + +#: shell//syncmanager.c:646 +msgid "Network Updater" +msgstr "Actualizador por red" + +#: shell//syncmanager.c:727 +msgid "_Synchronize" +msgstr "_Sincronizar" + +#: modules//computer.c:68 +msgid "Summary" +msgstr "Resumen" + +#: modules//computer.c:69 +msgid "Operating System" +msgstr "Sistema operativo" + +#: modules//computer.c:70 +msgid "Kernel Modules" +msgstr "Módulos del kernel" + +#: modules//computer.c:71 +msgid "Boots" +msgstr "Arranques" + +#: modules//computer.c:72 +msgid "Languages" +msgstr "Idiomas" + +#: modules//computer.c:73 +msgid "Filesystems" +msgstr "Sistemas de archivos" + +#: modules//computer.c:74 +msgid "Display" +msgstr "Pantalla" + +#: modules//computer.c:75 +msgid "Environment Variables" +msgstr "Variables de entorno" + +#: modules//computer.c:77 +msgid "Development" +msgstr "Desarrollo" + +#: modules//computer.c:79 +msgid "Users" +msgstr "Usuarios" + +#: modules//computer.c:80 +msgid "Groups" +msgstr "Grupos" + +#: modules//computer.c:104 +#, c-format +msgid "%dMB (%dMB used)" +msgstr "%dMB (%dMB usados)" + +#: modules//computer.c:200 +msgid "Scripting Languages" +msgstr "Lenguajes de scripting" + +#: modules//computer.c:201 +msgid "CPython" +msgstr "" + +#: modules//computer.c:202 +msgid "Perl" +msgstr "" + +#: modules//computer.c:203 +msgid "PHP" +msgstr "" + +#: modules//computer.c:204 +msgid "Ruby" +msgstr "" + +#: modules//computer.c:205 +msgid "Bash" +msgstr "" + +#: modules//computer.c:206 +msgid "Compilers" +msgstr "Compiladores" + +#: modules//computer.c:207 +msgid "C (GCC)" +msgstr "" + +#: modules//computer.c:208 +msgid "Java" +msgstr "" + +#: modules//computer.c:209 +msgid "CSharp (Mono, old)" +msgstr "CSharp (Mono, antiguo)" + +#: modules//computer.c:210 +msgid "CSharp (Mono)" +msgstr "" + +#: modules//computer.c:211 +msgid "Vala" +msgstr "" + +#: modules//computer.c:212 +msgid "Haskell (GHC)" +msgstr "" + +#: modules//computer.c:213 +msgid "FreePascal" +msgstr "" + +#: modules//computer.c:214 +msgid "Tools" +msgstr "Herramientas" + +#: modules//computer.c:262 +#, c-format +msgid "%s=Not found\n" +msgstr "%s=No encontrado\n" + +#: modules//computer.c:265 +#, c-format +msgid "Detecting version: %s" +msgstr "Detectando versión: %s" + +#: modules//computer.c:276 +#, c-format +msgid "" +"[$ShellParam$]\n" +"ColumnTitle$TextValue=Program\n" +"ColumnTitle$Value=Version\n" +"ShowColumnHeaders=true\n" +"%s" +msgstr "" +"[$ShellParam$]\n" +"ColumnTitle$TextValue=Programa\n" +"ColumnTitle$Value=Versión\n" +"ShowColumnHeaders=true\n" +"%s" + +#: modules//computer.c:356 +msgid "Physical machine" +msgstr "Equipo fÃsico" + +#: modules//computer.c:373 +#, c-format +msgid "" +"[$ShellParam$]\n" +"UpdateInterval$Memory=1000\n" +"UpdateInterval$Date/Time=1000\n" +"#ReloadInterval=5000\n" +"[Computer]\n" +"Processor=%s\n" +"Memory=...\n" +"Machine Type=%s\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" +"\n" +"%s\n" +"[Input Devices]\n" +"%s\n" +"\n" +"%s\n" +"\n" +"%s\n" +msgstr "" +"[$ShellParam$]\n" +"UpdateInterval$Memoria=1000\n" +"UpdateInterval$Fecha/Hora=1000\n" +"#ReloadInterval=5000\n" +"[Equipo]\n" +"Procesador=%s\n" +"Memoria=...\n" +"Tipo de equipo=%s\n" +"Sistema operativo=%s\n" +"Nombre de usuario=%s\n" +"Fecha/Hora=...\n" +"[Pantalla]\n" +"Resolución=%dx%d pixels\n" +"OpenGL Renderer=%s\n" +"Proveedor X11=%s\n" +"\n" +"%s\n" +"[Dispositivos de entrada]\n" +"%s\n" +"\n" +"%s\n" +"\n" +"%s\n" + +#: modules//computer.c:415 +#, c-format +msgid "" +"[$ShellParam$]\n" +"UpdateInterval$Uptime=10000\n" +"UpdateInterval$Load Average=1000\n" +"[Version]\n" +"Kernel=%s\n" +"Version=%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=..." +msgstr "" +"[$ShellParam$]\n" +"UpdateInterval$Uptime=10000\n" +"UpdateInterval$Load Average=1000\n" +"[Versión]\n" +"Núcleo=%s\n" +"Versión=%s\n" +"Biblioteca C=%s\n" +"Distribución=%s\n" +"[Sesión actual]\n" +"Nombre del equipo=%s\n" +"Nombre de usuario=%s\n" +"#Idioma=%s\n" +"Directorio personal=%s\n" +"Entorno de escritorio=%s\n" +"[Misc]\n" +"Uptime=...\n" +"Load Average=..." + +#: modules//computer.c:444 +#, c-format +msgid "" +"[Loaded Modules]\n" +"%s[$ShellParam$]\n" +"ViewType=1\n" +"ColumnTitle$TextValue=Name\n" +"ColumnTitle$Value=Description\n" +"ShowColumnHeaders=true\n" +msgstr "" +"[Módulos cargados]\n" +"%s[$ShellParam$]\n" +"ViewType=1\n" +"ColumnTitle$TextValue=Nombre\n" +"ColumnTitle$Value=Descripción\n" +"ShowColumnHeaders=true\n" + +#: modules//computer.c:455 +#, c-format +msgid "" +"[$ShellParam$]\n" +"ColumnTitle$TextValue=Date & Time\n" +"ColumnTitle$Value=Kernel Version\n" +"ShowColumnHeaders=true\n" +"\n" +"%s" +msgstr "" +"[$ShellParam$]\n" +"ColumnTitle$TextValue=Fecha y hora\n" +"ColumnTitle$Value=Versión del núcleo\n" +"ShowColumnHeaders=true\n" +"\n" +"%s" + +#: modules//computer.c:465 +#, c-format +msgid "" +"[$ShellParam$]\n" +"ViewType=1\n" +"ColumnTitle$TextValue=Language Code\n" +"ColumnTitle$Value=Name\n" +"ShowColumnHeaders=true\n" +"[Available Languages]\n" +"%s" +msgstr "" +"[$ShellParam$]\n" +"ViewType=1\n" +"ColumnTitle$TextValue=Código del idioma\n" +"ColumnTitle$Value=Nombre\n" +"ShowColumnHeaders=true\n" +"[Idiomas disponibles]\n" +"%s" + +#: modules//computer.c:476 +#, c-format +msgid "" +"[$ShellParam$]\n" +"ViewType=4\n" +"ReloadInterval=5000\n" +"Zebra=1\n" +"NormalizePercentage=false\n" +"ColumnTitle$Extra1=Mount Point\n" +"ColumnTitle$Progress=Usage\n" +"ColumnTitle$TextValue=Device\n" +"ShowColumnHeaders=true\n" +"[Mounted File Systems]\n" +"%s\n" +msgstr "" +"[$ShellParam$]\n" +"ViewType=4\n" +"ReloadInterval=5000\n" +"Zebra=1\n" +"NormalizePercentage=false\n" +"ColumnTitle$Extra1=Punto de montaje\n" +"ColumnTitle$Progress=Uso\n" +"ColumnTitle$TextValue=Dispositivo\n" +"ShowColumnHeaders=true\n" +"[Sistemas de archivos montados]\n" +"%s\n" + +#: modules//computer.c:490 +#, c-format +msgid "" +"[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" +msgstr "" +"[Pantalla]\n" +"Resolución=%dx%d pixels\n" +"Proveedor=%s\n" +"Versión=%s\n" +"[Monitores]\n" +"%s[Extensiones]\n" +"%s[OpenGL]\n" +"Proveedor=%s\n" +"Renderer=%s\n" +"Versión=%s\n" +"Direct Rendering=%s\n" + +#: modules//computer.c:512 +msgid "Y_es" +msgstr "_SÃ" + +#: modules//computer.c:512 +#: modules//devices/printers.c:138 +#: hardinfo//hardinfo.c:63 +msgid "No" +msgstr "_No" + +#: modules//computer.c:526 +#, c-format +msgid "" +"[$ShellParam$]\n" +"ReloadInterval=10000\n" +"ColumnTitle$TextValue=Name\n" +"ColumnTitle$Value=Group ID\n" +"ShowColumnHeaders=true\n" +"[Groups]\n" +"%s\n" +msgstr "" +"[$ShellParam$]\n" +"ReloadInterval=10000\n" +"ColumnTitle$TextValue=Nombre\n" +"ColumnTitle$Value=ID del grupo\n" +"ShowColumnHeaders=true\n" +"[Grupos]\n" +"%s\n" + +#: modules//computer.c:606 +msgid "Computer" +msgstr "Equipo" + +#: modules//computer.c:700 +msgid "Gathers high-level computer information" +msgstr "Obtiene información del equipo de alto nivel" + +#: modules//devices.c:74 +msgid "Processor" +msgstr "Procesador" + +#: modules//devices.c:75 +msgid "Memory" +msgstr "Memoria" + +#: modules//devices.c:76 +msgid "PCI Devices" +msgstr "Dispositivos PCI" + +#: modules//devices.c:77 +msgid "USB Devices" +msgstr "Dispositivos USB" + +#: modules//devices.c:78 +msgid "Printers" +msgstr "Impresoras" + +#: modules//devices.c:79 +msgid "Battery" +msgstr "BaterÃa" + +#: modules//devices.c:80 +msgid "Sensors" +msgstr "Sensores" + +#: modules//devices.c:81 +msgid "Input Devices" +msgstr "Dispositivos de entrada" + +#: modules//devices.c:82 +msgid "Storage" +msgstr "Almacenamiento" + +#: modules//devices.c:84 +msgid "DMI" +msgstr "" + +#: modules//devices.c:85 +msgid "Memory SPD" +msgstr "Memoria SPD" + +#: modules//devices.c:87 +msgid "Resources" +msgstr "Recursos" + +#: modules//devices.c:154 +#: modules//devices.c:197 +#: modules//computer/os.c:53 +#: modules//computer/os.c:130 +#: modules//devices/printers.c:99 +#: modules//devices/printers.c:106 +#: modules//devices/printers.c:116 +#: modules//devices/printers.c:131 +#: modules//devices/printers.c:140 +#: modules//devices/printers.c:243 +msgid "Unknown" +msgstr "Desconocido" + +#: modules//devices.c:178 +msgid "Total Memory" +msgstr "Memoria total" + +#: modules//devices.c:193 +msgid " (vendor unknown)" +msgstr " (proveedor desconocido)" + +#: modules//devices.c:195 +msgid " (model unknown)" +msgstr " (modelo desconocido)" + +#: modules//devices.c:412 +msgid "Devices" +msgstr "Dispositivos" + +#: modules//devices.c:424 +msgid "Update PCI ID listing" +msgstr "Actualizar listado de ids PCI" + +#: modules//devices.c:436 +msgid "Update CPU feature database" +msgstr "Actualizar base de datos de caracterÃsticas de CPU" + +#: modules//devices.c:464 +msgid "Gathers information about hardware devices" +msgstr "Obtiene información acerca de los dispositivos de hardware" + +#: modules//computer/boots.c:33 +msgid "[Boots]\n" +msgstr "[Arranques]\n" + +#: modules//computer/environment.c:32 +msgid "[Environment Variables]\n" +msgstr "[Variables de entorno]\n" + +#: modules//computer/display.c:83 +msgid "vendor string" +msgstr "cadena del proveedor" + +#: modules//computer/display.c:84 +msgid "X.Org version" +msgstr "Versión de X.Org" + +#: modules//computer/display.c:85 +msgid "XFree86 version" +msgstr "Versión de XFree86" + +#: modules//computer/display.c:122 +#, c-format +msgid "Monitor %d=%dx%d pixels\n" +msgstr "Monitor %d=%dx%d pixels\n" + +#: modules//computer/alsa.c:26 +msgid "[Audio Devices]\n" +msgstr "[Dispositivos de audio]\n" + +#: modules//computer/alsa.c:33 +#, c-format +msgid "Audio Adapter#%d=%s\n" +msgstr "Adaptador de audio#%d=%s\n" + +#: modules//computer/os.c:49 +#, c-format +msgid "GNU C Library version %s (%sstable)" +msgstr "Versión de la biblioteca GNU C %s (%sestable)" + +#: modules//computer/os.c:51 +msgid "un" +msgstr "in" + +#: modules//computer/os.c:72 +#, c-format +msgid "Version: %s" +msgstr "Versión: %s" + +#: modules//computer/os.c:106 +msgid "Terminal" +msgstr "Terminal" + +#: modules//computer/os.c:126 +#, c-format +msgid "Unknown (Window Manager: %s)" +msgstr "Desconocido (Gestor de ventanas: %s)" + +#: modules//computer/os.c:166 +msgid "Unknown distribution" +msgstr "Distribución desconocida" + +#: modules//devices/battery.c:181 +#, c-format +msgid "" +"\n" +"[Battery: %s]\n" +"State=%s (load: %s)\n" +"Capacity=%s / %s (%.2f%%)\n" +"Battery Technology=%s (%s)\n" +"Manufacturer=%s\n" +"Model Number=%s\n" +"Serial Number=%s\n" +msgstr "" +"\n" +"[BaterÃa: %s]\n" +"Estado=%s (carga: %s)\n" +"Capacidad=%s / %s (%.2f%%)\n" +"TecnologÃa de la baterÃa=%s (%s)\n" +"Fabricante=%s\n" +"Numero de modelo=%s\n" +"Numero de serie=%s\n" + +#: modules//devices/battery.c:266 +#, c-format +msgid "" +"\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" +msgstr "" +"\n" +"[BaterÃa (APM)]\n" +"Carga=%d%%\n" +"Carga restante=%s of %s\n" +"Usando=%s\n" +"Versión del driver APM=%s\n" +"APM BIOS version=%s\n" + +#: modules//devices/battery.c:278 +#, c-format +msgid "" +"\n" +"[Battery (APM)]\n" +"Charge=%d%%\n" +"Using=%s\n" +"APM driver version=%s\n" +"APM BIOS version=%s\n" +msgstr "" +"\n" +"[BaterÃa (APM)]\n" +"Carga=%d%%\n" +"Usando=%s\n" +"Versión del driver APM=%s\n" +"Versión del BIOS APM=%s\n" + +#: modules//devices/battery.c:304 +msgid "" +"[No batteries]\n" +"No batteries found on this system=\n" +msgstr "" +"[Sin baterÃas]\n" +"No se encontraron baterÃas en este sistema=\n" + +#: modules//devices/printers.c:81 +msgid "⚬ Can do black and white printing=\n" +msgstr "⚬ Puede imprimir en blanco y negro=\n" + +#: modules//devices/printers.c:83 +msgid "⚬ Can do color printing=\n" +msgstr "⚬ Puede imprimir en color=\n" + +#: modules//devices/printers.c:85 +msgid "⚬ Can do duplexing=\n" +msgstr "⚬ Can do duplexing=\n" + +#: modules//devices/printers.c:87 +msgid "⚬ Can do staple output=\n" +msgstr "⚬ Puede engrapar la salida=\n" + +#: modules//devices/printers.c:89 +msgid "⚬ Can do copies=\n" +msgstr "⚬ Puede hacer copias=\n" + +#: modules//devices/printers.c:91 +msgid "⚬ Can collate copies=\n" +msgstr "⚬ Puede compaginar copias=\n" + +#: modules//devices/printers.c:93 +msgid "⚬ Printer is rejecting jobs=\n" +msgstr "⚬ La impresora está rechazando trabajos=\n" + +#: modules//devices/printers.c:95 +msgid "⚬ Printer was automatically discovered and added=\n" +msgstr "⚬ La impresora fue encontrada automáticamente y agregada=\n" + +#: modules//devices/printers.c:110 +msgid "Idle" +msgstr "Ocioso" + +#: modules//devices/printers.c:112 +msgid "Printing a Job" +msgstr "Imprimiendo un trabajo" + +#: modules//devices/printers.c:114 +msgid "Stopped" +msgstr "Detenido" + +#: modules//devices/printers.c:138 +#: hardinfo//hardinfo.c:62 +#: hardinfo//hardinfo.c:63 +msgid "Yes" +msgstr "SÃ" + +#: modules//devices/printers.c:190 +msgid "" +"[Printers]\n" +"No suitable CUPS library found=" +msgstr "" +"[Impresoras]\n" +"No se encontró ninguna biblioteca CUPS usable=" + +#: modules//devices/printers.c:200 +msgid "[Printers (CUPS)]\n" +msgstr "[Impresoras (CUPS)]\n" + +#: modules//devices/printers.c:263 +msgid "" +"[Printers]\n" +"No printers found=\n" +msgstr "" +"[Impresoras]\n" +"No se encontraron impresoras=\n" + +#: modules//devices/storage.c:46 +msgid "" +"\n" +"[SCSI Disks]\n" +msgstr "" +"\n" +"[Discos SCSI]\n" + +#: modules//devices/storage.c:110 +#: modules//devices/storage.c:297 +#, c-format +msgid "" +"[Device Information]\n" +"Model=%s\n" +msgstr "" +"[Información de dispositivo]\n" +"Modelo=%s\n" + +#: modules//devices/storage.c:115 +#: modules//devices/storage.c:304 +#, c-format +msgid "Vendor=%s (%s)\n" +msgstr "Proveedor=%s (%s)\n" + +#: modules//devices/storage.c:120 +#: modules//devices/storage.c:309 +#, c-format +msgid "Vendor=%s\n" +msgstr "Proveedor=%s\n" + +#: modules//devices/storage.c:125 +#, c-format +msgid "" +"Type=%s\n" +"Revision=%s\n" +"[SCSI Controller]\n" +"Controller=scsi%d\n" +"Channel=%d\n" +"ID=%d\n" +"LUN=%d\n" +msgstr "" +"Tipo=%s\n" +"Revisión=%s\n" +"[Controladora SCSI]\n" +"Controladora=scsi%d\n" +"Canal=%d\n" +"ID=%d\n" +"LUN=%d\n" + +#: modules//devices/storage.c:169 +msgid "" +"\n" +"[IDE Disks]\n" +msgstr "" +"\n" +"[Discos IDE]\n" + +#: modules//devices/storage.c:242 +#, c-format +msgid "Driver=%s\n" +msgstr "Driver=%s\n" + +#: modules//devices/storage.c:314 +#, c-format +msgid "" +"Device Name=hd%c\n" +"Media=%s\n" +"Cache=%dkb\n" +msgstr "" +"Nombre del dispositivo=hd%c\n" +"Medio=%s\n" +"Cache=%dkb\n" + +#: modules//devices/storage.c:329 +#, c-format +msgid "" +"[Geometry]\n" +"Physical=%s\n" +"Logical=%s\n" +msgstr "" +"[GeometrÃa]\n" +"FÃsica=%s\n" +"Lógica=%s\n" + +#: modules//devices/storage.c:341 +#, c-format +msgid "" +"[Capabilities]\n" +"%s" +msgstr "" +"[Capacidades]\n" +"%s" + +#: modules//devices/storage.c:348 +#, c-format +msgid "" +"[Speeds]\n" +"%s" +msgstr "" +"[Velocidades]\n" +"%s" + +#: modules//network.c:59 +msgid "Interfaces" +msgstr "Interfaces" + +#: modules//network.c:60 +msgid "IP Connections" +msgstr "Conexiones IP" + +#: modules//network.c:61 +msgid "Routing Table" +msgstr "Tabla de ruteo" + +#: modules//network.c:62 +msgid "ARP Table" +msgstr "Tabla ARP" + +#: modules//network.c:63 +msgid "DNS Servers" +msgstr "Servidores DNS" + +#: modules//network.c:64 +msgid "Statistics" +msgstr "EstadÃsticas" + +#: modules//network.c:65 +msgid "Shared Directories" +msgstr "Directorios compartidos" + +#: modules//network.c:300 +#, c-format +msgid "" +"[ARP Table]\n" +"%s\n" +"[$ShellParam$]\n" +"ReloadInterval=3000\n" +"ColumnTitle$TextValue=IP Address\n" +"ColumnTitle$Value=Interface\n" +"ColumnTitle$Extra1=MAC Address\n" +"ShowColumnHeaders=true\n" +msgstr "" +"[Tabla ARP]\n" +"%s\n" +"[$ShellParam$]\n" +"ReloadInterval=3000\n" +"ColumnTitle$TextValue=Dirección IP\n" +"ColumnTitle$Value=Interfaz\n" +"ColumnTitle$Extra1=Dirección MAC\n" +"ShowColumnHeaders=true\n" + +#: modules//network.c:321 +#, c-format +msgid "" +"[Name servers]\n" +"%s\n" +"[$ShellParam$]\n" +"ColumnTitle$TextValue=IP Address\n" +"ColumnTitle$Value=Name\n" +"ShowColumnHeaders=true\n" +msgstr "" +"[Servidores de nombres]\n" +"%s\n" +"[$ShellParam$]\n" +"ColumnTitle$TextValue=IP Address\n" +"ColumnTitle$Value=Name\n" +"ShowColumnHeaders=true\n" + +#: modules//network.c:331 +#, c-format +msgid "" +"[Connections]\n" +"%s\n" +"[$ShellParam$]\n" +"ReloadInterval=3000\n" +"ColumnTitle$TextValue=Local Address\n" +"ColumnTitle$Value=Protocol\n" +"ColumnTitle$Extra1=Foreign Address\n" +"ColumnTitle$Extra2=State\n" +"ShowColumnHeaders=true\n" +msgstr "" +"[Conexiones]\n" +"%s\n" +"[$ShellParam$]\n" +"ReloadInterval=3000\n" +"ColumnTitle$TextValue=Local Address\n" +"ColumnTitle$Value=Protocol\n" +"ColumnTitle$Extra1=Foreign Address\n" +"ColumnTitle$Extra2=State\n" +"ShowColumnHeaders=true\n" + +#: modules//network.c:345 +#, c-format +msgid "" +"%s\n" +"[$ShellParam$]\n" +"ReloadInterval=3000\n" +"ViewType=1\n" +"ColumnTitle$TextValue=Interface\n" +"ColumnTitle$Value=IP Address\n" +"ColumnTitle$Extra1=Sent\n" +"ColumnTitle$Extra2=Received\n" +"ShowColumnHeaders=true\n" +"%s" +msgstr "" +"%s\n" +"[$ShellParam$]\n" +"ReloadInterval=3000\n" +"ViewType=1\n" +"ColumnTitle$TextValue=Interfaz\n" +"ColumnTitle$Value=Dirección IP\n" +"ColumnTitle$Extra1=Enviado\n" +"ColumnTitle$Extra2=Recibido\n" +"ShowColumnHeaders=true\n" +"%s" + +#: modules//network.c:361 +#, c-format +msgid "" +"[IP routing table]\n" +"%s\n" +"[$ShellParam$]\n" +"ViewType=0\n" +"ReloadInterval=3000\n" +"ColumnTitle$TextValue=Destination / Gateway\n" +"ColumnTitle$Value=Interface\n" +"ColumnTitle$Extra1=Flags\n" +"ColumnTitle$Extra2=Mask\n" +"ShowColumnHeaders=true\n" +msgstr "" +"[Tabla de ruteo IP]\n" +"%s\n" +"[$ShellParam$]\n" +"ViewType=0\n" +"ReloadInterval=3000\n" +"ColumnTitle$TextValue=Destino / Puerta de enlace\n" +"ColumnTitle$Value=Interfaz\n" +"ColumnTitle$Extra1=Flags\n" +"ColumnTitle$Extra2=Máscara\n" +"ShowColumnHeaders=true\n" + +#: modules//network.c:399 +msgid "Network" +msgstr "Red" + +#: modules//network.c:432 +msgid "Gathers information about this computer's network connection" +msgstr "Obtiene información sobre la conexión de red de esta computadora" + +#: modules//benchmark.c:50 +msgid "CPU Blowfish" +msgstr "" + +#: modules//benchmark.c:51 +msgid "CPU CryptoHash" +msgstr "" + +#: modules//benchmark.c:52 +msgid "CPU Fibonacci" +msgstr "" + +#: modules//benchmark.c:53 +msgid "CPU N-Queens" +msgstr "CPU N-Reinas" + +#: modules//benchmark.c:54 +msgid "FPU FFT" +msgstr "" + +#: modules//benchmark.c:55 +msgid "FPU Raytracing" +msgstr "FPU trazado de rayos" + +#: modules//benchmark.c:56 +msgid "GPU Drawing" +msgstr "GPU dibujo" + +#: modules//benchmark.c:222 +#, c-format +msgid "" +"[$ShellParam$]\n" +"Zebra=1\n" +"OrderType=%d\n" +"ViewType=3\n" +"ColumnTitle$Extra1=CPU Clock\n" +"ColumnTitle$Progress=Results\n" +"ColumnTitle$TextValue=CPU\n" +"ShowColumnHeaders=true\n" +"[%s]\n" +"<big><b>This Machine</b></big>=%.3f|%s MHz\n" +"%s" +msgstr "" +"[$ShellParam$]\n" +"Zebra=1\n" +"OrderType=%d\n" +"ViewType=3\n" +"ColumnTitle$Extra1=Reloj de la CPU\n" +"ColumnTitle$Progress=Resultados\n" +"ColumnTitle$TextValue=CPU\n" +"ShowColumnHeaders=true\n" +"[%s]\n" +"<big><b>Este equipo</b></big>=%.3f|%s MHz\n" +"%s" + +#: modules//benchmark.c:235 +#, c-format +msgid "" +"[$ShellParam$]\n" +"Zebra=1\n" +"OrderType=%d\n" +"ViewType=3\n" +"ColumnTitle$Extra1=CPU Clock\n" +"ColumnTitle$Progress=Results\n" +"ColumnTitle$TextValue=CPU\n" +"ShowColumnHeaders=true\n" +"[%s]\n" +"%s" +msgstr "" +"[$ShellParam$]\n" +"Zebra=1\n" +"OrderType=%d\n" +"ViewType=3\n" +"ColumnTitle$Extra1=Reloj del equipo CPU\n" +"ColumnTitle$Progress=Resultados\n" +"ColumnTitle$TextValue=CPU\n" +"ShowColumnHeaders=true\n" +"[%s]\n" +"%s" + +#: modules//benchmark.c:363 +#, c-format +msgid "Benchmarking: <b>%s</b>." +msgstr "Ejecutando benchmark: <b>%s</b>." + +#: modules//benchmark.c:377 +msgid "Benchmarking. Please do not move your mouse or press any keys." +msgstr "Ejecutando benchmarks. Por favor no mueva el mouse ni use el teclado." + +#: modules//benchmark.c:381 +msgid "Cancel" +msgstr "Cancelar" + +#: modules//benchmark.c:511 +msgid "Results in MiB/second. Higher is better." +msgstr "Resultados en MiB/segundo. Más alto es mejor." + +#: modules//benchmark.c:514 +msgid "Results in HIMarks. Higher is better." +msgstr "Resultados en HIMarks. Más alto es mejor." + +#: modules//benchmark.c:521 +msgid "Results in seconds. Lower is better." +msgstr "Resultados en segundos. Más bajo es mejor." + +#: modules//benchmark.c:529 +msgid "Benchmarks" +msgstr "Benchmarks" + +#: modules//benchmark.c:547 +msgid "Perform tasks and compare with other systems" +msgstr "Realizar tareas y comparar con otros sistemas" + +#: modules//benchmark.c:634 +msgid "Send benchmark results" +msgstr "Enviar resultados de los benchmark" + +#: modules//benchmark.c:639 +msgid "Receive benchmark results" +msgstr "Recibir resultados de los benchmark" + +#: hardinfo//util.c:102 +#: hardinfo//util.c:105 +#: hardinfo//util.c:110 +#, c-format +msgid "%d minute" +msgid_plural "%d minutes" +msgstr[0] "%d minuto" +msgstr[1] "%d minutos" + +#: hardinfo//util.c:104 +#, c-format +msgid "%d hour, " +msgid_plural "%d hours, " +msgstr[0] "%d hora, " +msgstr[1] "%d horas, " + +#: hardinfo//util.c:108 +#, c-format +msgid "%d day, " +msgid_plural "%d days, " +msgstr[0] "%d dÃa, " +msgstr[1] "%d dÃas, " + +#: hardinfo//util.c:109 +#, c-format +msgid "%d hour and " +msgid_plural "%d hours and " +msgstr[0] "%d hora y " +msgstr[1] "%d horas y " + +#: hardinfo//util.c:116 +#, c-format +msgid "%.1f B" +msgstr "" + +#: hardinfo//util.c:118 +#, c-format +msgid "%.1f KiB" +msgstr "" + +#: hardinfo//util.c:120 +#, c-format +msgid "%.1f MiB" +msgstr "" + +#: hardinfo//util.c:122 +#, c-format +msgid "%.1f GiB" +msgstr "" + +#: hardinfo//util.c:336 +msgid "Error" +msgstr "Error" + +#: hardinfo//util.c:336 +#: hardinfo//util.c:352 +msgid "Warning" +msgstr "Advertencia" + +#: hardinfo//util.c:351 +msgid "Fatal Error" +msgstr "Error fatal" + +#: hardinfo//util.c:376 +msgid "creates a report and prints to standard output" +msgstr "crea un reporte y lo imprime en la salida estándar" + +#: hardinfo//util.c:382 +msgid "chooses a report format (text, html)" +msgstr "elige un formato para el reporte (texto, html)" + +#: hardinfo//util.c:388 +msgid "run benchmark; requires benchmark.so to be loaded" +msgstr "correr benchmark; requiere benchmark.so para ser cargado" + +#: hardinfo//util.c:394 +msgid "lists modules" +msgstr "lista los módulos" + +#: hardinfo//util.c:400 +msgid "specify module to load" +msgstr "especificar módulo a cargar" + +#: hardinfo//util.c:406 +msgid "automatically load module dependencies" +msgstr "cargar automáticamente las dependencias de los módulos" + +#: hardinfo//util.c:413 +msgid "run in XML-RPC server mode" +msgstr "correr en modo servidor XML-RPC" + +#: hardinfo//util.c:420 +msgid "shows program version and quit" +msgstr "muestra la versión del programa y sale" + +#: hardinfo//util.c:425 +msgid "- System Profiler and Benchmark tool" +msgstr "- Analizador de sistema y herramienta de benchmark" + +#: hardinfo//util.c:435 +#, c-format +msgid "" +"Unrecognized arguments.\n" +"Try ``%s --help'' for more information.\n" +msgstr "" +"Argumentos no reconocidos.\n" +"Intente ``%s --help'' para más información.\n" + +#: hardinfo//util.c:501 +#, c-format +msgid "Couldn't find a Web browser to open URL %s." +msgstr "No se pudo encontrar un navegador Web para abrir la URL %s." + +#: hardinfo//util.c:848 +#, c-format +msgid "Module \"%s\" depends on module \"%s\", load it?" +msgstr "El módulo \"%s\" depende del módulo \"%s\", ¿desea cargarlo?" + +#: hardinfo//util.c:871 +#, c-format +msgid "Module \"%s\" depends on module \"%s\"." +msgstr "El módulo \"%s\" depende del módulo \"%s\"." + +#: hardinfo//util.c:916 +#, c-format +msgid "No module could be loaded. Check permissions on \"%s\" and try again." +msgstr "" +"No se puede cargar ningún módulo. Verifique los permisos en \"%s\" y " +"pruebe de nuevo." + +#: hardinfo//util.c:920 +msgid "" +"No module could be loaded. Please use hardinfo -l to list all available " +"modules and try again with a valid module list." +msgstr "" +"No se pudo cargar ningún módulo. Por favor use hardinfo -l para listar " +"todoslos módulos disponibles e intente de nuevo con una lista válida de " +"módulos." + +#: hardinfo//util.c:1096 +#, c-format +msgid "Scanning: %s..." +msgstr "Escaneando: %s..." + +#: hardinfo//hardinfo.c:54 +msgid "" +"Copyright (C) 2003-2009 Leandro A. F. Pereira. See COPYING for details.\n" +"\n" +msgstr "" +"Copyright (C) 2003-2009 Leandro A. F. Pereira. Vea COPYING para más " +"detalles.\n" +"\n" + +#: hardinfo//hardinfo.c:56 +#, c-format +msgid "" +"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" +msgstr "" +"Opciones de compilado:\n" +" Versión: %s (%s)\n" +" BinReloc habilitado: %s\n" +" Prefijo de datos: %s\n" +" Prefijo de bibliotecas: %s\n" +" Compilado en: %s %s (%s)\n" + +#: hardinfo//hardinfo.c:74 +#, c-format +msgid "" +"Failed to find runtime data.\n" +"\n" +"• Is HardInfo correctly installed?\n" +"• See if %s and %s exists and you have read permision." +msgstr "" +"Falló en encontrar datos del programa.\n" +"\n" +"• ¿HardInfo está correctamente instalado?\n" +"• Vea si %s y %s existen y usted tiene permisos de lectura." + +#: hardinfo//hardinfo.c:81 +#, c-format +msgid "" +"Modules:\n" +"%-20s%-15s%-12s\n" +msgstr "" +"Módulos:\n" +"%-20s%-15s%-12s\n" + +#: hardinfo//hardinfo.c:82 +msgid "File Name" +msgstr "Nombre de archivo" + +#: hardinfo//hardinfo.c:82 +msgid "Name" +msgstr "Nombre" + +#: hardinfo//hardinfo.c:82 +msgid "Version" +msgstr "Versión" + +#: hardinfo//hardinfo.c:135 +#, c-format +msgid "Unknown benchmark ``%s'' or libbenchmark.so not loaded" +msgstr "Benchmark desconocido ``%s'' o no se cargó libbenchmark.so" + +#: hardinfo//hardinfo.c:163 +msgid "Don't know what to do. Exiting." +msgstr "No se puede determinar que hacer. Saliendo." diff --git a/po/fr.po b/po/fr.po new file mode 100644 index 00000000..3faae3ad --- /dev/null +++ b/po/fr.po @@ -0,0 +1,1644 @@ +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# Yo L <http://kreizenn-dafar.org>, 2014. +# +msgid "" +msgstr "" +"Project-Id-Version: hardinfo\n" +"Report-Msgid-Bugs-To: https://github.com/lpereira/hardinfo\n" +"POT-Creation-Date: 2014-01-01\n" +"PO-Revision-Date: 2014-09-03\n" +"Last-Translator: yolateng0 @olala22000\n" +"Language-Team: LeFlood\n" +"Language: french\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" +"X-Generator: Poedit 1.5.4\n" +"X-Poedit-KeywordsList: HardInfo\n" + +#: shell//callbacks.c:71 +#, c-format +msgid "Remote: <b>%s</b>" +msgstr "Accès: <b>%s</b>" + +#: shell//callbacks.c:117 +msgid "Disconnecting..." +msgstr "Déconnexion ..." + +#: shell//callbacks.c:120 +msgid "Unloading modules..." +msgstr "Déconnexion des modules" + +#: shell//callbacks.c:123 +msgid "Loading local modules..." +msgstr "Chargement des modules locaux" + +#: shell//callbacks.c:130 +#: shell//callbacks.c:162 +#: shell//shell.c:314 +#: shell//shell.c:814 +#: shell//shell.c:1796 +#: modules//benchmark.c:431 +#: modules//benchmark.c:439 +#: hardinfo//util.c:1106 +msgid "Done." +msgstr "Réalisé." + +#: shell//callbacks.c:142 +msgid "Save Image" +msgstr "Sauvergarder l'image" + +#: shell//callbacks.c:158 +msgid "Saving image..." +msgstr "Sauvegarde de l'image" + +#: shell//callbacks.c:236 +msgid "No context help available." +msgstr "Pas d'aide disponible pour cela." + +#: shell//callbacks.c:318 +#, c-format +msgid "%s Module" +msgstr "%s Module" + +#: shell//callbacks.c:325 +#, c-format +msgid "" +"Written by %s\n" +"Licensed under %s" +msgstr "" +"Ecrit par %s\n" +"Sous Licence %s" + +#: shell//callbacks.c:339 +#, c-format +msgid "No about information is associated with the %s module." +msgstr "Pas d'information associée au module %s." + +#: shell//callbacks.c:353 +msgid "Author:" +msgstr "Auteur:" + +#: shell//callbacks.c:356 +msgid "Contributors:" +msgstr "Contributeurs:" + +#: shell//callbacks.c:360 +msgid "Based on work by:" +msgstr "Basé sur le travail de:" + +#: shell//callbacks.c:361 +msgid "MD5 implementation by Colin Plumb (see md5.c for details)" +msgstr "Implémentation MD5 par Colin Plumb (voir md5.c pour les détails)" + +#: shell//callbacks.c:362 +msgid "SHA1 implementation by Steve Reid (see sha1.c for details)" +msgstr "implémentation SHA1 par Steve Reid (voir sha1.c pour les détails)" + +#: shell//callbacks.c:363 +msgid "Blowfish implementation by Paul Kocher (see blowfich.c for details)" +msgstr "Implémentation Blowfish par Paul Kocher (voir blowchih.c pour de plus amples détails" + +#: shell//callbacks.c:364 +msgid "Raytracing benchmark by John Walker (see fbench.c for details)" +msgstr "Raytracing benchmark par John Walker (voir fbench.c pour de plus amples détails)" + +#: shell//callbacks.c:365 +msgid "FFT benchmark by Scott Robert Ladd (see fftbench.c for details)" +msgstr "FFT benchmark par Scott Robert Ladd (voir fftbench.c pour les détails)" + +#: shell//callbacks.c:366 +msgid "Some code partly based on x86cpucaps by Osamu Kayasono" +msgstr "Une partie du code est basé sur x86cpucaps par Osamu Kayasono" + +#: shell//callbacks.c:367 +msgid "Vendor list based on GtkSysInfo by Pissens Sebastien" +msgstr "La liste des fabricants est basée sur GtkSysInfo par Pissens Sebastien" + +#: shell//callbacks.c:368 +msgid "DMI support based on code by Stewart Adam" +msgstr "Les supports DMI sont basés sur le code de Stewart Adam" + +#: shell//callbacks.c:369 +msgid "SCSI support based on code by Pascal F. Martin" +msgstr "Les supports SCSI sont basés sur le code de Pascal F. Martin" + +#: shell//callbacks.c:373 +msgid "Jakub Szypulka" +msgstr "Jakub Szypulka" + +#: shell//callbacks.c:374 +msgid "Tango Project" +msgstr "Projet Tango" + +#: shell//callbacks.c:375 +msgid "The GNOME Project" +msgstr "Le Projet Gnome" + +#: shell//callbacks.c:376 +msgid "VMWare, Inc. (USB icon from VMWare Workstation 6)" +msgstr "VMWare, Inc. (USB icône sur VMWare Workstation 6)" + +#: shell//callbacks.c:387 +msgid "System information and benchmark tool" +msgstr "Information du systeme et outil d'évaluation" + +#: shell//callbacks.c:392 +msgid "" +"HardInfo 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.\n" +"\n" +"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. \n" +"\n" +"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" +msgstr "" +"HardInfo est un logiciel libre, vous pouvez le redistribuer et / ou le modifier sousles termes de la Licence Publique Générale GNU telle que publiée par la FreeSoftware Foundation, version 2 \n" +"\n" +"Ce programme est distribué dans l'espoir qu'il sera utile, mais SANS AUCUNE GARANTIE, sans même la garantie implicite de COMMERCIALISATION ou D'ADAPTATION À UN USAGE PARTICULIER. Voir la Licence Publique Générale GNU pour plus de détail. \n" +"\n" +"Vous devriez avoir reçu une copie de la Licence Publique Générale GNU avec ce programme; sinon, écrire à la Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA" + +#: shell//menu.c:35 +msgid "_Information" +msgstr "_Information" + +#: shell//menu.c:36 +msgid "_Remote" +msgstr "_Périphériques distants" + +#: shell//menu.c:37 +msgid "_View" +msgstr "_Voir" + +#: shell//menu.c:38 +msgid "_Help" +msgstr "_Aide" + +#: shell//menu.c:39 +msgid "About _Modules" +msgstr "A propos des _modules" + +#: shell//menu.c:43 +msgid "Generate _Report" +msgstr "Générer _Rapport" + +#: shell//menu.c:48 +msgid "_Network Updater..." +msgstr "_Mise à jour des données" + +#: shell//menu.c:53 +msgid "_Open..." +msgstr "_Ouvrir..." + +#: shell//menu.c:58 +msgid "_Connect to..." +msgstr "_Connection à ..." + +#: shell//menu.c:63 +msgid "_Manage hosts..." +msgstr "_Gestion hosts..." + +#: shell//menu.c:68 +msgid "_Local computer" +msgstr "_Ordinateur local..." + +#: shell//menu.c:73 +msgid "_Copy to Clipboard" +msgstr "_Copier dans le presse-papier" + +#: shell//menu.c:74 +msgid "Copy to clipboard" +msgstr "Copie dans le presse-papier" + +#: shell//menu.c:78 +msgid "_Save image as..." +msgstr "_Sauvegarde sous" + +#: shell//menu.c:83 +msgid "_Refresh" +msgstr "_Rafraichir" + +#: shell//menu.c:88 +msgid "Contents" +msgstr "Contenus" + +#: shell//menu.c:93 +#: shell//shell.c:1790 +#: shell//shell.c:1807 +msgid "Context help" +msgstr "Contenu de l'aide" + +#: shell//menu.c:98 +msgid "_Open HardInfo Web Site" +msgstr "_HardInfo Site Web" + +#: shell//menu.c:103 +msgid "_Report bug" +msgstr "_Rapporter un bug" + +#: shell//menu.c:108 +msgid "_Donate to the project" +msgstr "_Aider le projet" + +#: shell//menu.c:113 +msgid "_About HardInfo" +msgstr "_A Propos de HardInfo" + +#: shell//menu.c:114 +msgid "Displays program version information" +msgstr "Affiche les informations de version du programme" + +#: shell//menu.c:118 +msgid "_Quit" +msgstr "_Quitter" + +#: shell//menu.c:125 +msgid "_Side Pane" +msgstr "_Volet latéral" + +#: shell//menu.c:126 +msgid "Toggles side pane visibility" +msgstr "Basculer visibilité du panneau latéral " + +#: shell//menu.c:129 +msgid "_Toolbar" +msgstr "_Barre d'outils" + +#: shell//menu.c:133 +msgid "_Accept connections" +msgstr "_Accepter la connection" + +#: shell//report.c:492 +msgid "Save File" +msgstr "Sauvegarder le fichier" + +#: shell//report.c:616 +msgid "Cannot create ReportContext. Programming bug?" +msgstr "Impossible de créer un rapport général. Bug?" + +#: shell//report.c:634 +msgid "Open the report with your web browser?" +msgstr "Ouvrez le rapport avec votre navigateur Web?" + +#: shell//report.c:662 +msgid "Generating report..." +msgstr "Création du rapport..." + +#: shell//report.c:672 +msgid "Report saved." +msgstr "Rapport sauvegardé" + +#: shell//report.c:674 +msgid "Error while creating the report." +msgstr "Erreur lors de la création du rapport." + +#: shell//report.c:776 +msgid "Generate Report" +msgstr "Réalisation du Rapport" + +#: shell//report.c:793 +msgid "" +"<big><b>Generate Report</b></big>\n" +"Please choose the information that you wish to view in your report:" +msgstr "" +"<big> <b> Générer un rapport </b> </big> \n" +" S'il vous plaît choisissez les informations que vous souhaitez afficher dans votre rapport:" + +#: shell//report.c:853 +msgid "Select _None" +msgstr "Désélectionner _Tout" + +#: shell//report.c:860 +msgid "Select _All" +msgstr "Sélectionner _Tout" + +#: shell//report.c:878 +msgid "_Generate" +msgstr "_Création" + +#: shell//shell.c:407 +#, c-format +msgid "%s - System Information" +msgstr "%s - Informations du Système" + +#: shell//shell.c:412 +msgid "System Information" +msgstr "Informations du Système" + +#: shell//shell.c:801 +msgid "Loading modules..." +msgstr "Chargement des modules..." + +#: shell//shell.c:1650 +#, c-format +msgid "<b>%s → Summary</b>" +msgstr "<b>%s → Résumé</b>" + +#: shell//shell.c:1758 +msgid "Updating..." +msgstr "Mise à jour..." + +#: shell//syncmanager.c:69 +msgid "" +"<big><b>Synchronize with Central Database</b></big>\n" +"The following information may be synchronized with the HardInfo central database." +msgstr "" +"<big><b>Synchroniser avec la base de données centrale</b></big>\n" +"Les informations suivantes seront synchronisées avec la base de données de HardInfo." + +#: shell//syncmanager.c:72 +msgid "" +"<big><b>Synchronizing</b></big>\n" +"This may take some time." +msgstr "" +"<big><b>Synchronisation</b></big>\n" +"Cela peut prendre un certain temps." + +#: shell//syncmanager.c:132 +msgid "HardInfo was compiled without libsoup support. (Network Updater requires it.)" +msgstr "HARDiNFO a été compilé sans le support libsoup. (Mise à jour des données l'exige.)" + +#: shell//syncmanager.c:161 +#: shell//syncmanager.c:185 +#, c-format +msgid "%s (error #%d)" +msgstr "%s (erreur #%d)" + +#: shell//syncmanager.c:170 +#: shell//syncmanager.c:194 +msgid "Could not parse XML-RPC response" +msgstr "Impossible d'analyser la réponse XML-RPC" + +#: shell//syncmanager.c:267 +#, c-format +msgid "Server says it supports API version %d, but this version of HardInfo only supports API version %d." +msgstr "Le serveur dit qu'il supporte la version de l'API %d, mais cette version de HARDiNFO supporte seulement le support version de l'API %d." + +#: shell//syncmanager.c:362 +msgid "Contacting HardInfo Central Database" +msgstr "En contact avec la base de données centrale du site HARDiNFO" + +#: shell//syncmanager.c:363 +msgid "Cleaning up" +msgstr "Nettoyage" + +#: shell//syncmanager.c:480 +#, c-format +msgid "<s>%s</s> <i>(canceled)</i>" +msgstr "<s>%s</s> <i> (annuler) </i>" + +#: shell//syncmanager.c:497 +#, c-format +msgid "<b><s>%s</s></b> <i>(failed)</i>" +msgstr "<b><s>%s</s></b> <i>(Echec)</i>" + +#: shell//syncmanager.c:509 +#, c-format +msgid "" +"Failed while performing \"%s\". Please file a bug report if this problem persists. (Use the Help→Report bug option.)\n" +"\n" +"Details: %s" +msgstr "" +"Échec lors de l'exécution de \"%s\". S'il vous plaît remplissez un rapport de bug si ce problème persiste. (Utilisez l'option Aide → Rapport de Bug.)\n" +"\n" +"Détails: %s" + +#: shell//syncmanager.c:518 +#, c-format +msgid "Failed while performing \"%s\". Please file a bug report if this problem persists. (Use the Help→Report bug option.)" +msgstr "Échec lors de l'exécution de \"%s\". S'il vous plaît remplissez un rapport de bug si ce problème persiste. (Utilisez l'option Aide → Rapport de Bug.)" + +#: shell//syncmanager.c:646 +msgid "Network Updater" +msgstr "Mises à jour" + +#: shell//syncmanager.c:727 +msgid "_Synchronize" +msgstr "_Synchronisation" + +#: modules//benchmark.c:50 +msgid "CPU Blowfish" +msgstr "Test CPU Blowfish" + +#: modules//benchmark.c:51 +msgid "CPU CryptoHash" +msgstr "Test CPU CryptoHash" + +#: modules//benchmark.c:52 +msgid "CPU Fibonacci" +msgstr "Test CPU Fibonacci " + +#: modules//benchmark.c:53 +msgid "CPU N-Queens" +msgstr "Test CPU N-Queens" + +#: modules//benchmark.c:54 +msgid "FPU FFT" +msgstr "Test FPU FFT" + +#: modules//benchmark.c:55 +msgid "FPU Raytracing" +msgstr "Test FPU Raytracing" + +#: modules//benchmark.c:56 +msgid "GPU Drawing" +msgstr "Test GPU Drawing" + +#: modules//benchmark.c:222 +#, c-format +msgid "" +"[$ShellParam$]\n" +"Zebra=1\n" +"OrderType=%d\n" +"ViewType=3\n" +"ColumnTitle$Extra1=CPU Clock\n" +"ColumnTitle$Progress=Results\n" +"ColumnTitle$TextValue=CPU\n" +"ShowColumnHeaders=true\n" +"[%s]\n" +"<big><b>This Machine</b></big>=%.3f|%s MHz\n" +"%s" +msgstr "" +"[$ShellParam$]\n" +"Zebra=1\n" +"OrderType=%d\n" +"ViewType=3\n" +"ColumnTitle$Extra1=CPU Clock\n" +"ColumnTitle$Progress=Results\n" +"ColumnTitle$TextValue=CPU\n" +"ShowColumnHeaders=true\n" +"[%s]\n" +"<big><b>Cet Ordinateur</b></big>=%.3f|%s MHz\n" +"%s" + +#: modules//benchmark.c:235 +#, c-format +msgid "" +"[$ShellParam$]\n" +"Zebra=1\n" +"OrderType=%d\n" +"ViewType=3\n" +"ColumnTitle$Extra1=CPU Clock\n" +"ColumnTitle$Progress=Results\n" +"ColumnTitle$TextValue=CPU\n" +"ShowColumnHeaders=true\n" +"[%s]\n" +"%s" +msgstr "" +"[$ShellParam$]\n" +"Zebra=1\n" +"OrderType=%d\n" +"ViewType=3\n" +"ColumnTitle$Extra1=CPU Clock\n" +"ColumnTitle$Progress=Results\n" +"ColumnTitle$TextValue=CPU\n" +"ShowColumnHeaders=true\n" +"[%s]\n" +"%s" + +#: modules//benchmark.c:363 +#, c-format +msgid "Benchmarking: <b>%s</b>." +msgstr "Benchmarking: <b>%s</b>." + +#: modules//benchmark.c:377 +msgid "Benchmarking. Please do not move your mouse or press any keys." +msgstr "Benchmarking. S'il vous plaît ne pas déplacer votre souris ou appuyer sur les touches" + +#: modules//benchmark.c:381 +msgid "Cancel" +msgstr "Annuler" + +#: modules//benchmark.c:511 +msgid "Results in MiB/second. Higher is better." +msgstr "Résultats en MiB/seconde. Plus c'est élevé meilleur c'est." + +#: modules//benchmark.c:514 +msgid "Results in HIMarks. Higher is better." +msgstr "Résultats en HIMarks. Plus c'est élevé meilleur c'est." + +#: modules//benchmark.c:521 +msgid "Results in seconds. Lower is better." +msgstr "Résultats en secondes. Plus c'est bas meilleur c'est." + +#: modules//benchmark.c:529 +msgid "Benchmarks" +msgstr "Benchmarks" + +#: modules//benchmark.c:547 +msgid "Perform tasks and compare with other systems" +msgstr "Effectuer des tâches et les comparer avec d'autres systèmes" + +#: modules//benchmark.c:634 +msgid "Send benchmark results" +msgstr "Envoyer vos résultats de référence" + +#: modules//benchmark.c:639 +msgid "Receive benchmark results" +msgstr "Recevoir les résultats de benchmark" + +#: modules//computer/alsa.c:26 +msgid "[Audio Devices]\n" +msgstr "[Audio Devices]\n" + +#: modules//computer/alsa.c:33 +#, c-format +msgid "Audio Adapter#%d=%s\n" +msgstr "Adapteur Audio#%d=%s\n" + +#: modules//computer/boots.c:33 +msgid "[Boots]\n" +msgstr "[Boots]\n" + +#: modules//computer/display.c:83 +msgid "vendor string" +msgstr "fabricant" + +#: modules//computer/display.c:84 +msgid "X.Org version" +msgstr "version de X.Org" + +#: modules//computer/display.c:85 +msgid "XFree86 version" +msgstr "version de XFree86 " + +#: modules//computer/display.c:122 +#, c-format +msgid "Monitor %d=%dx%d pixels\n" +msgstr "Moniteur %d=%dx%d pixels\n" + +#: modules//computer/environment.c:32 +msgid "[Environment Variables]\n" +msgstr "[Environment Variables]\n" + +#: modules//computer/os.c:49 +#, c-format +msgid "GNU C Library version %s (%sstable)" +msgstr "GNU C Library version %s (%sstable)" + +#: modules//computer/os.c:51 +msgid "un" +msgstr "un" + +#: modules//computer/os.c:53 +#: modules//computer/os.c:130 +#: modules//devices/printers.c:99 +#: modules//devices/printers.c:106 +#: modules//devices/printers.c:116 +#: modules//devices/printers.c:131 +#: modules//devices/printers.c:140 +#: modules//devices/printers.c:243 +#: modules//devices.c:154 +#: modules//devices.c:197 +msgid "Unknown" +msgstr "Inconnu" + +#: modules//computer/os.c:72 +#, c-format +msgid "Version: %s" +msgstr "Version: %s" + +#: modules//computer/os.c:106 +msgid "Terminal" +msgstr "Terminal" + +#: modules//computer/os.c:126 +#, c-format +msgid "Unknown (Window Manager: %s)" +msgstr "Unknown (gestionnaire de fenêtres: %s)" + +#: modules//computer/os.c:166 +msgid "Unknown distribution" +msgstr "Distribution inconnue" + +#: modules//computer.c:68 +msgid "Summary" +msgstr "Résumé" + +#: modules//computer.c:69 +msgid "Operating System" +msgstr "Systeme d'exploitation" + +#: modules//computer.c:70 +msgid "Kernel Modules" +msgstr "Modules du kernel" + +#: modules//computer.c:71 +msgid "Boots" +msgstr "Boots" + +#: modules//computer.c:72 +msgid "Languages" +msgstr "Langues" + +#: modules//computer.c:73 +msgid "Filesystems" +msgstr "Fichiers Systeme" + +#: modules//computer.c:74 +msgid "Display" +msgstr "Affichage" + +#: modules//computer.c:75 +msgid "Environment Variables" +msgstr "Variables d'environnement" + +#: modules//computer.c:77 +msgid "Development" +msgstr "Developpement" + +#: modules//computer.c:79 +msgid "Users" +msgstr "Utilisateurs" + +#: modules//computer.c:80 +msgid "Groups" +msgstr "Groupes" + +#: modules//computer.c:104 +#, c-format +msgid "%dMB (%dMB used)" +msgstr "%dMB (%dMB utilisé)" + +#: modules//computer.c:200 +msgid "Scripting Languages" +msgstr "Type de script" + +#: modules//computer.c:201 +msgid "CPython" +msgstr "CPython" + +#: modules//computer.c:202 +msgid "Perl" +msgstr "Perl" + +#: modules//computer.c:203 +msgid "PHP" +msgstr "PHP" + +#: modules//computer.c:204 +msgid "Ruby" +msgstr "Ruby" + +#: modules//computer.c:205 +msgid "Bash" +msgstr "Bash" + +#: modules//computer.c:206 +msgid "Compilers" +msgstr "Compilateurs" + +#: modules//computer.c:207 +msgid "C (GCC)" +msgstr "C (GCC)" + +#: modules//computer.c:208 +msgid "Java" +msgstr "Java" + +#: modules//computer.c:209 +msgid "CSharp (Mono, old)" +msgstr "CSharp (Mono, old)" + +#: modules//computer.c:210 +msgid "CSharp (Mono)" +msgstr "CSharp (Mono)" + +#: modules//computer.c:211 +msgid "Vala" +msgstr "Vala" + +#: modules//computer.c:212 +msgid "Haskell (GHC)" +msgstr "Haskell (GHC)" + +#: modules//computer.c:213 +msgid "FreePascal" +msgstr "FreePascal" + +#: modules//computer.c:214 +msgid "Tools" +msgstr "Outils" + +#: modules//computer.c:262 +#, c-format +msgid "%s=Not found\n" +msgstr "%s=Non trouvé\n" + +#: modules//computer.c:265 +#, c-format +msgid "Detecting version: %s" +msgstr "Version détectée: %s" + +#: modules//computer.c:276 +#, c-format +msgid "" +"[$ShellParam$]\n" +"ColumnTitle$TextValue=Program\n" +"ColumnTitle$Value=Version\n" +"ShowColumnHeaders=true\n" +"%s" +msgstr "" +"[$ShellParam$]\n" +"ColumnTitle$TextValue=Programme\n" +"ColumnTitle$Value=Version\n" +"ShowColumnHeaders=true\n" +"%s" + +#: modules//computer.c:356 +msgid "Physical machine" +msgstr "Machine physique" + +#: modules//computer.c:373 +#, c-format +msgid "" +"[$ShellParam$]\n" +"UpdateInterval$Memory=1000\n" +"UpdateInterval$Date/Time=1000\n" +"#ReloadInterval=5000\n" +"[Computer]\n" +"Processor=%s\n" +"Memory=...\n" +"Machine Type=%s\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" +"\n" +"%s\n" +"[Input Devices]\n" +"%s\n" +"\n" +"%s\n" +"\n" +"%s\n" +msgstr "" +"[$ShellParam$]\n" +"UpdateInterval$Memory=1000\n" +"UpdateInterval$Date/Time=1000\n" +"#ReloadInterval=5000\n" +"[Computer]\n" +"Processeur=%s\n" +"Memoire=...\n" +"Machine Type=%s\n" +"Systeme d'exploitation=%s\n" +"Utilisateur=%s\n" +"Date/Heure=...\n" +"[Display]\n" +"Résolution=%dx%d pixels\n" +"OpenGL Renderer=%s\n" +"X11 Vendor=%s\n" +"\n" +"%s\n" +"[Input Devices]\n" +"%s\n" +"\n" +"%s\n" +"\n" +"%s\n" + +#: modules//computer.c:415 +#, c-format +msgid "" +"[$ShellParam$]\n" +"UpdateInterval$Uptime=10000\n" +"UpdateInterval$Load Average=1000\n" +"[Version]\n" +"Kernel=%s\n" +"Version=%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=..." +msgstr "" +"[$ShellParam$]\n" +"UpdateInterval$Uptime=10000\n" +"UpdateInterval$Load Average=1000\n" +"[Version]\n" +"Kernel=%s\n" +"Version=%s\n" +"C Library=%s\n" +"Distribution=%s\n" +"[Current Session]\n" +"Ordinateur=%s\n" +"Utilisateur=%s\n" +"#Language=%s\n" +"Dossier Home=%s\n" +"Environnement de bureau=%s\n" +"[Misc]\n" +"durée de fonctionnent=...\n" +"Charge moyenne=..." + +#: modules//computer.c:444 +#, c-format +msgid "" +"[Loaded Modules]\n" +"%s[$ShellParam$]\n" +"ViewType=1\n" +"ColumnTitle$TextValue=Name\n" +"ColumnTitle$Value=Description\n" +"ShowColumnHeaders=true\n" +msgstr "" +"[Loaded Modules]\n" +"%s[$ShellParam$]\n" +"ViewType=1\n" +"ColumnTitle$TextValue=Name\n" +"ColumnTitle$Value=Description\n" +"ShowColumnHeaders=true\n" + +#: modules//computer.c:455 +#, c-format +msgid "" +"[$ShellParam$]\n" +"ColumnTitle$TextValue=Date & Time\n" +"ColumnTitle$Value=Kernel Version\n" +"ShowColumnHeaders=true\n" +"\n" +"%s" +msgstr "" +"[$ShellParam$]\n" +"ColumnTitle$TextValue=Date & Time\n" +"ColumnTitle$Value=Kernel Version\n" +"ShowColumnHeaders=true\n" +"\n" +"%s" + +#: modules//computer.c:465 +#, c-format +msgid "" +"[$ShellParam$]\n" +"ViewType=1\n" +"ColumnTitle$TextValue=Language Code\n" +"ColumnTitle$Value=Name\n" +"ShowColumnHeaders=true\n" +"[Available Languages]\n" +"%s" +msgstr "" +"[$ShellParam$]\n" +"ViewType=1\n" +"ColumnTitle$TextValue=Type Code\n" +"ColumnTitle$Value=Nom\n" +"ShowColumnHeaders=true\n" +"[Available Langages]\n" +"%s" + +#: modules//computer.c:476 +#, c-format +msgid "" +"[$ShellParam$]\n" +"ViewType=4\n" +"ReloadInterval=5000\n" +"Zebra=1\n" +"NormalizePercentage=false\n" +"ColumnTitle$Extra1=Mount Point\n" +"ColumnTitle$Progress=Usage\n" +"ColumnTitle$TextValue=Device\n" +"ShowColumnHeaders=true\n" +"[Mounted File Systems]\n" +"%s\n" +msgstr "" +"[$ShellParam$]\n" +"ViewType=4\n" +"ReloadInterval=5000\n" +"Zebra=1\n" +"NormalizePercentage=false\n" +"ColumnTitle$Extra1=Point de montage\n" +"ColumnTitle$Progress=Usage\n" +"ColumnTitle$TextValue=Périphérique\n" +"ShowColumnHeaders=true\n" +"[Mounted File Systems]\n" +"%s\n" + +#: modules//computer.c:490 +#, c-format +msgid "" +"[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" +msgstr "" +"[Affichage]\n" +"Resolution=%dx%d pixels\n" +"Fabricant=%s\n" +"Version=%s\n" +"[Monitors]\n" +"%s[Extensions]\n" +"%s[OpenGL]\n" +"Vendeur=%s\n" +"Renderer=%s\n" +"Version=%s\n" +"Direct Rendering=%s\n" + +#: modules//computer.c:512 +msgid "Y_es" +msgstr "O_ui" + +#: modules//computer.c:512 +#: modules//devices/printers.c:138 +#: hardinfo//hardinfo.c:63 +msgid "No" +msgstr "Non" + +#: modules//computer.c:526 +#, c-format +msgid "" +"[$ShellParam$]\n" +"ReloadInterval=10000\n" +"ColumnTitle$TextValue=Name\n" +"ColumnTitle$Value=Group ID\n" +"ShowColumnHeaders=true\n" +"[Groups]\n" +"%s\n" +msgstr "" +"[$ShellParam$]\n" +"ReloadInterval=10000\n" +"ColumnTitle$TextValue=Nom\n" +"ColumnTitle$Value=Group ID\n" +"ShowColumnHeaders=true\n" +"[Groups]\n" +"%s\n" + +#: modules//computer.c:606 +msgid "Computer" +msgstr "Ordinateur" + +#: modules//computer.c:700 +msgid "Gathers high-level computer information" +msgstr "Collecte des informations de l'ordinateur" + +#: modules//devices/battery.c:181 +#, c-format +msgid "" +"\n" +"[Battery: %s]\n" +"State=%s (load: %s)\n" +"Capacity=%s / %s (%.2f%%)\n" +"Battery Technology=%s (%s)\n" +"Manufacturer=%s\n" +"Model Number=%s\n" +"Serial Number=%s\n" +msgstr "" +"\n" +"[Battery: %s]\n" +"Etat=%s (load: %s)\n" +"Capacité=%s / %s (%.2f%%)\n" +"Technologie=%s (%s)\n" +"Fabriquant=%s\n" +"Modele=%s\n" +"Numéro de série=%s\n" + +#: modules//devices/battery.c:266 +#, c-format +msgid "" +"\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" +msgstr"" +"\n" +"[Battery (APM)]\n" +"Charge=%d%%\n" +"Charge restante=%s of %s\n" +"Etat=%s\n" +"APM driver version=%s\n" +"APM BIOS version=%s\n" + +#: modules//devices/battery.c:278 +#, c-format +msgid "" +"\n" +"[Battery (APM)]\n" +"Charge=%d%%\n" +"Using=%s\n" +"APM driver version=%s\n" +"APM BIOS version=%s\n" +msgstr "" +"\n" +"[Battery (APM)]\n" +"Charge=%d%%\n" +"Etat=%s\n" +"APM driver version=%s\n" +"APM BIOS version=%s\n" + +#: modules//devices/battery.c:304 +msgid "" +"[No batteries]\n" +"No batteries found on this system=\n" +msgstr "" +"[Aucune batterie]\n" +"Aucune batterie trouvée sur ce système=\n" + +#: modules//devices/printers.c:81 +msgid "⚬ Can do black and white printing=\n" +msgstr "⚬ Impression en noir et blanc =\n" + +#: modules//devices/printers.c:83 +msgid "⚬ Can do color printing=\n" +msgstr "⚬ Imprimer en couleur=\n" + +#: modules//devices/printers.c:85 +msgid "⚬ Can do duplexing=\n" +msgstr "⚬ Imprimer recto verso=\n" + +#: modules//devices/printers.c:87 +msgid "⚬ Can do staple output=\n" +msgstr "⚬ Agrafer les feuilles imprimées=\n" + +#: modules//devices/printers.c:89 +msgid "⚬ Can do copies=\n" +msgstr "⚬ Réaliser copies=\n" + +#: modules//devices/printers.c:91 +msgid "⚬ Can collate copies=\n" +msgstr "⚬ Assembler des copies=\n" + +#: modules//devices/printers.c:93 +msgid "⚬ Printer is rejecting jobs=\n" +msgstr "⚬ Imprimante rejette cette tâche=\n" + +#: modules//devices/printers.c:95 +msgid "⚬ Printer was automatically discovered and added=\n" +msgstr "⚬ Imprimante a été automatiquement détecté et ajouté=\n" + +#: modules//devices/printers.c:110 +msgid "Idle" +msgstr "Inoccupé" + +#: modules//devices/printers.c:112 +msgid "Printing a Job" +msgstr "Impression" + +#: modules//devices/printers.c:114 +msgid "Stopped" +msgstr "Arrêt" + +#: modules//devices/printers.c:138 +#: hardinfo//hardinfo.c:62 +#: hardinfo//hardinfo.c:63 +msgid "Yes" +msgstr "Oui" + +#: modules//devices/printers.c:190 +msgid "" +"[Printers]\n" +"No suitable CUPS library found=" +msgstr "" +"[Printers]\n" +"Aucune suite de librairie CUPS trouvée=" + +#: modules//devices/printers.c:200 +msgid "[Printers (CUPS)]\n" +msgstr "[Printers (CUPS)]\n" + +#: modules//devices/printers.c:263 +msgid "" +"[Printers]\n" +"No printers found=\n" +msgstr "" +"[Printers]\n" +"Aucune imprimante trouvée=\n" + +#: modules//devices/storage.c:46 +msgid "" +"\n" +"[SCSI Disks]\n" +msgstr "" +"\n" +"[SCSI Disks]\n" + +#: modules//devices/storage.c:110 +#: modules//devices/storage.c:297 +#, c-format +msgid "" +"[Device Information]\n" +"Model=%s\n" +msgstr "" +"[Device Information]\n" +"Modele=%s\n" + +#: modules//devices/storage.c:115 +#: modules//devices/storage.c:304 +#, c-format +msgid "Vendor=%s (%s)\n" +msgstr "Vendeur=%s (%s)\n" + +#: modules//devices/storage.c:120 +#: modules//devices/storage.c:309 +#, c-format +msgid "Vendor=%s\n" +msgstr "Vendeur=%s\n" + +#: modules//devices/storage.c:125 +#, c-format +msgid "" +"Type=%s\n" +"Revision=%s\n" +"[SCSI Controller]\n" +"Controller=scsi%d\n" +"Channel=%d\n" +"ID=%d\n" +"LUN=%d\n" +msgstr "" +"Type=%s\n" +"Revision=%s\n" +"[SCSI Controller]\n" +"Controleur=scsi%d\n" +"Channel=%d\n" +"ID=%d\n" +"LUN=%d\n" + +#: modules//devices/storage.c:169 +msgid "" +"\n" +"[IDE Disks]\n" +msgstr "" +"\n" +"[IDE Disks]\n" + +#: modules//devices/storage.c:242 +#, c-format +msgid "Driver=%s\n" +msgstr "Driver=%s\n" + +#: modules//devices/storage.c:314 +#, c-format +msgid "" +"Devise Name=hd%c\n" +"Media=%s\n" +"Cache=%dkb\n" +msgstr "" +"Nom Périphérique=hd%c\n" +"Media=%s\n" +"Cache=%dkb\n" + +#: modules//devices/storage.c:329 +#, c-format +msgid "" +"[Geometry]\n" +"Physical=%s\n" +"Logical=%s\n" +msgstr "" +"[Geometry]\n" +"Physique=%s\n" +"Logique=%s\n" + +#: modules//devices/storage.c:341 +#, c-format +msgid "" +"[Capabilities]\n" +"%s" +msgstr "" +"[Capabilities]\n" +"%s" + +#: modules//devices/storage.c:348 +#, c-format +msgid "" +"[Speeds]\n" +"%s" +msgstr "" +"[Speeds]\n" +"%s" + +#: modules//devices.c:74 +msgid "Processor" +msgstr "Processeur" + +#: modules//devices.c:75 +msgid "Memory" +msgstr "Mémoire" + +#: modules//devices.c:76 +msgid "PCI Devices" +msgstr "Périphériques PCI" + +#: modules//devices.c:77 +msgid "USB Devices" +msgstr "Périphériques USB" + +#: modules//devices.c:78 +msgid "Printers" +msgstr "Imprimantes" + +#: modules//devices.c:79 +msgid "Battery" +msgstr "Batterie" + +#: modules//devices.c:80 +msgid "Sensors" +msgstr "Capteurs" + +#: modules//devices.c:81 +msgid "Input Devices" +msgstr "Périphériques d'entrée" + +#: modules//devices.c:82 +msgid "Storage" +msgstr "Stockage" + +#: modules//devices.c:84 +msgid "DMI" +msgstr "DMI" + +#: modules//devices.c:85 +msgid "Memory SPD" +msgstr "Mémoire SPD" + +#: modules//devices.c:87 +msgid "Resources" +msgstr "Ressources" + +#: modules//devices.c:178 +msgid "Total Memory" +msgstr "Mémoire totale" + +#: modules//devices.c:193 +msgid " (vendor unknown)" +msgstr " (Fabricant inconnu)" + +#: modules//devices.c:195 +msgid " (model unknown)" +msgstr " (modèle inconnu)" + +#: modules//devices.c:412 +msgid "Devices" +msgstr "Périphériques" + +#: modules//devices.c:424 +msgid "Update PCI ID listing" +msgstr "Mise à jour de la liste ID PCI " + +#: modules//devices.c:436 +msgid "Update CPU feature database" +msgstr "Mise à jour des bases de données caractéristiques CPU" + +#: modules//devices.c:464 +msgid "Gathers information about hardware devices" +msgstr "Collecte des informations des périphériques" + +#: modules//network.c:59 +msgid "Interfaces" +msgstr "Interfaces" + +#: modules//network.c:60 +msgid "IP Connections" +msgstr "Connections IP" + +#: modules//network.c:61 +msgid "Routing Table" +msgstr "Table de Routage" + +#: modules//network.c:62 +msgid "ARP Table" +msgstr "Table ARP" + +#: modules//network.c:63 +msgid "DNS Servers" +msgstr "Serveurs DNS" + +#: modules//network.c:64 +msgid "Statistics" +msgstr "Statistiques" + +#: modules//network.c:65 +msgid "Shared Directories" +msgstr "Dossiers d'interopérabilités" + +#: modules//network.c:300 +#, c-format +msgid "" +"[ARP Table]\n" +"%s\n" +"[$ShellParam$]\n" +"ReloadInterval=3000\n" +"ColumnTitle$TextValue=IP Address\n" +"ColumnTitle$Value=Interface\n" +"ColumnTitle$Extra1=MAC Address\n" +"ShowColumnHeaders=true\n" +msgstr "" +"[ARP Table]\n" +"%s\n" +"[$ShellParam$]\n" +"ReloadInterval=3000\n" +"ColumnTitle$TextValue=IP Addresse\n" +"ColumnTitle$Value=Interface\n" +"ColumnTitle$Extra1=MAC Address\n" +"ShowColumnHeaders=true\n" + +#: modules//network.c:321 +#, c-format +msgid "" +"[Name servers]\n" +"%s\n" +"[$ShellParam$]\n" +"ColumnTitle$TextValue=IP Address\n" +"ColumnTitle$Value=Name\n" +"ShowColumnHeaders=true\n" +msgstr "" +"[Name servers]\n" +"%s\n" +"[$ShellParam$]\n" +"ColumnTitle$TextValue=IP Address\n" +"ColumnTitle$Value=Name\n" +"ShowColumnHeaders=true\n" + +#: modules//network.c:331 +#, c-format +msgid "" +"[Connections]\n" +"%s\n" +"[$ShellParam$]\n" +"ReloadInterval=3000\n" +"ColumnTitle$TextValue=Local Address\n" +"ColumnTitle$Value=Protocol\n" +"ColumnTitle$Extra1=Foreign Address\n" +"ColumnTitle$Extra2=State\n" +"ShowColumnHeaders=true\n" +msgstr "" +"[Connections]\n" +"%s\n" +"[$ShellParam$]\n" +"ReloadInterval=3000\n" +"ColumnTitle$TextValue=Local Address\n" +"ColumnTitle$Value=Protocol\n" +"ColumnTitle$Extra1=Foreign Address\n" +"ColumnTitle$Extra2=State\n" +"ShowColumnHeaders=true\n" + +#: modules//network.c:345 +#, c-format +msgid "" +"%s\n" +"[$ShellParam$]\n" +"ReloadInterval=3000\n" +"ViewType=1\n" +"ColumnTitle$TextValue=Interface\n" +"ColumnTitle$Value=IP Address\n" +"ColumnTitle$Extra1=Sent\n" +"ColumnTitle$Extra2=Received\n" +"ShowColumnHeaders=true\n" +"%s" +msgstr "" +"%s\n" +"[$ShellParam$]\n" +"ReloadInterval=3000\n" +"ViewType=1\n" +"ColumnTitle$TextValue=Interface\n" +"ColumnTitle$Value=Addresse IP\n" +"ColumnTitle$Extra1=Envoyé\n" +"ColumnTitle$Extra2=Reçue\n" +"ShowColumnHeaders=true\n" +"%s" + +#: modules//network.c:361 +#, c-format +msgid "" +"[IP routing table]\n" +"%s\n" +"[$ShellParam$]\n" +"ViewType=0\n" +"ReloadInterval=3000\n" +"ColumnTitle$TextValue=Destination / Gateway\n" +"ColumnTitle$Value=Interface\n" +"ColumnTitle$Extra1=Flags\n" +"ColumnTitle$Extra2=Mask\n" +"ShowColumnHeaders=true\n" +msgstr "" + +#: modules//network.c:399 +msgid "Network" +msgstr "Réseau" + +#: modules//network.c:432 +msgid "Gathers information about this computer's network connection" +msgstr "Collecte des informations sur les connexions réseau de cet ordinateur" + +#: hardinfo//hardinfo.c:54 +msgid "" +"Copyright (C) 2003-2009 Leandro A. F. Pereira. See COPYING for details.\n" +"\n" +msgstr "" +"Copyright (C) 2003-2009 Leandro A. F. Pereira. voir COPYING pour les details.\n" +"\n" + +#: hardinfo//hardinfo.c:56 +#, c-format +msgid "" +"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" +msgstr "" +"Compile-time options:\n" +" Version: %s (%s)\n" +" BinReloc activé: %s\n" +" Data prefix: %s\n" +" Library prefix: %s\n" +" Compilation: %s %s (%s)\n" + +#: hardinfo//hardinfo.c:74 +#, c-format +msgid "" +"Failed to find runtime data.\n" +"\n" +"• Is HardInfo correctly installed?\n" +"• See if %s and %s exists and you have read permision." +msgstr "" +"Impossible de trouver les données d'exécution.\n" +"\n" +"• Est ce que HardInfo est correctement installé?\n" +"• Voir si %s et %s existes et que vous avez bien les privilèges." + +#: hardinfo//hardinfo.c:81 +#, c-format +msgid "" +"Modules:\n" +"%-20s%-15s%-12s\n" +msgstr "" +"Modules:\n" +"%-20s%-15s%-12s\n" + +#: hardinfo//hardinfo.c:82 +msgid "File Name" +msgstr "Nom du fichier" + +#: hardinfo//hardinfo.c:82 +msgid "Name" +msgstr "Nom" + +#: hardinfo//hardinfo.c:82 +msgid "Version" +msgstr "Version" + +#: hardinfo//hardinfo.c:135 +#, c-format +msgid "Unknown benchmark ``%s'' or libbenchmark.so not loaded" +msgstr "Benchmark inconnu ``%s'' ou libbenchmark.so non chargé" + +#: hardinfo//hardinfo.c:163 +msgid "Don't know what to do. Exiting." +msgstr "Que faire. Sortie." + +#: hardinfo//util.c:102 +#: hardinfo//util.c:105 +#: hardinfo//util.c:110 +#, c-format +msgid "%d minute" +msgid_plural "%d minutes" +msgstr[0] "%d minute" +msgstr[1] "%d minutes" + +#: hardinfo//util.c:104 +#, c-format +msgid "%d hour, " +msgid_plural "%d hours, " +msgstr[0] "%d heure, " +msgstr[1] "%d heures, " + +#: hardinfo//util.c:108 +#, c-format +msgid "%d day, " +msgid_plural "%d days, " +msgstr[0] "%d jour, " +msgstr[1] "%d jours, " + +#: hardinfo//util.c:109 +#, c-format +msgid "%d hour and " +msgid_plural "%d hours and " +msgstr[0] "%d heure et " +msgstr[1] "%d heures et " + +#: hardinfo//util.c:116 +#, c-format +msgid "%.1f B" +msgstr "%.1f B" + +#: hardinfo//util.c:118 +#, c-format +msgid "%.1f KiB" +msgstr "%.1f KiB" + +#: hardinfo//util.c:120 +#, c-format +msgid "%.1f MiB" +msgstr "%.1f MiB" + +#: hardinfo//util.c:122 +#, c-format +msgid "%.1f GiB" +msgstr "%.1f GiB" + +#: hardinfo//util.c:336 +msgid "Error" +msgstr "Erreur" + +#: hardinfo//util.c:336 +#: hardinfo//util.c:352 +msgid "Warning" +msgstr "Attention" + +#: hardinfo//util.c:351 +msgid "Fatal Error" +msgstr "Erreur Fatale" + +#: hardinfo//util.c:376 +msgid "creates a report and prints to standard output" +msgstr "crée un rapport et imprime sur la sortie standard" + +#: hardinfo//util.c:382 +msgid "chooses a report format (text, html)" +msgstr "choisir un format de rapport (texte, html)" + +#: hardinfo//util.c:388 +msgid "run benchmark; requires benchmark.so to be loaded" +msgstr "Envoyé le benchmark; nécessite benchmark.so" + +#: hardinfo//util.c:394 +msgid "lists modules" +msgstr "Listes des modules" + +#: hardinfo//util.c:400 +msgid "specify module to load" +msgstr "spécifie les modules à charger" + +#: hardinfo//util.c:406 +msgid "automatically load module dependencies" +msgstr "charger automatiquement les dépendances entre modules" + +#: hardinfo//util.c:413 +msgid "run in XML-RPC server mode" +msgstr "fonctionner en mode serveur XML-RPC" + +#: hardinfo//util.c:420 +msgid "shows program version and quit" +msgstr "Affiche la version du programme et quitter" + +#: hardinfo//util.c:425 +msgid "- System Profiler and Benchmark tool" +msgstr "- Profil du Systeme et outil d'évaluation Benchmark" + +#: hardinfo//util.c:435 +#, c-format +msgid "" +"Unrecognized arguments.\n" +"Try ``%s --help'' for more information.\n" +msgstr "" +"commandes inconnues.\n" +"taper ``%s --help'' pour plus d'informations.\n" + +#: hardinfo//util.c:501 +#, c-format +msgid "Couldn't find a Web browser to open URL %s." +msgstr "Impossible de trouver un navigateur Web pour ouvrir l'URL %s." + +#: hardinfo//util.c:848 +#, c-format +msgid "Module \"%s\" depends on module \"%s\", load it?" +msgstr "Module \"%s\" depends du module \"%s\", le charger?" + +#: hardinfo//util.c:871 +#, c-format +msgid "Module \"%s\" depends on module \"%s\"." +msgstr "Module \"%s\" depends du module \"%s\"." + +#: hardinfo//util.c:916 +#, c-format +msgid "No module could be loaded. Check permissions on \"%s\" and try again." +msgstr "Aucun module peut être chargé. Vérifiez les permissions sur \"%s\" et essayez à nouveau." + +#: hardinfo//util.c:920 +msgid "No module could be loaded. Please use hardinfo -l to list all available modules and try again with a valid module list." +msgstr "Aucun module peut être chargé. S'il vous plaît utiliser hardinfo -l pour répertorier tous les modules disponibles et essayez à nouveau avec une liste de modules valides." + +#: hardinfo//util.c:1096 +#, c-format +msgid "Scanning: %s..." +msgstr "Scanne: %s..." + + + + diff --git a/po/hardinfo.pot b/po/hardinfo.pot new file mode 100644 index 00000000..9d83a3e5 --- /dev/null +++ b/po/hardinfo.pot @@ -0,0 +1,1498 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-06-10 10:11+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" + +#: shell//callbacks.c:71 +#, c-format +msgid "Remote: <b>%s</b>" +msgstr "" + +#: shell//callbacks.c:117 +msgid "Disconnecting..." +msgstr "" + +#: shell//callbacks.c:120 +msgid "Unloading modules..." +msgstr "" + +#: shell//callbacks.c:123 +msgid "Loading local modules..." +msgstr "" + +#: shell//callbacks.c:130 +#: shell//callbacks.c:162 +#: shell//shell.c:314 +#: shell//shell.c:816 +#: shell//shell.c:1800 +#: modules//benchmark.c:431 +#: modules//benchmark.c:439 +#: hardinfo//util.c:1112 +msgid "Done." +msgstr "" + +#: shell//callbacks.c:142 +msgid "Save Image" +msgstr "" + +#: shell//callbacks.c:158 +msgid "Saving image..." +msgstr "" + +#: shell//callbacks.c:236 +msgid "No context help available." +msgstr "" + +#: shell//callbacks.c:318 +#, c-format +msgid "%s Module" +msgstr "" + +#: shell//callbacks.c:325 +#, c-format +msgid "" +"Written by %s\n" +"Licensed under %s" +msgstr "" + +#: shell//callbacks.c:339 +#, c-format +msgid "No about information is associated with the %s module." +msgstr "" + +#: shell//callbacks.c:353 +msgid "Author:" +msgstr "" + +#: shell//callbacks.c:356 +msgid "Contributors:" +msgstr "" + +#: shell//callbacks.c:360 +msgid "Based on work by:" +msgstr "" + +#: shell//callbacks.c:361 +msgid "MD5 implementation by Colin Plumb (see md5.c for details)" +msgstr "" + +#: shell//callbacks.c:362 +msgid "SHA1 implementation by Steve Reid (see sha1.c for details)" +msgstr "" + +#: shell//callbacks.c:363 +msgid "Blowfish implementation by Paul Kocher (see blowfich.c for details)" +msgstr "" + +#: shell//callbacks.c:364 +msgid "Raytracing benchmark by John Walker (see fbench.c for details)" +msgstr "" + +#: shell//callbacks.c:365 +msgid "FFT benchmark by Scott Robert Ladd (see fftbench.c for details)" +msgstr "" + +#: shell//callbacks.c:366 +msgid "Some code partly based on x86cpucaps by Osamu Kayasono" +msgstr "" + +#: shell//callbacks.c:367 +msgid "Vendor list based on GtkSysInfo by Pissens Sebastien" +msgstr "" + +#: shell//callbacks.c:368 +msgid "DMI support based on code by Stewart Adam" +msgstr "" + +#: shell//callbacks.c:369 +msgid "SCSI support based on code by Pascal F. Martin" +msgstr "" + +#: shell//callbacks.c:373 +msgid "Jakub Szypulka" +msgstr "" + +#: shell//callbacks.c:374 +msgid "Tango Project" +msgstr "" + +#: shell//callbacks.c:375 +msgid "The GNOME Project" +msgstr "" + +#: shell//callbacks.c:376 +msgid "VMWare, Inc. (USB icon from VMWare Workstation 6)" +msgstr "" + +#: shell//callbacks.c:387 +msgid "System information and benchmark tool" +msgstr "" + +#: shell//callbacks.c:392 +msgid "" +"HardInfo 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.\n" +"\n" +"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.\n" +"\n" +"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" +msgstr "" + +#: shell//menu.c:35 +msgid "_Information" +msgstr "" + +#: shell//menu.c:36 +msgid "_Remote" +msgstr "" + +#: shell//menu.c:37 +msgid "_View" +msgstr "" + +#: shell//menu.c:38 +msgid "_Help" +msgstr "" + +#: shell//menu.c:39 +msgid "About _Modules" +msgstr "" + +#: shell//menu.c:43 +msgid "Generate _Report" +msgstr "" + +#: shell//menu.c:48 +msgid "_Network Updater..." +msgstr "" + +#: shell//menu.c:53 +msgid "_Open..." +msgstr "" + +#: shell//menu.c:58 +msgid "_Connect to..." +msgstr "" + +#: shell//menu.c:63 +msgid "_Manage hosts..." +msgstr "" + +#: shell//menu.c:68 +msgid "_Local computer" +msgstr "" + +#: shell//menu.c:73 +msgid "_Copy to Clipboard" +msgstr "" + +#: shell//menu.c:74 +msgid "Copy to clipboard" +msgstr "" + +#: shell//menu.c:78 +msgid "_Save image as..." +msgstr "" + +#: shell//menu.c:83 +msgid "_Refresh" +msgstr "" + +#: shell//menu.c:88 +msgid "Contents" +msgstr "" + +#: shell//menu.c:93 +#: shell//shell.c:1794 +#: shell//shell.c:1811 +msgid "Context help" +msgstr "" + +#: shell//menu.c:98 +msgid "_Open HardInfo Web Site" +msgstr "" + +#: shell//menu.c:103 +msgid "_Report bug" +msgstr "" + +#: shell//menu.c:108 +msgid "_Donate to the project" +msgstr "" + +#: shell//menu.c:113 +msgid "_About HardInfo" +msgstr "" + +#: shell//menu.c:114 +msgid "Displays program version information" +msgstr "" + +#: shell//menu.c:118 +msgid "_Quit" +msgstr "" + +#: shell//menu.c:125 +msgid "_Side Pane" +msgstr "" + +#: shell//menu.c:126 +msgid "Toggles side pane visibility" +msgstr "" + +#: shell//menu.c:129 +msgid "_Toolbar" +msgstr "" + +#: shell//menu.c:133 +msgid "_Accept connections" +msgstr "" + +#: shell//report.c:492 +msgid "Save File" +msgstr "" + +#: shell//report.c:616 +msgid "Cannot create ReportContext. Programming bug?" +msgstr "" + +#: shell//report.c:634 +msgid "Open the report with your web browser?" +msgstr "" + +#: shell//report.c:662 +msgid "Generating report..." +msgstr "" + +#: shell//report.c:672 +msgid "Report saved." +msgstr "" + +#: shell//report.c:674 +msgid "Error while creating the report." +msgstr "" + +#: shell//report.c:776 +msgid "Generate Report" +msgstr "" + +#: shell//report.c:793 +msgid "" +"<big><b>Generate Report</b></big>\n" +"Please choose the information that you wish to view in your report:" +msgstr "" + +#: shell//report.c:853 +msgid "Select _None" +msgstr "" + +#: shell//report.c:860 +msgid "Select _All" +msgstr "" + +#: shell//report.c:878 +msgid "_Generate" +msgstr "" + +#: shell//shell.c:407 +#, c-format +msgid "%s - System Information" +msgstr "" + +#: shell//shell.c:412 +msgid "System Information" +msgstr "" + +#: shell//shell.c:803 +msgid "Loading modules..." +msgstr "" + +#: shell//shell.c:1654 +#, c-format +msgid "<b>%s → Summary</b>" +msgstr "" + +#: shell//shell.c:1762 +msgid "Updating..." +msgstr "" + +#: shell//syncmanager.c:69 +msgid "" +"<big><b>Synchronize with Central Database</b></big>\n" +"The following information may be synchronized with the HardInfo central " +"database." +msgstr "" + +#: shell//syncmanager.c:72 +msgid "" +"<big><b>Synchronizing</b></big>\n" +"This may take some time." +msgstr "" + +#: shell//syncmanager.c:132 +msgid "" +"HardInfo was compiled without libsoup support. (Network Updater requires it.)" +msgstr "" + +#: shell//syncmanager.c:161 +#: shell//syncmanager.c:185 +#, c-format +msgid "%s (error #%d)" +msgstr "" + +#: shell//syncmanager.c:170 +#: shell//syncmanager.c:194 +msgid "Could not parse XML-RPC response" +msgstr "" + +#: shell//syncmanager.c:267 +#, c-format +msgid "" +"Server says it supports API version %d, but this version of HardInfo only " +"supports API version %d." +msgstr "" + +#: shell//syncmanager.c:362 +msgid "Contacting HardInfo Central Database" +msgstr "" + +#: shell//syncmanager.c:363 +msgid "Cleaning up" +msgstr "" + +#: shell//syncmanager.c:480 +#, c-format +msgid "<s>%s</s> <i>(canceled)</i>" +msgstr "" + +#: shell//syncmanager.c:497 +#, c-format +msgid "<b><s>%s</s></b> <i>(failed)</i>" +msgstr "" + +#: shell//syncmanager.c:509 +#, c-format +msgid "" +"Failed while performing \"%s\". Please file a bug report if this problem " +"persists. (Use the Help→Report bug option.)\n" +"\n" +"Details: %s" +msgstr "" + +#: shell//syncmanager.c:518 +#, c-format +msgid "" +"Failed while performing \"%s\". Please file a bug report if this problem " +"persists. (Use the Help→Report bug option.)" +msgstr "" + +#: shell//syncmanager.c:646 +msgid "Network Updater" +msgstr "" + +#: shell//syncmanager.c:727 +msgid "_Synchronize" +msgstr "" + +#: modules//benchmark.c:50 +msgid "CPU Blowfish" +msgstr "" + +#: modules//benchmark.c:51 +msgid "CPU CryptoHash" +msgstr "" + +#: modules//benchmark.c:52 +msgid "CPU Fibonacci" +msgstr "" + +#: modules//benchmark.c:53 +msgid "CPU N-Queens" +msgstr "" + +#: modules//benchmark.c:54 +msgid "FPU FFT" +msgstr "" + +#: modules//benchmark.c:55 +msgid "FPU Raytracing" +msgstr "" + +#: modules//benchmark.c:56 +msgid "GPU Drawing" +msgstr "" + +#: modules//benchmark.c:222 +#, c-format +msgid "" +"[$ShellParam$]\n" +"Zebra=1\n" +"OrderType=%d\n" +"ViewType=3\n" +"ColumnTitle$Extra1=CPU Clock\n" +"ColumnTitle$Progress=Results\n" +"ColumnTitle$TextValue=CPU\n" +"ShowColumnHeaders=true\n" +"[%s]\n" +"<big><b>This Machine</b></big>=%.3f|%s MHz\n" +"%s" +msgstr "" + +#: modules//benchmark.c:235 +#, c-format +msgid "" +"[$ShellParam$]\n" +"Zebra=1\n" +"OrderType=%d\n" +"ViewType=3\n" +"ColumnTitle$Extra1=CPU Clock\n" +"ColumnTitle$Progress=Results\n" +"ColumnTitle$TextValue=CPU\n" +"ShowColumnHeaders=true\n" +"[%s]\n" +"%s" +msgstr "" + +#: modules//benchmark.c:363 +#, c-format +msgid "Benchmarking: <b>%s</b>." +msgstr "" + +#: modules//benchmark.c:377 +msgid "Benchmarking. Please do not move your mouse or press any keys." +msgstr "" + +#: modules//benchmark.c:381 +msgid "Cancel" +msgstr "" + +#: modules//benchmark.c:511 +msgid "Results in MiB/second. Higher is better." +msgstr "" + +#: modules//benchmark.c:514 +msgid "Results in HIMarks. Higher is better." +msgstr "" + +#: modules//benchmark.c:521 +msgid "Results in seconds. Lower is better." +msgstr "" + +#: modules//benchmark.c:529 +msgid "Benchmarks" +msgstr "" + +#: modules//benchmark.c:547 +msgid "Perform tasks and compare with other systems" +msgstr "" + +#: modules//benchmark.c:634 +msgid "Send benchmark results" +msgstr "" + +#: modules//benchmark.c:639 +msgid "Receive benchmark results" +msgstr "" + +#: modules//computer.c:68 +msgid "Summary" +msgstr "" + +#: modules//computer.c:69 +msgid "Operating System" +msgstr "" + +#: modules//computer.c:70 +msgid "Kernel Modules" +msgstr "" + +#: modules//computer.c:71 +msgid "Boots" +msgstr "" + +#: modules//computer.c:72 +msgid "Languages" +msgstr "" + +#: modules//computer.c:73 +msgid "Filesystems" +msgstr "" + +#: modules//computer.c:74 +msgid "Display" +msgstr "" + +#: modules//computer.c:75 +msgid "Environment Variables" +msgstr "" + +#: modules//computer.c:77 +msgid "Development" +msgstr "" + +#: modules//computer.c:79 +msgid "Users" +msgstr "" + +#: modules//computer.c:80 +msgid "Groups" +msgstr "" + +#: modules//computer.c:104 +#, c-format +msgid "%dMB (%dMB used)" +msgstr "" + +#: modules//computer.c:200 +msgid "Scripting Languages" +msgstr "" + +#: modules//computer.c:201 +msgid "CPython" +msgstr "" + +#: modules//computer.c:202 +msgid "Perl" +msgstr "" + +#: modules//computer.c:203 +msgid "PHP" +msgstr "" + +#: modules//computer.c:204 +msgid "Ruby" +msgstr "" + +#: modules//computer.c:205 +msgid "Bash" +msgstr "" + +#: modules//computer.c:206 +msgid "Compilers" +msgstr "" + +#: modules//computer.c:207 +msgid "C (GCC)" +msgstr "" + +#: modules//computer.c:208 +msgid "C (Clang)" +msgstr "" + +#: modules//computer.c:209 +msgid "D (dmd)" +msgstr "" + +#: modules//computer.c:210 +msgid "Java" +msgstr "" + +#: modules//computer.c:211 +msgid "CSharp (Mono, old)" +msgstr "" + +#: modules//computer.c:212 +msgid "CSharp (Mono)" +msgstr "" + +#: modules//computer.c:213 +msgid "Vala" +msgstr "" + +#: modules//computer.c:214 +msgid "Haskell (GHC)" +msgstr "" + +#: modules//computer.c:215 +msgid "FreePascal" +msgstr "" + +#: modules//computer.c:216 +msgid "Tools" +msgstr "" + +#: modules//computer.c:217 +msgid "make" +msgstr "" + +#: modules//computer.c:218 +msgid "GDB" +msgstr "" + +#: modules//computer.c:219 +msgid "strace" +msgstr "" + +#: modules//computer.c:220 +msgid "valgrind" +msgstr "" + +#: modules//computer.c:221 +msgid "QMake" +msgstr "" + +#: modules//computer.c:264 +#, c-format +msgid "%s=Not found\n" +msgstr "" + +#: modules//computer.c:267 +#, c-format +msgid "Detecting version: %s" +msgstr "" + +#: modules//computer.c:278 +#, c-format +msgid "" +"[$ShellParam$]\n" +"ColumnTitle$TextValue=Program\n" +"ColumnTitle$Value=Version\n" +"ShowColumnHeaders=true\n" +"%s" +msgstr "" + +#: modules//computer.c:358 +msgid "Physical machine" +msgstr "" + +#: modules//computer.c:375 +#, c-format +msgid "" +"[$ShellParam$]\n" +"UpdateInterval$Memory=1000\n" +"UpdateInterval$Date/Time=1000\n" +"#ReloadInterval=5000\n" +"[Computer]\n" +"Processor=%s\n" +"Memory=...\n" +"Machine Type=%s\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" +"\n" +"%s\n" +"[Input Devices]\n" +"%s\n" +"\n" +"%s\n" +"\n" +"%s\n" +msgstr "" + +#: modules//computer.c:417 +#, c-format +msgid "" +"[$ShellParam$]\n" +"UpdateInterval$Uptime=10000\n" +"UpdateInterval$Load Average=1000\n" +"[Version]\n" +"Kernel=%s\n" +"Version=%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=..." +msgstr "" + +#: modules//computer.c:446 +#, c-format +msgid "" +"[Loaded Modules]\n" +"%s[$ShellParam$]\n" +"ViewType=1\n" +"ColumnTitle$TextValue=Name\n" +"ColumnTitle$Value=Description\n" +"ShowColumnHeaders=true\n" +msgstr "" + +#: modules//computer.c:457 +#, c-format +msgid "" +"[$ShellParam$]\n" +"ColumnTitle$TextValue=Date & Time\n" +"ColumnTitle$Value=Kernel Version\n" +"ShowColumnHeaders=true\n" +"\n" +"%s" +msgstr "" + +#: modules//computer.c:467 +#, c-format +msgid "" +"[$ShellParam$]\n" +"ViewType=1\n" +"ColumnTitle$TextValue=Language Code\n" +"ColumnTitle$Value=Name\n" +"ShowColumnHeaders=true\n" +"[Available Languages]\n" +"%s" +msgstr "" + +#: modules//computer.c:478 +#, c-format +msgid "" +"[$ShellParam$]\n" +"ViewType=4\n" +"ReloadInterval=5000\n" +"Zebra=1\n" +"NormalizePercentage=false\n" +"ColumnTitle$Extra1=Mount Point\n" +"ColumnTitle$Progress=Usage\n" +"ColumnTitle$TextValue=Device\n" +"ShowColumnHeaders=true\n" +"[Mounted File Systems]\n" +"%s\n" +msgstr "" + +#: modules//computer.c:492 +#, c-format +msgid "" +"[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" +msgstr "" + +#: modules//computer.c:514 +msgid "Y_es" +msgstr "" + +#: modules//computer.c:514 +#: modules//devices/printers.c:138 +#: hardinfo//hardinfo.c:63 +msgid "No" +msgstr "" + +#: modules//computer.c:528 +#, c-format +msgid "" +"[$ShellParam$]\n" +"ReloadInterval=10000\n" +"ColumnTitle$TextValue=Name\n" +"ColumnTitle$Value=Group ID\n" +"ShowColumnHeaders=true\n" +"[Groups]\n" +"%s\n" +msgstr "" + +#: modules//computer.c:608 +msgid "Computer" +msgstr "" + +#: modules//computer.c:702 +msgid "Gathers high-level computer information" +msgstr "" + +#: modules//computer/alsa.c:26 +msgid "[Audio Devices]\n" +msgstr "" + +#: modules//computer/alsa.c:33 +#, c-format +msgid "Audio Adapter#%d=%s\n" +msgstr "" + +#: modules//computer/boots.c:33 +msgid "[Boots]\n" +msgstr "" + +#: modules//computer/display.c:122 +#, c-format +msgid "Monitor %d=%dx%d pixels\n" +msgstr "" + +#: modules//computer/environment.c:32 +msgid "[Environment Variables]\n" +msgstr "" + +#: modules//computer/os.c:57 +#, c-format +msgid "GNU C Library version %s (%sstable)" +msgstr "" + +#: modules//computer/os.c:59 +msgid "un" +msgstr "" + +#: modules//computer/os.c:61 +#: modules//computer/os.c:138 +#: modules//devices.c:154 +#: modules//devices.c:197 +#: modules//devices/printers.c:99 +#: modules//devices/printers.c:106 +#: modules//devices/printers.c:116 +#: modules//devices/printers.c:131 +#: modules//devices/printers.c:140 +#: modules//devices/printers.c:243 +msgid "Unknown" +msgstr "" + +#: modules//computer/os.c:80 +#, c-format +msgid "Version: %s" +msgstr "" + +#: modules//computer/os.c:114 +msgid "Terminal" +msgstr "" + +#: modules//computer/os.c:134 +#, c-format +msgid "Unknown (Window Manager: %s)" +msgstr "" + +#: modules//computer/os.c:174 +msgid "Unknown distribution" +msgstr "" + +#: modules//devices.c:74 +msgid "Processor" +msgstr "" + +#: modules//devices.c:75 +msgid "Memory" +msgstr "" + +#: modules//devices.c:76 +msgid "PCI Devices" +msgstr "" + +#: modules//devices.c:77 +msgid "USB Devices" +msgstr "" + +#: modules//devices.c:78 +msgid "Printers" +msgstr "" + +#: modules//devices.c:79 +msgid "Battery" +msgstr "" + +#: modules//devices.c:80 +msgid "Sensors" +msgstr "" + +#: modules//devices.c:81 +msgid "Input Devices" +msgstr "" + +#: modules//devices.c:82 +msgid "Storage" +msgstr "" + +#: modules//devices.c:84 +msgid "DMI" +msgstr "" + +#: modules//devices.c:85 +msgid "Memory SPD" +msgstr "" + +#: modules//devices.c:87 +msgid "Resources" +msgstr "" + +#: modules//devices.c:193 +msgid " (vendor unknown)" +msgstr "" + +#: modules//devices.c:195 +msgid " (model unknown)" +msgstr "" + +#: modules//devices.c:412 +msgid "Devices" +msgstr "" + +#: modules//devices.c:424 +msgid "Update PCI ID listing" +msgstr "" + +#: modules//devices.c:436 +msgid "Update CPU feature database" +msgstr "" + +#: modules//devices.c:464 +msgid "Gathers information about hardware devices" +msgstr "" + +#: modules//devices/battery.c:181 +#, c-format +msgid "" +"\n" +"[Battery: %s]\n" +"State=%s (load: %s)\n" +"Capacity=%s / %s (%.2f%%)\n" +"Battery Technology=%s (%s)\n" +"Manufacturer=%s\n" +"Model Number=%s\n" +"Serial Number=%s\n" +msgstr "" + +#: modules//devices/battery.c:258 +#, c-format +msgid "" +"\n" +"[Battery: %s]\n" +"State=%s\n" +"Capacity=%s / %s\n" +"Battery Technology=%s\n" +"Manufacturer=%s\n" +"Model Number=%s\n" +"Serial Number=%s\n" +msgstr "" + +#: modules//devices/battery.c:346 +#, c-format +msgid "" +"\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" +msgstr "" + +#: modules//devices/battery.c:358 +#, c-format +msgid "" +"\n" +"[Battery (APM)]\n" +"Charge=%d%%\n" +"Using=%s\n" +"APM driver version=%s\n" +"APM BIOS version=%s\n" +msgstr "" + +#: modules//devices/battery.c:385 +msgid "" +"[No batteries]\n" +"No batteries found on this system=\n" +msgstr "" + +#: modules//devices/printers.c:81 +msgid "⚬ Can do black and white printing=\n" +msgstr "" + +#: modules//devices/printers.c:83 +msgid "⚬ Can do color printing=\n" +msgstr "" + +#: modules//devices/printers.c:85 +msgid "⚬ Can do duplexing=\n" +msgstr "" + +#: modules//devices/printers.c:87 +msgid "⚬ Can do staple output=\n" +msgstr "" + +#: modules//devices/printers.c:89 +msgid "⚬ Can do copies=\n" +msgstr "" + +#: modules//devices/printers.c:91 +msgid "⚬ Can collate copies=\n" +msgstr "" + +#: modules//devices/printers.c:93 +msgid "⚬ Printer is rejecting jobs=\n" +msgstr "" + +#: modules//devices/printers.c:95 +msgid "⚬ Printer was automatically discovered and added=\n" +msgstr "" + +#: modules//devices/printers.c:110 +msgid "Idle" +msgstr "" + +#: modules//devices/printers.c:112 +msgid "Printing a Job" +msgstr "" + +#: modules//devices/printers.c:114 +msgid "Stopped" +msgstr "" + +#: modules//devices/printers.c:138 +#: hardinfo//hardinfo.c:62 +#: hardinfo//hardinfo.c:63 +msgid "Yes" +msgstr "" + +#: modules//devices/printers.c:190 +msgid "" +"[Printers]\n" +"No suitable CUPS library found=" +msgstr "" + +#: modules//devices/printers.c:200 +msgid "[Printers (CUPS)]\n" +msgstr "" + +#: modules//devices/printers.c:263 +msgid "" +"[Printers]\n" +"No printers found=\n" +msgstr "" + +#: modules//devices/storage.c:46 +msgid "" +"\n" +"[SCSI Disks]\n" +msgstr "" + +#: modules//devices/storage.c:110 +#: modules//devices/storage.c:297 +#, c-format +msgid "" +"[Device Information]\n" +"Model=%s\n" +msgstr "" + +#: modules//devices/storage.c:115 +#: modules//devices/storage.c:304 +#, c-format +msgid "Vendor=%s (%s)\n" +msgstr "" + +#: modules//devices/storage.c:120 +#: modules//devices/storage.c:309 +#, c-format +msgid "Vendor=%s\n" +msgstr "" + +#: modules//devices/storage.c:125 +#, c-format +msgid "" +"Type=%s\n" +"Revision=%s\n" +"[SCSI Controller]\n" +"Controller=scsi%d\n" +"Channel=%d\n" +"ID=%d\n" +"LUN=%d\n" +msgstr "" + +#: modules//devices/storage.c:169 +msgid "" +"\n" +"[IDE Disks]\n" +msgstr "" + +#: modules//devices/storage.c:242 +#, c-format +msgid "Driver=%s\n" +msgstr "" + +#: modules//devices/storage.c:314 +#, c-format +msgid "" +"Device Name=hd%c\n" +"Media=%s\n" +"Cache=%dkb\n" +msgstr "" + +#: modules//devices/storage.c:329 +#, c-format +msgid "" +"[Geometry]\n" +"Physical=%s\n" +"Logical=%s\n" +msgstr "" + +#: modules//devices/storage.c:341 +#, c-format +msgid "" +"[Capabilities]\n" +"%s" +msgstr "" + +#: modules//devices/storage.c:348 +#, c-format +msgid "" +"[Speeds]\n" +"%s" +msgstr "" + +#: modules//devices/x86/processor.c:145 +#: modules//devices/x86_64/processor.c:145 +msgid "Cache information not available=\n" +msgstr "" + +#: modules//devices/x86/processor.c:484 +#: modules//devices/x86_64/processor.c:484 +#, c-format +msgid "" +"[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" +"[Cache]\n" +"%s\n" +"[Capabilities]\n" +"%s" +msgstr "" + +#: modules//devices/x86/processor.c:542 +#: modules//devices/x86_64/processor.c:542 +#, c-format +msgid "%s$CPU%d$%s=%.2fMHz\n" +msgstr "" + +#: modules//network.c:59 +msgid "Interfaces" +msgstr "" + +#: modules//network.c:60 +msgid "IP Connections" +msgstr "" + +#: modules//network.c:61 +msgid "Routing Table" +msgstr "" + +#: modules//network.c:62 +msgid "ARP Table" +msgstr "" + +#: modules//network.c:63 +msgid "DNS Servers" +msgstr "" + +#: modules//network.c:64 +msgid "Statistics" +msgstr "" + +#: modules//network.c:65 +msgid "Shared Directories" +msgstr "" + +#: modules//network.c:300 +#, c-format +msgid "" +"[ARP Table]\n" +"%s\n" +"[$ShellParam$]\n" +"ReloadInterval=3000\n" +"ColumnTitle$TextValue=IP Address\n" +"ColumnTitle$Value=Interface\n" +"ColumnTitle$Extra1=MAC Address\n" +"ShowColumnHeaders=true\n" +msgstr "" + +#: modules//network.c:321 +#, c-format +msgid "" +"[Name servers]\n" +"%s\n" +"[$ShellParam$]\n" +"ColumnTitle$TextValue=IP Address\n" +"ColumnTitle$Value=Name\n" +"ShowColumnHeaders=true\n" +msgstr "" + +#: modules//network.c:331 +#, c-format +msgid "" +"[Connections]\n" +"%s\n" +"[$ShellParam$]\n" +"ReloadInterval=3000\n" +"ColumnTitle$TextValue=Local Address\n" +"ColumnTitle$Value=Protocol\n" +"ColumnTitle$Extra1=Foreign Address\n" +"ColumnTitle$Extra2=State\n" +"ShowColumnHeaders=true\n" +msgstr "" + +#: modules//network.c:345 +#, c-format +msgid "" +"%s\n" +"[$ShellParam$]\n" +"ReloadInterval=3000\n" +"ViewType=1\n" +"ColumnTitle$TextValue=Interface\n" +"ColumnTitle$Value=IP Address\n" +"ColumnTitle$Extra1=Sent\n" +"ColumnTitle$Extra2=Received\n" +"ShowColumnHeaders=true\n" +"%s" +msgstr "" + +#: modules//network.c:361 +#, c-format +msgid "" +"[IP routing table]\n" +"%s\n" +"[$ShellParam$]\n" +"ViewType=0\n" +"ReloadInterval=3000\n" +"ColumnTitle$TextValue=Destination / Gateway\n" +"ColumnTitle$Value=Interface\n" +"ColumnTitle$Extra1=Flags\n" +"ColumnTitle$Extra2=Mask\n" +"ShowColumnHeaders=true\n" +msgstr "" + +#: modules//network.c:399 +msgid "Network" +msgstr "" + +#: modules//network.c:432 +msgid "Gathers information about this computer's network connection" +msgstr "" + +#: hardinfo//hardinfo.c:54 +msgid "" +"Copyright (C) 2003-2009 Leandro A. F. Pereira. See COPYING for details.\n" +"\n" +msgstr "" + +#: hardinfo//hardinfo.c:56 +#, c-format +msgid "" +"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" +msgstr "" + +#: hardinfo//hardinfo.c:74 +#, c-format +msgid "" +"Failed to find runtime data.\n" +"\n" +"• Is HardInfo correctly installed?\n" +"• See if %s and %s exists and you have read permision." +msgstr "" + +#: hardinfo//hardinfo.c:81 +#, c-format +msgid "" +"Modules:\n" +"%-20s%-15s%-12s\n" +msgstr "" + +#: hardinfo//hardinfo.c:82 +msgid "File Name" +msgstr "" + +#: hardinfo//hardinfo.c:82 +msgid "Name" +msgstr "" + +#: hardinfo//hardinfo.c:82 +msgid "Version" +msgstr "" + +#: hardinfo//hardinfo.c:135 +#, c-format +msgid "Unknown benchmark ``%s'' or libbenchmark.so not loaded" +msgstr "" + +#: hardinfo//hardinfo.c:163 +msgid "Don't know what to do. Exiting." +msgstr "" + +#: hardinfo//util.c:104 +#: hardinfo//util.c:107 +#: hardinfo//util.c:112 +#, c-format +msgid "%d minute" +msgid_plural "%d minutes" +msgstr[0] "" +msgstr[1] "" + +#: hardinfo//util.c:106 +#, c-format +msgid "%d hour, " +msgid_plural "%d hours, " +msgstr[0] "" +msgstr[1] "" + +#: hardinfo//util.c:110 +#, c-format +msgid "%d day, " +msgid_plural "%d days, " +msgstr[0] "" +msgstr[1] "" + +#: hardinfo//util.c:111 +#, c-format +msgid "%d hour and " +msgid_plural "%d hours and " +msgstr[0] "" +msgstr[1] "" + +#: hardinfo//util.c:118 +#, c-format +msgid "%.1f B" +msgstr "" + +#: hardinfo//util.c:120 +#, c-format +msgid "%.1f KiB" +msgstr "" + +#: hardinfo//util.c:122 +#, c-format +msgid "%.1f MiB" +msgstr "" + +#: hardinfo//util.c:124 +#, c-format +msgid "%.1f GiB" +msgstr "" + +#: hardinfo//util.c:126 +#, c-format +msgid "%.1f TiB" +msgstr "" + +#: hardinfo//util.c:128 +#, c-format +msgid "%.1f PiB" +msgstr "" + +#: hardinfo//util.c:342 +msgid "Error" +msgstr "" + +#: hardinfo//util.c:342 +#: hardinfo//util.c:358 +msgid "Warning" +msgstr "" + +#: hardinfo//util.c:357 +msgid "Fatal Error" +msgstr "" + +#: hardinfo//util.c:382 +msgid "creates a report and prints to standard output" +msgstr "" + +#: hardinfo//util.c:388 +msgid "chooses a report format (text, html)" +msgstr "" + +#: hardinfo//util.c:394 +msgid "run benchmark; requires benchmark.so to be loaded" +msgstr "" + +#: hardinfo//util.c:400 +msgid "lists modules" +msgstr "" + +#: hardinfo//util.c:406 +msgid "specify module to load" +msgstr "" + +#: hardinfo//util.c:412 +msgid "automatically load module dependencies" +msgstr "" + +#: hardinfo//util.c:419 +msgid "run in XML-RPC server mode" +msgstr "" + +#: hardinfo//util.c:426 +msgid "shows program version and quit" +msgstr "" + +#: hardinfo//util.c:431 +msgid "- System Profiler and Benchmark tool" +msgstr "" + +#: hardinfo//util.c:441 +#, c-format +msgid "" +"Unrecognized arguments.\n" +"Try ``%s --help'' for more information.\n" +msgstr "" + +#: hardinfo//util.c:507 +#, c-format +msgid "Couldn't find a Web browser to open URL %s." +msgstr "" + +#: hardinfo//util.c:854 +#, c-format +msgid "Module \"%s\" depends on module \"%s\", load it?" +msgstr "" + +#: hardinfo//util.c:877 +#, c-format +msgid "Module \"%s\" depends on module \"%s\"." +msgstr "" + +#: hardinfo//util.c:922 +#, c-format +msgid "No module could be loaded. Check permissions on \"%s\" and try again." +msgstr "" + +#: hardinfo//util.c:926 +msgid "" +"No module could be loaded. Please use hardinfo -l to list all available " +"modules and try again with a valid module list." +msgstr "" + +#: hardinfo//util.c:1102 +#, c-format +msgid "Scanning: %s..." +msgstr "" diff --git a/po/ru.po b/po/ru.po new file mode 100644 index 00000000..ca33d0a0 --- /dev/null +++ b/po/ru.po @@ -0,0 +1,1812 @@ +msgid "" +msgstr "" +"Project-Id-Version: hardinfo puppy\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-09-01 22:24+0300\n" +"PO-Revision-Date: \n" +"Last-Translator: Sergey Rodin <rodin.s@rambler.ru>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Language: Russian\n" +"X-Poedit-Country: UKRAINE\n" +"X-Poedit-SourceCharset: utf-8\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n" + +#: shell/callbacks.c:71 +#, c-format +msgid "Remote: <b>%s</b>" +msgstr "Удалённо: <b>%s</b>" + +#: shell/callbacks.c:117 +msgid "Disconnecting..." +msgstr "Отключение..." + +#: shell/callbacks.c:120 +msgid "Unloading modules..." +msgstr "Выгрузка модулей..." + +#: shell/callbacks.c:123 +msgid "Loading local modules..." +msgstr "Загрузка локальных модулей..." + +#: shell/callbacks.c:130 +#: shell/callbacks.c:162 +#: shell/shell.c:314 +#: shell/shell.c:814 +#: shell/shell.c:1796 +#: modules/benchmark.c:431 +#: modules/benchmark.c:439 +#: hardinfo/util.c:1106 +msgid "Done." +msgstr "Выполнено." + +#: shell/callbacks.c:142 +msgid "Save Image" +msgstr "Сохранить изображение" + +#: shell/callbacks.c:158 +msgid "Saving image..." +msgstr "Сохранение изображениÑ..." + +#: shell/callbacks.c:236 +msgid "No context help available." +msgstr "КонтекÑÑ‚Ð½Ð°Ñ Ñправка недоÑтупна" + +#: shell/callbacks.c:318 +#, c-format +msgid "%s Module" +msgstr "%s модуль" + +#: shell/callbacks.c:325 +#, c-format +msgid "" +"Written by %s\n" +"Licensed under %s" +msgstr "" +"Ðвтор программы %s\n" +"Ð›Ð¸Ñ†ÐµÐ½Ð·Ð¸Ñ %s" + +#: shell/callbacks.c:339 +#, c-format +msgid "No about information is associated with the %s module." +msgstr "Ðет информации о модуле %s." + +#: shell/callbacks.c:353 +msgid "Author:" +msgstr "Ðвтор:" + +#: shell/callbacks.c:356 +msgid "Contributors:" +msgstr "УчаÑтники:" + +#: shell/callbacks.c:360 +msgid "Based on work by:" +msgstr "ОÑнован на работах:" + +#: shell/callbacks.c:361 +msgid "MD5 implementation by Colin Plumb (see md5.c for details)" +msgstr "Ð ÐµÐ°Ð»Ð¸Ð·Ð°Ñ†Ð¸Ñ MD5 от Colin Plumb (Ñм. подробноÑти в md5.c)" + +#: shell/callbacks.c:362 +msgid "SHA1 implementation by Steve Reid (see sha1.c for details)" +msgstr "Ð ÐµÐ°Ð»Ð¸Ð·Ð°Ñ†Ð¸Ñ SHA1 от Steve Reid (Ñм. подробноÑти в sha1.c) " + +#: shell/callbacks.c:363 +msgid "Blowfish implementation by Paul Kocher (see blowfich.c for details)" +msgstr "Ð ÐµÐ°Ð»Ð¸Ð·Ð°Ñ†Ð¸Ñ Blowfish от Paul Kocher (Ñм. подробноÑти в blowfich.c)" + +#: shell/callbacks.c:364 +msgid "Raytracing benchmark by John Walker (see fbench.c for details)" +msgstr "ТеÑÑ‚ Raytracing от John Walker (Ñм. подробноÑти в fbench.c)" + +#: shell/callbacks.c:365 +msgid "FFT benchmark by Scott Robert Ladd (see fftbench.c for details)" +msgstr "ТеÑÑ‚ FFT Скотта от Robert Ladd (Ñм. подробноÑти в fbench.c)" + +#: shell/callbacks.c:366 +msgid "Some code partly based on x86cpucaps by Osamu Kayasono" +msgstr "ЧаÑÑ‚ÑŒ кода оÑнована на x86cpucaps от Osamu Kayasono" + +#: shell/callbacks.c:367 +msgid "Vendor list based on GtkSysInfo by Pissens Sebastien" +msgstr "СпиÑок поÑтавщиков оÑнован на GtkSysInfo от Pissens Sebastien" + +#: shell/callbacks.c:368 +msgid "DMI support based on code by Stewart Adam" +msgstr "Поддержка DMI оÑнована на коде от Stewart Adam" + +#: shell/callbacks.c:369 +msgid "SCSI support based on code by Pascal F. Martin" +msgstr "Поддержка SCSI оÑнована на коде от Pascal F. Martin" + +#: shell/callbacks.c:373 +#, fuzzy +msgid "Jakub Szypulka" +msgstr "Jakub Szypulka" + +#: shell/callbacks.c:374 +msgid "Tango Project" +msgstr "Проект Tango" + +#: shell/callbacks.c:375 +msgid "The GNOME Project" +msgstr "Проект GNOME" + +#: shell/callbacks.c:376 +msgid "VMWare, Inc. (USB icon from VMWare Workstation 6)" +msgstr "VMWare, Inc. (значок USB из VMWare Workstation 6)" + +#: shell/callbacks.c:387 +msgid "System information and benchmark tool" +msgstr "Ð˜Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð¾ ÑиÑтеме и теÑтирование" + +#: shell/callbacks.c:392 +msgid "" +"HardInfo 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.\n" +"\n" +"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.\n" +"\n" +"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" +msgstr "" +"HardInfo — Ñто Ñвободное программное обеÑпечение; вы можете раÑпроÑтранÑÑ‚ÑŒ его и/или изменÑÑ‚ÑŒ под уÑловиÑми Общей общеÑтвенной лицензии GNU, ÐºÐ¾Ñ‚Ð¾Ñ€Ð°Ñ Ð±Ñ‹Ð»Ð° опубликована Фондом Ñвободного программного обеÑпечениÑ, верÑÐ¸Ñ 2.\n" +"\n" +"Ðта программа раÑпроÑтранÑÑ‚ÑÑ Ð² надежде, что она будет полезной, но БЕЗ КÐКОЙ-ЛИБО ГÐÐ ÐÐТИИ; даже без предполагаемой гарантии ПРИГОДÐОСТИ ДЛЯ КОÐКРЕТÐЫХ ЦЕЛЕЙ. См. подробноÑти в ОбщеÑтвенной лицензии GNU.\n" +"\n" +"Ð’Ñ‹ должны были получить копию ОбщеÑтвенной лицензии GNU вмеÑте Ñ Ñтой программой; еÑли нет, пишите в Фонд Ñвободного программного обеÑпечениÑ, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA" + +#: shell/menu.c:35 +msgid "_Information" +msgstr "_ИнформациÑ" + +#: shell/menu.c:36 +msgid "_Remote" +msgstr "_Удалённо" + +#: shell/menu.c:37 +msgid "_View" +msgstr "_Вид" + +#: shell/menu.c:38 +msgid "_Help" +msgstr "_Справка" + +#: shell/menu.c:39 +msgid "About _Modules" +msgstr "О _модулÑÑ…" + +#: shell/menu.c:43 +msgid "Generate _Report" +msgstr "Создать _отчёт" + +#: shell/menu.c:48 +msgid "_Network Updater..." +msgstr "_Обновление через Ñеть..." + +#: shell/menu.c:53 +msgid "_Open..." +msgstr "_Открыть..." + +#: shell/menu.c:58 +msgid "_Connect to..." +msgstr "_ПодключитьÑÑ Ðº..." + +#: shell/menu.c:63 +msgid "_Manage hosts..." +msgstr "_Управление хоÑтами..." + +#: shell/menu.c:68 +msgid "_Local computer" +msgstr "_Локальный компьютер" + +#: shell/menu.c:73 +msgid "_Copy to Clipboard" +msgstr "_Копировать в буфер" + +#: shell/menu.c:74 +msgid "Copy to clipboard" +msgstr "Копировать в буфер обмена" + +#: shell/menu.c:78 +msgid "_Save image as..." +msgstr "_Сохранить изображение как..." + +#: shell/menu.c:83 +msgid "_Refresh" +msgstr "_Обновить" + +#: shell/menu.c:88 +msgid "Contents" +msgstr "Содержание" + +#: shell/menu.c:93 +#: shell/shell.c:1790 +#: shell/shell.c:1807 +msgid "Context help" +msgstr "КонтекÑÑ‚Ð½Ð°Ñ Ñправка" + +#: shell/menu.c:98 +msgid "_Open HardInfo Web Site" +msgstr "_Открыть веб-Ñайт Hardinfo" + +#: shell/menu.c:103 +msgid "_Report bug" +msgstr "_Сообщить об ошибке" + +#: shell/menu.c:108 +msgid "_Donate to the project" +msgstr "_Поддержать проект" + +#: shell/menu.c:113 +msgid "_About HardInfo" +msgstr "_О HardInfo" + +#: shell/menu.c:114 +msgid "Displays program version information" +msgstr "Показывает информацию о верÑии программы" + +#: shell/menu.c:118 +msgid "_Quit" +msgstr "_Выход" + +#: shell/menu.c:125 +msgid "_Side Pane" +msgstr "_Ð‘Ð¾ÐºÐ¾Ð²Ð°Ñ Ð¿Ð°Ð½ÐµÐ»ÑŒ" + +#: shell/menu.c:126 +msgid "Toggles side pane visibility" +msgstr "УправлÑет боковой панелью" + +#: shell/menu.c:129 +msgid "_Toolbar" +msgstr "_Панель инÑтрументов" + +#: shell/menu.c:133 +msgid "_Accept connections" +msgstr "_Принимать подключениÑ" + +#: shell/report.c:492 +msgid "Save File" +msgstr "Сохранить файл" + +#: shell/report.c:616 +msgid "Cannot create ReportContext. Programming bug?" +msgstr "Ðе могу Ñоздать ReportContext. Ошибка программированиÑ?" + +#: shell/report.c:634 +msgid "Open the report with your web browser?" +msgstr "Открыть отчёт в веб-браузере?" + +#: shell/report.c:662 +msgid "Generating report..." +msgstr "СоздаётÑÑ Ð¾Ñ‚Ñ‡Ñ‘Ñ‚..." + +#: shell/report.c:672 +msgid "Report saved." +msgstr "Отчёт Ñохранён." + +#: shell/report.c:674 +msgid "Error while creating the report." +msgstr "Ошибка во Ð²Ñ€ÐµÐ¼Ñ ÑÐ¾Ð·Ð´Ð°Ð½Ð¸Ñ Ð¾Ñ‚Ñ‡Ñ‘Ñ‚Ð°." + +#: shell/report.c:776 +msgid "Generate Report" +msgstr "Создать отчёт" + +#: shell/report.c:793 +msgid "" +"<big><b>Generate Report</b></big>\n" +"Please choose the information that you wish to view in your report:" +msgstr "" +"<big><b>Создать отчёт</b></big>\n" +"ПожалуйÑта выберите информацию, которую вы хотите видеть в отчёте:" + +#: shell/report.c:853 +msgid "Select _None" +msgstr "Выбор: нет" + +#: shell/report.c:860 +msgid "Select _All" +msgstr "Выбор: вÑе" + +#: shell/report.c:878 +msgid "_Generate" +msgstr "_Сгенерировать" + +#: shell/shell.c:407 +#, c-format +msgid "%s - System Information" +msgstr "%s - Ð˜Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð¾ ÑиÑтеме" + +#: shell/shell.c:412 +msgid "System Information" +msgstr "Ð˜Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð¾ ÑиÑтеме" + +#: shell/shell.c:801 +msgid "Loading modules..." +msgstr "Загрузка модулей..." + +#: shell/shell.c:1650 +#, c-format +msgid "<b>%s → Summary</b>" +msgstr "<b>%s → </b>" + +#: shell/shell.c:1758 +msgid "Updating..." +msgstr "Обновление..." + +#: shell/syncmanager.c:69 +msgid "" +"<big><b>Synchronize with Central Database</b></big>\n" +"The following information may be synchronized with the HardInfo central database." +msgstr "" +"<big><b>Синхронизировать Ñ Ñ†ÐµÐ½Ñ‚Ñ€Ð°Ð»ÑŒÐ½Ð¾Ð¹ базой данных</b></big>\n" +"Ð¡Ð»ÐµÐ´ÑƒÑŽÑ‰Ð°Ñ Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð¼Ð¾Ð¶ÐµÑ‚ быть Ñинхронизирована Ñ Ñ†ÐµÐ½Ñ‚Ñ€Ð°Ð»ÑŒÐ½Ð¾Ð¹ базой данных HardInfo." + +#: shell/syncmanager.c:72 +msgid "" +"<big><b>Synchronizing</b></big>\n" +"This may take some time." +msgstr "" +"<big><b>СинхронизациÑ</b></big>\n" +"Ðто может занÑÑ‚ÑŒ какое-то времÑ." + +#: shell/syncmanager.c:132 +msgid "HardInfo was compiled without libsoup support. (Network Updater requires it.)" +msgstr "HardInfo был Ñкомпилирован без поддержки libsoup. (Ðужен Ð´Ð»Ñ Ñетевого обновлениÑ.)" + +#: shell/syncmanager.c:161 +#: shell/syncmanager.c:185 +#, c-format +msgid "%s (error #%d)" +msgstr "%s (ошибка #%d)" + +#: shell/syncmanager.c:170 +#: shell/syncmanager.c:194 +msgid "Could not parse XML-RPC response" +msgstr "Ðе могу разобрать XML-RPC ответ" + +#: shell/syncmanager.c:267 +#, c-format +msgid "Server says it supports API version %d, but this version of HardInfo only supports API version %d." +msgstr "Сервер говорит, что поддерживает API верÑии %d, но Ñта верÑÐ¸Ñ HardInfo поддерживает API только верÑии %d." + +#: shell/syncmanager.c:362 +msgid "Contacting HardInfo Central Database" +msgstr "Подключение к центральной базе данных Hardinfo" + +#: shell/syncmanager.c:363 +msgid "Cleaning up" +msgstr "ОчиÑтка" + +#: shell/syncmanager.c:480 +#, c-format +msgid "<s>%s</s> <i>(canceled)</i>" +msgstr "<s>%s</s> <i>(отменен)</i>" + +#: shell/syncmanager.c:497 +#, c-format +msgid "<b><s>%s</s></b> <i>(failed)</i>" +msgstr "<b><s>%s</s></b> <i>(ошибка)</i>" + +#: shell/syncmanager.c:509 +#, c-format +msgid "" +"Failed while performing \"%s\". Please file a bug report if this problem persists. (Use the Help→Report bug option.)\n" +"\n" +"Details: %s" +msgstr "" +"Ошибка во Ð²Ñ€ÐµÐ¼Ñ Ð²Ñ‹Ð¿Ð¾Ð»Ð½ÐµÐ½Ð¸Ñ \"%s\". ЕÑли проблема будет повторÑÑ‚ÑŒÑÑ, пожалуйÑта, Ñообщите об ошибке. (ИÑпользуйте опцию в меню Справка.)\n" +"\n" +"ПодробноÑти: %s" + +#: shell/syncmanager.c:518 +#, c-format +msgid "Failed while performing \"%s\". Please file a bug report if this problem persists. (Use the Help→Report bug option.)" +msgstr "Ошибка во Ð²Ñ€ÐµÐ¼Ñ Ð²Ñ‹Ð¿Ð¾Ð»Ð½ÐµÐ½Ð¸Ñ \"%s\". ЕÑли проблема будет повторÑÑ‚ÑŒÑÑ, пожалуйÑта, Ñообщите об ошибке. (ИÑпользуйте опцию в меню Справка.)" + +#: shell/syncmanager.c:646 +msgid "Network Updater" +msgstr "Сетевое обновление" + +#: shell/syncmanager.c:727 +msgid "_Synchronize" +msgstr "_Синхронизировать" + +#: modules/benchmark.c:50 +#, fuzzy +msgid "CPU Blowfish" +msgstr "ЦПУ МГц" + +#: modules/benchmark.c:51 +#, fuzzy +msgid "CPU CryptoHash" +msgstr "ЦПУ МГц" + +#: modules/benchmark.c:52 +#, fuzzy +msgid "CPU Fibonacci" +msgstr "ЦПУ МГц" + +#: modules/benchmark.c:53 +#, fuzzy +msgid "CPU N-Queens" +msgstr "ЦПУ МГц" + +#: modules/benchmark.c:54 +msgid "FPU FFT" +msgstr "" + +#: modules/benchmark.c:55 +msgid "FPU Raytracing" +msgstr "" + +#: modules/benchmark.c:56 +msgid "GPU Drawing" +msgstr "" + +#: modules/benchmark.c:222 +#, c-format +msgid "" +"[$ShellParam$]\n" +"Zebra=1\n" +"OrderType=%d\n" +"ViewType=3\n" +"ColumnTitle$Extra1=CPU Clock\n" +"ColumnTitle$Progress=Results\n" +"ColumnTitle$TextValue=CPU\n" +"ShowColumnHeaders=true\n" +"[%s]\n" +"<big><b>This Machine</b></big>=%.3f|%s MHz\n" +"%s" +msgstr "" +"[$ShellParam$]\n" +"Zebra=1\n" +"OrderType=%d\n" +"ViewType=3\n" +"ColumnTitle$Extra1=ЧаÑтота процеÑÑора\n" +"ColumnTitle$Progress=Результаты\n" +"ColumnTitle$TextValue=ПроцеÑÑор\n" +"ShowColumnHeaders=true\n" +"[%s]\n" +"<big><b>Ðта машина</b></big>=%.3f|%s MHz\n" +"%s" + +#: modules/benchmark.c:235 +#, c-format +msgid "" +"[$ShellParam$]\n" +"Zebra=1\n" +"OrderType=%d\n" +"ViewType=3\n" +"ColumnTitle$Extra1=CPU Clock\n" +"ColumnTitle$Progress=Results\n" +"ColumnTitle$TextValue=CPU\n" +"ShowColumnHeaders=true\n" +"[%s]\n" +"%s" +msgstr "" +"[$ShellParam$]\n" +"Zebra=1\n" +"OrderType=%d\n" +"ViewType=3\n" +"ColumnTitle$Extra1=ЧаÑтота процеÑÑора\n" +"ColumnTitle$Progress=Результаты\n" +"ColumnTitle$TextValue=ПроцеÑÑор\n" +"ShowColumnHeaders=true\n" +"[%s]\n" +"%s" + +#: modules/benchmark.c:363 +#, c-format +msgid "Benchmarking: <b>%s</b>." +msgstr "ТеÑтирование: <b>%s</b>" + +#: modules/benchmark.c:377 +msgid "Benchmarking. Please do not move your mouse or press any keys." +msgstr "ТеÑтирование. ПожалуйÑта, не двигайте мышь и не нажимайте на кнопки." + +#: modules/benchmark.c:381 +msgid "Cancel" +msgstr "Отмена" + +#: modules/benchmark.c:511 +msgid "Results in MiB/second. Higher is better." +msgstr "Результаты в МиБ/Ñек. Чем выше, тем лучше." + +#: modules/benchmark.c:514 +msgid "Results in HIMarks. Higher is better." +msgstr "Результаты в HIMarks. Чем выше, тем лучше." + +#: modules/benchmark.c:521 +msgid "Results in seconds. Lower is better." +msgstr "Результат в Ñекундах. Чем ниже, тем лучше." + +#: modules/benchmark.c:529 +msgid "Benchmarks" +msgstr "ТеÑÑ‚Ñ‹" + +#: modules/benchmark.c:547 +msgid "Perform tasks and compare with other systems" +msgstr "ВыполнÑет Ð·Ð°Ð´Ð°Ð½Ð¸Ñ Ð¸ Ñравнивает Ñ Ð´Ñ€ÑƒÐ³Ð¸Ð¼Ð¸ ÑиÑтемами" + +#: modules/benchmark.c:634 +msgid "Send benchmark results" +msgstr "Отправить результаты теÑтированиÑ" + +#: modules/benchmark.c:639 +msgid "Receive benchmark results" +msgstr "ПринÑÑ‚ÑŒ результаты теÑтированиÑ" + +#: modules/computer.c:68 +msgid "Summary" +msgstr "ÐžÐ±Ñ‰Ð°Ñ Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ" + +#: modules/computer.c:69 +msgid "Operating System" +msgstr "ÐžÐ¿ÐµÑ€Ð°Ñ†Ð¸Ð¾Ð½Ð½Ð°Ñ ÑиÑтема" + +#: modules/computer.c:70 +msgid "Kernel Modules" +msgstr "Модули Ñдра" + +#: modules/computer.c:71 +msgid "Boots" +msgstr "Загрузки" + +#: modules/computer.c:72 +msgid "Languages" +msgstr "Языки" + +#: modules/computer.c:73 +msgid "Filesystems" +msgstr "Файловые ÑиÑтемы" + +#: modules/computer.c:74 +msgid "Display" +msgstr "ДиÑплей" + +#: modules/computer.c:75 +msgid "Environment Variables" +msgstr "Переменные Ñреды" + +#: modules/computer.c:77 +msgid "Development" +msgstr "Разработка" + +#: modules/computer.c:79 +msgid "Users" +msgstr "Пользователи" + +#: modules/computer.c:80 +msgid "Groups" +msgstr "Группы" + +#: modules/computer.c:104 +#, c-format +msgid "%dMB (%dMB used)" +msgstr "%dМб (%dМб занÑто)" + +#: modules/computer.c:200 +msgid "Scripting Languages" +msgstr "Скриптовые Ñзыки" + +#: modules/computer.c:201 +msgid "CPython" +msgstr "" + +#: modules/computer.c:202 +#, fuzzy +msgid "Perl" +msgstr "Perl" + +#: modules/computer.c:203 +msgid "PHP" +msgstr "" + +#: modules/computer.c:204 +msgid "Ruby" +msgstr "" + +#: modules/computer.c:205 +msgid "Bash" +msgstr "" + +#: modules/computer.c:206 +msgid "Compilers" +msgstr "КомпилÑторы" + +#: modules/computer.c:207 +msgid "C (GCC)" +msgstr "" + +#: modules/computer.c:208 +#, fuzzy +msgid "Java" +msgstr "Язык Ð¿Ñ€Ð¾Ð³Ñ€Ð°Ð¼Ð¼Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ Java" + +#: modules/computer.c:209 +#, fuzzy +msgid "CSharp (Mono, old)" +msgstr "Ðайдена ÑÑ‚Ð°Ñ€Ð°Ñ ÑƒÑтановка %s." + +#: modules/computer.c:210 +#, fuzzy +msgid "CSharp (Mono)" +msgstr "Моноширинный шрифт" + +#: modules/computer.c:211 +#, fuzzy +msgid "Vala" +msgstr "базы данных vala" + +#: modules/computer.c:212 +msgid "Haskell (GHC)" +msgstr "" + +#: modules/computer.c:213 +msgid "FreePascal" +msgstr "" + +#: modules/computer.c:214 +msgid "Tools" +msgstr "ИнÑтрументы" + +#: modules/computer.c:262 +#, c-format +msgid "%s=Not found\n" +msgstr "%s=Ðе найдено\n" + +#: modules/computer.c:265 +#, c-format +msgid "Detecting version: %s" +msgstr "Определена верÑиÑ: %s" + +#: modules/computer.c:276 +#, c-format +msgid "" +"[$ShellParam$]\n" +"ColumnTitle$TextValue=Program\n" +"ColumnTitle$Value=Version\n" +"ShowColumnHeaders=true\n" +"%s" +msgstr "" +"[$ShellParam$]\n" +"ColumnTitle$TextValue=Программа\n" +"ColumnTitle$Value=ВерÑиÑ\n" +"ShowColumnHeaders=true\n" +"%s" + +#: modules/computer.c:356 +msgid "Physical machine" +msgstr "ФизичеÑÐºÐ°Ñ Ð¼Ð°ÑˆÐ¸Ð½Ð°" + +# Memory и Date/Time не переводить — не будут обновлÑÑ‚ÑŒÑÑ! +#: modules/computer.c:373 +#, c-format +msgid "" +"[$ShellParam$]\n" +"UpdateInterval$Memory=1000\n" +"UpdateInterval$Date/Time=1000\n" +"#ReloadInterval=5000\n" +"[Computer]\n" +"Processor=%s\n" +"Memory=...\n" +"Machine Type=%s\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" +"\n" +"%s\n" +"[Input Devices]\n" +"%s\n" +"\n" +"%s\n" +"\n" +"%s\n" +msgstr "" +"[$ShellParam$]\n" +"UpdateInterval$ПамÑÑ‚ÑŒ=1000\n" +"UpdateInterval$Date/Time=1000\n" +"#ReloadInterval=5000\n" +"[Компьютер]\n" +"ПроцеÑÑор=%s\n" +"ПамÑÑ‚ÑŒ=...\n" +"Тип машины=%s\n" +"ÐžÐ¿ÐµÑ€Ð°Ñ†Ð¸Ð¾Ð½Ð½Ð°Ñ ÑиÑтема=%s\n" +"Пользователь=%s\n" +"Date/Time=...\n" +"[ДиÑплей]\n" +"Разрешение=%dx%d пикÑ.\n" +"Рендер OpenGL=%s\n" +"ПоÑтавщик X11=%s\n" +"\n" +"%s\n" +"[УÑтройÑтва ввода]\n" +"%s\n" +"\n" +"%s\n" +"\n" +"%s\n" + +# Uptime, Load Average и Available entropy in /dev/random не переводить — не будут обновлÑÑ‚ÑŒÑÑ! +#: modules/computer.c:415 +#, c-format +msgid "" +"[$ShellParam$]\n" +"UpdateInterval$Uptime=10000\n" +"UpdateInterval$Load Average=1000\n" +"UpdateInterval$Available entropy in /dev/random=1000\n" +"[Version]\n" +"Kernel=%s\n" +"Version=%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=...\n" +"Available entropy in /dev/random=..." +msgstr "" +"[$ShellParam$]\n" +"UpdateInterval$Uptime=10000\n" +"UpdateInterval$Load Average=1000\n" +"UpdateInterval$Available entropy in /dev/random=1000\n" +"[ВерÑиÑ]\n" +"Ядро=%s\n" +"ВерÑиÑ=%s\n" +"Библиотека C=%s\n" +"ДиÑтрибутив=%s\n" +"[Ð¢ÐµÐºÑƒÑ‰Ð°Ñ ÑеÑÑиÑ]\n" +"Ð˜Ð¼Ñ ÐºÐ¾Ð¼Ð¿ÑŒÑŽÑ‚ÐµÑ€Ð°=%s\n" +"Пользователь=%s\n" +"#Язык=%s\n" +"Домашний каталог=%s\n" +"Окружение рабочего Ñтола=%s\n" +"[Разное]\n" +"Uptime=...\n" +"Load Average=...\n" +"Available entropy in /dev/random=..." + +#: modules/computer.c:444 +#, c-format +msgid "" +"[Loaded Modules]\n" +"%s[$ShellParam$]\n" +"ViewType=1\n" +"ColumnTitle$TextValue=Name\n" +"ColumnTitle$Value=Description\n" +"ShowColumnHeaders=true\n" +msgstr "" +"[Loaded Modules]\n" +"%s[$ShellParam$]\n" +"ViewType=1\n" +"ColumnTitle$TextValue=ИмÑ\n" +"ColumnTitle$Value=ОпиÑание\n" +"ShowColumnHeaders=true\n" + +#: modules/computer.c:455 +#, c-format +msgid "" +"[$ShellParam$]\n" +"ColumnTitle$TextValue=Date & Time\n" +"ColumnTitle$Value=Kernel Version\n" +"ShowColumnHeaders=true\n" +"\n" +"%s" +msgstr "" +"[$ShellParam$]\n" +"ColumnTitle$TextValue=Дата и времÑ\n" +"ColumnTitle$Value=ВерÑÐ¸Ñ Ñдра\n" +"ShowColumnHeaders=true\n" +"\n" +"%s" + +#: modules/computer.c:465 +#, c-format +msgid "" +"[$ShellParam$]\n" +"ViewType=1\n" +"ColumnTitle$TextValue=Language Code\n" +"ColumnTitle$Value=Name\n" +"ShowColumnHeaders=true\n" +"[Available Languages]\n" +"%s" +msgstr "" +"[$ShellParam$]\n" +"ViewType=1\n" +"ColumnTitle$TextValue=Код Ñзыка\n" +"ColumnTitle$Value=Ðазвание\n" +"ShowColumnHeaders=true\n" +"[Available Languages]\n" +"%s" + +#: modules/computer.c:476 +#, c-format +msgid "" +"[$ShellParam$]\n" +"ViewType=4\n" +"ReloadInterval=5000\n" +"Zebra=1\n" +"NormalizePercentage=false\n" +"ColumnTitle$Extra1=Mount Point\n" +"ColumnTitle$Progress=Usage\n" +"ColumnTitle$TextValue=Device\n" +"ShowColumnHeaders=true\n" +"[Mounted File Systems]\n" +"%s\n" +msgstr "" +"[$ShellParam$]\n" +"ViewType=4\n" +"ReloadInterval=5000\n" +"Zebra=1\n" +"NormalizePercentage=false\n" +"ColumnTitle$Extra1=Точка монтированиÑ\n" +"ColumnTitle$Progress=ИÑпользование\n" +"ColumnTitle$TextValue=УÑтройÑтво\n" +"ShowColumnHeaders=true\n" +"[Mounted File Systems]\n" +"%s\n" + +#: modules/computer.c:490 +#, c-format +msgid "" +"[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" +msgstr "" +"[ДиÑплей]\n" +"Разрешение=%dx%d пикÑ.\n" +"ПоÑтавщик=%s\n" +"ВерÑиÑ=%s\n" +"[Монитор]\n" +"%s[РаÑширениÑ]\n" +"%s[OpenGL]\n" +"ПоÑтавщик=%s\n" +"Рендер=%s\n" +"ВерÑиÑ=%s\n" +"ГрафичеÑкое уÑкорение=%s\n" + +#: modules/computer.c:512 +msgid "Y_es" +msgstr "ЕÑÑ‚ÑŒ" + +#: modules/computer.c:512 +#: modules/devices/printers.c:138 +msgid "No" +msgstr "Ðет" + +#: modules/computer.c:526 +#, c-format +msgid "" +"[$ShellParam$]\n" +"ReloadInterval=10000\n" +"ColumnTitle$TextValue=Name\n" +"ColumnTitle$Value=Group ID\n" +"ShowColumnHeaders=true\n" +"[Groups]\n" +"%s\n" +msgstr "" +"[$ShellParam$]\n" +"ReloadInterval=10000\n" +"ColumnTitle$TextValue=ИмÑ\n" +"ColumnTitle$Value=ID группы\n" +"ShowColumnHeaders=true\n" +"[Groups]\n" +"%s\n" + +#: modules/computer.c:606 +msgid "Computer" +msgstr "Компьютер" + +#: modules/computer.c:700 +msgid "Gathers high-level computer information" +msgstr "Собирает выÑокоуровневую информацию о компьютере" + +#: modules/devices.c:74 +msgid "Processor" +msgstr "ПроцеÑÑор" + +#: modules/devices.c:75 +msgid "Memory" +msgstr "ПамÑÑ‚ÑŒ" + +#: modules/devices.c:76 +msgid "PCI Devices" +msgstr "УÑтройÑтва PCI" + +#: modules/devices.c:77 +msgid "USB Devices" +msgstr "УÑтройÑтва USB" + +#: modules/devices.c:78 +msgid "Printers" +msgstr "Принтеры" + +#: modules/devices.c:79 +msgid "Battery" +msgstr "БатареÑ" + +#: modules/devices.c:80 +msgid "Sensors" +msgstr "СенÑоры" + +#: modules/devices.c:81 +msgid "Input Devices" +msgstr "УÑтройÑтва ввода" + +#: modules/devices.c:82 +msgid "Storage" +msgstr "УÑтройÑтва хранениÑ" + +#: modules/devices.c:84 +msgid "DMI" +msgstr "" + +#: modules/devices.c:85 +msgid "Memory SPD" +msgstr "ПамÑÑ‚ÑŒ SPD" + +#: modules/devices.c:87 +msgid "Resources" +msgstr "РеÑурÑÑ‹" + +#: modules/devices.c:154 +#: modules/devices.c:197 +#: modules/devices/printers.c:99 +#: modules/devices/printers.c:106 +#: modules/devices/printers.c:116 +#: modules/devices/printers.c:131 +#: modules/devices/printers.c:140 +#: modules/devices/printers.c:243 +#: modules/computer/os.c:53 +#: modules/computer/os.c:130 +msgid "Unknown" +msgstr "ÐеизвеÑтно" + +#: modules/devices.c:193 +msgid " (vendor unknown)" +msgstr "(поÑтавщик неизвеÑтен)" + +#: modules/devices.c:195 +msgid " (model unknown)" +msgstr "(модель неизвеÑтна)" + +#: modules/devices.c:412 +msgid "Devices" +msgstr "УÑтройÑтва" + +#: modules/devices.c:424 +msgid "Update PCI ID listing" +msgstr "Обновить ÑпиÑок PCI ID" + +#: modules/devices.c:436 +msgid "Update CPU feature database" +msgstr "Обновить базу данных функций процеÑÑора" + +#: modules/devices.c:464 +msgid "Gathers information about hardware devices" +msgstr "Собирает информацию об уÑтройÑтвах" + +#: modules/devices.c:500 +msgid "Resource information requires superuser privileges" +msgstr "Ð”Ð»Ñ Ð²Ñ‹Ð²Ð¾Ð´Ð° информации о реÑурÑах нужны права админиÑтратора" + +#: modules/network.c:59 +msgid "Interfaces" +msgstr "ИнтерфейÑÑ‹" + +#: modules/network.c:60 +msgid "IP Connections" +msgstr "IP ПодключениÑ" + +#: modules/network.c:61 +msgid "Routing Table" +msgstr "Таблица маршрутизации" + +#: modules/network.c:62 +msgid "ARP Table" +msgstr "Таблица ARP" + +#: modules/network.c:63 +msgid "DNS Servers" +msgstr "DNS Ñервера" + +#: modules/network.c:64 +msgid "Statistics" +msgstr "СтатиÑтика" + +#: modules/network.c:65 +msgid "Shared Directories" +msgstr "Общие каталоги" + +#: modules/network.c:300 +#, c-format +msgid "" +"[ARP Table]\n" +"%s\n" +"[$ShellParam$]\n" +"ReloadInterval=3000\n" +"ColumnTitle$TextValue=IP Address\n" +"ColumnTitle$Value=Interface\n" +"ColumnTitle$Extra1=MAC Address\n" +"ShowColumnHeaders=true\n" +msgstr "" +"[Таблица ARP]\n" +"%s\n" +"[$ShellParam$]\n" +"ReloadInterval=3000\n" +"ColumnTitle$TextValue=IP-адреÑ\n" +"ColumnTitle$Value=ИнтерфейÑ\n" +"ColumnTitle$Extra1=MAC-адреÑ\n" +"ShowColumnHeaders=true\n" + +#: modules/network.c:321 +#, c-format +msgid "" +"[Name servers]\n" +"%s\n" +"[$ShellParam$]\n" +"ColumnTitle$TextValue=IP Address\n" +"ColumnTitle$Value=Name\n" +"ShowColumnHeaders=true\n" +msgstr "" +"[Name servers]\n" +"%s\n" +"[$ShellParam$]\n" +"ColumnTitle$TextValue=IP-адреÑ\n" +"ColumnTitle$Value=ИмÑ\n" +"ShowColumnHeaders=true\n" + +#: modules/network.c:331 +#, c-format +msgid "" +"[Connections]\n" +"%s\n" +"[$ShellParam$]\n" +"ReloadInterval=3000\n" +"ColumnTitle$TextValue=Local Address\n" +"ColumnTitle$Value=Protocol\n" +"ColumnTitle$Extra1=Foreign Address\n" +"ColumnTitle$Extra2=State\n" +"ShowColumnHeaders=true\n" +msgstr "" +"[Connections]\n" +"%s\n" +"[$ShellParam$]\n" +"ReloadInterval=3000\n" +"ColumnTitle$TextValue=Локальный адреÑ\n" +"ColumnTitle$Value=Протокол\n" +"ColumnTitle$Extra1=Удалённый адреÑ\n" +"ColumnTitle$Extra2=СоÑтоÑние\n" +"ShowColumnHeaders=true\n" + +#: modules/network.c:345 +#, c-format +msgid "" +"%s\n" +"[$ShellParam$]\n" +"ReloadInterval=3000\n" +"ViewType=1\n" +"ColumnTitle$TextValue=Interface\n" +"ColumnTitle$Value=IP Address\n" +"ColumnTitle$Extra1=Sent\n" +"ColumnTitle$Extra2=Received\n" +"ShowColumnHeaders=true\n" +"%s" +msgstr "" +"%s\n" +"[$ShellParam$]\n" +"ReloadInterval=3000\n" +"ViewType=1\n" +"ColumnTitle$TextValue=ИнтерфейÑ\n" +"ColumnTitle$Value=IP-адреÑ\n" +"ColumnTitle$Extra1=Отправлено\n" +"ColumnTitle$Extra2=Получено\n" +"ShowColumnHeaders=true\n" +"%s" + +#: modules/network.c:361 +#, c-format +msgid "" +"[IP routing table]\n" +"%s\n" +"[$ShellParam$]\n" +"ViewType=0\n" +"ReloadInterval=3000\n" +"ColumnTitle$TextValue=Destination / Gateway\n" +"ColumnTitle$Value=Interface\n" +"ColumnTitle$Extra1=Flags\n" +"ColumnTitle$Extra2=Mask\n" +"ShowColumnHeaders=true\n" +msgstr "" +"[IP routing table]\n" +"%s\n" +"[$ShellParam$]\n" +"ViewType=0\n" +"ReloadInterval=3000\n" +"ColumnTitle$TextValue=Цель / Шлюз\n" +"ColumnTitle$Value=ИнтерфейÑ\n" +"ColumnTitle$Extra1=Флаги\n" +"ColumnTitle$Extra2=МаÑка\n" +"ShowColumnHeaders=true\n" + +#: modules/network.c:399 +msgid "Network" +msgstr "Сеть" + +#: modules/network.c:432 +msgid "Gathers information about this computer's network connection" +msgstr "Собирает информацию о Ñетевых подключениÑÑ…" + +#: modules/computer/alsa.c:26 +msgid "[Audio Devices]\n" +msgstr "[Ðудио уÑтройÑтва]\n" + +#: modules/computer/alsa.c:33 +#, c-format +msgid "Audio Adapter#%d=%s\n" +msgstr "Ð—Ð²ÑƒÐºÐ¾Ð²Ð°Ñ ÐºÐ°Ñ€Ñ‚Ð°#%d=%s\n" + +#: modules/computer/boots.c:33 +msgid "[Boots]\n" +msgstr "[Загрузки]\n" + +#: modules/computer/display.c:83 +msgid "vendor string" +msgstr "Ñтрока поÑтавщика" + +#: modules/computer/display.c:84 +msgid "X.Org version" +msgstr "ВерÑÐ¸Ñ X.Org" + +#: modules/computer/display.c:85 +msgid "XFree86 version" +msgstr "ВерÑÐ¸Ñ XFree86" + +#: modules/computer/display.c:122 +#, c-format +msgid "Monitor %d=%dx%d pixels\n" +msgstr "Монитор %d=%dx%d пикÑелей\n" + +#: modules/computer/environment.c:32 +msgid "[Environment Variables]\n" +msgstr "[Переменные Ñреды]\n" + +#: modules/devices/devmemory.c:89 +msgid "Total Memory" +msgstr "ÐžÐ±Ñ‰Ð°Ñ Ð¿Ð°Ð¼ÑÑ‚ÑŒ" + +#: modules/devices/devmemory.c:90 +msgid "Free Memory" +msgstr "Ð¡Ð²Ð¾Ð±Ð¾Ð´Ð½Ð°Ñ Ð¿Ð°Ð¼ÑÑ‚ÑŒ" + +#: modules/devices/devmemory.c:91 +msgid "Cached Swap" +msgstr "КÑш подкачки" + +#: modules/devices/devmemory.c:92 +msgid "High Memory" +msgstr "Ð’Ñ‹ÑÐ¾ÐºÐ°Ñ Ð¿Ð°Ð¼ÑÑ‚ÑŒ" + +#: modules/devices/devmemory.c:93 +msgid "Free High Memory" +msgstr "Ð¡Ð²Ð¾Ð±Ð¾Ð´Ð½Ð°Ñ Ð²Ñ‹ÑÐ¾ÐºÐ°Ñ Ð¿Ð°Ð¼ÑÑ‚ÑŒ" + +#: modules/devices/devmemory.c:94 +msgid "Low Memory" +msgstr "ÐÐ¸Ð·ÐºÐ°Ñ Ð¿Ð°Ð¼ÑÑ‚ÑŒ" + +#: modules/devices/devmemory.c:95 +msgid "Free Low Memory" +msgstr "Ð¡Ð²Ð¾Ð±Ð¾Ð´Ð½Ð°Ñ Ð½Ð¸Ð·ÐºÐ°Ñ Ð¿Ð°Ð¼ÑÑ‚ÑŒ" + +#: modules/devices/devmemory.c:96 +msgid "Virtual Memory" +msgstr "Ð’Ð¸Ñ€Ñ‚ÑƒÐ°Ð»ÑŒÐ½Ð°Ñ Ð¿Ð°Ð¼ÑÑ‚ÑŒ" + +#: modules/devices/devmemory.c:97 +msgid "Free Virtual Memory" +msgstr "Ð¡Ð²Ð¾Ð±Ð¾Ð´Ð½Ð°Ñ Ð²Ð¸Ñ€Ñ‚ÑƒÐ°Ð»ÑŒÐ½Ð°Ñ Ð¿Ð°Ð¼ÑÑ‚ÑŒ" + +#: modules/devices/spd-decode.c:1475 +msgid "" +"[SPD]\n" +"Please load the eeprom module to obtain information about memory SPD=\n" +"[$ShellParam$]\n" +"ReloadInterval=500\n" +msgstr "" +"[SPD]\n" +"ПожалуйÑта, загрузите модуль eeprom Ð´Ð»Ñ Ð¿Ð¾Ð»ÑƒÑ‡ÐµÐ½Ð¸Ñ Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ð¸ о памÑти SPD=\n" +"[$ShellParam$]\n" +"ReloadInterval=500\n" + +#: modules/devices/spd-decode.c:1480 +msgid "" +"[SPD]\n" +"Reading memory SPD not supported on this system=\n" +msgstr "" +"[SPD]\n" +"Чтение памÑти SPD не поддерживаетÑÑ Ð½Ð° данной ÑиÑтеме=\n" + +#: hardinfo/util.c:102 +#: hardinfo/util.c:105 +#: hardinfo/util.c:110 +#, c-format +msgid "%d minute" +msgid_plural "%d minutes" +msgstr[0] "%d минута" +msgstr[1] "%d минуты" +msgstr[2] "%d минут" + +#: hardinfo/util.c:104 +#, c-format +msgid "%d hour, " +msgid_plural "%d hours, " +msgstr[0] "%d чаÑ" +msgstr[1] "%d чаÑа" +msgstr[2] "%d чаÑов" + +#: hardinfo/util.c:108 +#, c-format +msgid "%d day, " +msgid_plural "%d days, " +msgstr[0] "%d день" +msgstr[1] "%d днÑ" +msgstr[2] "%d дней" + +#: hardinfo/util.c:109 +#, c-format +msgid "%d hour and " +msgid_plural "%d hours and " +msgstr[0] "%d Ñ‡Ð°Ñ Ð¸" +msgstr[1] "%d чаÑа и" +msgstr[2] "%d чаÑов и" + +#: hardinfo/util.c:116 +#, c-format +msgid "%.1f B" +msgstr "%.1f Б" + +#: hardinfo/util.c:118 +#, fuzzy, c-format +msgid "%.1f KiB" +msgstr "%.1f КиБ" + +#: hardinfo/util.c:120 +#, fuzzy, c-format +msgid "%.1f MiB" +msgstr "%.1f МиБ" + +#: hardinfo/util.c:122 +#, fuzzy, c-format +msgid "%.1f GiB" +msgstr "%.1f ГиБ" + +#: hardinfo/util.c:336 +msgid "Error" +msgstr "Ошибка" + +#: hardinfo/util.c:336 +#: hardinfo/util.c:352 +msgid "Warning" +msgstr "Предупреждение" + +#: hardinfo/util.c:351 +msgid "Fatal Error" +msgstr "Ð¤Ð°Ñ‚Ð°Ð»ÑŒÐ½Ð°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ°" + +#: hardinfo/util.c:376 +msgid "creates a report and prints to standard output" +msgstr "Ñоздаёт отчёт и выводит на Ñтандартный вывод" + +#: hardinfo/util.c:382 +msgid "chooses a report format (text, html)" +msgstr "выбирает формат отчёта (text, html)" + +#: hardinfo/util.c:388 +msgid "run benchmark; requires benchmark.so to be loaded" +msgstr "запуÑк теÑта; требует, чтобы benchmark.so был загружен" + +#: hardinfo/util.c:394 +msgid "lists modules" +msgstr "ÑпиÑок модулей" + +#: hardinfo/util.c:400 +msgid "specify module to load" +msgstr "укажите модуль Ð´Ð»Ñ Ð·Ð°Ð³Ñ€ÑƒÐ·ÐºÐ¸" + +#: hardinfo/util.c:406 +msgid "automatically load module dependencies" +msgstr "автоматичеÑки загружает завиÑимоÑти модулей" + +#: hardinfo/util.c:413 +msgid "run in XML-RPC server mode" +msgstr "запуÑк в режиме Ñервера XML-RPC" + +#: hardinfo/util.c:420 +msgid "shows program version and quit" +msgstr "показывает верÑию программы и выходит" + +#: hardinfo/util.c:425 +msgid "- System Profiler and Benchmark tool" +msgstr "- ИнÑтрумент Ð´Ð»Ñ Ñ‚ÐµÑÑ‚Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ Ð¸ проверки ÑвойÑтв ÑиÑтемы" + +#: hardinfo/util.c:435 +#, c-format +msgid "" +"Unrecognized arguments.\n" +"Try ``%s --help'' for more information.\n" +msgstr "" +"ÐеизвеÑтные аргументы.\n" +"ИÑпользуйте `%s --help' Ð´Ð»Ñ Ñправки.\n" + +#: hardinfo/util.c:501 +#, c-format +msgid "Couldn't find a Web browser to open URL %s." +msgstr "Ðе удаётÑÑ Ð½Ð°Ð¹Ñ‚Ð¸ веб-браузер Ð´Ð»Ñ Ð¾Ñ‚ÐºÑ€Ñ‹Ñ‚Ð¸Ñ URL %s." + +#: hardinfo/util.c:848 +#, c-format +msgid "Module \"%s\" depends on module \"%s\", load it?" +msgstr "Модуль \"%s\" завиÑит от Ð¼Ð¾Ð´ÑƒÐ»Ñ \"%s\", загрузить его?" + +#: hardinfo/util.c:871 +#, c-format +msgid "Module \"%s\" depends on module \"%s\"." +msgstr "Модуль \"%s\" завиÑит от Ð¼Ð¾Ð´ÑƒÐ»Ñ \"%s\"." + +#: hardinfo/util.c:916 +#, c-format +msgid "No module could be loaded. Check permissions on \"%s\" and try again." +msgstr "Модули не могут быть загружены. Проверьте Ñ€Ð°Ð·Ñ€ÐµÑˆÐµÐ½Ð¸Ñ Ð½Ð° \"%s\" и попробуйте Ñнова." + +#: hardinfo/util.c:920 +msgid "No module could be loaded. Please use hardinfo -l to list all available modules and try again with a valid module list." +msgstr "Ðе удаетÑÑ Ð·Ð°Ð³Ñ€ÑƒÐ·Ð¸Ñ‚ÑŒ модули. ПожалуйÑта, иÑпользуйте hardinfo -l Ð´Ð»Ñ Ð¿Ð¾Ð»ÑƒÑ‡ÐµÐ½Ð¸Ñ ÑпиÑка доÑтупных модулей и попробуйте Ñнова Ñ Ð¿Ñ€Ð°Ð²Ð¸Ð»ÑŒÐ½Ñ‹Ð¼ ÑпиÑком модулей." + +#: hardinfo/util.c:1096 +#, c-format +msgid "Scanning: %s..." +msgstr "Сканирование: %s..." + +#: modules/devices/x86/processor.c:145 +msgid "Cache information not available=\n" +msgstr "Ð˜Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð¾ кÑше недоÑтупна=\n" + +#: modules/devices/x86/processor.c:484 +#, c-format +msgid "" +"[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" +"[Cache]\n" +"%s\n" +"[Capabilities]\n" +"%s" +msgstr "" +"[ПроцеÑÑор]\n" +"Ðазвание=%s\n" +"СемейÑтво, модель, Ñтеппинг=%d, %d, %d (%s)\n" +"Производитель=%s\n" +"[КонфигурациÑ]\n" +"Размер кÑша=%dкб\n" +"ЧаÑтота=%.2fМГц\n" +"BogoMIPS=%.2f\n" +"ПорÑдок байтов=%s\n" +"[Функции]\n" +"Ошибка FDIV=%s\n" +"Ошибка HLT=%s\n" +"Ошибка F00F=%s\n" +"Ошибка Coma=%s\n" +"FPU=%s\n" +"[КÑш]\n" +"%s\n" +"[ВозможноÑти]\n" +"%s" + +#: modules/devices/x86/processor.c:542 +#, c-format +msgid "%s$CPU%d$%s=%.2fMHz\n" +msgstr "%s$CPU%d$%s=%.2fМГц\n" + +#: modules/devices/printers.c:81 +msgid "⚬ Can do black and white printing=\n" +msgstr "⚬ Может печатать черно-белым=\n" + +#: modules/devices/printers.c:83 +msgid "⚬ Can do color printing=\n" +msgstr "⚬ Может печатать цветным=\n" + +#: modules/devices/printers.c:85 +#, fuzzy +msgid "⚬ Can do duplexing=\n" +msgstr "Ðе иÑправлÑÑ‚ÑŒ:" + +#: modules/devices/printers.c:87 +#, fuzzy +msgid "⚬ Can do staple output=\n" +msgstr "Выходной файл не может быть переименован." + +#: modules/devices/printers.c:89 +msgid "⚬ Can do copies=\n" +msgstr "⚬ Можно делать копии=\n" + +#: modules/devices/printers.c:91 +msgid "⚬ Can collate copies=\n" +msgstr "⚬ Can collate copies=\n" + +#: modules/devices/printers.c:93 +msgid "⚬ Printer is rejecting jobs=\n" +msgstr "⚬ Printer is rejecting jobs=\n" + +#: modules/devices/printers.c:95 +msgid "⚬ Printer was automatically discovered and added=\n" +msgstr "⚬ Принтер был автоматичеÑки найден и добавлен=\n" + +#: modules/devices/printers.c:110 +msgid "Idle" +msgstr "Ðеактивен" + +#: modules/devices/printers.c:112 +msgid "Printing a Job" +msgstr "ПечатаетÑÑ Ð·Ð°Ð´Ð°Ñ‡Ð°" + +#: modules/devices/printers.c:114 +msgid "Stopped" +msgstr "ОÑтановлен" + +#: modules/devices/printers.c:138 +msgid "Yes" +msgstr "Да" + +#: modules/devices/printers.c:190 +msgid "" +"[Printers]\n" +"No suitable CUPS library found=" +msgstr "" +"[Принтеры]\n" +"ПодходÑщей библиотеки CUPS не найдено=" + +#: modules/devices/printers.c:200 +msgid "[Printers (CUPS)]\n" +msgstr "[Принтеры (CUPS)]\n" + +#: modules/devices/printers.c:263 +msgid "" +"[Printers]\n" +"No printers found=\n" +msgstr "" +"[Принтеры]\n" +"Принтеры не найдены=\n" + +#: modules/computer/os.c:49 +#, c-format +msgid "GNU C Library version %s (%sstable)" +msgstr "Библиотека GNU C верÑии %s (%s Ñтабильна)" + +#: modules/computer/os.c:51 +msgid "un" +msgstr "не" + +#: modules/computer/os.c:72 +#, c-format +msgid "Version: %s" +msgstr "ВерÑиÑ: %s" + +#: modules/computer/os.c:106 +msgid "Terminal" +msgstr "Терминал" + +#: modules/computer/os.c:126 +#, c-format +msgid "Unknown (Window Manager: %s)" +msgstr "ÐеизвеÑтно (Оконный менеджер: %s)" + +#: modules/computer/os.c:166 +msgid "Unknown distribution" +msgstr "ÐеизвеÑтный диÑтрибутив" + +#: modules/devices/battery.c:181 +#, c-format +msgid "" +"\n" +"[Battery: %s]\n" +"State=%s (load: %s)\n" +"Capacity=%s / %s (%.2f%%)\n" +"Battery Technology=%s (%s)\n" +"Manufacturer=%s\n" +"Model Number=%s\n" +"Serial Number=%s\n" +msgstr "" +"\n" +"[БатареÑ: %s]\n" +"СоÑтоÑние=%s (нагрузка: %s)\n" +"ЕмкоÑÑ‚ÑŒ=%s / %s (%.2f%%)\n" +"Ð¢ÐµÑ…Ð½Ð¾Ð»Ð¾Ð³Ð¸Ñ Ð±Ð°Ñ‚Ð°Ñ€ÐµÐ¸=%s (%s)\n" +"Изготовитель=%s\n" +"Ðомер модели=%s\n" +"Серийный номер=%s\n" + +#: modules/devices/battery.c:266 +#, c-format +msgid "" +"\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" +msgstr "" +"\n" +"[Ð‘Ð°Ñ‚Ð°Ñ€ÐµÑ (APM)]\n" +"ЗарÑд=%d%%\n" +"ОÑтавшийÑÑ Ð·Ð°Ñ€Ñд=%s из %s\n" +"ИÑпользуетÑÑ=%s\n" +"APM драйвер верÑии=%s\n" +"APM BIOS верÑии=%s\n" + +#: modules/devices/battery.c:278 +#, c-format +msgid "" +"\n" +"[Battery (APM)]\n" +"Charge=%d%%\n" +"Using=%s\n" +"APM driver version=%s\n" +"APM BIOS version=%s\n" +msgstr "" +"\n" +"[Ð‘Ð°Ñ‚Ð°Ñ€ÐµÑ (APM)]\n" +"ЗарÑд=%d%%\n" +"ИÑпользуетÑÑ=%s\n" +"APM драйвер верÑии=%s\n" +"APM BIOS верÑии=%s\n" + +#: modules/devices/battery.c:304 +msgid "" +"[No batteries]\n" +"No batteries found on this system=\n" +msgstr "" +"[No batteries]\n" +"Батареи не найдены на Ñтой ÑиÑтеме=\n" + +#: modules/devices/storage.c:46 +msgid "" +"\n" +"[SCSI Disks]\n" +msgstr "" +"\n" +"[SCSI диÑки]\n" + +#: modules/devices/storage.c:110 +#: modules/devices/storage.c:297 +#, c-format +msgid "" +"[Device Information]\n" +"Model=%s\n" +msgstr "" +"[Ð˜Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð¾Ð± уÑтройÑтве]\n" +"Модель=%s\n" + +#: modules/devices/storage.c:115 +#: modules/devices/storage.c:304 +#, c-format +msgid "Vendor=%s (%s)\n" +msgstr "Изготовитель=%s (%s)\n" + +#: modules/devices/storage.c:120 +#: modules/devices/storage.c:309 +#, c-format +msgid "Vendor=%s\n" +msgstr "Изготовитель=%s\n" + +#: modules/devices/storage.c:125 +#, c-format +msgid "" +"Type=%s\n" +"Revision=%s\n" +"[SCSI Controller]\n" +"Controller=scsi%d\n" +"Channel=%d\n" +"ID=%d\n" +"LUN=%d\n" +msgstr "" + +#: modules/devices/storage.c:169 +msgid "" +"\n" +"[IDE Disks]\n" +msgstr "" +"\n" +"[IDE диÑки]\n" + +#: modules/devices/storage.c:242 +#, c-format +msgid "Driver=%s\n" +msgstr "Драйвер=%s\n" + +#: modules/devices/storage.c:314 +#, c-format +msgid "" +"Device Name=hd%c\n" +"Media=%s\n" +"Cache=%dkb\n" +msgstr "" +"Ð˜Ð¼Ñ ÑƒÑтройÑтва=hd%c\n" +"Медиа=%s\n" +"КÑш=%dkb\n" + +#: modules/devices/storage.c:329 +#, c-format +msgid "" +"[Geometry]\n" +"Physical=%s\n" +"Logical=%s\n" +msgstr "" +"[ГеометриÑ]\n" +"ФизичеÑкаÑ=%s\n" +"ЛогичеÑкаÑ=%s\n" + +#: modules/devices/storage.c:341 +#, c-format +msgid "" +"[Capabilities]\n" +"%s" +msgstr "" +"[ВозможноÑти]\n" +"%s" + +#: modules/devices/storage.c:348 +#, c-format +msgid "" +"[Speeds]\n" +"%s" +msgstr "" +"[СкороÑти]\n" +"%s" + +#~ msgid "" +#~ "[$ShellParam$]\n" +#~ "ReloadInterval=10000\n" +#~ "ViewType=1\n" +#~ "[Users]\n" +#~ "%s\n" +#~ msgstr "" +#~ "[$ShellParam$]\n" +#~ "ReloadInterval=10000\n" +#~ "ViewType=1\n" +#~ "[Пользователи]\n" +#~ "%s\n" + +#, fuzzy +#~ msgid "" +#~ "[Operating System]\n" +#~ "Icon=os.png\n" +#~ "Method=computer::getOS\n" +#~ "[CPU]\n" +#~ "Icon=processor.png\n" +#~ "Method=devices::getProcessorName\n" +#~ "[RAM]\n" +#~ "Icon=memory.png\n" +#~ "Method=devices::getMemoryTotal\n" +#~ "[Motherboard]\n" +#~ "Icon=module.png\n" +#~ "Method=devices::getMotherboard\n" +#~ "[Graphics]\n" +#~ "Icon=monitor.png\n" +#~ "Method=computer::getDisplaySummary\n" +#~ "[Storage]\n" +#~ "Icon=hdd.png\n" +#~ "Method=devices::getStorageDevices\n" +#~ "[Printers]\n" +#~ "Icon=printer.png\n" +#~ "Method=devices::getPrinters\n" +#~ "[Audio]\n" +#~ "Icon=audio.png\n" +#~ "Method=computer::getAudioCards\n" +#~ msgstr "" +#~ "[Operating System]\n" +#~ "Icon=os.png\n" +#~ "Method=computer::getOS\n" +#~ "[CPU]\n" +#~ "Icon=processor.png\n" +#~ "Method=devices::getProcessorName\n" +#~ "[RAM]\n" +#~ "Icon=memory.png\n" +#~ "Method=devices::getMemoryTotal\n" +#~ "[Motherboard]\n" +#~ "Icon=module.png\n" +#~ "Method=devices::getMotherboard\n" +#~ "[Graphics]\n" +#~ "Icon=monitor.png\n" +#~ "Method=computer::getDisplaySummary\n" +#~ "[Storage]\n" +#~ "Icon=hdd.png\n" +#~ "Method=devices::getStorageDevices\n" +#~ "[Printers]\n" +#~ "Icon=printer.png\n" +#~ "Method=devices::getPrinters\n" +#~ "[Audio]\n" +#~ "Icon=audio.png\n" +#~ "Method=computer::getAudioCards\n" +#~ msgid "Uptime" +#~ msgstr "Ð’Ñ€ÐµÐ¼Ñ Ñ€Ð°Ð±Ð¾Ñ‚Ñ‹" +#~ msgid "Date/Time" +#~ msgstr "Дата/времÑ" + +# Должно Ñовпадать Ñ Ñ‚Ð°ÐºÐ¸Ð¼-же полем в Ñтроке 430 computer.c +#~ msgid "Load Average" +#~ msgstr "СреднÑÑ Ð½Ð°Ð³Ñ€ÑƒÐ·ÐºÐ°" +#~ msgid "" +#~ "[Memory]\n" +#~ "%s\n" +#~ "[$ShellParam$]\n" +#~ "ViewType=2\n" +#~ "LoadGraphSuffix= kB\n" +#~ "RescanInterval=2000\n" +#~ "%s\n" +#~ msgstr "" +#~ "[Memory]\n" +#~ "%s\n" +#~ "[$ShellParam$]\n" +#~ "ViewType=2\n" +#~ "LoadGraphSuffix= kB\n" +#~ "RescanInterval=2000\n" +#~ "%s\n" +#~ msgid "" +#~ "[PCI Devices]\n" +#~ "%s[$ShellParam$]\n" +#~ "ViewType=1\n" +#~ msgstr "" +#~ "[PCI Devices]\n" +#~ "%s[$ShellParam$]\n" +#~ "ViewType=1\n" +#~ msgid "" +#~ "[Input Devices]\n" +#~ "%s[$ShellParam$]\n" +#~ "ViewType=1\n" +#~ "ReloadInterval=5000\n" +#~ "%s" +#~ msgstr "" +#~ "[Input Devices]\n" +#~ "%s[$ShellParam$]\n" +#~ "ViewType=1\n" +#~ "ReloadInterval=5000\n" +#~ "%s" +#~ msgid "HardInfo cannot run without loading the additional module." +#~ msgstr "HardInfo не может быть запущен без дополнительного модулÑ." +#, fuzzy +#~ msgid "AboutModule%s" +#~ msgstr "О _модулÑÑ…" diff --git a/callbacks.c b/shell/callbacks.c index 40ee07bc..d5ac34da 100644 --- a/callbacks.c +++ b/shell/callbacks.c @@ -19,19 +19,22 @@ #include <stdlib.h> #include <gtk/gtk.h> -#include <hardinfo.h> -#include <callbacks.h> -#include <iconcache.h> +#include "hardinfo.h" +#include "callbacks.h" +#include "iconcache.h" -#include <shell.h> -#include <report.h> -#include <syncmanager.h> +#include "shell.h" +#include "report.h" +#include "syncmanager.h" +#include "xmlrpc-server.h" -#include <config.h> +#include "config.h" void cb_sync_manager() { - sync_manager_show(); + Shell *shell = shell_get_main_shell(); + + sync_manager_show(shell->window); } void cb_save_graphic() @@ -41,7 +44,7 @@ void cb_save_graphic() gchar *filename; /* save the pixbuf to a png file */ - dialog = gtk_file_chooser_dialog_new("Save Image", + dialog = gtk_file_chooser_dialog_new(_("Save Image"), NULL, GTK_FILE_CHOOSER_ACTION_SAVE, GTK_STOCK_CANCEL, @@ -57,11 +60,11 @@ void cb_save_graphic() filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); gtk_widget_destroy(dialog); - shell_status_update("Saving image..."); + shell_status_update(_("Saving image...")); tree_view_save_image(filename); - shell_status_update("Done."); + shell_status_update(_("Done.")); g_free(filename); return; @@ -72,22 +75,12 @@ void cb_save_graphic() void cb_open_web_page() { - open_url("http://wiki.hardinfo.org"); -} - -void cb_open_online_docs() -{ - open_url("http://wiki.hardinfo.org/Documentation"); + open_url("http://www.hardinfo.org"); } void cb_report_bug() { - open_url("http://wiki.hardinfo.org/BugReports"); -} - -void cb_donate() -{ - open_url("http://wiki.hardinfo.org/Donate"); + open_url("https://github.com/lpereira/hardinfo"); } void cb_refresh() @@ -155,14 +148,14 @@ void cb_about_module(GtkAction * action) about = gtk_about_dialog_new(); - text = g_strdup_printf("%s Module", sm->name); + text = g_strdup_printf(_("%s Module"), sm->name); gtk_about_dialog_set_name(GTK_ABOUT_DIALOG(about), text); g_free(text); gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(about), ma->version); - text = g_strdup_printf("Written by %s\nLicensed under %s", + text = g_strdup_printf(_("Written by %s\nLicensed under %s"), ma->author, ma->license); gtk_about_dialog_set_copyright(GTK_ABOUT_DIALOG(about), text); g_free(text); @@ -176,7 +169,7 @@ void cb_about_module(GtkAction * action) gtk_widget_destroy(about); } else { g_warning - ("No about information is associated with the %s module.", + (_("No about information is associated with the %s module."), name); } @@ -190,30 +183,30 @@ void cb_about() { GtkWidget *about; const gchar *authors[] = { - "Author:", + _("Author:"), "Leandro A. F. Pereira", "", - "Contributors:", + _("Contributors:"), "Agney Lopes Roth Ferraz", "Andrey Esin", "", - "Based on work by:", - "MD5 implementation by Colin Plumb (see md5.c for details)", - "SHA1 implementation by Steve Reid (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)", - "FFT benchmark by Scott Robert Ladd (see fftbench.c for details)", - "Some code partly based on x86cpucaps by Osamu Kayasono", - "Vendor list based on GtkSysInfo by Pissens Sebastien", - "DMI support based on code by Stewart Adam", - "SCSI support based on code by Pascal F. Martin", + _("Based on work by:"), + _("MD5 implementation by Colin Plumb (see md5.c for details)"), + _("SHA1 implementation by Steve Reid (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)"), + _("FFT benchmark by Scott Robert Ladd (see fftbench.c for details)"), + _("Some code partly based on x86cpucaps by Osamu Kayasono"), + _("Vendor list based on GtkSysInfo by Pissens Sebastien"), + _("DMI support based on code by Stewart Adam"), + _("SCSI support based on code by Pascal F. Martin"), NULL }; const gchar *artists[] = { - "Jakub Szypulka", - "Tango Project", - "The GNOME Project", - "VMWare, Inc. (USB icon from VMWare Workstation 6)", + _("Jakub Szypulka"), + _("Tango Project"), + _("The GNOME Project"), + _("VMWare, Inc. (USB icon from VMWare Workstation 6)"), NULL }; @@ -221,15 +214,15 @@ 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-2009 " + "Copyright \302\251 2003-2016 " "Leandro A. F. Pereira"); gtk_about_dialog_set_comments(GTK_ABOUT_DIALOG(about), - "System information and benchmark tool"); + _("System information and benchmark tool")); gtk_about_dialog_set_logo(GTK_ABOUT_DIALOG(about), icon_cache_get_pixbuf("logo.png")); gtk_about_dialog_set_license(GTK_ABOUT_DIALOG(about), - "HardInfo is free software; you can redistribute it and/or modify " + _("HardInfo 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.\n\n" "This program is distributed in the hope that it will be useful, " @@ -238,7 +231,7 @@ void cb_about() "GNU General Public License for more details.\n\n" "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"); + "Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA")); #if GTK_CHECK_VERSION(2,8,0) gtk_about_dialog_set_wrap_license(GTK_ABOUT_DIALOG(about), TRUE); #endif @@ -267,4 +260,6 @@ void cb_quit(void) do { gtk_main_quit(); } while (gtk_main_level() > 1); + + exit(0); } diff --git a/iconcache.c b/shell/iconcache.c index c927ca5e..74b19b0c 100644 --- a/iconcache.c +++ b/shell/iconcache.c @@ -23,11 +23,9 @@ static GHashTable *cache = NULL; void icon_cache_init(void) { - DEBUG("initializing icon cache"); if (!cache) { + DEBUG("initializing icon cache"); cache = g_hash_table_new(g_str_hash, g_str_equal); - } else { - DEBUG("already initialized? huh?"); } } diff --git a/loadgraph.c b/shell/loadgraph.c index c8503072..8fbeef48 100644 --- a/loadgraph.c +++ b/shell/loadgraph.c @@ -265,7 +265,7 @@ void load_graph_update(LoadGraph * lg, gint value) return; /* shift-right our data */ - for (i = 0; i < lg->size; i++) { + for (i = 0; i < lg->size - 1; i++) { lg->data[i] = lg->data[i + 1]; } @@ -323,6 +323,8 @@ gboolean lg_update(gpointer d) int main(int argc, char **argv) { + + LoadGraph *lg; GtkWidget *window; @@ -28,88 +28,75 @@ #include <callbacks.h> #include <hardinfo.h> + #include "uidefs.h" static GtkActionEntry entries[] = { - {"InformationMenuAction", NULL, "_Information"}, /* name, stock id, label */ - {"ViewMenuAction", NULL, "_View"}, - {"HelpMenuAction", NULL, "_Help"}, - {"HelpMenuModulesAction", HI_STOCK_ABOUT_MODULES, "About _Modules"}, + {"InformationMenuAction", NULL, N_("_Information")}, /* name, stock id, label */ + {"RemoteMenuAction", NULL, N_("_Remote")}, + {"ViewMenuAction", NULL, N_("_View")}, + {"HelpMenuAction", NULL, N_("_Help")}, + {"HelpMenuModulesAction", HI_STOCK_ABOUT_MODULES, N_("About _Modules")}, {"MainMenuBarAction", NULL, ""}, {"ReportAction", HI_STOCK_REPORT, /* name, stock id */ - "Generate _Report", "<control>R", /* label, accelerator */ + N_("Generate _Report"), "<control>R", /* label, accelerator */ NULL, /* tooltip */ G_CALLBACK(cb_generate_report)}, {"SyncManagerAction", HI_STOCK_SYNC_MENU, - "_Network Updater...", NULL, + N_("_Network Updater..."), NULL, NULL, G_CALLBACK(cb_sync_manager)}, {"OpenAction", GTK_STOCK_OPEN, - "_Open...", NULL, + N_("_Open..."), NULL, NULL, G_CALLBACK(cb_sync_manager)}, - {"ConnectToAction", GTK_STOCK_CONNECT, - "_Connect to...", NULL, - NULL, - G_CALLBACK(cb_sync_manager)}, - {"CopyAction", GTK_STOCK_COPY, - "_Copy to Clipboard", "<control>C", - NULL, + N_("_Copy to Clipboard"), "<control>C", + N_("Copy to clipboard"), G_CALLBACK(cb_copy_to_clipboard)}, {"SaveGraphAction", GTK_STOCK_SAVE_AS, - "_Save image as...", "<control>S", + N_("_Save image as..."), "<control>S", NULL, G_CALLBACK(cb_save_graphic)}, {"RefreshAction", GTK_STOCK_REFRESH, - "_Refresh", "F5", + N_("_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, + N_("_Open HardInfo Web Site"), NULL, NULL, G_CALLBACK(cb_open_web_page)}, {"ReportBugAction", HI_STOCK_INTERNET, - "_Report bug", NULL, + N_("_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 HardInfo", NULL, - "Displays program version information", + N_("_About HardInfo"), NULL, + N_("Displays program version information"), G_CALLBACK(cb_about)}, {"QuitAction", GTK_STOCK_QUIT, - "_Quit", "<control>Q", + N_("_Quit"), "<control>Q", NULL, G_CALLBACK(cb_quit)} }; static GtkToggleActionEntry toggle_entries[] = { {"SidePaneAction", NULL, - "_Side Pane", NULL, - "Toggles side pane visibility", + N_("_Side Pane"), NULL, + N_("Toggles side pane visibility"), G_CALLBACK(cb_side_pane)}, {"ToolbarAction", NULL, - "_Toolbar", NULL, + N_("_Toolbar"), NULL, NULL, G_CALLBACK(cb_toolbar)}, }; @@ -143,13 +130,15 @@ void menu_init(Shell * shell) /* Pack up our objects: * menu_box -> window * actions -> action_group - * action_group -> menu_manager */ + * action_group -> menu_manager */ + gtk_action_group_set_translation_domain( action_group, "hardinfo" );//gettext gtk_action_group_add_actions(action_group, entries, G_N_ELEMENTS(entries), NULL); gtk_action_group_add_toggle_actions(action_group, toggle_entries, G_N_ELEMENTS(toggle_entries), NULL); gtk_ui_manager_insert_action_group(menu_manager, action_group, 0); + /* Read in the UI from our XML file */ error = NULL; diff --git a/report.c b/shell/report.c index 39e96faf..3b5d3bdb 100644 --- a/report.c +++ b/shell/report.c @@ -93,7 +93,7 @@ void report_context_configure(ReportContext * ctx, GKeyFile * keyfile) 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 */ + https://en.wikipedia.org/wiki/Data:_URI_scheme */ ctx->is_image_enabled = (g_key_file_get_boolean(keyfile, group, @@ -111,8 +111,18 @@ void report_context_configure(ReportContext * ctx, GKeyFile * keyfile) if (g_str_equal(key, "ShowColumnHeaders")) { ctx->show_column_headers = g_key_file_get_boolean(keyfile, group, key, NULL); } else if (g_str_has_prefix(key, "ColumnTitle")) { - gchar *value, *title = strchr(key, '$') + 1; + gchar *value, *title = strchr(key, '$'); + if (!title) { + DEBUG("couldn't find column title"); + break; + } + title++; + if (!*title) { + DEBUG("title is empty"); + break; + } + value = g_key_file_get_value(keyfile, group, key, NULL); if (g_str_equal(title, "Extra1")) { ctx->columns |= REPORT_COL_EXTRA1; @@ -126,9 +136,8 @@ void report_context_configure(ReportContext * ctx, GKeyFile * keyfile) ctx->columns |= REPORT_COL_PROGRESS; } - g_hash_table_replace(ctx->column_titles, title, g_strdup(value)); - - g_free(value); + g_hash_table_replace(ctx->column_titles, + g_strdup(title), g_strdup(value)); } else if (g_str_equal(key, "ViewType")) { if (g_key_file_get_integer(keyfile, group, "ViewType", NULL) == SHELL_VIEW_PROGRESS) { ctx->columns &= ~REPORT_COL_VALUE; @@ -226,8 +235,7 @@ void report_table(ReportContext * ctx, gchar * text) static void report_html_header(ReportContext * ctx) { - if (ctx->output) - g_free(ctx->output); + g_free(ctx->output); ctx->output = g_strdup_printf @@ -318,8 +326,7 @@ report_html_key_value(ReportContext * ctx, gchar * key, gchar * value) static void report_text_header(ReportContext * ctx) { - if (ctx->output) - g_free(ctx->output); + g_free(ctx->output); ctx->output = g_strdup(""); } @@ -426,7 +433,7 @@ static GSList *report_create_module_list_from_dialog(ReportDialog * rd) if (!selected) continue; - gtk_tree_model_get(model, &child, TREE_COL_DATA, &entry, + gtk_tree_model_get(model, &child, TREE_COL_MODULE_ENTRY, &entry, -1); module->entries = g_slist_append(module->entries, entry); } @@ -483,7 +490,7 @@ static gchar *report_get_filename(void) GtkWidget *dialog; gchar *filename = NULL; - dialog = gtk_file_chooser_dialog_new("Save File", + dialog = gtk_file_chooser_dialog_new(_("Save File"), NULL, GTK_FILE_CHOOSER_ACTION_SAVE, GTK_STOCK_CANCEL, @@ -520,7 +527,8 @@ ReportContext *report_context_html_new() ctx->output = g_strdup(""); ctx->format = REPORT_FORMAT_HTML; - ctx->column_titles = g_hash_table_new(g_str_hash, g_str_equal); + ctx->column_titles = g_hash_table_new_full(g_str_hash, g_str_equal, + g_free, g_free); ctx->first_table = TRUE; return ctx; @@ -541,7 +549,8 @@ ReportContext *report_context_text_new() ctx->output = g_strdup(""); ctx->format = REPORT_FORMAT_TEXT; - ctx->column_titles = g_hash_table_new(g_str_hash, g_str_equal); + ctx->column_titles = g_hash_table_new_full(g_str_hash, g_str_equal, + g_free, g_free); ctx->first_table = TRUE; return ctx; @@ -607,8 +616,9 @@ static gboolean report_generate(ReportDialog * rd) create_context = file_types_get_data_by_name(file_types, file); if (!create_context) { - g_warning("Cannot create ReportContext. Programming bug?"); + g_warning(_("Cannot create ReportContext. Programming bug?")); g_free(file); + fclose(stream); return FALSE; } @@ -625,12 +635,18 @@ static gboolean report_generate(ReportDialog * rd) GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, - "Open the report with your web browser?"); + _("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); + if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) { + gchar *temp; + + temp = g_strdup_printf("file://%s", file); + open_url(temp); + + g_free(temp); + } gtk_widget_destroy(dialog); } @@ -647,7 +663,7 @@ void report_dialog_show(GtkTreeModel * model, GtkWidget * parent) ReportDialog *rd = report_dialog_new(model, parent); if (gtk_dialog_run(GTK_DIALOG(rd->dialog)) == GTK_RESPONSE_ACCEPT) { - shell_status_update("Generating report..."); + shell_status_update(_("Generating report...")); gtk_widget_hide(rd->dialog); shell_view_set_enabled(FALSE); shell_status_set_enabled(TRUE); @@ -657,9 +673,9 @@ void report_dialog_show(GtkTreeModel * model, GtkWidget * parent) shell_status_set_enabled(FALSE); if (success) - shell_status_update("Report saved."); + shell_status_update(_("Report saved.")); else - shell_status_update("Error while creating the report."); + shell_status_update(_("Error while creating the report.")); } set_all_active(rd, FALSE); @@ -726,6 +742,15 @@ report_dialog_sel_toggle(GtkCellRendererToggle * cellrenderertoggle, -1); set_children_active(model, &iter, active); + if (active) { + GtkTreeIter parent; + + if (gtk_tree_model_iter_parent(model, &parent, &iter)) { + gtk_tree_store_set(GTK_TREE_STORE(model), &parent, + TREE_COL_SEL, active, -1); + } + } + gtk_tree_path_free(path); } @@ -752,7 +777,7 @@ static ReportDialog rd = g_new0(ReportDialog, 1); dialog = gtk_dialog_new(); - gtk_window_set_title(GTK_WINDOW(dialog), "Generate Report"); + gtk_window_set_title(GTK_WINDOW(dialog), _("Generate Report")); gtk_container_set_border_width(GTK_CONTAINER(dialog), 5); gtk_window_set_default_size(GTK_WINDOW(dialog), 420, 260); gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(parent)); @@ -769,9 +794,9 @@ static ReportDialog 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" + label = gtk_label_new(_("<big><b>Generate Report</b></big>\n" "Please choose the information that you wish " - "to view in your report:"); + "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); @@ -829,14 +854,14 @@ static ReportDialog gtk_button_box_set_layout(GTK_BUTTON_BOX(vbuttonbox3), GTK_BUTTONBOX_START); - button3 = gtk_button_new_with_mnemonic("Select _None"); + button3 = gtk_button_new_with_mnemonic(_("Select _None")); gtk_widget_show(button3); gtk_container_add(GTK_CONTAINER(vbuttonbox3), button3); GTK_WIDGET_SET_FLAGS(button3, GTK_CAN_DEFAULT); g_signal_connect(button3, "clicked", G_CALLBACK(report_dialog_sel_none), rd); - button6 = gtk_button_new_with_mnemonic("Select _All"); + button6 = gtk_button_new_with_mnemonic(_("Select _All")); gtk_widget_show(button6); gtk_container_add(GTK_CONTAINER(vbuttonbox3), button6); GTK_WIDGET_SET_FLAGS(button6, GTK_CAN_DEFAULT); @@ -854,7 +879,7 @@ static ReportDialog GTK_RESPONSE_CANCEL); GTK_WIDGET_SET_FLAGS(button8, GTK_CAN_DEFAULT); - button7 = gtk_button_new_with_mnemonic("_Generate"); + button7 = gtk_button_new_with_mnemonic(_("_Generate")); gtk_widget_show(button7); gtk_dialog_add_action_widget(GTK_DIALOG(dialog), button7, GTK_RESPONSE_ACCEPT); @@ -17,19 +17,21 @@ */ #include <stdlib.h> #include <string.h> + #include <gtk/gtk.h> +#include <glib/gstdio.h> -#include <config.h> +#include "config.h" -#include <hardinfo.h> +#include "hardinfo.h" -#include <shell.h> -#include <syncmanager.h> -#include <iconcache.h> -#include <menu.h> -#include <stock.h> +#include "shell.h" +#include "syncmanager.h" +#include "iconcache.h" +#include "menu.h" +#include "stock.h" -#include <callbacks.h> +#include "callbacks.h" /* * Internal Prototypes ******************************************************** @@ -82,6 +84,19 @@ void shell_ui_manager_set_visible(const gchar * path, gboolean setting) gtk_widget_hide(widget); } +void shell_clear_tree_models(Shell *shell) +{ + gtk_tree_store_clear(GTK_TREE_STORE(shell->tree->model)); + gtk_tree_store_clear(GTK_TREE_STORE(shell->info->model)); + gtk_tree_store_clear(GTK_TREE_STORE(shell->moreinfo->model)); + gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(shell->info->view), FALSE); +} + +void shell_clear_timeouts(Shell *shell) +{ + h_hash_table_remove_all(update_tbl); +} + void shell_action_set_property(const gchar * action_name, const gchar * property, gboolean setting) { @@ -103,6 +118,21 @@ void shell_action_set_property(const gchar * action_name, } } +void shell_action_set_label(const gchar * action_name, gchar * label) +{ +#if GTK_CHECK_VERSION(2,16,0) + if (params.gui_running && shell->action_group) { + GtkAction *action; + + action = + gtk_action_group_get_action(shell->action_group, action_name); + if (action) { + gtk_action_set_label(action, label); + } + } +#endif +} + void shell_action_set_enabled(const gchar * action_name, gboolean setting) { if (params.gui_running && shell->action_group) { @@ -249,6 +279,7 @@ void shell_view_set_enabled(gboolean setting) gtk_widget_set_sensitive(shell->hpaned, setting); shell_action_set_enabled("ViewMenuAction", setting); + shell_action_set_enabled("ConnectToAction", setting); shell_action_set_enabled("RefreshAction", setting); shell_action_set_enabled("CopyAction", setting); shell_action_set_enabled("ReportAction", setting); @@ -269,7 +300,7 @@ void shell_status_set_enabled(gboolean setting) gtk_widget_hide(shell->progress); shell_view_set_enabled(TRUE); - shell_status_update("Done."); + shell_status_update(_("Done.")); } } @@ -311,18 +342,30 @@ static void destroy_me(void) static void close_note(GtkWidget * widget, gpointer user_data) { - gtk_widget_hide(shell->note->frame); + gtk_widget_hide(shell->note->event_box); } static ShellNote *note_new(void) { ShellNote *note; GtkWidget *hbox, *icon, *button; + GtkWidget *border_box; + /* colors stolen from gtkinfobar.c */ + GdkColor info_default_border_color = { 0, 0xb800, 0xad00, 0x9d00 }; + GdkColor info_default_fill_color = { 0, 0xff00, 0xff00, 0xbf00 }; note = g_new0(ShellNote, 1); note->label = gtk_label_new(""); - note->frame = gtk_frame_new(NULL); + note->event_box = gtk_event_box_new(); button = gtk_button_new(); + + border_box = gtk_event_box_new(); + gtk_container_set_border_width(GTK_CONTAINER(border_box), 1); + gtk_container_add(GTK_CONTAINER(note->event_box), border_box); + gtk_widget_show(border_box); + + gtk_widget_modify_bg(border_box, GTK_STATE_NORMAL, &info_default_fill_color); + gtk_widget_modify_bg(note->event_box, GTK_STATE_NORMAL, &info_default_border_color); icon = icon_cache_get_image("close.png"); gtk_widget_show(icon); @@ -338,13 +381,27 @@ static ShellNote *note_new(void) 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_container_set_border_width(GTK_CONTAINER(hbox), 2); + gtk_container_add(GTK_CONTAINER(border_box), hbox); gtk_widget_show_all(hbox); return note; } +void shell_set_title(Shell *shell, gchar *subtitle) +{ + if (subtitle) { + gchar *tmp; + + tmp = g_strdup_printf(_("%s - System Information"), subtitle); + gtk_window_set_title(GTK_WINDOW(shell->window), tmp); + + g_free(tmp); + } else { + gtk_window_set_title(GTK_WINDOW(shell->window), _("System Information")); + } +} + static void create_window(void) { GtkWidget *vbox, *hbox; @@ -354,7 +411,7 @@ static void create_window(void) shell->window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_icon(GTK_WINDOW(shell->window), icon_cache_get_pixbuf("logo.png")); - gtk_window_set_title(GTK_WINDOW(shell->window), "System Information"); + shell_set_title(shell, NULL); gtk_window_set_default_size(GTK_WINDOW(shell->window), 800, 600); g_signal_connect(G_OBJECT(shell->window), "destroy", destroy_me, NULL); @@ -389,7 +446,7 @@ static void create_window(void) 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); + gtk_box_pack_end(GTK_BOX(vbox), shell->note->event_box, FALSE, FALSE, 0); shell->vpaned = gtk_vpaned_new(); gtk_box_pack_start(GTK_BOX(vbox), shell->vpaned, TRUE, TRUE, 0); @@ -416,9 +473,28 @@ static void view_menu_select_entry(gpointer data, gpointer data2) gtk_tree_path_free(path); } +static void menu_item_set_icon_always_visible(Shell *shell, + gchar *parent_path, + gchar *item_id) +{ + GtkWidget *menuitem; + gchar *path; + + path = g_strdup_printf("%s/%s", parent_path, item_id); + menuitem = gtk_ui_manager_get_widget(shell->ui_manager, path); +#if GTK_CHECK_VERSION(2, 18, 0) + gtk_image_menu_item_set_always_show_image(GTK_IMAGE_MENU_ITEM(menuitem), TRUE); +#endif + g_free(path); +} + static void add_module_to_menu(gchar * name, GdkPixbuf * pixbuf) { + GtkAction *action; + GtkWidget *menuitem; gchar *about_module = g_strdup_printf("AboutModule%s", name); + gchar *path; + gint merge_id; GtkActionEntry entries[] = { { @@ -441,48 +517,76 @@ static void add_module_to_menu(gchar * name, GdkPixbuf * pixbuf) stock_icon_register_pixbuf(pixbuf, name); + if ((action = gtk_action_group_get_action(shell->action_group, name))) { + gtk_action_group_remove_action(shell->action_group, action); + } + + if ((action = gtk_action_group_get_action(shell->action_group, about_module))) { + gtk_action_group_remove_action(shell->action_group, action); + } + gtk_action_group_add_actions(shell->action_group, entries, 2, NULL); + merge_id = gtk_ui_manager_new_merge_id(shell->ui_manager); gtk_ui_manager_add_ui(shell->ui_manager, - gtk_ui_manager_new_merge_id(shell->ui_manager), + merge_id, "/menubar/ViewMenu/LastSep", name, name, GTK_UI_MANAGER_MENU, TRUE); - + shell->merge_ids = g_slist_prepend(shell->merge_ids, GINT_TO_POINTER(merge_id)); + + merge_id = gtk_ui_manager_new_merge_id(shell->ui_manager); gtk_ui_manager_add_ui(shell->ui_manager, - gtk_ui_manager_new_merge_id(shell->ui_manager), + merge_id, "/menubar/HelpMenu/HelpMenuModules/LastSep", about_module, about_module, GTK_UI_MANAGER_AUTO, TRUE); + shell->merge_ids = g_slist_prepend(shell->merge_ids, GINT_TO_POINTER(merge_id)); + + menu_item_set_icon_always_visible(shell, "/menubar/ViewMenu", name); } static void add_module_entry_to_view_menu(gchar * module, gchar * name, GdkPixbuf * pixbuf, GtkTreeIter * iter) { - GtkActionEntry entries[] = { - { - name, /* name */ - name, /* stockid */ - name, /* label */ - NULL, /* accelerator */ - NULL, /* tooltip */ - (GCallback) view_menu_select_entry, /* callback */ - }, + GtkAction *action; + GtkWidget *menuitem; + gint merge_id; + gchar *path; + GtkActionEntry entry = { + name, /* name */ + name, /* stockid */ + name, /* label */ + NULL, /* accelerator */ + NULL, /* tooltip */ + (GCallback) view_menu_select_entry, /* callback */ }; stock_icon_register_pixbuf(pixbuf, name); - gtk_action_group_add_actions(shell->action_group, entries, 1, iter); + if ((action = gtk_action_group_get_action(shell->action_group, name))) { + gtk_action_group_remove_action(shell->action_group, action); + } + + gtk_action_group_add_actions(shell->action_group, &entry, 1, iter); + + merge_id = gtk_ui_manager_new_merge_id(shell->ui_manager); + path = g_strdup_printf("/menubar/ViewMenu/%s", module); gtk_ui_manager_add_ui(shell->ui_manager, - gtk_ui_manager_new_merge_id(shell->ui_manager), - g_strdup_printf("/menubar/ViewMenu/%s", module), + merge_id, + path, name, name, GTK_UI_MANAGER_AUTO, FALSE); + shell->merge_ids = g_slist_prepend(shell->merge_ids, GINT_TO_POINTER(merge_id)); + + menu_item_set_icon_always_visible(shell, path, name); + + g_free(path); } -static void add_modules_to_gui(gpointer data, gpointer user_data) +void shell_add_modules_to_gui(gpointer _shell_module, gpointer _shell_tree) { - ShellTree *shelltree = (ShellTree *) user_data; - ShellModule *module = (ShellModule *) data; + ShellModule *module = (ShellModule *) _shell_module; + ShellTree *shelltree = (ShellTree *) _shell_tree; GtkTreeStore *store = GTK_TREE_STORE(shelltree->model); GtkTreeIter parent; @@ -491,8 +595,12 @@ static void add_modules_to_gui(gpointer data, gpointer user_data) } 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); + gtk_tree_store_set(store, &parent, + TREE_COL_NAME, module->name, + TREE_COL_MODULE, module, + TREE_COL_MODULE_ENTRY, NULL, + TREE_COL_SEL, FALSE, + -1); if (module->icon) { gtk_tree_store_set(store, &parent, TREE_COL_PBUF, module->icon, @@ -511,7 +619,7 @@ static void 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_MODULE_ENTRY, entry, TREE_COL_SEL, FALSE, -1); if (entry->icon) { @@ -534,6 +642,26 @@ static void __tree_iter_destroy(gpointer data) gtk_tree_iter_free((GtkTreeIter *) data); } +ShellSummary *summary_new(void) +{ + ShellSummary *summary; + + summary = g_new0(ShellSummary, 1); + summary->scroll = gtk_scrolled_window_new(NULL, NULL); + summary->view = gtk_vbox_new(FALSE, 5); + summary->items = NULL; + + gtk_container_set_border_width(GTK_CONTAINER(summary->view), 6); + gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(summary->scroll), + GTK_POLICY_AUTOMATIC, + GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(summary->scroll), + summary->view); + gtk_widget_show_all(summary->scroll); + + return summary; +} + void shell_init(GSList * modules) { if (shell) { @@ -545,14 +673,18 @@ void shell_init(GSList * modules) create_window(); + shell_action_set_property("ConnectToAction", "is-important", TRUE); 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_action_set_property("ReportBugAction", "is-important", TRUE); shell->tree = tree_new(); shell->info = info_tree_new(FALSE); shell->moreinfo = info_tree_new(TRUE); shell->loadgraph = load_graph_new(75); + shell->summary = summary_new(); + update_tbl = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, __tree_iter_destroy); @@ -566,25 +698,27 @@ void shell_init(GSList * modules) gtk_notebook_append_page(GTK_NOTEBOOK(shell->notebook), load_graph_get_framed(shell->loadgraph), NULL); - + gtk_notebook_append_page(GTK_NOTEBOOK(shell->notebook), + shell->summary->scroll, NULL); + gtk_notebook_set_show_tabs(GTK_NOTEBOOK(shell->notebook), FALSE); gtk_notebook_set_show_border(GTK_NOTEBOOK(shell->notebook), FALSE); shell_status_set_enabled(TRUE); - shell_status_update("Loading modules..."); + shell_status_update(_("Loading modules...")); shell->tree->modules = modules ? modules : modules_load_all(); - g_slist_foreach(shell->tree->modules, add_modules_to_gui, shell->tree); + g_slist_foreach(shell->tree->modules, shell_add_modules_to_gui, shell->tree); gtk_tree_view_expand_all(GTK_TREE_VIEW(shell->tree->view)); gtk_widget_show_all(shell->hpaned); load_graph_configure_expose(shell->loadgraph); gtk_widget_hide(shell->notebook); - gtk_widget_hide(shell->note->frame); + gtk_widget_hide(shell->note->event_box); - shell_status_update("Done."); + shell_status_update(_("Done.")); shell_status_set_enabled(FALSE); shell_action_set_enabled("RefreshAction", FALSE); @@ -611,12 +745,14 @@ static gboolean update_field(gpointer data) DEBUG("update_field [%s]", fu->field_name); iter = g_hash_table_lookup(update_tbl, fu->field_name); - g_return_val_if_fail(iter != NULL, FALSE); + if (!iter) { + return FALSE; + } /* if the entry is still selected, update it */ if (iter && fu->entry->selected && fu->entry->fieldfunc) { GtkTreeStore *store = GTK_TREE_STORE(shell->info->model); - gchar *value = fu->entry->fieldfunc(fu->field_name); + gchar *value = fu->entry->fieldfunc(_(fu->field_name)); /* * this function is also used to feed the load graph when ViewType @@ -653,9 +789,15 @@ static gboolean update_field(gpointer data) } #define RANGE_SET_VALUE(tree,scrollbar,value) \ - gtk_range_set_value(GTK_RANGE \ + do { \ + GtkRange CONCAT(*range, __LINE__) = GTK_RANGE(GTK_SCROLLED_WINDOW(shell->tree->scroll)->scrollbar); \ + gtk_range_set_value(CONCAT(range, __LINE__), value); \ + gtk_adjustment_value_changed(GTK_ADJUSTMENT(gtk_range_get_adjustment(CONCAT(range, __LINE__)))); \ + } while (0) +#define RANGE_GET_VALUE(tree,scrollbar) \ + gtk_range_get_value(GTK_RANGE \ (GTK_SCROLLED_WINDOW(shell->tree->scroll)-> \ - scrollbar), value); + scrollbar)) static gboolean reload_section(gpointer data) { @@ -665,7 +807,12 @@ static gboolean reload_section(gpointer data) if (entry->selected) { GtkTreePath *path = NULL; GtkTreeIter iter; - + double pos_info_scroll, pos_more_scroll; + + /* save current position */ + pos_info_scroll = RANGE_GET_VALUE(info, vscrollbar); + pos_more_scroll = RANGE_GET_VALUE(moreinfo, vscrollbar); + /* avoid drawing the window while we reload */ gdk_window_freeze_updates(shell->window->window); @@ -686,8 +833,12 @@ static gboolean reload_section(gpointer data) gtk_tree_view_set_cursor(GTK_TREE_VIEW(shell->info->view), path, NULL, FALSE); gtk_tree_path_free(path); - } - + } else { + /* restore position */ + RANGE_SET_VALUE(info, vscrollbar, pos_info_scroll); + RANGE_SET_VALUE(moreinfo, vscrollbar, pos_more_scroll); + } + /* make the window drawable again */ gdk_window_thaw_updates(shell->window->window); } @@ -705,7 +856,13 @@ static gboolean rescan_section(gpointer data) return entry->selected; } -gint +static gint +compare_float(float a, float b) +{ + return (a > b) - (a < b); +} + +static gint info_tree_compare_val_func(GtkTreeModel * model, GtkTreeIter * a, GtkTreeIter * b, gpointer userdata) @@ -716,15 +873,16 @@ info_tree_compare_val_func(GtkTreeModel * model, 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)); - } + if (!col1 && !col2) + ret = 0; + else if (!col1) + ret = -1; + else if (!col2) + ret = 1; + else if (shell->_order_type == SHELL_ORDER_ASCENDING) + ret = compare_float(atof(col2), atof(col1)); + else + ret = compare_float(atof(col1), atof(col2)); g_free(col1); g_free(col2); @@ -758,9 +916,12 @@ static void set_view_type(ShellViewType viewtype, gboolean reload) /* turn off the save graphic action */ shell_action_set_enabled("SaveGraphAction", FALSE); + close_note(NULL, NULL); + switch (viewtype) { default: case SHELL_VIEW_NORMAL: + gtk_widget_show(shell->info->scroll); gtk_widget_hide(shell->notebook); if (!reload) { @@ -768,10 +929,16 @@ static void set_view_type(ShellViewType viewtype, gboolean reload) } break; case SHELL_VIEW_DUAL: + gtk_widget_show(shell->info->scroll); + gtk_widget_show(shell->moreinfo->scroll); gtk_notebook_set_page(GTK_NOTEBOOK(shell->notebook), 0); gtk_widget_show(shell->notebook); + + gtk_paned_set_position(GTK_PANED(shell->vpaned), + shell->hpaned->allocation.height / 2); break; case SHELL_VIEW_LOAD_GRAPH: + gtk_widget_show(shell->info->scroll); gtk_notebook_set_page(GTK_NOTEBOOK(shell->notebook), 1); gtk_widget_show(shell->notebook); load_graph_clear(shell->loadgraph); @@ -781,10 +948,13 @@ static void set_view_type(ShellViewType viewtype, gboolean reload) shell->loadgraph->height - 16); break; case SHELL_VIEW_PROGRESS_DUAL: - gtk_notebook_set_page(GTK_NOTEBOOK(shell->notebook), 0); gtk_widget_show(shell->notebook); + gtk_widget_show(shell->moreinfo->scroll); + + gtk_notebook_set_page(GTK_NOTEBOOK(shell->notebook), 0); /* fallthrough */ case SHELL_VIEW_PROGRESS: + gtk_widget_show(shell->info->scroll); shell_action_set_enabled("SaveGraphAction", TRUE); if (!reload) { @@ -795,6 +965,12 @@ static void set_view_type(ShellViewType viewtype, gboolean reload) if (viewtype == SHELL_VIEW_PROGRESS) gtk_widget_hide(shell->notebook); break; + case SHELL_VIEW_SUMMARY: + gtk_notebook_set_page(GTK_NOTEBOOK(shell->notebook), 2); + + gtk_widget_show(shell->notebook); + gtk_widget_hide(shell->info->scroll); + gtk_widget_hide(shell->moreinfo->scroll); } } @@ -816,7 +992,7 @@ group_handle_special(GKeyFile * key_file, ShellModuleEntry * entry, ms = g_key_file_get_integer(key_file, group, key, NULL); - fu->field_name = g_strdup(strchr(key, '$') + 1); + fu->field_name = g_strdup(g_utf8_strchr(key, -1, '$') + 1); fu->entry = entry; sfutbl = g_new0(ShellFieldUpdateSource, 1); @@ -847,7 +1023,7 @@ group_handle_special(GKeyFile * key_file, ShellModuleEntry * entry, headers_visible = g_key_file_get_boolean(key_file, group, key, NULL); } else if (g_str_has_prefix(key, "ColumnTitle")) { GtkTreeViewColumn *column = NULL; - gchar *value, *title = strchr(key, '$') + 1; + gchar *value, *title = g_utf8_strchr(key, -1, '$') + 1; value = g_key_file_get_value(key_file, group, key, NULL); @@ -878,8 +1054,8 @@ group_handle_special(GKeyFile * key_file, ShellModuleEntry * entry, key, NULL), reload); } else if (g_str_has_prefix(key, "Icon")) { GtkTreeIter *iter = g_hash_table_lookup(update_tbl, - strchr(key, - '$') + 1); + g_utf8_strchr(key, + -1, '$') + 1); if (iter) { gchar *file = @@ -931,7 +1107,7 @@ group_handle_normal(GKeyFile * key_file, ShellModuleEntry * entry, value = g_key_file_get_value(key_file, group, key, NULL); if (entry->fieldfunc && value && g_str_equal(value, "...")) { g_free(value); - value = entry->fieldfunc(key); + value = entry->fieldfunc(_(key)); } if ((key && value) && g_utf8_validate(key, -1, NULL) && g_utf8_validate(value, -1, NULL)) { @@ -942,7 +1118,7 @@ group_handle_normal(GKeyFile * key_file, ShellModuleEntry * entry, } /* FIXME: use g_key_file_get_string_list? */ - if (strchr(value, '|')) { + if (g_utf8_strchr(value, -1, '|')) { gchar **columns = g_strsplit(value, "|", 0); gtk_tree_store_set(store, &child, INFO_TREE_COL_VALUE, columns[0], -1); @@ -970,7 +1146,7 @@ group_handle_normal(GKeyFile * key_file, ShellModuleEntry * entry, g_strfreev(tmp); } else { - gtk_tree_store_set(store, &child, INFO_TREE_COL_NAME, key, + gtk_tree_store_set(store, &child, INFO_TREE_COL_NAME, _(key), INFO_TREE_COL_DATA, NULL, -1); } @@ -1019,66 +1195,62 @@ static void update_progress() GtkTreeStore *store = GTK_TREE_STORE(model); GtkTreeIter iter, fiter; gchar *tmp; - gdouble maxv = 0, maxp = 0, cur, floatval; + gdouble maxv = INT_MIN, minv = INT_MAX, coeff, cur; - gtk_tree_model_get_iter_first(model, &fiter); + if (!gtk_tree_model_get_iter_first(model, &fiter)) + return; /* finds the maximum value */ if (shell->normalize_percentage) { 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)); - } else { - maxv = 100.0f; - } - - /* 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); + cur = atof(tmp); + if (cur > maxv) + maxv = cur; + if (cur < minv) + minv = cur; g_free(tmp); } while (gtk_tree_model_iter_next(model, &iter)); - maxp = 100 - maxp; + if (minv - maxv < 0.001) + maxv += 1.0f; + } else { + minv = 1.0f; + maxv = 100.0f; } + coeff = (100.0f - 1.0f) / (maxv - minv); + /* fix the maximum relative percentage */ iter = fiter; do { - char *strval; - + char *space; + char formatted[128]; + gdouble pct; + gtk_tree_model_get(model, &iter, INFO_TREE_COL_VALUE, &tmp, -1); - floatval = atof(tmp); - strval = g_strdup(tmp); - g_free(tmp); - - cur = 100 * floatval / maxv; + cur = atof(tmp); + space = g_utf8_strchr(tmp, -1, ' '); + pct = coeff * (cur - minv) + 1.0f; if (shell->_order_type == SHELL_ORDER_ASCENDING) - cur = 100 - cur + maxp; - - if (strchr(strval, ' ')) { - tmp = g_strdup_printf("%.2f%s", floatval, strchr(strval, ' ')); - } else { - tmp = g_strdup_printf("%.2f", floatval); - } + pct = 100.0 - pct; + pct = ceil(pct); - tmp = strreplace(tmp, ",", '.'); - gtk_tree_store_set(store, &iter, INFO_TREE_COL_PROGRESS, cur, - INFO_TREE_COL_VALUE, tmp, -1); - g_free(tmp); - g_free(strval); + if (space) { + snprintf(formatted, sizeof(formatted), "%.2f%s", cur, space); + } else { + snprintf(formatted, sizeof(formatted), "%.2f", cur); + } + + gtk_tree_store_set(store, &iter, INFO_TREE_COL_PROGRESS, pct, + INFO_TREE_COL_VALUE, strreplacechr(formatted, ",", + '.'), -1); + + g_free(tmp); } while (gtk_tree_model_iter_next(model, &iter)); /* now sort everything up. that wasn't as hard as i thought :) */ @@ -1086,8 +1258,7 @@ static void update_progress() 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_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)); @@ -1100,12 +1271,31 @@ void shell_set_note_from_entry(ShellModuleEntry * entry) if (note) { gtk_label_set_markup(GTK_LABEL(shell->note->label), note); - gtk_widget_show(shell->note->frame); + gtk_widget_show(shell->note->event_box); } else { - gtk_widget_hide(shell->note->frame); + gtk_widget_hide(shell->note->event_box); } } else { - gtk_widget_hide(shell->note->frame); + gtk_widget_hide(shell->note->event_box); + } +} + +void shell_clear_field_updates(void) +{ + 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; } } @@ -1136,22 +1326,7 @@ module_selected_show_info(ShellModuleEntry * entry, gboolean reload) h_hash_table_remove_all(update_tbl); } - 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; - } + shell_clear_field_updates(); store = GTK_TREE_STORE(shell->info->model); @@ -1247,19 +1422,207 @@ static void info_selected_show_extra(gchar * data) } } +static gchar *shell_summary_clear_value(gchar *value) +{ + GKeyFile *keyfile; + gchar *return_value; + + keyfile = g_key_file_new(); + if (!value) return_value = g_strdup(""); + else + if (g_key_file_load_from_data(keyfile, value, + strlen(value), 0, NULL)) { + gchar **groups; + gint group; + + return_value = g_strdup(""); + + groups = g_key_file_get_groups(keyfile, NULL); + for (group = 0; groups[group]; group++) { + gchar **keys; + gint key; + + keys = g_key_file_get_keys(keyfile, groups[group], NULL, NULL); + for (key = 0; keys[key]; key++) { + gchar *temp = keys[key]; + + if (*temp == '$') { + temp++; + while (*temp && *temp != '$') + temp++; + temp++; + + return_value = h_strdup_cprintf("%s\n", return_value, temp); + } else { + return_value = g_key_file_get_string(keyfile, groups[group], + keys[key], NULL); + } + } + + g_strfreev(keys); + } + + g_strfreev(groups); + } else { + return_value = g_strdup(value); + } + + g_key_file_free(keyfile); + + return g_strstrip(return_value); +} + +static void shell_summary_add_item(ShellSummary *summary, + gchar *icon, + gchar *name, + gchar *value) +{ + GtkWidget *frame; + GtkWidget *frame_label_box; + GtkWidget *frame_image; + GtkWidget *frame_label; + GtkWidget *content; + GtkWidget *alignment; + gchar *temp; + + temp = shell_summary_clear_value(value); + + /* creates the frame */ + frame = gtk_frame_new(NULL); + gtk_frame_set_shadow_type(GTK_FRAME(frame), + GTK_SHADOW_NONE); + + frame_label_box = gtk_hbox_new(FALSE, 5); + frame_image = icon_cache_get_image(icon); + frame_label = gtk_label_new(name); + gtk_label_set_use_markup(GTK_LABEL(frame_label), TRUE); + gtk_box_pack_start(GTK_BOX(frame_label_box), frame_image, FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(frame_label_box), frame_label, FALSE, FALSE, 0); + + alignment = gtk_alignment_new(0.5, 0.5, 1, 1); + gtk_widget_show(alignment); + gtk_container_add(GTK_CONTAINER(frame), alignment); + gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 0, 0, 48, 0); + + content = gtk_label_new(temp); + gtk_misc_set_alignment(GTK_MISC(content), 0.0, 0.5); + gtk_container_add(GTK_CONTAINER(alignment), content); + + gtk_widget_show_all(frame); + gtk_widget_show_all(frame_label_box); + + gtk_frame_set_label_widget(GTK_FRAME(frame), frame_label_box); + + /* pack the item on the summary screen */ + gtk_box_pack_start(GTK_BOX(shell->summary->view), frame, FALSE, FALSE, 4); + + /* add the item to the list of summary items */ + summary->items = g_slist_prepend(summary->items, frame); + + g_free(temp); +} + +static void shell_summary_clear(ShellSummary *summary) +{ + GSList *item; + + for (item = summary->items; item; item = item->next) { + gtk_widget_destroy(GTK_WIDGET(item->data)); + } + + g_slist_free(summary->items); + summary->items = NULL; + + if (summary->header) gtk_widget_destroy(summary->header); + summary->header = NULL; +} +static void shell_summary_create_header(ShellSummary *summary, + gchar *title) +{ + GtkWidget *header, *label; + gchar *temp; + + temp = g_strdup_printf(_("<b>%s \342\206\222 Summary</b>"), title); + + header = gtk_menu_item_new_with_label(temp); + gtk_menu_item_select(GTK_MENU_ITEM(header)); + gtk_widget_show(header); + + label = gtk_bin_get_child(GTK_BIN(header)); + gtk_label_set_use_markup(GTK_LABEL(label), TRUE); + + gtk_box_pack_start(GTK_BOX(shell->summary->view), header, FALSE, FALSE, 4); + + summary->header = header; + + g_free(temp); +} + +static void shell_show_summary(void) +{ + GKeyFile *keyfile; + gchar *summary; + + set_view_type(SHELL_VIEW_SUMMARY, FALSE); + shell_summary_clear(shell->summary); + shell_summary_create_header(shell->summary, shell->selected_module->name); + + keyfile = g_key_file_new(); + summary = shell->selected_module->summaryfunc(); + + if (g_key_file_load_from_data(keyfile, summary, + strlen(summary), 0, NULL)) { + gchar **groups; + gint group; + + groups = g_key_file_get_groups(keyfile, NULL); + + for (group = 0; groups[group]; group++) { + gchar *icon, *method, *method_result; + + shell_status_pulse(); + + icon = g_key_file_get_string(keyfile, groups[group], "Icon", NULL); + method = g_key_file_get_string(keyfile, groups[group], "Method", NULL); + if (method) { + method_result = module_call_method(method); + } else { + method_result = g_strdup("N/A"); + } + + shell_summary_add_item(shell->summary, + icon, groups[group], method_result); + shell_status_pulse(); + + g_free(icon); + g_free(method); + g_free(method_result); + } + + g_strfreev(groups); + } else { + DEBUG("error while parsing summary"); + set_view_type(SHELL_VIEW_NORMAL, FALSE); + } + + g_free(summary); + g_key_file_free(keyfile); + + shell_view_set_enabled(TRUE); +} + static void module_selected(gpointer data) { ShellTree *shelltree = shell->tree; GtkTreeModel *model = GTK_TREE_MODEL(shelltree->model); - GtkTreeIter parent; + GtkTreeIter iter, parent; ShellModuleEntry *entry; static ShellModuleEntry *current = NULL; static gboolean updating = FALSE; /* Gets the currently selected item on the left-side TreeView; if there is no selection, silently return */ - if (!gtk_tree_selection_get_selected - (shelltree->selection, &model, &parent)) { + if (!gtk_tree_selection_get_selected(shelltree->selection, &model, &iter)) { return; } @@ -1275,18 +1638,24 @@ static void module_selected(gpointer data) updating = TRUE; } + if (!gtk_tree_model_iter_parent(model, &parent, &iter)) { + memcpy(&parent, &iter, sizeof(iter)); + } + + gtk_tree_model_get(model, &parent, TREE_COL_MODULE, &shell->selected_module, -1); + /* Get the current selection and shows its related info */ - gtk_tree_model_get(model, &parent, TREE_COL_DATA, &entry, -1); + gtk_tree_model_get(model, &iter, TREE_COL_MODULE_ENTRY, &entry, -1); if (entry && !entry->selected) { gchar *title; shell_status_set_enabled(TRUE); - shell_status_update("Updating..."); + shell_status_update(_("Updating...")); entry->selected = TRUE; 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)); @@ -1296,23 +1665,26 @@ static void module_selected(gpointer data) RANGE_SET_VALUE(moreinfo, vscrollbar, 0.0); RANGE_SET_VALUE(moreinfo, hscrollbar, 0.0); - shell_status_update("Done."); - shell_status_set_enabled(FALSE); - - title = g_strdup_printf("%s - System Information", entry->name); - gtk_window_set_title(GTK_WINDOW(shell->window), title); + title = g_strdup_printf("%s - %s", shell->selected_module->name, entry->name); + shell_set_title(shell, title); g_free(title); shell_action_set_enabled("RefreshAction", TRUE); shell_action_set_enabled("CopyAction", TRUE); + + shell_status_update(_("Done.")); + shell_status_set_enabled(FALSE); } else { - gtk_window_set_title(GTK_WINDOW(shell->window), - "System Information"); + shell_set_title(shell, NULL); 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, FALSE); + + if (shell->selected_module->summaryfunc) { + shell_show_summary(); + } } current = entry; @@ -1328,6 +1700,12 @@ static void info_selected(GtkTreeSelection * ts, gpointer data) if (!gtk_tree_selection_get_selected(ts, &model, &parent)) return; + + if (shell->view_type == SHELL_VIEW_NORMAL || + shell->view_type == SHELL_VIEW_PROGRESS) { + gtk_tree_selection_unselect_all(ts); + return; + } gtk_tree_model_get(model, &parent, INFO_TREE_COL_DATA, &datacol, -1); info_selected_show_extra(datacol); @@ -1457,11 +1835,16 @@ static ShellTree *tree_new() GTK_POLICY_AUTOMATIC); store = gtk_tree_store_new(TREE_NCOL, GDK_TYPE_PIXBUF, G_TYPE_STRING, - G_TYPE_POINTER, G_TYPE_BOOLEAN); + G_TYPE_POINTER, G_TYPE_POINTER, G_TYPE_BOOLEAN); model = GTK_TREE_MODEL(store); treeview = gtk_tree_view_new_with_model(model); gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(treeview), FALSE); +#if GTK_CHECK_VERSION(2,12,0) + gtk_tree_view_set_show_expanders(GTK_TREE_VIEW(treeview), FALSE); + gtk_tree_view_set_level_indentation(GTK_TREE_VIEW(treeview), 24); +#endif + column = gtk_tree_view_column_new(); gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column); @@ -31,6 +31,7 @@ static struct { { "about-modules.png", HI_STOCK_ABOUT_MODULES}, { "syncmanager-small.png", HI_STOCK_SYNC_MENU}, { "face-grin.png", HI_STOCK_DONATE}, + { "server.png", HI_STOCK_SERVER}, }; static GtkIconFactory *icon_factory; diff --git a/syncmanager.c b/shell/syncmanager.c index 37788a7b..0b95e720 100644 --- a/syncmanager.c +++ b/shell/syncmanager.c @@ -63,16 +63,16 @@ static SoupSession *session = NULL; static GMainLoop *loop; static GQuark err_quark; -#define XMLRPC_SERVER_URI "http://hardinfo.berlios.de/xmlrpc/" +#define XMLRPC_SERVER_URI "https://xmlrpc.hardinfo.org/" #define XMLRPC_SERVER_API_VERSION 1 -#define LABEL_SYNC_DEFAULT "<big><b>Synchronize with Central Database</b></big>\n" \ +#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." + "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 SyncDialog *sync_dialog_new(GtkWidget *parent); static void sync_dialog_destroy(SyncDialog * sd); static void sync_dialog_start_sync(SyncDialog * sd); @@ -113,13 +113,25 @@ void sync_manager_add_entry(SyncEntry * entry) #endif /* HAS_LIBSOUP */ } -void sync_manager_show(void) +void sync_manager_clear_entries(void) +{ +#ifdef HAS_LIBSOUP + DEBUG("clearing syncmanager entries"); + + g_slist_free(entries); + entries = NULL; +#else + DEBUG("libsoup support is disabled."); +#endif /* HAS_LIBSOUP */ +} + +void sync_manager_show(GtkWidget *parent) { #ifndef HAS_LIBSOUP g_warning - ("HardInfo was compiled without libsoup support. (Network Updater requires it.)"); + (_("HardInfo was compiled without libsoup support. (Network Updater requires it.)")); #else /* !HAS_LIBSOUP */ - SyncDialog *sd = sync_dialog_new(); + SyncDialog *sd = sync_dialog_new(parent); err_quark = g_quark_from_static_string("syncmanager"); @@ -146,19 +158,23 @@ static gint _soup_get_xmlrpc_value_int(SoupMessage * msg, sna->error = NULL; if (!SOUP_STATUS_IS_SUCCESSFUL(msg->status_code)) { - SNA_ERROR(1, "%s (error #%d)", msg->reason_phrase, + SNA_ERROR(1, _("%s (error #%d)"), msg->reason_phrase, msg->status_code); goto bad; } - if (!soup_xmlrpc_extract_method_response(msg->response_body->data, - msg->response_body->length, - NULL, - G_TYPE_INT, &int_value)) { - SNA_ERROR(2, "Could not parse XML-RPC response"); + GVariant *value = soup_xmlrpc_parse_response(msg->response_body->data, + msg->response_body->length, + "h", NULL); + if (!value) { + SNA_ERROR(2, _("Could not parse XML-RPC response")); + goto bad; } - bad: + int_value = g_variant_get_int32(value); + g_variant_unref(value); + +bad: return int_value; } @@ -170,19 +186,23 @@ static gchar *_soup_get_xmlrpc_value_string(SoupMessage * msg, sna->error = NULL; if (!SOUP_STATUS_IS_SUCCESSFUL(msg->status_code)) { - SNA_ERROR(1, "%s (error #%d)", msg->reason_phrase, + SNA_ERROR(1, _("%s (error #%d)"), msg->reason_phrase, msg->status_code); goto bad; } - if (!soup_xmlrpc_extract_method_response(msg->response_body->data, - msg->response_body->length, - NULL, - G_TYPE_STRING, &string)) { - SNA_ERROR(2, "Could not parse XML-RPC response"); + GVariant *value = soup_xmlrpc_parse_response(msg->response_body->data, + msg->response_body->length, + "s", NULL); + if (!value) { + SNA_ERROR(2, _("Could not parse XML-RPC response")); + goto bad; } - bad: + string = g_strdup(g_variant_get_string(value, NULL)); + g_variant_unref(value); + +bad: return string; } @@ -193,8 +213,7 @@ static gboolean _soup_xmlrpc_call(gchar * method, SyncNetAction * sna, sna->error = NULL; - msg = soup_xmlrpc_request_new(XMLRPC_SERVER_URI, method, - G_TYPE_INVALID); + msg = soup_xmlrpc_message_new(XMLRPC_SERVER_URI, method, NULL, NULL); if (!msg) return FALSE; @@ -212,7 +231,8 @@ static gboolean _soup_xmlrpc_call_with_parameters(gchar * method, callback, ...) { SoupMessage *msg; - GValueArray *parameters; + GVariantBuilder builder; + GVariant *parameters; gchar *argument, *body; va_list ap; @@ -224,24 +244,29 @@ static gboolean _soup_xmlrpc_call_with_parameters(gchar * method, if (!msg) return FALSE; - parameters = g_value_array_new(1); + g_variant_builder_init(&builder, G_VARIANT_TYPE_ARRAY); va_start(ap, callback); while ((argument = va_arg(ap, gchar *))) { - soup_value_array_append(parameters, G_TYPE_STRING, argument); + g_variant_builder_add(&builder, "s", argument); DEBUG("with parameter: %s", argument); } va_end(ap); + parameters = g_variant_builder_end(&builder); + g_variant_builder_unref(&builder); - body = soup_xmlrpc_build_method_call(method, parameters->values, - parameters->n_values); - g_value_array_free(parameters); - soup_message_set_request(msg, "text/xml", - SOUP_MEMORY_TAKE, body, strlen (body)); + body = soup_xmlrpc_build_request(method, parameters, NULL); + g_variant_unref(parameters); + if (body) { + soup_message_set_request(msg, "text/xml", + SOUP_MEMORY_TAKE, body, strlen(body)); - soup_session_queue_message(session, msg, callback, sna); - g_main_run(loop); + soup_session_queue_message(session, msg, callback, sna); + g_main_run(loop); - return TRUE; + return TRUE; + } + + return FALSE; } static void _action_check_api_version_got_response(SoupSession * session, @@ -252,9 +277,9 @@ static void _action_check_api_version_got_response(SoupSession * session, gint version = _soup_get_xmlrpc_value_int(msg, sna); if (version != XMLRPC_SERVER_API_VERSION) { - SNA_ERROR(5, "Server says it supports API version %d, but " + SNA_ERROR(5, _("Server says it supports API version %d, but " "this version of HardInfo only supports API " - "version %d.", version, XMLRPC_SERVER_API_VERSION); + "version %d."), version, XMLRPC_SERVER_API_VERSION); } g_main_quit(loop); @@ -314,14 +339,12 @@ static gboolean _action_call_function(SyncDialog * sd, gpointer user_data) VERSION, ARCH, sna->entry->name, str_data, NULL)) { - if (str_data) - g_free(str_data); + g_free(str_data); return FALSE; } - if (str_data) - g_free(str_data); + g_free(str_data); } return sna->error ? FALSE : TRUE; @@ -349,8 +372,8 @@ static SyncNetAction *sync_manager_get_selected_actions(gint * n) GSList *entry; SyncNetAction *actions; SyncNetAction - action_check_api = { "Contacting HardInfo Central Database", _action_check_api_version }, - action_clean_up = { "Cleaning up", NULL}; + 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)); @@ -393,8 +416,7 @@ static void sync_dialog_start_sync(SyncDialog * sd) if (!session) { SoupURI *proxy = sync_manager_get_proxy(); - session = - soup_session_async_new_with_options(SOUP_SESSION_TIMEOUT, 10, + session = soup_session_new_with_options(SOUP_SESSION_TIMEOUT, 10, SOUP_SESSION_PROXY_URI, proxy, NULL); /* Crashes if we unref the proxy? O_o */ @@ -429,12 +451,14 @@ static void sync_dialog_netarea_start_actions(SyncDialog * sd, { 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"); + GtkWidget **status_labels; + const gchar *done_str = "\342\234\223"; + const gchar *error_str = "\342\234\227"; + const gchar *curr_str = "\342\226\266"; + const gchar *empty_str = "\302\240\302\240"; labels = g_new0(GtkWidget *, n); - icons = g_new0(GtkWidget *, n); + status_labels = g_new0(GtkWidget *, n); for (i = 0; i < n; i++) { GtkWidget *hbox; @@ -442,16 +466,15 @@ static void sync_dialog_netarea_start_actions(SyncDialog * sd, 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)); + status_labels[i] = gtk_label_new(empty_str); gtk_label_set_use_markup(GTK_LABEL(labels[i]), TRUE); + gtk_label_set_use_markup(GTK_LABEL(status_labels[i]), TRUE); + gtk_misc_set_alignment(GTK_MISC(labels[i]), 0.0, 0.5); + gtk_misc_set_alignment(GTK_MISC(status_labels[i]), 1.0, 0.5); - gtk_box_pack_start(GTK_BOX(hbox), icons[i], FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(hbox), status_labels[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); @@ -466,14 +489,12 @@ static void sync_dialog_netarea_start_actions(SyncDialog * sd, if (sd->flag_cancel) { markup = - g_strdup_printf("<s>%s</s> <i>(canceled)</i>", + 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")); + gtk_label_set_markup(GTK_LABEL(status_labels[i]), error_str); break; } @@ -481,46 +502,44 @@ static void sync_dialog_netarea_start_actions(SyncDialog * sd, gtk_label_set_markup(GTK_LABEL(labels[i]), markup); g_free(markup); - gtk_image_set_from_pixbuf(GTK_IMAGE(icons[i]), curr_icon); + gtk_label_set_markup(GTK_LABEL(status_labels[i]), curr_str); if (sna[i].do_action && !sna[i].do_action(sd, &sna[i])) { markup = - g_strdup_printf("<b><s>%s</s></b> <i>(failed)</i>", + 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")); + gtk_label_set_markup(GTK_LABEL(status_labels[i]), error_str); if (sna[i].error) { if (sna[i].error->code != 1) { /* the user has not cancelled something... */ g_warning - ("Failed while performing \"%s\". Please file a bug report " + (_("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, + " 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 " + (_("Failed while performing \"%s\". Please file a bug report " "if this problem persists. (Use the Help\342\206\222Report" - " bug option.)", sna[i].name); + " bug option.)"), sna[i].name); } break; } - gtk_image_set_from_pixbuf(GTK_IMAGE(icons[i]), done_icon); + gtk_label_set_markup(GTK_LABEL(status_labels[i]), done_str); gtk_label_set_markup(GTK_LABEL(labels[i]), sna[i].name); } g_free(labels); - g_free(icons); + g_free(status_labels); } static SyncNetArea *sync_dialog_netarea_new(void) @@ -612,7 +631,7 @@ static void close_clicked(void) g_main_quit(loop); } -static SyncDialog *sync_dialog_new(void) +static SyncDialog *sync_dialog_new(GtkWidget *parent) { SyncDialog *sd; GtkWidget *dialog; @@ -635,7 +654,8 @@ static SyncDialog *sync_dialog_new(void) sd->sna = sync_dialog_netarea_new(); dialog = gtk_dialog_new(); - gtk_window_set_title(GTK_WINDOW(dialog), "Network Updater"); + gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(parent)); + gtk_window_set_title(GTK_WINDOW(dialog), _("Network Updater")); gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE); gtk_window_set_icon(GTK_WINDOW(dialog), icon_cache_get_pixbuf("syncmanager.png")); @@ -716,7 +736,7 @@ static SyncDialog *sync_dialog_new(void) GTK_RESPONSE_CANCEL); GTK_WIDGET_SET_FLAGS(button8, GTK_CAN_DEFAULT); - button7 = gtk_button_new_with_mnemonic("_Synchronize"); + button7 = gtk_button_new_with_mnemonic(_("_Synchronize")); gtk_widget_show(button7); gtk_dialog_add_action_widget(GTK_DIALOG(dialog), button7, GTK_RESPONSE_ACCEPT); |