Send commitlog mailing list submissions to
        commitlog@lists.openmoko.org

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.openmoko.org/mailman/listinfo/commitlog
or, via email, send a message with subject or body 'help' to
        commitlog-requ...@lists.openmoko.org

You can reach the person managing the list at
        commitlog-ow...@lists.openmoko.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of commitlog digest..."
Today's Topics:

   1. r5698 - trunk/eda/fped (wer...@docs.openmoko.org)
--- Begin Message ---
Author: werner
Date: 2009-10-21 01:50:45 +0200 (Wed, 21 Oct 2009)
New Revision: 5698

Modified:
   trunk/eda/fped/fped.c
Log:
For future extensions.

- fped.c: added cpp-like command-line options -D, -U, and -I



Modified: trunk/eda/fped/fped.c
===================================================================
--- trunk/eda/fped/fped.c       2009-10-19 16:36:24 UTC (rev 5697)
+++ trunk/eda/fped/fped.c       2009-10-20 23:50:45 UTC (rev 5698)
@@ -43,9 +43,12 @@
 
 static void usage(const char *name)
 {
-       fprintf(stderr, "usage: %s [-k|-p] [in_file [out_file]]\n\n", name);
-       fprintf(stderr, "  -k  write KiCad output, then exit\n");
-       fprintf(stderr, "  -p  write Postscript output, then exit\n");
+       fprintf(stderr,
+"usage: %s [-k|-p] [cpp_option ...] [in_file [out_file]]\n\n"
+"  -k          write KiCad output, then exit\n"
+"  -p          write Postscript output, then exit\n"
+"  cpp_option  -Idir, -Dname[=value], or -Uname\n"
+    , name);
        exit(1);
 }
 
@@ -56,11 +59,12 @@
        char **fake_argv;
        char *args[2];
        int fake_argc;
+       char opt[] = "-?";
        int error, batch;
        int batch_write_kicad = 0, batch_write_ps = 0;
        int c;
 
-       while ((c = getopt(argc, argv, "kp")) != EOF)
+       while ((c = getopt(argc, argv, "kpD:U:I:")) != EOF)
                switch (c) {
                case 'k':
                        batch_write_kicad = 1;
@@ -68,6 +72,13 @@
                case 'p':
                        batch_write_ps = 1;
                        break;
+               case 'D':
+               case 'U':
+               case 'I':
+                       opt[1] = c;
+                       add_cpp_arg(opt);
+                       add_cpp_arg(optarg);
+                       break;
                default:
                        usage(name);
                }




--- End Message ---
_______________________________________________
commitlog mailing list
commitlog@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/commitlog

Reply via email to