- Timestamp:
- Apr 23, 2016, 8:49:06 PM (9 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
- Children:
- dff2ded
- Parents:
- e22356e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
examples/parse_args.h
re22356e r7d7bf8f 18 18 19 19 */ 20 21 #include "config.h" 22 23 #ifdef HAVE_GETOPT_H 24 #include <getopt.h> 25 #endif 20 26 21 27 extern int verbose; … … 64 70 void usage (FILE * stream, int exit_code) 65 71 { 72 #ifdef HAVE_GETOPT_H 66 73 fprintf (stream, "usage: %s [ options ] \n", prog_name); 67 74 fprintf (stream, … … 107 114 " -h --help display this message\n" 108 115 ); 116 #else /* HAVE_GETOPT_H */ 117 fprintf (stream, "warning: compiled with getopt.h, no argument parsing\n"); 118 fprintf (stream, "usage: %s <filename> \n", prog_name); 119 #endif /* HAVE_GETOPT_H */ 109 120 exit (exit_code); 110 121 } … … 113 124 parse_args (int argc, char **argv) 114 125 { 126 #ifdef HAVE_GETOPT_H 115 127 const char *options = "hv" 116 128 "i:r:B:H:" … … 158 170 {NULL, 0, NULL, 0} 159 171 }; 172 #endif /* HAVE_GETOPT_H */ 160 173 prog_name = argv[0]; 161 174 if (argc < 1) { … … 163 176 return -1; 164 177 } 178 #ifdef HAVE_GETOPT_H 165 179 do { 166 180 next_option = getopt_long (argc, argv, options, long_options, NULL); … … 236 250 } 237 251 while (next_option != -1); 252 #endif /* HAVE_GETOPT_H */ 238 253 239 254 // if unique, use the non option argument as the source
Note: See TracChangeset
for help on using the changeset viewer.