home *** CD-ROM | disk | FTP | other *** search
- /*
- * LSYS.C
- *
- * (C) Copyright 1989-1990 by Matthew Dillon, All Rights Reserved.
- *
- */
-
- #include <exec/types.h>
- #include <stdlib.h>
- #include <string.h>
- #include <stdio.h>
- #include "config.h"
-
- Prototype int is_in_L_sys_file (const char *);
-
- int
- is_in_L_sys_file (const char *system_name)
- {
- static char
- buf [256],
- system [128];
- FILE
- *fd;
- char
- *lsysFile = MakeConfigPath (UULIB, "L.sys");
-
- if (!(fd = fopen (lsysFile, "r"))) {
- fprintf (stderr, "Couldn't open %s\n", lsysFile);
- exit (30);
- }
-
- sprintf (system, "%s ", system_name);
-
- while (fgets (buf, sizeof buf, fd)) {
- if (buf [0] == '#' || buf [0] == '\n')
- continue;
- if (strncmp (buf, system, strlen (system)) == 0) {
- fclose (fd);
- return TRUE;
- }
- }
- fclose (fd);
-
- return FALSE;
- }
-