1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- /* This file creates the file white-space.txt */
- #include <stdio.h>
- #include <argp.h>
- enum boolean { NO, YES };
- enum boolean bool = NO;
- const char * argp_program_version = "0.1";
- /* mail bug reports to */
- const char * argp_program_bug_address = "jbranso@fastmail.com";
- static const struct argp_option options [] =
- {
- //{"", 'j', "ARG", OPTION_ARG_OPTIONAL, "Print a funny joke" },
- { 0 }
- };
- error_t argp_parser (int opt, char *arg, struct argp_state *state) {
- extern enum boolean bool;
- switch (opt)
- {
- // if this parser function is called on an option that it doesn't recognize, then don't do anything.
- default:
- return ARGP_ERR_UNKNOWN;
- /* case 'j': */
- /* { */
- /* bool = YES; */
- /* break; */
- /* } */
- }
- return 0;
- }
- struct argp argp =
- { options, argp_parser, 0, "creates a data file white-space.txt" };
- int main (int argc, char **argv) {
- argp_parse (&argp, argc, argv, 0, 0, 0);
- FILE * file = fopen("white-space.txt", "w");
- fputs ("This is some serious \n", file);
- fputs ("white space\n", file);
- fputs ("bro \n", file);
- fputs ("It totally is.\n", file);
- fputs ("Why did the duck cross the road? \n", file);
- fputs ("Well that's annoying.\n", file);
- fclose (file);
- return 0;
- }
|