1:
2: /* @(#)maxusers.c 2.1 SCCS id keyword */
3: # include <stdio.h>
4:
5: /*
6: * This checks and sees if more than "max" users are logged in.
7: * If there are, it prints out a given message and exits. The string
8: * is printed out as a format string to printf. If that string includes
9: * ``%d'', the number printed out will be the maximum number of users.
10: * If there are fewer than or max people on, the number logged on is
11: * returned.
12: */
13:
14: # define reg register
15:
16: static char standard[] =
17: "Sorry, there are more than %d people on.\nPlease try again later\n";
18:
19: maxusers(max, str)
20: reg int max;
21: reg char *str; {
22:
23: reg int on;
24:
25: if ((on = ucount()) > max) {
26: if (str == NULL)
27: str = standard;
28: printf(str, max);
29: exit(-1);
30: }
31: return(on);
32: }
Defined functions
Defined variables
Defined macros
reg
defined in line
14; used 3 times