home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / waffle / aser28.zip / REJECT.C < prev    next >
C/C++ Source or Header  |  1991-12-01  |  760b  |  30 lines

  1. /*
  2. Check whether a given e-mail address is in the REJECTFILE
  3. For ASER - Waffle Archive Server
  4. Exit code: -1 error occurs
  5.             0 no, e-mail address is not in the REJECTFILE
  6.             x yes, e-mail address is found at line x
  7. 1991, Budi Rahardjo
  8. */
  9.  
  10. #include <stdio.h>
  11. #define REJECTFILE "e:/budi/reject/reject.lst"
  12.  
  13. main(argc,argv)
  14. int argc; char **argv;
  15.    {
  16.    int result;
  17.    if (argc < 2) {
  18.       printf("reject: needs argument\n");
  19.       exit(-1);}
  20.  
  21.    result = matchstring(argv[1],REJECTFILE);
  22.    if (result <0) {
  23.       printf("reject: Error in matching\n");
  24.       exit(-1); }
  25.  
  26.    printf("reject: return value will be %d\n", result);
  27.    /* if name is found in REJECTFILE return the line number */
  28.    exit(result);
  29.    }
  30.