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.
This commit is contained in:
Benoît Dejean
2004-08-03 11:40:37 +00:00
parent 5b39a4831d
commit 808a2d48ac
4 changed files with 52 additions and 7 deletions

View File

@@ -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;
}