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 | 7aacc9f2510901c9e97b30fa9bcb550bb7f99c03 (patch) | |
tree | 16908948750c11da8332d80d8bb9b339399ee4d7 /includes | |
parent | 7c47b5b9584f5011aeba18d7e1b26b3d3124825f (diff) |
New upstream version 0.5.1+git20170605
Diffstat (limited to 'includes')
44 files changed, 2206 insertions, 0 deletions
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/includes/arm/processor-platform.h b/includes/arm/processor-platform.h new file mode 100644 index 00000000..290b9a62 --- /dev/null +++ b/includes/arm/processor-platform.h @@ -0,0 +1,41 @@ +/* + * 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 *decoded_name; + gchar *flags; + gfloat bogomips; + + gfloat cpu_mhz; /* for devices.c, identical to cpukhz_max/1000 */ + gint cpukhz_max, cpukhz_min, cpukhz_cur; /* for arm/processor.c */ + gint id; + + gchar *cpu_implementer; + gchar *cpu_architecture; + gchar *cpu_variant; + gchar *cpu_part; + gchar *cpu_revision; + + gint mode; +}; + +#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/includes/binreloc.h b/includes/binreloc.h new file mode 100644 index 00000000..3bf48bc6 --- /dev/null +++ b/includes/binreloc.h @@ -0,0 +1,68 @@ +/* + * BinReloc - a library for creating relocatable executables + * Written by: Hongli Lai <h.lai@chello.nl> + * http://autopackage.org/ + * + * This source code is public domain. You can relicense this code + * under whatever license you want. + * + * See http://autopackage.org/docs/binreloc/ for + * more information and how to use this. + */ + +#ifndef __BINRELOC_H__ +#define __BINRELOC_H__ + +#include <glib.h> + +G_BEGIN_DECLS + + +/** These error codes can be returned by br_init(), br_init_lib(), gbr_init() or gbr_init_lib(). */ +typedef enum { + /** Cannot allocate memory. */ + GBR_INIT_ERROR_NOMEM, + /** Unable to open /proc/self/maps; see errno for details. */ + GBR_INIT_ERROR_OPEN_MAPS, + /** Unable to read from /proc/self/maps; see errno for details. */ + GBR_INIT_ERROR_READ_MAPS, + /** The file format of /proc/self/maps is invalid; kernel bug? */ + GBR_INIT_ERROR_INVALID_MAPS, + /** BinReloc is disabled (the ENABLE_BINRELOC macro is not defined). */ + GBR_INIT_ERROR_DISABLED +} GbrInitError; + + +#ifndef BINRELOC_RUNNING_DOXYGEN +/* Mangle symbol names to avoid symbol collisions with other ELF objects. */ + #define gbr_find_exe UfUy21856259474323_gbr_find_exe + #define gbr_find_exe_dir UfUy21856259474323_gbr_find_exe_dir + #define gbr_find_prefix UfUy21856259474323_gbr_find_prefix + #define gbr_find_bin_dir UfUy21856259474323_gbr_find_bin_dir + #define gbr_find_sbin_dir UfUy21856259474323_gbr_find_sbin_dir + #define gbr_find_data_dir UfUy21856259474323_gbr_find_data_dir + #define gbr_find_locale_dir UfUy21856259474323_gbr_find_locale_dir + #define gbr_find_lib_dir UfUy21856259474323_gbr_find_lib_dir + #define gbr_find_libexec_dir UfUy21856259474323_gbr_find_libexec_dir + #define gbr_find_etc_dir UfUy21856259474323_gbr_find_etc_dir + + +#endif +gboolean gbr_init (GError **error); +gboolean gbr_init_lib (GError **error); + +gchar *gbr_find_exe (const gchar *default_exe); +gchar *gbr_find_exe_dir (const gchar *default_dir); +gchar *gbr_find_prefix (const gchar *default_prefix); +gchar *gbr_find_bin_dir (const gchar *default_bin_dir); +gchar *gbr_find_sbin_dir (const gchar *default_sbin_dir); +gchar *gbr_find_data_dir (const gchar *default_data_dir); +gchar *gbr_find_locale_dir (const gchar *default_locale_dir); +gchar *gbr_find_lib_dir (const gchar *default_lib_dir); +gchar *gbr_find_libexec_dir (const gchar *default_libexec_dir); +gchar *gbr_find_etc_dir (const gchar *default_etc_dir); + + +G_END_DECLS + +#endif /* __BINRELOC_H__ */ diff --git a/includes/blowfish.h b/includes/blowfish.h new file mode 100644 index 00000000..3f33e945 --- /dev/null +++ b/includes/blowfish.h @@ -0,0 +1,33 @@ +/*
+blowfish.h: Header file for blowfish.c
+
+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
+
+
+See blowfish.c for more information about this file.
+*/
+
+
+typedef struct {
+ unsigned long P[16 + 2];
+ unsigned long S[4][256];
+} BLOWFISH_CTX;
+
+void Blowfish_Init(BLOWFISH_CTX *ctx, unsigned char *key, int keyLen);
+void Blowfish_Encrypt(BLOWFISH_CTX *ctx, unsigned long *xl, unsigned long *xr);
+void Blowfish_Decrypt(BLOWFISH_CTX *ctx, unsigned long *xl, unsigned long *xr);
+
+
+
diff --git a/includes/callbacks.h b/includes/callbacks.h new file mode 100644 index 00000000..d53e1861 --- /dev/null +++ b/includes/callbacks.h @@ -0,0 +1,45 @@ +/* + * 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 __CALLBACKS_H__ +#define __CALLBACKS_H__ + +#include <gtk/gtk.h> + +void cb_about(); +void cb_about_module(GtkAction *action); +void cb_generate_report(); +void cb_save_graphic(); +void cb_quit(); +void cb_refresh(); +void cb_copy_to_clipboard(); +void cb_side_pane(); +void cb_toolbar(); +void cb_open_web_page(); +void cb_open_online_docs(); +void cb_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/includes/computer.h b/includes/computer.h new file mode 100644 index 00000000..c23acab6 --- /dev/null +++ b/includes/computer.h @@ -0,0 +1,190 @@ +/* + * 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 __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" }, + { DB_PREFIX "mandriva-release", "mdv" }, + { DB_PREFIX "fedora-release", "fdra" }, + { DB_PREFIX "coas", "coas" }, + { DB_PREFIX "environment.corel", "corel"}, + { DB_PREFIX "gentoo-release", "gnt" }, + { DB_PREFIX "conectiva-release", "cnc" }, + { DB_PREFIX "versão-conectiva", "cnc" }, + { DB_PREFIX "turbolinux-release", "tl" }, + { DB_PREFIX "yellowdog-release", "yd" }, + { DB_PREFIX "sabayon-release", "sbn" }, + { DB_PREFIX "arch-release", "arch" }, + { DB_PREFIX "enlisy-release", "enlsy"}, + { 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. + */ + { DB_PREFIX "redhat-release", "rh" }, + { NULL, NULL } +}; + +typedef struct _Computer Computer; +typedef struct _OperatingSystem OperatingSystem; +typedef struct _MemoryInfo MemoryInfo; +typedef struct _UptimeInfo UptimeInfo; +typedef struct _LoadInfo LoadInfo; +typedef struct _DisplayInfo DisplayInfo; + +typedef struct _AlsaInfo AlsaInfo; +typedef struct _AlsaCard AlsaCard; + +typedef struct _FileSystem FileSystem; +typedef struct _FileSystemEntry FileSystemEntry; + +struct _AlsaCard { + gchar *alsa_name; + gchar *friendly_name; +/* + gchar *board; + gchar revision, compat_class; + gint subsys_vendorid, subsys_id; + + gint cap_dac_res, cap_adc_res; + gboolean cap_3d_enh; + + gint curr_mic_gain; + gboolean curr_3d_enh, + curr_loudness, + curr_simstereo; + gchar *curr_mic_select; +*/ +}; + +struct _AlsaInfo { + GSList *cards; +}; + +struct _DisplayInfo { + gchar *ogl_vendor, *ogl_renderer, *ogl_version; + gboolean dri; + + gchar *display_name, *vendor, *version; + gchar *extensions; + gchar *monitors; + + gint width, height; +}; + +struct _LoadInfo { + float load1, load5, load15; +}; + +struct _UptimeInfo { + int days, hours, minutes; +}; + +struct _Computer { + MemoryInfo *memory; + OperatingSystem *os; + DisplayInfo *display; + AlsaInfo *alsa; + + gchar *date_time; +}; + +struct _OperatingSystem { + gchar *kernel; + gchar *libc; + gchar *distrocode, *distro; + gchar *hostname; + gchar *language; + gchar *homedir; + gchar *kernel_version; + + gchar *languages; + + gchar *desktop; + gchar *username; + + gchar *boots; + + gchar *entropy_avail; +}; + +struct _MemoryInfo { + gint total, used, free, cached; + gfloat ratio; +}; + +#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; \ + } + +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/includes/expr.h b/includes/expr.h new file mode 100644 index 00000000..4bda6b72 --- /dev/null +++ b/includes/expr.h @@ -0,0 +1,48 @@ +/* + * 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 __EXPR_H__ +#define __EXPR_H__ + +typedef struct _MathToken MathToken; + +typedef enum { + TOKEN_OPERATOR, + TOKEN_VARIABLE, + TOKEN_VALUE +} MathTokenType; + +struct _MathToken { + union { + gfloat value; + gchar op; + } val; + MathTokenType type; +}; + +#define math_postfix_free math_infix_free + +GSList *math_infix_to_postfix(GSList *infix); +void math_infix_free(GSList *infix, gboolean free_tokens); + +GSList *math_string_to_infix(gchar *string); +GSList *math_string_to_postfix(gchar *string); + +gfloat math_postfix_eval(GSList *postfix, gfloat at_value); +gfloat math_string_eval(gchar *string, gfloat at_value); + +#endif /* __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/includes/hardinfo.h b/includes/hardinfo.h new file mode 100644 index 00000000..70329ac7 --- /dev/null +++ b/includes/hardinfo.h @@ -0,0 +1,170 @@ +/* + * 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 __HARDINFO_H__ +#define __HARDINFO_H__ + +#include <gtk/gtk.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; +typedef struct _FileTypes FileTypes; +typedef struct _ProgramParameters ProgramParameters; + +struct _ProgramParameters { + gboolean create_report; + gboolean show_version; + gboolean gui_running; + gboolean list_modules; + gboolean autoload_deps; + gboolean run_xmlrpc_server; + + gint report_format; + + gchar **use_modules; + gchar *run_benchmark; + gchar *path_lib; + gchar *path_data; + gchar *argv0; +}; + +struct _FileTypes { + gchar *name; + gchar *mime_type; + gchar *extension; + gpointer data; +}; + +struct _ModuleEntry { + gchar *name; + gchar *icon; + gpointer callback; + gpointer scan_callback; + guint32 flags; +}; + +struct _ModuleAbout { + const gchar *description; + const gchar *author; + const gchar *version; + const gchar *license; +}; + +/* String utility functions */ +inline void remove_quotes(gchar *str); +inline char *strend(gchar *str, gchar chr); +inline void remove_linefeed(gchar *str); +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); +gint tree_view_get_visible_height(GtkTreeView *tv); +void tree_view_save_image(gchar *filename); + +/* File Chooser utility functions */ +void file_chooser_open_expander(GtkWidget *chooser); +void file_chooser_add_filters(GtkWidget *chooser, FileTypes *filters); +gchar *file_chooser_get_extension(GtkWidget *chooser, FileTypes *filters); +gchar *file_chooser_build_filename(GtkWidget *chooser, gchar *extension); +gpointer file_types_get_data_by_name(FileTypes *file_types, gchar *name); + +/* Misc utility functions */ +#if RELEASE == 1 +gpointer idle_free(gpointer ptr); +#else +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); + +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); + +/* GTK UI stuff */ +gboolean ui_init(int *argc, char ***argv); +void parameters_init(int *argc, char ***argv, ProgramParameters *params); +extern ProgramParameters params; + +/* Module stuff */ +gchar *module_call_method(gchar *method); +gchar *module_call_method_param(gchar * method, gchar * parameter); + +/* Sysfs stuff */ +gfloat h_sysfs_read_float(gchar *endpoint, gchar *entry); +gint h_sysfs_read_int(gchar *endpoint, gchar *entry); +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/includes/iconcache.h b/includes/iconcache.h new file mode 100644 index 00000000..97f59a82 --- /dev/null +++ b/includes/iconcache.h @@ -0,0 +1,30 @@ +/* + * 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 __ICONCACHE_H__ +#define __ICONCACHE_H__ + +#include <gtk/gtk.h> + +void icon_cache_init(void); +GdkPixbuf *icon_cache_get_pixbuf(const gchar *file); +GtkWidget *icon_cache_get_image(const gchar *file); +GdkPixbuf *icon_cache_get_pixbuf_at_size(const gchar *file, gint wid, gint hei); +GtkWidget *icon_cache_get_image_at_size(const gchar *file, gint wid, gint hei); + +#endif /* __ICONCACHE_H__ */ diff --git a/includes/loadgraph.h b/includes/loadgraph.h new file mode 100644 index 00000000..1eae976f --- /dev/null +++ b/includes/loadgraph.h @@ -0,0 +1,75 @@ +/* + * Simple Load Graph + * Copyright (C) 2006 Leandro A. F. Pereira <leandro@hardinfo.org> + * + * The Simple Load Graph is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License, version 2.1, as published by the Free Software Foundation. + * + * The Simple Load Graph 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 the Simple Load Graph; if not, write to the Free + * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + * 02111-1307 USA. + */ + + +#ifndef __LOADGRAPH_H__ +#define __LOADGRAPH_H__ + +#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; + +typedef enum { + LG_COLOR_GREEN = 0x4FB05A, + LG_COLOR_BLUE = 0x4F58B0, + LG_COLOR_RED = 0xB04F4F +} LoadGraphColor; + +struct _LoadGraph { + GdkPixmap *buf; + GtkWidget *area; + + GdkGC *grid; + GdkGC *trace; + GdkGC *fill; + + gint *data; + gfloat scale; + + gint size; + gint width, height; + LoadGraphColor color; + + gint max_value, remax_count; + + PangoLayout *layout; + gchar *suffix; +}; + +LoadGraph *load_graph_new(gint size); +void load_graph_destroy(LoadGraph *lg); +void load_graph_configure_expose(LoadGraph *lg); +GtkWidget *load_graph_get_framed(LoadGraph *lg); + +void load_graph_update(LoadGraph *lg, gint value); +void load_graph_set_color(LoadGraph *lg, LoadGraphColor color); +void load_graph_clear(LoadGraph *lg); + +void load_graph_set_data_suffix(LoadGraph *lg, gchar *suffix); +gchar *load_graph_get_data_suffix(LoadGraph *lg); + +#endif /* __LOADGRAPH_H__ */ 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/includes/md5.h b/includes/md5.h new file mode 100644 index 00000000..1522170c --- /dev/null +++ b/includes/md5.h @@ -0,0 +1,26 @@ +/* See md5.c for explanation and copyright information. */ + +#ifndef MD5_H +#define MD5_H + +/* Unlike previous versions of this code, uint32 need not be exactly + 32 bits, merely 32 bits or more. Choosing a data type which is 32 + bits instead of 64 is not important; speed is considerably more + important. ANSI guarantees that "unsigned long" will be big enough, + and always using it seems to have few disadvantages. */ +typedef unsigned long uint32; + +struct MD5Context { + uint32 buf[4]; + uint32 bits[2]; + unsigned char in[64]; +}; + +void MD5Init (struct MD5Context *context); +void MD5Update (struct MD5Context *context, + unsigned char const *buf, unsigned len); +void MD5Final (unsigned char digest[16], + struct MD5Context *context); +void MD5Transform (uint32 buf[4], const unsigned char in[64]); + +#endif /* !MD5_H */ diff --git a/includes/menu.h b/includes/menu.h new file mode 100644 index 00000000..3c804008 --- /dev/null +++ b/includes/menu.h @@ -0,0 +1,26 @@ +/* + * 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 __MENU_H__ +#define __MENU_H__ + +#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/includes/nqueens.h b/includes/nqueens.h new file mode 100644 index 00000000..a4be93f0 --- /dev/null +++ b/includes/nqueens.h @@ -0,0 +1,13 @@ +/* + * N-Queens Problem Solver + * Found somewhere on the Internet; can't remember where. Possibly Wikipedia. + */ +#ifndef __NQUEENS_H__ +#define __NQUEENS_H__ + +int nqueens(int y); + + +#endif /* __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/includes/report.h b/includes/report.h new file mode 100644 index 00000000..782621cb --- /dev/null +++ b/includes/report.h @@ -0,0 +1,93 @@ +/* + * 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 __REPORT_H__ +#define __REPORT_H__ +#include <gtk/gtk.h> +#include <shell.h> + +typedef enum { + REPORT_FORMAT_HTML, + REPORT_FORMAT_TEXT, + N_REPORT_FORMAT +} ReportFormat; + +typedef enum { + REPORT_COL_PROGRESS = 1<<0, + REPORT_COL_VALUE = 1<<1, + REPORT_COL_EXTRA1 = 1<<2, + REPORT_COL_EXTRA2 = 1<<3, + REPORT_COL_TEXTVALUE= 1<<4 +} ReportColumn; + +typedef struct _ReportDialog ReportDialog; +typedef struct _ReportContext ReportContext; + +struct _ReportContext { + ShellModuleEntry *entry; + gchar *output; + + void (*header) (ReportContext *ctx); + void (*footer) (ReportContext *ctx); + void (*title) (ReportContext *ctx, gchar *text); + void (*subtitle) (ReportContext *ctx, gchar *text); + void (*subsubtitle) (ReportContext *ctx, gchar *text); + void (*keyvalue) (ReportContext *ctx, gchar *key, gchar *value); + + ReportFormat format; + + gboolean is_image_enabled; + gboolean first_table; + + gboolean show_column_headers; + guint columns; + GHashTable *column_titles; +}; + +struct _ReportDialog { + GtkWidget *dialog; + GtkWidget *filechooser; + GtkWidget *btn_cancel; + GtkWidget *btn_generate; + GtkWidget *btn_sel_all; + GtkWidget *btn_sel_none; + GtkWidget *treeview; + + GtkTreeModel *model; +}; + +void report_dialog_show(); + +ReportContext *report_context_html_new(); +ReportContext *report_context_text_new(); + +void report_header (ReportContext *ctx); +void report_footer (ReportContext *ctx); +void report_title (ReportContext *ctx, gchar *text); +void report_subtitle (ReportContext *ctx, gchar *text); +void report_subsubtitle (ReportContext *ctx, gchar *text); +void report_key_value (ReportContext *ctx, gchar *key, gchar *value); +void report_table (ReportContext *ctx, gchar *text); + +void report_create_from_module_list(ReportContext *ctx, GSList *modules); +gchar *report_create_from_module_list_format(GSList *modules, ReportFormat format); + +void report_context_free(ReportContext *ctx); +void report_module_list_free(GSList *modules); + +#endif /* __REPORT_H__ */ 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/includes/sha1.h b/includes/sha1.h new file mode 100644 index 00000000..573ff8ac --- /dev/null +++ b/includes/sha1.h @@ -0,0 +1,30 @@ +/* + * SHA-1 in C + * By Steve Reid <steve@edmweb.com> + * 100% Public Domain + */ + +#ifndef __SHA1_H__ +#define __SHA1_H__ + +#include <glib.h> + +#ifndef LITTLE_ENDIAN +#if G_BYTE_ORDER == G_LITTLE_ENDIAN +#define LITTLE_ENDIAN /* This should be #define'd if true. */ +#endif /* G_BYTE_ORDER */ +#endif /* LITTLE_ENDIAN */ + + +typedef struct { + guint32 state[5]; + guint32 count[2]; + guchar buffer[64]; +} SHA1_CTX; + +void SHA1Transform(guint32 state[5], guchar buffer[64]); +void SHA1Init(SHA1_CTX* context); +void SHA1Update(SHA1_CTX* context, guchar* data, unsigned int len); +void SHA1Final(guchar digest[20], SHA1_CTX* context); + +#endif /* __SHA1_H__ */ diff --git a/includes/shell.h b/includes/shell.h new file mode 100644 index 00000000..2eb9e6d2 --- /dev/null +++ b/includes/shell.h @@ -0,0 +1,225 @@ +/* + * 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 __SHELL_H__ +#define __SHELL_H__ + +#include <gtk/gtk.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; +typedef struct _ShellModuleEntry ShellModuleEntry; + +typedef struct _ShellFieldUpdate ShellFieldUpdate; +typedef struct _ShellFieldUpdateSource ShellFieldUpdateSource; + +typedef enum { + SHELL_ORDER_DESCENDING, + SHELL_ORDER_ASCENDING, +} ShellOrderType; + +typedef enum { + SHELL_PACK_RESIZE = 1 << 0, + SHELL_PACK_SHRINK = 1 << 1 +} ShellPackOptions; + +typedef enum { + SHELL_VIEW_NORMAL, + SHELL_VIEW_DUAL, + 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_MODULE_ENTRY, + TREE_COL_MODULE, + TREE_COL_SEL, + TREE_NCOL +} ShellTreeColumns; + +typedef enum { + INFO_TREE_COL_NAME, + INFO_TREE_COL_VALUE, + INFO_TREE_COL_DATA, + INFO_TREE_COL_PBUF, + INFO_TREE_COL_PROGRESS, + INFO_TREE_COL_EXTRA1, + INFO_TREE_COL_EXTRA2, + INFO_TREE_NCOL +} ShellInfoTreeColumns; + +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 { + GtkWidget *scroll; + GtkWidget *view; + GtkTreeModel *model; + GtkTreeSelection *selection; + + GSList *modules; +}; + +struct _ShellInfoTree { + GtkWidget *scroll; + GtkWidget *view; + GtkTreeModel *model; + GtkTreeSelection *selection; + + GtkTreeViewColumn *col_progress, *col_value, *col_extra1, *col_extra2, *col_textvalue; +}; + +struct _ShellNote { + GtkWidget *event_box; + GtkWidget *label; +}; + +struct _ShellModule { + gchar *name; + GdkPixbuf *icon; + GModule *dll; + + gpointer (*aboutfunc) (); + gchar *(*summaryfunc) (); + void (*deinit) (); + + guchar weight; + + GSList *entries; +}; + +struct _ShellModuleMethod { + gchar *name; + gpointer function; +}; + +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); +}; + +struct _ShellFieldUpdate { + ShellModuleEntry *entry; + gchar *field_name; +}; + +struct _ShellFieldUpdateSource { + guint source_id; + ShellFieldUpdate *sfu; +}; + +void shell_init(GSList *modules); +void shell_do_reload(void); + +Shell *shell_get_main_shell(); + +void shell_action_set_enabled(const gchar *action_name, + gboolean setting); +gboolean shell_action_get_enabled(const gchar *action_name); +gboolean shell_action_get_active(const gchar *action_name); +void shell_action_set_active(const gchar *action_name, + gboolean setting); +void shell_action_set_property(const gchar *action_name, + const gchar *property, + gboolean setting); + +void shell_set_side_pane_visible(gboolean setting); +void shell_set_note_from_entry(ShellModuleEntry *entry); +void shell_ui_manager_set_visible(const gchar *path, + gboolean setting); + +void shell_status_update(const gchar *message); +void shell_status_pulse(void); +void shell_status_set_percentage(gint percentage); +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/includes/socket.h b/includes/socket.h new file mode 100644 index 00000000..7c44837e --- /dev/null +++ b/includes/socket.h @@ -0,0 +1,36 @@ +/* + * 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 __HI_SOCKET_H__ +#define __HI_SOCKET_H__ + +typedef struct _Socket Socket; + +struct _Socket { + gint sock; +}; + +Socket *sock_connect(gchar * host, gint port); +int sock_write(Socket * s, gchar * str); +int sock_read(Socket * s, gchar * buffer, gint size); +void sock_close(Socket * s); + +int sock_ready_to_read(Socket *s); +int sock_ready_to_write(Socket *s); + +#endif /* __HI_SOCKET_H__ */ 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/includes/stock.h b/includes/stock.h new file mode 100644 index 00000000..706e5c51 --- /dev/null +++ b/includes/stock.h @@ -0,0 +1,34 @@ +/* + * 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 __STOCK_H__ +#define __STOCK_H__ + +#define HI_STOCK_REPORT "hi-stock-report" +#define HI_STOCK_INTERNET "hi-stock-internet" +#define HI_STOCK_MODULE "hi-stock-module" +#define HI_STOCK_ABOUT_MODULES "hi-stock-about-modules" +#define HI_STOCK_SYNC_MENU "hi-stock-sync-menu" +#define HI_STOCK_DONATE "hi-stock-donate" +#define HI_STOCK_SERVER "hi-stock-server" + +void stock_icons_init(void); +void stock_icon_register(gchar *filename, gchar *stock_id); +void stock_icon_register_pixbuf(GdkPixbuf *pixbuf, gchar *stock_id); + +#endif /* __STOCK_H__ */ diff --git a/includes/syncmanager.h b/includes/syncmanager.h new file mode 100644 index 00000000..ae0ed267 --- /dev/null +++ b/includes/syncmanager.h @@ -0,0 +1,42 @@ +/* + * 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 __SYNCMANAGER_H__ +#define __SYNCMANAGER_H__ + +#include <gtk/gtk.h> + +typedef struct _SyncEntry SyncEntry; + +struct _SyncEntry { + gchar *name; + gchar *fancy_name; + gchar *save_to; + + gchar *(*get_data)(void); + void (*callback)(SyncEntry *entry, const gchar *response); + + gboolean selected; +}; + +void sync_manager_add_entry(SyncEntry *entry); +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/includes/uidefs.h b/includes/uidefs.h new file mode 100644 index 00000000..3bb1c88f --- /dev/null +++ b/includes/uidefs.h @@ -0,0 +1,63 @@ +#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=\"Report\" action=\"ReportAction\" />" \ +" <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=\"Quit\" action=\"QuitAction\" />" \ +" </menu>" \ +" <menu name=\"ViewMenu\" action=\"ViewMenuAction\">" \ +" <menuitem name=\"SidePane\" action=\"SidePaneAction\"/>" \ +" <menuitem name=\"Toolbar\" action=\"ToolbarAction\"/>" \ +" <separator/>"\ +" <separator name=\"LastSep\"/>" \ +" <menuitem name=\"Refresh\" action=\"RefreshAction\"/>" \ +" </menu>" \ +" <menu name=\"HelpMenu\" action=\"HelpMenuAction\">" \ +" <menuitem name=\"WebPage\" action=\"HomePageAction\"/>" \ +" <menuitem name=\"ReportBug\" action=\"ReportBugAction\"/>" \ +" <separator/>" \ +" <menu name=\"HelpMenuModules\" action=\"HelpMenuModulesAction\">" \ +" <separator name=\"LastSep\"/>" \ +" </menu>" \ +" <menuitem name=\"About\" action=\"AboutAction\"/>" \ +" </menu>" \ +" </menubar>" \ +" <toolbar action=\"MainMenuBar\" action=\"MainMenuBarAction\">" \ +" <placeholder name=\"ToolItems\">" \ +" <toolitem name=\"Refresh\" action=\"RefreshAction\"/>" \ +" <separator/>" \ +" <toolitem name=\"Report\" action=\"ReportAction\"/>" \ +" <toolitem name=\"Copy\" action=\"CopyAction\"/>" \ +" <separator/>" \ +DEBUG_TOOLBAR_ITEMS \ +" </placeholder>" \ +" </toolbar>" \ +"</ui>"; + +#endif /* __UIDEFS_H__ */ diff --git a/includes/vendor.h b/includes/vendor.h new file mode 100644 index 00000000..778e2ea3 --- /dev/null +++ b/includes/vendor.h @@ -0,0 +1,33 @@ +/* + * 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 __VENDOR_H__ +#define __VENDOR_H__ + +typedef struct _Vendor Vendor; +struct _Vendor { + char *id; + char *name; + char *url; +}; + +void vendor_init(void); +const gchar *vendor_get_name(const gchar *id); +const gchar *vendor_get_url(const gchar *id); + +#endif /* __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__ */ + |