version 1.9, 2003/07/10 00:06:50 |
version 1.10, 2004/03/15 02:50:29 |
|
|
|
|
#ifndef lint |
#ifndef lint |
/*static char sccsid[] = "from: @(#)sprint.c 5.8 (Berkeley) 12/4/90";*/ |
/*static char sccsid[] = "from: @(#)sprint.c 5.8 (Berkeley) 12/4/90";*/ |
static char rcsid[] = "$OpenBSD$"; |
static const char rcsid[] = "$OpenBSD$"; |
#endif /* not lint */ |
#endif /* not lint */ |
|
|
#include <sys/types.h> |
#include <sys/types.h> |
|
|
for (lp = list, pn = phead; pn != NULL; pn = pn->next) |
for (lp = list, pn = phead; pn != NULL; pn = pn->next) |
*lp++ = pn; |
*lp++ = pn; |
(void)qsort(list, entries, sizeof(PERSON *), psort); |
(void)qsort(list, entries, sizeof(PERSON *), psort); |
return(list); |
return (list); |
} |
} |
|
|
int |
int |
psort(const void *p, const void *t) |
psort(const void *p, const void *t) |
{ |
{ |
return(strcmp((*(PERSON **)p)->name, (*(PERSON **)t)->name)); |
return (strcmp((*(PERSON **)p)->name, (*(PERSON **)t)->name)); |
} |
} |
|
|
void |
void |
|
|
struct tm *delta; |
struct tm *delta; |
|
|
delta = gmtime(&w->idletime); |
delta = gmtime(&w->idletime); |
if (!delta->tm_yday) |
if (!delta->tm_yday) { |
if (!delta->tm_hour) |
if (!delta->tm_hour) { |
if (!delta->tm_min) |
if (!delta->tm_min) |
(void)printf(" -"); |
(void)printf(" -"); |
else |
else |
(void)printf("%5d", delta->tm_min); |
(void)printf("%5d", delta->tm_min); |
else |
} else { |
(void)printf("%2d:%02d", |
(void)printf("%2d:%02d", |
delta->tm_hour, delta->tm_min); |
delta->tm_hour, delta->tm_min); |
else |
} |
|
} else |
(void)printf("%4dd", delta->tm_yday); |
(void)printf("%4dd", delta->tm_yday); |
} |
} |