]>
jfr.im git - irc/quakenet/newserv.git/blob - helpmod/helpmod_user.c
1 #include "helpmod_user.h"
2 #include "helpmod_entries.h"
4 helpmod_user
helpmod_get_user(long numeric
)
7 helpmod_user
*tmp
,tmp2
;
8 for(tmp
=&helpmod_users
;*tmp
;tmp
=&(*tmp
)->next
)
9 if ((*tmp
)->numeric
== numeric
)
11 (*tmp
)->last_active
= time(NULL
);
15 *tmp
= (helpmod_user
)malloc(sizeof(struct helpmod_user_struct
));
17 (*tmp
)->last_active
= time(NULL
);
18 (*tmp
)->numeric
= numeric
;
19 (*tmp
)->state
= helpmod_base
;
23 void helpmod_clear_users(void)
28 tmp
= helpmod_users
->next
;
35 void helpmod_init_users(void)
40 void helpmod_clear_inactives(void)
42 helpmod_user
*tmp
, tmp2
;
43 for (tmp
= &helpmod_users
;*tmp
;tmp
= &(*tmp
)->next
)
44 while (time(NULL
) - (*tmp
)->last_active
> HELPMOD_USER_TIMEOUT
)
54 long helpmod_user_count(void)
58 for (counter
=0, tmp
= &helpmod_users
;*tmp
;counter
++, tmp
= &(*tmp
)->next
);