drop adt746x objects
[monky] / src / core.c
index 5932602..ce75e90 100644 (file)
@@ -36,6 +36,7 @@
 #include "colours.h"
 #include "combine.h"
 #include "diskio.h"
+#include "entropy.h"
 #include "exec.h"
 #include "proc.h"
 #ifdef X11
@@ -75,9 +76,6 @@
 #include "openbsd.h"
 #endif
 
-/* OS specific prototypes to be implemented by linux.c & Co. */
-void update_entropy(void);
-
 #include <string.h>
 #include <ctype.h>
 
@@ -644,8 +642,24 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
        END OBJ(desktop_name, &update_x11info)
 #endif
        END OBJ(nodename, 0)
-       END OBJ_ARG(pid, 0, "pid needs arguments")
-               scan_pid_arg(obj, arg, free_at_crash);
+       END OBJ_ARG(pid_cmdline, 0, "pid_cmdline needs a pid as argument")
+               scan_pid_cmdline_arg(obj, arg, free_at_crash);
+       END OBJ_ARG(pid_cwd, 0, "pid_cwd needs a pid as argument")
+               scan_pid_cwd_arg(obj, arg, free_at_crash);
+       END OBJ_ARG(pid_environ, 0, "pid_environ needs arguments")
+               scan_pid_environ_arg(obj, arg, free_at_crash);
+       END OBJ_ARG(pid_environ_list, 0, "pid_environ_list needs a pid as argument")
+               scan_pid_environ_list_arg(obj, arg, free_at_crash);
+       END OBJ_ARG(pid_exe, 0, "pid_exe needs a pid as argument")
+               scan_pid_exe_arg(obj, arg, free_at_crash);
+       END OBJ_ARG(pid_openfiles, 0, "pid_openfiles needs a pid as argument")
+               scan_pid_openfiles_arg(obj, arg, free_at_crash);
+       END OBJ_ARG(pid_stderr, 0, "pid_stderr needs a pid as argument")
+               scan_pid_stderr_arg(obj, arg, free_at_crash);
+       END OBJ_ARG(pid_stdin, 0, "pid_stdin needs a pid as argument")
+               scan_pid_stdin_arg(obj, arg, free_at_crash);
+       END OBJ_ARG(pid_stdout, 0, "pid_stdout needs a pid as argument")
+               scan_pid_stdout_arg(obj, arg, free_at_crash);
        END OBJ(processes, &update_total_processes)
        END OBJ(running_processes, &update_running_processes)
        END OBJ(threads, &update_threads)
@@ -711,10 +725,6 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
        END OBJ(gw_iface, &update_gateway_info)
        END OBJ(gw_ip, &update_gateway_info)
 #endif /* !__linux__ */
-#ifndef __OpenBSD__
-       END OBJ(adt746xcpu, 0)
-       END OBJ(adt746xfan, 0)
-#endif /* !__OpenBSD__ */
 #if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__) \
                || defined(__OpenBSD__)) && (defined(i386) || defined(__i386__))
        END OBJ(apm_adapter, 0)
@@ -1238,7 +1248,31 @@ void free_text_objects(struct text_object *root, int internal)
                                free_sysfs_sensor(obj);
                                break;
 #endif /* __linux__ */
-                       case OBJ_pid:
+                       case OBJ_pid_cmdline:
+                               free(data.s);
+                               break;
+                       case OBJ_pid_cwd:
+                               free(data.s);
+                               break;
+                       case OBJ_pid_environ:
+                               free_pid_environ(obj);
+                               break;
+                       case OBJ_pid_environ_list:
+                               free(data.s);
+                               break;
+                       case OBJ_pid_exe:
+                               free(data.s);
+                               break;
+                       case OBJ_pid_openfiles:
+                               free(data.s);
+                               break;
+                       case OBJ_pid_stderr:
+                               free(data.s);
+                               break;
+                       case OBJ_pid_stdin:
+                               free(data.s);
+                               break;
+                       case OBJ_pid_stdout:
                                free(data.s);
                                break;
                        case OBJ_read_tcp: