# HG changeset patch # User Mychaela Falconia # Date 1454286364 0 # Node ID fab9fc6460448090cfda01af806a00c70f133ef3 # Parent a3d47129ebdc6913465fa7151ec46b779805752a pads2gpcb: single -f option to write loose footprint files diff -r a3d47129ebdc -r fab9fc646044 pads2gpcb/decals.c --- a/pads2gpcb/decals.c Mon Feb 01 00:13:20 2016 +0000 +++ b/pads2gpcb/decals.c Mon Feb 01 00:26:04 2016 +0000 @@ -561,7 +561,7 @@ exit(1); } *current_decal->body = fpbody; - if (write_decal_files) + if (write_footprint_files) write_decal_as_element(); } else { printf("decal to gpcb fp conversion FAILED\n"); diff -r a3d47129ebdc -r fab9fc646044 pads2gpcb/globals.c --- a/pads2gpcb/globals.c Mon Feb 01 00:13:20 2016 +0000 +++ b/pads2gpcb/globals.c Mon Feb 01 00:26:04 2016 +0000 @@ -3,4 +3,4 @@ struct part_type *part_type_list; struct part_instance *part_inst_list; int do_footprint_silk; -int write_decal_files, write_parttype_files, write_final_elements; +int write_footprint_files; diff -r a3d47129ebdc -r fab9fc646044 pads2gpcb/globals.h --- a/pads2gpcb/globals.h Mon Feb 01 00:13:20 2016 +0000 +++ b/pads2gpcb/globals.h Mon Feb 01 00:26:04 2016 +0000 @@ -4,7 +4,7 @@ extern struct part_type *part_type_list; extern struct part_instance *part_inst_list; extern int do_footprint_silk; -extern int write_decal_files, write_parttype_files, write_final_elements; +extern int write_footprint_files; /* readpads.c */ extern char *input_filename; diff -r a3d47129ebdc -r fab9fc646044 pads2gpcb/main.c --- a/pads2gpcb/main.c Mon Feb 01 00:13:20 2016 +0000 +++ b/pads2gpcb/main.c Mon Feb 01 00:26:04 2016 +0000 @@ -29,30 +29,6 @@ return(0); } -static void -process_write_option() -{ - extern char *optarg; - - if (strlen(optarg) != 1) { -inv: fprintf(stderr, "usage error: invalid -w option\n"); - exit(1); - } - switch (optarg[0]) { - case 'd': - write_decal_files = 1; - return; - case 'p': - write_parttype_files = 1; - return; - case 'e': - write_final_elements = 1; - return; - default: - goto inv; - } -} - main(argc, argv) char **argv; { @@ -60,15 +36,15 @@ extern int optind; extern char *optarg; - while ((c = getopt(argc, argv, "s:w:")) != EOF) + while ((c = getopt(argc, argv, "fs:")) != EOF) switch (c) { + case 'f': + write_footprint_files = 1; + continue; case 's': do_footprint_silk = 1; select_drawlevel_for_silk(atoi(optarg)); continue; - case 'w': - process_write_option(); - continue; default: usage: fprintf(stderr, "usage: %s [options] pads-file.asc\n",