You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

40 lines
684 B

#define GETOPTOPT \
do { \
if (*++cp == '\0' && argc > 1) \
{ \
argc--, argv++; \
cp = argv[0]; \
} \
while (*cp != '\0' && isspace((int)*cp)) \
cp++; \
} while (0)
#define GETOPTINTOPT \
do { \
if (*++cp == '\0' && argc > 1 && atoi(argv[1]) > 0) \
{ \
argc--, argv++; \
cp = argv[0]; \
} \
while (*cp != '\0' && isspace((int)*cp)) \
cp++; \
} while (0)
#define GETOPT \
do { \
if (*++cp == '\0' && argc < 2) \
{ \
fprintf(stderr, \
"No argument supplied for -%c\n", opt); \
exit(1); \
} \
else if (*cp == '\0') \
{ \
argc--, argv++; \
cp = argv[0]; \
} \
while (isspace((int)*cp)) \
cp++; \
} while (0)