comparison lwar/main.c @ 212:bae1e3ecdce1

More preparation for gnulib integration
author lost
date Fri, 24 Apr 2009 06:43:02 +0000
parents bb2665c7005c
children
comparison
equal deleted inserted replaced
211:51511cf1c9f8 212:bae1e3ecdce1
20 20
21 Implements the program startup code 21 Implements the program startup code
22 22
23 */ 23 */
24 24
25 #ifdef HAVE_CONFIG_H 25 #include <config.h>
26 #include "config.h"
27 #endif
28 26
29 #include <argp.h> 27 #include <argp.h>
30 #include <errno.h> 28 #include <errno.h>
31 #include <stdio.h> 29 #include <stdio.h>
32 #include <stdlib.h> 30 #include <stdlib.h>
37 #include "lwar.h" 35 #include "lwar.h"
38 36
39 // command line option handling 37 // command line option handling
40 const char *argp_program_version = "LWAR from " PACKAGE_STRING; 38 const char *argp_program_version = "LWAR from " PACKAGE_STRING;
41 const char *argp_program_bug_address = PACKAGE_BUGREPORT; 39 const char *argp_program_bug_address = PACKAGE_BUGREPORT;
40 char *program_name;
42 41
43 static error_t parse_opts(int key, char *arg, struct argp_state *state) 42 static error_t parse_opts(int key, char *arg, struct argp_state *state)
44 { 43 {
45 switch (key) 44 switch (key)
46 { 45 {
129 128
130 // main function; parse command line, set up assembler state, and run the 129 // main function; parse command line, set up assembler state, and run the
131 // assembler on the first file 130 // assembler on the first file
132 int main(int argc, char **argv) 131 int main(int argc, char **argv)
133 { 132 {
133 program_name = argv[0];
134 argp_parse(&argp, argc, argv, 0, 0, NULL); 134 argp_parse(&argp, argc, argv, 0, 0, NULL);
135 if (archive_file == NULL) 135 if (archive_file == NULL)
136 { 136 {
137 fprintf(stderr, "You must specify an archive file.\n"); 137 fprintf(stderr, "You must specify an archive file.\n");
138 exit(1); 138 exit(1);