home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 4 / CDPD_IV.bin / networking / uucp / amigauucpsrc / lib / lsys.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-06-29  |  756 b   |  44 lines

  1.  
  2. /*
  3.  *  LSYS.C
  4.  *
  5.  *  (C) Copyright 1989-1990 by Matthew Dillon,  All Rights Reserved.
  6.  *
  7.  */
  8.  
  9. #include <exec/types.h>
  10. #include <stdio.h>
  11. #include "config.h"
  12.  
  13. Prototype int is_in_L_sys_file(const char *);
  14.  
  15. int
  16. is_in_L_sys_file(system_name)
  17. const char *system_name;
  18. {
  19.     static char buf[256];
  20.     static char system[128];
  21.     FILE *fd;
  22.     char *lsysFile = MakeConfigPath(UULIB, "L.sys");
  23.  
  24.     if (!(fd = fopen(lsysFile, "r"))) {
  25.     printf("Couldn't open %s\n", lsysFile);
  26.     exit(1);
  27.     }
  28.  
  29.     sprintf(system, "%s ", system_name);
  30.  
  31.     while (fgets(buf, sizeof buf, fd)) {
  32.     if (buf[0] == '#' || buf[0] == '\n')
  33.         continue;
  34.     if (strncmp(buf, system, strlen(system)) == 0) {
  35.         fclose(fd);
  36.         return TRUE;
  37.     }
  38.     }
  39.     fclose(fd);
  40.     return FALSE;
  41. }
  42.  
  43.  
  44.