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:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user