--- projects/libstatgrab/examples/user_list.c 2003/11/07 18:43:56 1.3 +++ projects/libstatgrab/examples/user_list.c 2003/11/23 13:51:10 1.4 @@ -24,22 +24,25 @@ #include int main(int argc, char **argv){ - + extern char *optarg; - extern int optind; - int c; + extern int optind; + int c; int delay = 1; user_stat_t *users; while ((c = getopt(argc, argv, "d:")) != -1){ - switch (c){ - case 'd': - delay = atoi(optarg); - break; + switch (c){ + case 'd': + delay = atoi(optarg); + break; } } + /* Initialise statgrab */ + statgrab_init(); + if( (users = get_user_stats()) != NULL){ printf("Users : %s\n", users->name_list); printf("Number of users : %d\n", users->num_entries); @@ -47,6 +50,3 @@ int main(int argc, char **argv){ exit(0); } - - -