diff options
author | Benoît Dejean <bdejean@src.gnome.org> | 2004-08-03 11:40:37 +0000 |
---|---|---|
committer | Benoît Dejean <bdejean@src.gnome.org> | 2004-08-03 11:40:37 +0000 |
commit | 808a2d48ac98f8c277428db939e975941c0e4aff (patch) | |
tree | c4acbfc768efce29e962710782b0cb4459121496 /sysdeps/linux/glibtop_server.h | |
parent | 5b39a4831df592857c4faea787a9d2bd0a767a14 (diff) | |
download | libgtop-808a2d48ac98f8c277428db939e975941c0e4aff.tar.gz |
Added next_token(). Changed skip_token(), i hope it won't break any bad
* glibtop_server.h: Added next_token(). Changed skip_token(),
i hope it won't break any bad code.
* procstate.c: (glibtop_get_proc_state_s): Used next_token.
* proctime.c: (glibtop_get_proc_time_s): Implemented .start_time
the way it ought to be. Clean ups.
Diffstat (limited to 'sysdeps/linux/glibtop_server.h')
-rw-r--r-- | sysdeps/linux/glibtop_server.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sysdeps/linux/glibtop_server.h b/sysdeps/linux/glibtop_server.h index 69143fe4..80796c20 100644 --- a/sysdeps/linux/glibtop_server.h +++ b/sysdeps/linux/glibtop_server.h @@ -41,12 +41,19 @@ G_BEGIN_DECLS unsigned get_pageshift(); +static inline char* +next_token(const char *p) +{ + while (isspace(*p)) p++; + return (char*) p; +} static inline char * skip_token (const char *p) { - while (isspace(*p)) p++; + p = next_token(p); while (*p && !isspace(*p)) p++; + p = next_token(p); return (char *)p; } |