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

maxusers defined in line 19; never used

Defined variables

standard defined in line 16; used 1 times
  • in line 27

Defined macros

reg defined in line 14; used 3 times
Last modified: 1981-07-10
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 561
Valid CSS Valid XHTML 1.0 Strict