ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/trunk/src/applications/staticProps/StaticPropsCmd.cpp
(Generate patch)

Comparing trunk/src/applications/staticProps/StaticPropsCmd.c (file contents):
Revision 1390 by gezelter, Wed Nov 25 20:02:06 2009 UTC vs.
Revision 1413 by gezelter, Mon Mar 22 19:21:22 2010 UTC

# Line 1 | Line 1
1   /*
2    File autogenerated by gengetopt version 2.22
3    generated with the following command:
4 <  gengetopt -F StaticPropsCmd
4 >  gengetopt -F StaticPropsCmd -u
5  
6    The developers of gengetopt consider the fixed text that goes in all
7    gengetopt output files to be in the public domain:
# Line 23 | Line 23 | const char *gengetopt_args_info_purpose = "";
23  
24   const char *gengetopt_args_info_purpose = "";
25  
26 < const char *gengetopt_args_info_usage = "Usage: StaticProps [OPTIONS]...";
26 > const char *gengetopt_args_info_usage = "Usage: StaticProps [OPTIONS]... [FILES]...";
27  
28   const char *gengetopt_args_info_description = "";
29  
# Line 64 | Line 64 | const char *gengetopt_args_info_help[] = {
64    "  -s, --scd                     scd order parameter (either --sele1, --sele2, \n                                  --sele3 are specified or --molname, --begin, \n                                  --end are specified)",
65    "  -d, --density                 density plot",
66    "      --slab_density            slab density",
67 +  "      --p_angle                 p(cos(theta))",
68    "      --hxy                     hxy",
69    "      --rho_r                   rho of R",
70    "      --hullvol                 hull volume of nanoparticle",
# Line 129 | Line 130 | void clear_given (struct gengetopt_args_info *args_inf
130    args_info->scd_given = 0 ;
131    args_info->density_given = 0 ;
132    args_info->slab_density_given = 0 ;
133 +  args_info->p_angle_given = 0 ;
134    args_info->hxy_given = 0 ;
135    args_info->rho_r_given = 0 ;
136    args_info->hullvol_given = 0 ;
# Line 214 | Line 216 | void init_args_info(struct gengetopt_args_info *args_i
216    args_info->scd_help = gengetopt_args_info_help[33] ;
217    args_info->density_help = gengetopt_args_info_help[34] ;
218    args_info->slab_density_help = gengetopt_args_info_help[35] ;
219 <  args_info->hxy_help = gengetopt_args_info_help[36] ;
220 <  args_info->rho_r_help = gengetopt_args_info_help[37] ;
221 <  args_info->hullvol_help = gengetopt_args_info_help[38] ;
219 >  args_info->p_angle_help = gengetopt_args_info_help[36] ;
220 >  args_info->hxy_help = gengetopt_args_info_help[37] ;
221 >  args_info->rho_r_help = gengetopt_args_info_help[38] ;
222 >  args_info->hullvol_help = gengetopt_args_info_help[39] ;
223    
224   }
225  
# Line 256 | Line 259 | cmdline_parser_init (struct gengetopt_args_info *args_
259    clear_given (args_info);
260    clear_args (args_info);
261    init_args_info (args_info);
262 +
263 +  args_info->inputs = NULL;
264 +  args_info->inputs_num = 0;
265   }
266  
267   void
# Line 294 | Line 300 | cmdline_parser_release (struct gengetopt_args_info *ar
300   static void
301   cmdline_parser_release (struct gengetopt_args_info *args_info)
302   {
303 <
303 >  unsigned int i;
304    free_string_field (&(args_info->input_arg));
305    free_string_field (&(args_info->input_orig));
306    free_string_field (&(args_info->output_arg));
# Line 324 | Line 330 | cmdline_parser_release (struct gengetopt_args_info *ar
330    free_string_field (&(args_info->radius_orig));
331    
332    
333 +  for (i = 0; i < args_info->inputs_num; ++i)
334 +    free (args_info->inputs [i]);
335  
336 +  if (args_info->inputs_num)
337 +    free (args_info->inputs);
338 +
339    clear_given (args_info);
340   }
341  
# Line 421 | Line 432 | cmdline_parser_dump(FILE *outfile, struct gengetopt_ar
432      write_into_file(outfile, "density", 0, 0 );
433    if (args_info->slab_density_given)
434      write_into_file(outfile, "slab_density", 0, 0 );
435 +  if (args_info->p_angle_given)
436 +    write_into_file(outfile, "p_angle", 0, 0 );
437    if (args_info->hxy_given)
438      write_into_file(outfile, "hxy", 0, 0 );
439    if (args_info->rho_r_given)
# Line 494 | Line 507 | reset_group_staticProps(struct gengetopt_args_info *ar
507    args_info->scd_given = 0 ;
508    args_info->density_given = 0 ;
509    args_info->slab_density_given = 0 ;
510 +  args_info->p_angle_given = 0 ;
511    args_info->hxy_given = 0 ;
512    args_info->rho_r_given = 0 ;
513    args_info->hullvol_given = 0 ;
# Line 772 | Line 786 | cmdline_parser_internal (int argc, char * const *argv,
786          { "scd",        0, NULL, 's' },
787          { "density",    0, NULL, 'd' },
788          { "slab_density",       0, NULL, 0 },
789 +        { "p_angle",    0, NULL, 0 },
790          { "hxy",        0, NULL, 0 },
791          { "rho_r",      0, NULL, 0 },
792          { "hullvol",    0, NULL, 0 },
# Line 1270 | Line 1285 | cmdline_parser_internal (int argc, char * const *argv,
1285                  &(local_args_info.slab_density_given), optarg, 0, 0, ARG_NO,
1286                  check_ambiguity, override, 0, 0,
1287                  "slab_density", '-',
1288 +                additional_error))
1289 +              goto failure;
1290 +          
1291 +          }
1292 +          /* p(cos(theta)).  */
1293 +          else if (strcmp (long_options[option_index].name, "p_angle") == 0)
1294 +          {
1295 +          
1296 +            if (args_info->staticProps_group_counter && override)
1297 +              reset_group_staticProps (args_info);
1298 +            args_info->staticProps_group_counter += 1;
1299 +          
1300 +            if (update_arg( 0 ,
1301 +                 0 , &(args_info->p_angle_given),
1302 +                &(local_args_info.p_angle_given), optarg, 0, 0, ARG_NO,
1303 +                check_ambiguity, override, 0, 0,
1304 +                "p_angle", '-',
1305                  additional_error))
1306                goto failure;
1307            
# Line 1355 | Line 1387 | cmdline_parser_internal (int argc, char * const *argv,
1387    if ( error )
1388      return (EXIT_FAILURE);
1389  
1390 +  if (optind < argc)
1391 +    {
1392 +      int i = 0 ;
1393 +      int found_prog_name = 0;
1394 +      /* whether program name, i.e., argv[0], is in the remaining args
1395 +         (this may happen with some implementations of getopt,
1396 +          but surely not with the one included by gengetopt) */
1397 +
1398 +      i = optind;
1399 +      while (i < argc)
1400 +        if (argv[i++] == argv[0]) {
1401 +          found_prog_name = 1;
1402 +          break;
1403 +        }
1404 +      i = 0;
1405 +
1406 +      args_info->inputs_num = argc - optind - found_prog_name;
1407 +      args_info->inputs =
1408 +        (char **)(malloc ((args_info->inputs_num)*sizeof(char *))) ;
1409 +      while (optind < argc)
1410 +        if (argv[optind++] != argv[0])
1411 +          args_info->inputs[ i++ ] = gengetopt_strdup (argv[optind-1]) ;
1412 +    }
1413 +
1414    return 0;
1415  
1416   failure:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines