diff options
author | Benoît Dejean <bdejean@src.gnome.org> | 2004-07-07 20:22:58 +0000 |
---|---|---|
committer | Benoît Dejean <bdejean@src.gnome.org> | 2004-07-07 20:22:58 +0000 |
commit | a8593d5b84ca37483d943b0f692b4eaab4ecfa0e (patch) | |
tree | 4d5b316cdf84e745f1ecc7ac4bda7469498fb763 | |
parent | de7fd9e85b2a95d826a006dfc4be603d1d8837c8 (diff) | |
download | libgtop-a8593d5b84ca37483d943b0f692b4eaab4ecfa0e.tar.gz |
Added new glibtop_get_proc_argv*() functions. These are more easier to use
* include/glibtop/procargs.h: Added new glibtop_get_proc_argv*() functions.
These are more easier to use than glibtop_get_proc_args*(). They return
a NULL-terminated array of string (like main's char* argv[]).
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | include/glibtop/procargs.h | 72 |
2 files changed, 62 insertions, 16 deletions
@@ -1,5 +1,11 @@ 2004-07-07 Benoît Dejean <tazforever@dlfp.org> + * include/glibtop/procargs.h: Added new glibtop_get_proc_argv*() functions. + These are more easier to use than glibtop_get_proc_args*(). They return + a NULL-terminated array of string (like main's char* argv[]). + +2004-07-07 Benoît Dejean <tazforever@dlfp.org> + * include/glibtop/netinfo.h: * structures.def: * sysdeps/names/netinfo.c: Removed netinfo.[ch] that were never used. diff --git a/include/glibtop/procargs.h b/include/glibtop/procargs.h index 8571c20e..1d7159e0 100644 --- a/include/glibtop/procargs.h +++ b/include/glibtop/procargs.h @@ -41,31 +41,71 @@ struct _glibtop_proc_args size; /* GLIBTOP_PROC_ARGS_SIZE */ }; -#define glibtop_get_proc_args(proc_args,pid,max_len) glibtop_get_proc_args_l(glibtop_global_server, proc_args, pid, max_len) - -#if GLIBTOP_SUID_PROC_ARGS -#define glibtop_get_proc_args_r glibtop_get_proc_args_p -#else -#define glibtop_get_proc_args_r glibtop_get_proc_args_s -#endif char * glibtop_get_proc_args_l (glibtop *server, glibtop_proc_args *buf, pid_t pid, unsigned max_len); +#define glibtop_get_proc_args(proc_args,pid,max_len) glibtop_get_proc_args_l(glibtop_global_server, proc_args, pid, max_len) + + + #if GLIBTOP_SUID_PROC_ARGS -void glibtop_init_proc_args_p (glibtop *server); -char * -glibtop_get_proc_args_p (glibtop *server, glibtop_proc_args *buf, - pid_t pid, unsigned max_len); -#else -void glibtop_init_proc_args_s (glibtop *server); +# define glibtop_get_proc_args_r glibtop_get_proc_args_p -char * -glibtop_get_proc_args_s (glibtop *server, glibtop_proc_args *buf, + void glibtop_init_proc_args_p (glibtop *server); + + char * + glibtop_get_proc_args_p (glibtop *server, glibtop_proc_args *buf, + pid_t pid, unsigned max_len); + + +#else /* !GLIBTOP_SUID_PROC_ARGS */ + +# define glibtop_get_proc_args_r glibtop_get_proc_args_s + + void glibtop_init_proc_args_s (glibtop *server); + + char * + glibtop_get_proc_args_s (glibtop *server, glibtop_proc_args *buf, + pid_t pid, unsigned max_len); +#endif /* GLIBTOP_SUID_PROC_ARGS */ + + + +/* + * NEW functions + */ + +char ** +glibtop_get_proc_argv_l (glibtop *server, glibtop_proc_args *buf, pid_t pid, unsigned max_len); -#endif + +#define glibtop_get_proc_argv(proc_args,pid,max_len) glibtop_get_proc_argv_l(glibtop_global_server, proc_args, pid, max_len) + + +#if GLIBTOP_SUID_PROC_ARGS + +# define glibtop_get_proc_argv_r glibtop_get_proc_args_p +# define glibtop_init_proc_argv_p glibtop_init_proc_args_p + + char ** + glibtop_get_proc_argv_p (glibtop *server, glibtop_proc_args *buf, + pid_t pid, unsigned max_len); + + +#else /* !GLIBTOP_SUID_PROC_ARGS */ + +# define glibtop_get_proc_argv_r glibtop_get_proc_args_s +# define glibtop_init_proc_argv_s glibtop_init_proc_args_s + + char ** + glibtop_get_proc_argv_s (glibtop *server, glibtop_proc_args *buf, + pid_t pid, unsigned max_len); +#endif /* GLIBTOP_SUID_PROC_ARGS */ + + #ifdef GLIBTOP_NAMES |