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

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