Revision: 42110
          http://brlcad.svn.sourceforge.net/brlcad/?rev=42110&view=rev
Author:   brlcad
Date:     2011-01-12 01:11:49 +0000 (Wed, 12 Jan 2011)

Log Message:
-----------
more string literals that are way too long.  convert to usage() functions.

Modified Paths:
--------------
    brlcad/trunk/src/conv/iges/g-iges.c
    brlcad/trunk/src/conv/iges/main.c
    brlcad/trunk/src/conv/iges/usage.c

Modified: brlcad/trunk/src/conv/iges/g-iges.c
===================================================================
--- brlcad/trunk/src/conv/iges/g-iges.c 2011-01-12 01:06:26 UTC (rev 42109)
+++ brlcad/trunk/src/conv/iges/g-iges.c 2011-01-12 01:11:49 UTC (rev 42110)
@@ -75,23 +75,28 @@
 BU_EXTERN( void get_props, ( struct iges_properties *props, struct 
rt_comb_internal *comb ) );
 BU_EXTERN( int comb_to_iges, ( struct rt_comb_internal *comb, int length, int 
dependent, struct iges_properties *props, int de_pointers[], FILE *fp_dir, FILE 
*fp_param ) );
 
-static char usage[] = "Usage: %s [-f|t|m] [-v] [-s] [-xX lvl] [-a abs_tol] [-r 
rel_tol] [-n norm_tol] [-d dist_tol] [-o output_file] brlcad_db.g object(s)\n\
-       options:\n\
-               f - convert each region to facetted BREP before output\n\
-               t - produce a file of trimmed surfaces (experimental)\n\
-               m - produces a seperate IGES file for each region,\n\
-                       implies -t, -o gives directory for output IGES file\n\
-               s - produce NURBS for faces of any BREP objects\n\
-               v - verbose\n\
-               a - absolute tolerance for tessellation (mm)\n\
-               r - relative tolerance for tessellation\n\
-               n - normal tolerance for tessellation\n\
-               d - distance tolerance (mm) (minimum distance between distinct 
points)\n\
-               x - librt debug flag\n\
-               X - nmg debug flag\n\
-               o - file to receive IGES output (or directory when '-m' option 
is used)\n\
-       The f and t options are mutually exclusive. If neither is specified,\n\
-       the default output is a CSG file to the maximum extent possible\n";
+static void
+usage(const char *argv0)
+{
+    bu_log("Usage: %s [-f|t|m] [-v] [-s] [-xX lvl] [-a abs_tol] [-r rel_tol] 
[-n norm_tol] [-d dist_tol] [-o output_file] brlcad_db.g object(s)\n", argv0);
+    bu_log("   options:\n");
+    bu_log("           f - convert each region to facetted BREP before 
output\n");
+    bu_log("           t - produce a file of trimmed surfaces 
(experimental)\n");
+    bu_log("           m - produces a seperate IGES file for each region,\n");
+    bu_log("                   implies -t, -o gives directory for output IGES 
file\n");
+    bu_log("           s - produce NURBS for faces of any BREP objects\n");
+    bu_log("           v - verbose\n");
+    bu_log("           a - absolute tolerance for tessellation (mm)\n");
+    bu_log("           r - relative tolerance for tessellation\n");
+    bu_log("           n - normal tolerance for tessellation\n");
+    bu_log("           d - distance tolerance (mm) (minimum distance between 
distinct points)\n");
+    bu_log("           x - librt debug flag\n");
+    bu_log("           X - nmg debug flag\n");
+    bu_log("           o - file to receive IGES output (or directory when '-m' 
option is used)\n");
+    bu_log("   The f and t options are mutually exclusive. If neither is 
specified,\n");
+    bu_log("   the default output is a CSG file to the maximum extent 
possible\n");
+    bu_exit(1, NULL);
+}
 
 int            verbose=0;
 static char    *db_name;       /* name of the BRL-CAD database */
@@ -264,13 +269,13 @@
                NMG_debug = rt_g.NMG_debug;
                break;
            default:
-               bu_exit(1, usage, argv[0]);
+               usage(argv[0]);
                break;
        }
     }
 
     if (bu_optind+1 >= argc) {
-       bu_exit(1, usage, argv[0]);
+       usage(argv[0]);
     }
 
     /* Open BRL-CAD database */

Modified: brlcad/trunk/src/conv/iges/main.c
===================================================================
--- brlcad/trunk/src/conv/iges/main.c   2011-01-12 01:06:26 UTC (rev 42109)
+++ brlcad/trunk/src/conv/iges/main.c   2011-01-12 01:11:49 UTC (rev 42110)
@@ -178,15 +178,13 @@
                sscanf( bu_optarg, "%x", (unsigned int *)&rt_g.NMG_debug );
                break;
            default:
-               usage();
-               bu_exit(1, NULL);
+               usage(argv[0]);
                break;
        }
     }
 
     if (bu_optind >= argc || output_file == (char *)NULL || 
do_drawings+do_splines+trimmed_surf > 1) {
-       usage();
-       bu_exit(1, NULL);
+       usage(argv[0]);
     }
 
     if ( bu_debug & BU_DEBUG_MEM_CHECK )
@@ -225,8 +223,7 @@
     {
        bu_log( "Cannot open %s\n", output_file );
        perror( "iges-g" );
-       usage();
-       bu_exit( 1, NULL );
+       usage(argv[0]);
     }
     bu_strlcpy( brlcad_file,  output_file, sizeof(brlcad_file) );
 
@@ -257,8 +254,7 @@
        {
            bu_log( "Cannot open %s\n", iges_file );
            perror( "iges-g" );
-           usage();
-           bu_exit( 1, NULL );
+           usage(argv[0]);
        }
 
        bu_log( "\n\n\nIGES FILE: %s\n", iges_file );

Modified: brlcad/trunk/src/conv/iges/usage.c
===================================================================
--- brlcad/trunk/src/conv/iges/usage.c  2011-01-12 01:06:26 UTC (rev 42109)
+++ brlcad/trunk/src/conv/iges/usage.c  2011-01-12 01:11:49 UTC (rev 42110)
@@ -33,29 +33,29 @@
 #include "bu.h"
 
 
-char *message="Usage:  iges-g [-N solid_name] [-X nmg_debug_flag] [-x 
rt_debug_flag] [-n|d|t] -o file.g file.iges\n\
-       -n - Convert all rational B-spline surfaces to a single spline solid\n\
-       -d - Convert IGES drawings to NMG objects (and ignore solid objects)\n\
-       -3 - Convert IGES drawings to NMG objects, but don't project to 2D (and 
ignore solid objects)\n\
-       -t - Convert all trimmed surfaces to a single NMG trimmed NURBS solid\n\
-       -o - Specify BRL-CAD output file\n\
-       -p - Write BREP objects as NMG's rather than BOT's\n\
-       -X - Set debug flag for NMG routines\n\
-       -x - Set debug flag for librt\n\
-       -N - Specify name of solid to be created\n\
-The n, d (or 3), and t options are mutually exclusive.\n\
-With none of the n, d (or 3), or t options specified, the default action\n\
-is to convert only IGES solid model entities (CSG and planar face BREP)\n\
-The N option provides a name for the single solid created with the n or t\n\
-options, it is ignored for all other options\n";
-
-
 void
-usage()
+usage(const char *argv0)
 {
-    bu_exit( 1, message );
+    bu_log("Usage:  %s [-N solid_name] [-X nmg_debug_flag] [-x rt_debug_flag] 
[-n|d|t] -o file.g file.iges\n", argv0);
+    bu_log("   -n - Convert all rational B-spline surfaces to a single spline 
solid\n");
+    bu_log("   -d - Convert IGES drawings to NMG objects (and ignore solid 
objects)\n");
+    bu_log("   -3 - Convert IGES drawings to NMG objects, but don't project to 
2D (and ignore solid objects)\n");
+    bu_log("   -t - Convert all trimmed surfaces to a single NMG trimmed NURBS 
solid\n");
+    bu_log("   -o - Specify BRL-CAD output file\n");
+    bu_log("   -p - Write BREP objects as NMG's rather than BOT's\n");
+    bu_log("   -X - Set debug flag for NMG routines\n");
+    bu_log("   -x - Set debug flag for librt\n");
+    bu_log("   -N - Specify name of solid to be created\n");
+    bu_log("The n, d (or 3), and t options are mutually exclusive.\n");
+    bu_log("With none of the n, d (or 3), or t options specified, the default 
action\n");
+    bu_log("is to convert only IGES solid model entities (CSG and planar face 
BREP)\n");
+    bu_log("The N option provides a name for the single solid created with the 
n or t\n");
+    bu_log("options, it is ignored for all other options\n");
+
+    bu_exit(1, NULL);
 }
 
+
 /*
  * Local Variables:
  * mode: C


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to