-/* $Header$
+/* $Id $
*
* disabled: check to see if registration is enabled right now. Most of this
* code is stolen from the cron daemon.
*
- * (c) Copyright 1988 by the Massachusetts Institute of Technology.
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
+ * Copyright (C) 1988-1998 by the Massachusetts Institute of Technology.
+ * For copying and distribution information, please see the file
+ * <mit-copyright.h>.
*/
#include <mit-copyright.h>
-#include <stdio.h>
+#include <moira.h>
+
#include <ctype.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/file.h>
-#include "files.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+
+#include "userreg.h"
#define LISTS (2 * BUFSIZ)
#define MAXLIN BUFSIZ
#define RANGE 103
#define EOS 104
-time_t itime, time();
+time_t itime;
struct tm *loct;
-struct tm *localtime();
-char *malloc();
-char *realloc();
int flag;
char *list;
char *listend;
unsigned listsize;
-char *cmp();
-int number(register char c, FILE *f);
+char *cmp(char *p, int v);
+void init(void);
+void append(char *fn);
+int number(char c, FILE *f);
/* This routine will determine if registration is enabled at this time. If
* NULL is returned, registration is OK. Otherwise, the string returned
char *disabled(char **msg)
{
- register char *cp;
+ char *cp;
int hit;
*msg = 0;
char *cmp(char *p, int v)
{
- register char *cp;
+ char *cp;
cp = p;
switch (*cp++)
return cp;
}
-init(void)
+void init(void)
{
/*
* Don't free in case was longer than LISTS. Trades off
listend = list;
}
-append(char *fn)
+void append(char *fn)
{
- register int i, c;
- register char *cp;
- register char *ocp;
- register int n;
- FILE *f, *fopen();
+ int i, c;
+ char *cp;
+ char *ocp;
+ int n;
+ FILE *f;
if (!(f = fopen(fn, "r")))
return;
goto loop;
}
-int number(register char c, FILE *f)
+int number(char c, FILE *f)
{
- register int n = 0;
+ int n = 0;
while (isdigit(c))
{