home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS - Coast to Coast
/
simteldosarchivecoasttocoast2.iso
/
waffle
/
aser28.zip
/
VALID.C
< prev
next >
Wrap
C/C++ Source or Header
|
1991-12-02
|
962b
|
35 lines
/*
Check whether a given e-mail address is in the VALIDFILE
For ASER - Waffle Archive Server
Exit code: -1 error occurs
0 yes, e-mail address is in the VALIDFILE
1 no, e-mail address is not in the VALIDFILE
1991, Budi Rahardjo
*/
#include <stdio.h>
#define VALIDFILE "e:/budi/reject/valid.lst"
main(argc,argv)
int argc; char **argv;
{
int result;
if (argc < 2) {
printf("valid: needs argument\n");
exit(-1);}
result = matchstring(argv[1],VALIDFILE);
if (result < 0) {
printf("valid: Error in matching\n"); exit(-1); }
/* result > 0 if name is found on the VALIDFILE */
/* therefore reset it to 0 */
/* if 'name' is not found on the VALIDFILE */
/* set the return value to 1 */
if (result >0) {result = 0;}
else {result = 1; }
printf("valid: return value will be %d\n", result);
exit(result);
}