| 1 |  | /* | 
| 2 | < | File autogenerated by gengetopt version 2.19.1 | 
| 2 | > | File autogenerated by gengetopt version 2.22.4 | 
| 3 |  | generated with the following command: | 
| 4 | < | gengetopt --file-name=StaticPropsCmd -u | 
| 4 | > | gengetopt --file-name=StaticPropsCmd --unamed-opts | 
| 5 |  |  | 
| 6 |  | The developers of gengetopt consider the fixed text that goes in all | 
| 7 |  | gengetopt output files to be in the public domain: | 
| 17 |  | #include <stdlib.h> | 
| 18 |  | #include <string.h> | 
| 19 |  |  | 
| 20 | < | #include "getopt.h" | 
| 20 | > | #ifndef FIX_UNUSED | 
| 21 | > | #define FIX_UNUSED(X) (void) (X) /* avoid warnings for unused params */ | 
| 22 | > | #endif | 
| 23 |  |  | 
| 24 | + | #ifdef WIN32 | 
| 25 | + | #include "utils/wingetopt.h" | 
| 26 | + | #else | 
| 27 | + | #include <getopt.h> | 
| 28 | + | #endif | 
| 29 | + |  | 
| 30 |  | #include "StaticPropsCmd.h" | 
| 31 |  |  | 
| 32 |  | const char *gengetopt_args_info_purpose = ""; | 
| 44 |  | "  -b, --nbins=INT               number of bins (general purpose)  \n                                  (default=`100')", | 
| 45 |  | "  -x, --nbins_x=INT             number of bins in x axis  (default=`100')", | 
| 46 |  | "  -y, --nbins_y=INT             number of bins in y axis  (default=`100')", | 
| 47 | + | "      --nbins_z=INT             number of bins in z axis  (default=`100')", | 
| 48 |  | "  -a, --nanglebins=INT          number of bins for cos(angle)  (default=`50')", | 
| 40 | – | "      --length=DOUBLE           maximum length (Defaults to 1/2 smallest length \n                                  of first frame)", | 
| 49 |  | "  -c, --rcut=DOUBLE             cutoff radius (rcut)", | 
| 50 | + | "      --dz=DOUBLE               slab width (dz)", | 
| 51 | + | "      --length=DOUBLE           maximum length (Defaults to 1/2 smallest length \n                                  of first frame)", | 
| 52 | + | "      --zlength=DOUBLE          maximum length (Defaults to 1/2 smallest length \n                                  of first frame)", | 
| 53 |  | "  -z, --zoffset=DOUBLE          Where to set the zero for the slab_density \n                                  calculation  (default=`0')", | 
| 54 |  | "      --sele1=selection script  select the first stuntdouble set", | 
| 55 |  | "      --sele2=selection script  select the second stuntdouble set", | 
| 56 |  | "      --sele3=selection script  select the third stuntdouble set", | 
| 57 |  | "      --refsele=selection script\n                                select reference (use and only use with --gxyz)", | 
| 58 | + | "      --comsele=selection script\n                                select stunt doubles for center-of-mass \n                                  reference point", | 
| 59 | + | "      --seleoffset=INT          global index offset for a second object (used \n                                  to define a vector between sites in molecule)", | 
| 60 | + | "      --seleoffset2=INT         global index offset for a third object (used to \n                                  define a vector between sites in molecule)", | 
| 61 |  | "      --molname=STRING          molecule name", | 
| 62 |  | "      --begin=INT               begin internal index", | 
| 63 |  | "      --end=INT                 end internal index", | 
| 64 |  | "      --radius=DOUBLE           nanoparticle radius", | 
| 65 |  | "\n Group: staticProps\n   an option of this group is required", | 
| 66 |  | "      --bo                      bond order parameter (--rcut must be specified)", | 
| 67 | < | "      --bor                     bond order parameter as a function of radius \n                                  (--rcut must be specified)", | 
| 67 | > | "      --ior                     icosahedral bond order parameter as a function \n                                  of radius (--rcut must be specified)", | 
| 68 | > | "      --for                     FCC bond order parameter as a function of \n                                  radius (--rcut must be specified)", | 
| 69 |  | "      --bad                     N(theta) bond angle density within (--rcut must \n                                  be specified)", | 
| 70 | + | "      --count                   count of molecules matching selection criteria \n                                  (and associated statistics)", | 
| 71 |  | "  -g, --gofr                    g(r)", | 
| 72 |  | "      --gofz                    g(z)", | 
| 73 |  | "      --r_theta                 g(r, cos(theta))", | 
| 74 |  | "      --r_omega                 g(r, cos(omega))", | 
| 75 | + | "      --r_z                     g(r, z)", | 
| 76 |  | "      --theta_omega             g(cos(theta), cos(omega))", | 
| 77 |  | "      --gxyz                    g(x, y, z)", | 
| 78 | < | "  -p, --p2                      p2 order parameter (--sele1 and --sele2 must be \n                                  specified)", | 
| 78 | > | "      --twodgofr                2D g(r) (Slab width --dz must be specified)", | 
| 79 | > | "  -p, --p2                      p2 order parameter (--sele1 must be specified, \n                                  --sele2 is optional)", | 
| 80 |  | "      --rp2                     rp2 order parameter (--sele1 and --sele2 must \n                                  be specified)", | 
| 81 |  | "  -s, --scd                     scd order parameter (either --sele1, --sele2, \n                                  --sele3 are specified or --molname, --begin, \n                                  --end are specified)", | 
| 82 |  | "  -d, --density                 density plot", | 
| 83 |  | "      --slab_density            slab density", | 
| 84 | + | "      --p_angle                 p(cos(theta)) (--sele1 must be specified, \n                                  --sele2 is optional)", | 
| 85 |  | "      --hxy                     hxy", | 
| 86 |  | "      --rho_r                   rho of R", | 
| 87 | + | "      --angle_r                 angle of R", | 
| 88 |  | "      --hullvol                 hull volume of nanoparticle", | 
| 89 | + | "      --rodlength               length of nanorod", | 
| 90 | + | "  -Q, --tet_param               tetrahedrality order parameter (Qk)", | 
| 91 | + | "      --tet_param_z             spatially-resolved tetrahedrality order \n                                  parameter Qk(z)", | 
| 92 | + | "      --rnemdz                  slab-resolved RNEMD statistics (temperature, \n                                  density, velocity)", | 
| 93 | + | "      --rnemdr                  shell-resolved RNEMD statistics (temperature, \n                                  density, angular velocity)", | 
| 94 | + | "      --rnemdrt                 shell and angle-resolved RNEMD statistics \n                                  (temperature, density, angular velocity)", | 
| 95 | + | "      --nitrile                 electrostatic potential to frequency map based \n                                  on the Cho nitrile fits", | 
| 96 | + | "  -m, --multipole               average multipole moments contained within \n                                  cutoff spheres as a function of radius", | 
| 97 |  | 0 | 
| 98 |  | }; | 
| 99 |  |  | 
| 100 | + | typedef enum {ARG_NO | 
| 101 | + | , ARG_STRING | 
| 102 | + | , ARG_INT | 
| 103 | + | , ARG_DOUBLE | 
| 104 | + | } cmdline_parser_arg_type; | 
| 105 | + |  | 
| 106 |  | static | 
| 107 |  | void clear_given (struct gengetopt_args_info *args_info); | 
| 108 |  | static | 
| 109 |  | void clear_args (struct gengetopt_args_info *args_info); | 
| 110 |  |  | 
| 111 |  | static int | 
| 112 | < | cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required, const char *additional_error); | 
| 112 | > | cmdline_parser_internal (int argc, char **argv, struct gengetopt_args_info *args_info, | 
| 113 | > | struct cmdline_parser_params *params, const char *additional_error); | 
| 114 |  |  | 
| 115 |  | static int | 
| 116 |  | cmdline_parser_required2 (struct gengetopt_args_info *args_info, const char *prog_name, const char *additional_error); | 
| 129 |  | args_info->nbins_given = 0 ; | 
| 130 |  | args_info->nbins_x_given = 0 ; | 
| 131 |  | args_info->nbins_y_given = 0 ; | 
| 132 | + | args_info->nbins_z_given = 0 ; | 
| 133 |  | args_info->nanglebins_given = 0 ; | 
| 98 | – | args_info->length_given = 0 ; | 
| 134 |  | args_info->rcut_given = 0 ; | 
| 135 | + | args_info->dz_given = 0 ; | 
| 136 | + | args_info->length_given = 0 ; | 
| 137 | + | args_info->zlength_given = 0 ; | 
| 138 |  | args_info->zoffset_given = 0 ; | 
| 139 |  | args_info->sele1_given = 0 ; | 
| 140 |  | args_info->sele2_given = 0 ; | 
| 141 |  | args_info->sele3_given = 0 ; | 
| 142 |  | args_info->refsele_given = 0 ; | 
| 143 | + | args_info->comsele_given = 0 ; | 
| 144 | + | args_info->seleoffset_given = 0 ; | 
| 145 | + | args_info->seleoffset2_given = 0 ; | 
| 146 |  | args_info->molname_given = 0 ; | 
| 147 |  | args_info->begin_given = 0 ; | 
| 148 |  | args_info->end_given = 0 ; | 
| 149 |  | args_info->radius_given = 0 ; | 
| 150 |  | args_info->bo_given = 0 ; | 
| 151 | < | args_info->bor_given = 0 ; | 
| 151 | > | args_info->ior_given = 0 ; | 
| 152 | > | args_info->for_given = 0 ; | 
| 153 |  | args_info->bad_given = 0 ; | 
| 154 | + | args_info->count_given = 0 ; | 
| 155 |  | args_info->gofr_given = 0 ; | 
| 156 |  | args_info->gofz_given = 0 ; | 
| 157 |  | args_info->r_theta_given = 0 ; | 
| 158 |  | args_info->r_omega_given = 0 ; | 
| 159 | + | args_info->r_z_given = 0 ; | 
| 160 |  | args_info->theta_omega_given = 0 ; | 
| 161 |  | args_info->gxyz_given = 0 ; | 
| 162 | + | args_info->twodgofr_given = 0 ; | 
| 163 |  | args_info->p2_given = 0 ; | 
| 164 |  | args_info->rp2_given = 0 ; | 
| 165 |  | args_info->scd_given = 0 ; | 
| 166 |  | args_info->density_given = 0 ; | 
| 167 |  | args_info->slab_density_given = 0 ; | 
| 168 | + | args_info->p_angle_given = 0 ; | 
| 169 |  | args_info->hxy_given = 0 ; | 
| 170 |  | args_info->rho_r_given = 0 ; | 
| 171 | + | args_info->angle_r_given = 0 ; | 
| 172 |  | args_info->hullvol_given = 0 ; | 
| 173 | + | args_info->rodlength_given = 0 ; | 
| 174 | + | args_info->tet_param_given = 0 ; | 
| 175 | + | args_info->tet_param_z_given = 0 ; | 
| 176 | + | args_info->rnemdz_given = 0 ; | 
| 177 | + | args_info->rnemdr_given = 0 ; | 
| 178 | + | args_info->rnemdrt_given = 0 ; | 
| 179 | + | args_info->nitrile_given = 0 ; | 
| 180 | + | args_info->multipole_given = 0 ; | 
| 181 |  | args_info->staticProps_group_counter = 0 ; | 
| 182 |  | } | 
| 183 |  |  | 
| 184 |  | static | 
| 185 |  | void clear_args (struct gengetopt_args_info *args_info) | 
| 186 |  | { | 
| 187 | + | FIX_UNUSED (args_info); | 
| 188 |  | args_info->input_arg = NULL; | 
| 189 |  | args_info->input_orig = NULL; | 
| 190 |  | args_info->output_arg = NULL; | 
| 197 |  | args_info->nbins_x_orig = NULL; | 
| 198 |  | args_info->nbins_y_arg = 100; | 
| 199 |  | args_info->nbins_y_orig = NULL; | 
| 200 | + | args_info->nbins_z_arg = 100; | 
| 201 | + | args_info->nbins_z_orig = NULL; | 
| 202 |  | args_info->nanglebins_arg = 50; | 
| 203 |  | args_info->nanglebins_orig = NULL; | 
| 146 | – | args_info->length_orig = NULL; | 
| 204 |  | args_info->rcut_orig = NULL; | 
| 205 | + | args_info->dz_orig = NULL; | 
| 206 | + | args_info->length_orig = NULL; | 
| 207 | + | args_info->zlength_orig = NULL; | 
| 208 |  | args_info->zoffset_arg = 0; | 
| 209 |  | args_info->zoffset_orig = NULL; | 
| 210 |  | args_info->sele1_arg = NULL; | 
| 215 |  | args_info->sele3_orig = NULL; | 
| 216 |  | args_info->refsele_arg = NULL; | 
| 217 |  | args_info->refsele_orig = NULL; | 
| 218 | + | args_info->comsele_arg = NULL; | 
| 219 | + | args_info->comsele_orig = NULL; | 
| 220 | + | args_info->seleoffset_orig = NULL; | 
| 221 | + | args_info->seleoffset2_orig = NULL; | 
| 222 |  | args_info->molname_arg = NULL; | 
| 223 |  | args_info->molname_orig = NULL; | 
| 224 |  | args_info->begin_orig = NULL; | 
| 230 |  | static | 
| 231 |  | void init_args_info(struct gengetopt_args_info *args_info) | 
| 232 |  | { | 
| 233 | + |  | 
| 234 | + |  | 
| 235 |  | args_info->help_help = gengetopt_args_info_help[0] ; | 
| 236 |  | args_info->version_help = gengetopt_args_info_help[1] ; | 
| 237 |  | args_info->input_help = gengetopt_args_info_help[2] ; | 
| 240 |  | args_info->nbins_help = gengetopt_args_info_help[5] ; | 
| 241 |  | args_info->nbins_x_help = gengetopt_args_info_help[6] ; | 
| 242 |  | args_info->nbins_y_help = gengetopt_args_info_help[7] ; | 
| 243 | < | args_info->nanglebins_help = gengetopt_args_info_help[8] ; | 
| 244 | < | args_info->length_help = gengetopt_args_info_help[9] ; | 
| 243 | > | args_info->nbins_z_help = gengetopt_args_info_help[8] ; | 
| 244 | > | args_info->nanglebins_help = gengetopt_args_info_help[9] ; | 
| 245 |  | args_info->rcut_help = gengetopt_args_info_help[10] ; | 
| 246 | < | args_info->zoffset_help = gengetopt_args_info_help[11] ; | 
| 247 | < | args_info->sele1_help = gengetopt_args_info_help[12] ; | 
| 248 | < | args_info->sele2_help = gengetopt_args_info_help[13] ; | 
| 249 | < | args_info->sele3_help = gengetopt_args_info_help[14] ; | 
| 250 | < | args_info->refsele_help = gengetopt_args_info_help[15] ; | 
| 251 | < | args_info->molname_help = gengetopt_args_info_help[16] ; | 
| 252 | < | args_info->begin_help = gengetopt_args_info_help[17] ; | 
| 253 | < | args_info->end_help = gengetopt_args_info_help[18] ; | 
| 254 | < | args_info->radius_help = gengetopt_args_info_help[19] ; | 
| 255 | < | args_info->bo_help = gengetopt_args_info_help[20] ; | 
| 256 | < | args_info->bor_help = gengetopt_args_info_help[21] ; | 
| 257 | < | args_info->bad_help = gengetopt_args_info_help[22] ; | 
| 258 | < | args_info->gofr_help = gengetopt_args_info_help[23] ; | 
| 259 | < | args_info->gofz_help = gengetopt_args_info_help[24] ; | 
| 260 | < | args_info->r_theta_help = gengetopt_args_info_help[25] ; | 
| 261 | < | args_info->r_omega_help = gengetopt_args_info_help[26] ; | 
| 262 | < | args_info->theta_omega_help = gengetopt_args_info_help[27] ; | 
| 263 | < | args_info->gxyz_help = gengetopt_args_info_help[28] ; | 
| 264 | < | args_info->p2_help = gengetopt_args_info_help[29] ; | 
| 265 | < | args_info->rp2_help = gengetopt_args_info_help[30] ; | 
| 266 | < | args_info->scd_help = gengetopt_args_info_help[31] ; | 
| 267 | < | args_info->density_help = gengetopt_args_info_help[32] ; | 
| 268 | < | args_info->slab_density_help = gengetopt_args_info_help[33] ; | 
| 269 | < | args_info->hxy_help = gengetopt_args_info_help[34] ; | 
| 270 | < | args_info->rho_r_help = gengetopt_args_info_help[35] ; | 
| 271 | < | args_info->hullvol_help = gengetopt_args_info_help[36] ; | 
| 246 | > | args_info->dz_help = gengetopt_args_info_help[11] ; | 
| 247 | > | args_info->length_help = gengetopt_args_info_help[12] ; | 
| 248 | > | args_info->zlength_help = gengetopt_args_info_help[13] ; | 
| 249 | > | args_info->zoffset_help = gengetopt_args_info_help[14] ; | 
| 250 | > | args_info->sele1_help = gengetopt_args_info_help[15] ; | 
| 251 | > | args_info->sele2_help = gengetopt_args_info_help[16] ; | 
| 252 | > | args_info->sele3_help = gengetopt_args_info_help[17] ; | 
| 253 | > | args_info->refsele_help = gengetopt_args_info_help[18] ; | 
| 254 | > | args_info->comsele_help = gengetopt_args_info_help[19] ; | 
| 255 | > | args_info->seleoffset_help = gengetopt_args_info_help[20] ; | 
| 256 | > | args_info->seleoffset2_help = gengetopt_args_info_help[21] ; | 
| 257 | > | args_info->molname_help = gengetopt_args_info_help[22] ; | 
| 258 | > | args_info->begin_help = gengetopt_args_info_help[23] ; | 
| 259 | > | args_info->end_help = gengetopt_args_info_help[24] ; | 
| 260 | > | args_info->radius_help = gengetopt_args_info_help[25] ; | 
| 261 | > | args_info->bo_help = gengetopt_args_info_help[27] ; | 
| 262 | > | args_info->ior_help = gengetopt_args_info_help[28] ; | 
| 263 | > | args_info->for_help = gengetopt_args_info_help[29] ; | 
| 264 | > | args_info->bad_help = gengetopt_args_info_help[30] ; | 
| 265 | > | args_info->count_help = gengetopt_args_info_help[31] ; | 
| 266 | > | args_info->gofr_help = gengetopt_args_info_help[32] ; | 
| 267 | > | args_info->gofz_help = gengetopt_args_info_help[33] ; | 
| 268 | > | args_info->r_theta_help = gengetopt_args_info_help[34] ; | 
| 269 | > | args_info->r_omega_help = gengetopt_args_info_help[35] ; | 
| 270 | > | args_info->r_z_help = gengetopt_args_info_help[36] ; | 
| 271 | > | args_info->theta_omega_help = gengetopt_args_info_help[37] ; | 
| 272 | > | args_info->gxyz_help = gengetopt_args_info_help[38] ; | 
| 273 | > | args_info->twodgofr_help = gengetopt_args_info_help[39] ; | 
| 274 | > | args_info->p2_help = gengetopt_args_info_help[40] ; | 
| 275 | > | args_info->rp2_help = gengetopt_args_info_help[41] ; | 
| 276 | > | args_info->scd_help = gengetopt_args_info_help[42] ; | 
| 277 | > | args_info->density_help = gengetopt_args_info_help[43] ; | 
| 278 | > | args_info->slab_density_help = gengetopt_args_info_help[44] ; | 
| 279 | > | args_info->p_angle_help = gengetopt_args_info_help[45] ; | 
| 280 | > | args_info->hxy_help = gengetopt_args_info_help[46] ; | 
| 281 | > | args_info->rho_r_help = gengetopt_args_info_help[47] ; | 
| 282 | > | args_info->angle_r_help = gengetopt_args_info_help[48] ; | 
| 283 | > | args_info->hullvol_help = gengetopt_args_info_help[49] ; | 
| 284 | > | args_info->rodlength_help = gengetopt_args_info_help[50] ; | 
| 285 | > | args_info->tet_param_help = gengetopt_args_info_help[51] ; | 
| 286 | > | args_info->tet_param_z_help = gengetopt_args_info_help[52] ; | 
| 287 | > | args_info->rnemdz_help = gengetopt_args_info_help[53] ; | 
| 288 | > | args_info->rnemdr_help = gengetopt_args_info_help[54] ; | 
| 289 | > | args_info->rnemdrt_help = gengetopt_args_info_help[55] ; | 
| 290 | > | args_info->nitrile_help = gengetopt_args_info_help[56] ; | 
| 291 | > | args_info->multipole_help = gengetopt_args_info_help[57] ; | 
| 292 |  |  | 
| 293 |  | } | 
| 294 |  |  | 
| 295 |  | void | 
| 296 |  | cmdline_parser_print_version (void) | 
| 297 |  | { | 
| 298 | < | printf ("%s %s\n", CMDLINE_PARSER_PACKAGE, CMDLINE_PARSER_VERSION); | 
| 298 | > | printf ("%s %s\n", | 
| 299 | > | (strlen(CMDLINE_PARSER_PACKAGE_NAME) ? CMDLINE_PARSER_PACKAGE_NAME : CMDLINE_PARSER_PACKAGE), | 
| 300 | > | CMDLINE_PARSER_VERSION); | 
| 301 |  | } | 
| 302 |  |  | 
| 303 | < | void | 
| 216 | < | cmdline_parser_print_help (void) | 
| 217 | < | { | 
| 218 | < | int i = 0; | 
| 303 | > | static void print_help_common(void) { | 
| 304 |  | cmdline_parser_print_version (); | 
| 305 |  |  | 
| 306 |  | if (strlen(gengetopt_args_info_purpose) > 0) | 
| 307 |  | printf("\n%s\n", gengetopt_args_info_purpose); | 
| 308 |  |  | 
| 309 | < | printf("\n%s\n\n", gengetopt_args_info_usage); | 
| 309 | > | if (strlen(gengetopt_args_info_usage) > 0) | 
| 310 | > | printf("\n%s\n", gengetopt_args_info_usage); | 
| 311 |  |  | 
| 312 | + | printf("\n"); | 
| 313 | + |  | 
| 314 |  | if (strlen(gengetopt_args_info_description) > 0) | 
| 315 | < | printf("%s\n", gengetopt_args_info_description); | 
| 315 | > | printf("%s\n\n", gengetopt_args_info_description); | 
| 316 | > | } | 
| 317 |  |  | 
| 318 | + | void | 
| 319 | + | cmdline_parser_print_help (void) | 
| 320 | + | { | 
| 321 | + | int i = 0; | 
| 322 | + | print_help_common(); | 
| 323 |  | while (gengetopt_args_info_help[i]) | 
| 324 |  | printf("%s\n", gengetopt_args_info_help[i++]); | 
| 325 |  | } | 
| 331 |  | clear_args (args_info); | 
| 332 |  | init_args_info (args_info); | 
| 333 |  |  | 
| 334 | < | args_info->inputs = NULL; | 
| 334 | > | args_info->inputs = 0; | 
| 335 |  | args_info->inputs_num = 0; | 
| 336 |  | } | 
| 337 |  |  | 
| 338 | + | void | 
| 339 | + | cmdline_parser_params_init(struct cmdline_parser_params *params) | 
| 340 | + | { | 
| 341 | + | if (params) | 
| 342 | + | { | 
| 343 | + | params->override = 0; | 
| 344 | + | params->initialize = 1; | 
| 345 | + | params->check_required = 1; | 
| 346 | + | params->check_ambiguity = 0; | 
| 347 | + | params->print_errors = 1; | 
| 348 | + | } | 
| 349 | + | } | 
| 350 | + |  | 
| 351 | + | struct cmdline_parser_params * | 
| 352 | + | cmdline_parser_params_create(void) | 
| 353 | + | { | 
| 354 | + | struct cmdline_parser_params *params = | 
| 355 | + | (struct cmdline_parser_params *)malloc(sizeof(struct cmdline_parser_params)); | 
| 356 | + | cmdline_parser_params_init(params); | 
| 357 | + | return params; | 
| 358 | + | } | 
| 359 | + |  | 
| 360 |  | static void | 
| 361 | < | cmdline_parser_release (struct gengetopt_args_info *args_info) | 
| 361 | > | free_string_field (char **s) | 
| 362 |  | { | 
| 363 | < |  | 
| 248 | < | unsigned int i; | 
| 249 | < | if (args_info->input_arg) | 
| 363 | > | if (*s) | 
| 364 |  | { | 
| 365 | < | free (args_info->input_arg); /* free previous argument */ | 
| 366 | < | args_info->input_arg = 0; | 
| 253 | < | } | 
| 254 | < | if (args_info->input_orig) | 
| 255 | < | { | 
| 256 | < | free (args_info->input_orig); /* free previous argument */ | 
| 257 | < | args_info->input_orig = 0; | 
| 258 | < | } | 
| 259 | < | if (args_info->output_arg) | 
| 260 | < | { | 
| 261 | < | free (args_info->output_arg); /* free previous argument */ | 
| 262 | < | args_info->output_arg = 0; | 
| 263 | < | } | 
| 264 | < | if (args_info->output_orig) | 
| 265 | < | { | 
| 266 | < | free (args_info->output_orig); /* free previous argument */ | 
| 267 | < | args_info->output_orig = 0; | 
| 268 | < | } | 
| 269 | < | if (args_info->step_orig) | 
| 270 | < | { | 
| 271 | < | free (args_info->step_orig); /* free previous argument */ | 
| 272 | < | args_info->step_orig = 0; | 
| 273 | < | } | 
| 274 | < | if (args_info->nbins_orig) | 
| 275 | < | { | 
| 276 | < | free (args_info->nbins_orig); /* free previous argument */ | 
| 277 | < | args_info->nbins_orig = 0; | 
| 278 | < | } | 
| 279 | < | if (args_info->nbins_x_orig) | 
| 280 | < | { | 
| 281 | < | free (args_info->nbins_x_orig); /* free previous argument */ | 
| 282 | < | args_info->nbins_x_orig = 0; | 
| 283 | < | } | 
| 284 | < | if (args_info->nbins_y_orig) | 
| 285 | < | { | 
| 286 | < | free (args_info->nbins_y_orig); /* free previous argument */ | 
| 287 | < | args_info->nbins_y_orig = 0; | 
| 288 | < | } | 
| 289 | < | if (args_info->nanglebins_orig) | 
| 290 | < | { | 
| 291 | < | free (args_info->nanglebins_orig); /* free previous argument */ | 
| 292 | < | args_info->nanglebins_orig = 0; | 
| 293 | < | } | 
| 294 | < | if (args_info->length_orig) | 
| 295 | < | { | 
| 296 | < | free (args_info->length_orig); /* free previous argument */ | 
| 297 | < | args_info->length_orig = 0; | 
| 365 | > | free (*s); | 
| 366 | > | *s = 0; | 
| 367 |  | } | 
| 368 | < | if (args_info->rcut_orig) | 
| 369 | < | { | 
| 370 | < | free (args_info->rcut_orig); /* free previous argument */ | 
| 371 | < | args_info->rcut_orig = 0; | 
| 372 | < | } | 
| 373 | < | if (args_info->zoffset_orig) | 
| 374 | < | { | 
| 375 | < | free (args_info->zoffset_orig); /* free previous argument */ | 
| 376 | < | args_info->zoffset_orig = 0; | 
| 377 | < | } | 
| 378 | < | if (args_info->sele1_arg) | 
| 379 | < | { | 
| 380 | < | free (args_info->sele1_arg); /* free previous argument */ | 
| 381 | < | args_info->sele1_arg = 0; | 
| 382 | < | } | 
| 383 | < | if (args_info->sele1_orig) | 
| 384 | < | { | 
| 385 | < | free (args_info->sele1_orig); /* free previous argument */ | 
| 386 | < | args_info->sele1_orig = 0; | 
| 387 | < | } | 
| 388 | < | if (args_info->sele2_arg) | 
| 389 | < | { | 
| 390 | < | free (args_info->sele2_arg); /* free previous argument */ | 
| 391 | < | args_info->sele2_arg = 0; | 
| 392 | < | } | 
| 393 | < | if (args_info->sele2_orig) | 
| 394 | < | { | 
| 395 | < | free (args_info->sele2_orig); /* free previous argument */ | 
| 396 | < | args_info->sele2_orig = 0; | 
| 397 | < | } | 
| 398 | < | if (args_info->sele3_arg) | 
| 399 | < | { | 
| 400 | < | free (args_info->sele3_arg); /* free previous argument */ | 
| 401 | < | args_info->sele3_arg = 0; | 
| 402 | < | } | 
| 403 | < | if (args_info->sele3_orig) | 
| 404 | < | { | 
| 405 | < | free (args_info->sele3_orig); /* free previous argument */ | 
| 406 | < | args_info->sele3_orig = 0; | 
| 338 | < | } | 
| 339 | < | if (args_info->refsele_arg) | 
| 340 | < | { | 
| 341 | < | free (args_info->refsele_arg); /* free previous argument */ | 
| 342 | < | args_info->refsele_arg = 0; | 
| 343 | < | } | 
| 344 | < | if (args_info->refsele_orig) | 
| 345 | < | { | 
| 346 | < | free (args_info->refsele_orig); /* free previous argument */ | 
| 347 | < | args_info->refsele_orig = 0; | 
| 348 | < | } | 
| 349 | < | if (args_info->molname_arg) | 
| 350 | < | { | 
| 351 | < | free (args_info->molname_arg); /* free previous argument */ | 
| 352 | < | args_info->molname_arg = 0; | 
| 353 | < | } | 
| 354 | < | if (args_info->molname_orig) | 
| 355 | < | { | 
| 356 | < | free (args_info->molname_orig); /* free previous argument */ | 
| 357 | < | args_info->molname_orig = 0; | 
| 358 | < | } | 
| 359 | < | if (args_info->begin_orig) | 
| 360 | < | { | 
| 361 | < | free (args_info->begin_orig); /* free previous argument */ | 
| 362 | < | args_info->begin_orig = 0; | 
| 363 | < | } | 
| 364 | < | if (args_info->end_orig) | 
| 365 | < | { | 
| 366 | < | free (args_info->end_orig); /* free previous argument */ | 
| 367 | < | args_info->end_orig = 0; | 
| 368 | < | } | 
| 369 | < | if (args_info->radius_orig) | 
| 370 | < | { | 
| 371 | < | free (args_info->radius_orig); /* free previous argument */ | 
| 372 | < | args_info->radius_orig = 0; | 
| 373 | < | } | 
| 368 | > | } | 
| 369 | > |  | 
| 370 | > |  | 
| 371 | > | static void | 
| 372 | > | cmdline_parser_release (struct gengetopt_args_info *args_info) | 
| 373 | > | { | 
| 374 | > | unsigned int i; | 
| 375 | > | free_string_field (&(args_info->input_arg)); | 
| 376 | > | free_string_field (&(args_info->input_orig)); | 
| 377 | > | free_string_field (&(args_info->output_arg)); | 
| 378 | > | free_string_field (&(args_info->output_orig)); | 
| 379 | > | free_string_field (&(args_info->step_orig)); | 
| 380 | > | free_string_field (&(args_info->nbins_orig)); | 
| 381 | > | free_string_field (&(args_info->nbins_x_orig)); | 
| 382 | > | free_string_field (&(args_info->nbins_y_orig)); | 
| 383 | > | free_string_field (&(args_info->nbins_z_orig)); | 
| 384 | > | free_string_field (&(args_info->nanglebins_orig)); | 
| 385 | > | free_string_field (&(args_info->rcut_orig)); | 
| 386 | > | free_string_field (&(args_info->dz_orig)); | 
| 387 | > | free_string_field (&(args_info->length_orig)); | 
| 388 | > | free_string_field (&(args_info->zlength_orig)); | 
| 389 | > | free_string_field (&(args_info->zoffset_orig)); | 
| 390 | > | free_string_field (&(args_info->sele1_arg)); | 
| 391 | > | free_string_field (&(args_info->sele1_orig)); | 
| 392 | > | free_string_field (&(args_info->sele2_arg)); | 
| 393 | > | free_string_field (&(args_info->sele2_orig)); | 
| 394 | > | free_string_field (&(args_info->sele3_arg)); | 
| 395 | > | free_string_field (&(args_info->sele3_orig)); | 
| 396 | > | free_string_field (&(args_info->refsele_arg)); | 
| 397 | > | free_string_field (&(args_info->refsele_orig)); | 
| 398 | > | free_string_field (&(args_info->comsele_arg)); | 
| 399 | > | free_string_field (&(args_info->comsele_orig)); | 
| 400 | > | free_string_field (&(args_info->seleoffset_orig)); | 
| 401 | > | free_string_field (&(args_info->seleoffset2_orig)); | 
| 402 | > | free_string_field (&(args_info->molname_arg)); | 
| 403 | > | free_string_field (&(args_info->molname_orig)); | 
| 404 | > | free_string_field (&(args_info->begin_orig)); | 
| 405 | > | free_string_field (&(args_info->end_orig)); | 
| 406 | > | free_string_field (&(args_info->radius_orig)); | 
| 407 |  |  | 
| 408 | + |  | 
| 409 |  | for (i = 0; i < args_info->inputs_num; ++i) | 
| 410 |  | free (args_info->inputs [i]); | 
| 411 | < |  | 
| 411 | > |  | 
| 412 |  | if (args_info->inputs_num) | 
| 413 |  | free (args_info->inputs); | 
| 414 | < |  | 
| 414 | > |  | 
| 415 |  | clear_given (args_info); | 
| 416 |  | } | 
| 417 |  |  | 
| 418 | + |  | 
| 419 | + | static void | 
| 420 | + | write_into_file(FILE *outfile, const char *opt, const char *arg, const char *values[]) | 
| 421 | + | { | 
| 422 | + | FIX_UNUSED (values); | 
| 423 | + | if (arg) { | 
| 424 | + | fprintf(outfile, "%s=\"%s\"\n", opt, arg); | 
| 425 | + | } else { | 
| 426 | + | fprintf(outfile, "%s\n", opt); | 
| 427 | + | } | 
| 428 | + | } | 
| 429 | + |  | 
| 430 | + |  | 
| 431 |  | int | 
| 432 | + | cmdline_parser_dump(FILE *outfile, struct gengetopt_args_info *args_info) | 
| 433 | + | { | 
| 434 | + | int i = 0; | 
| 435 | + |  | 
| 436 | + | if (!outfile) | 
| 437 | + | { | 
| 438 | + | fprintf (stderr, "%s: cannot dump options to stream\n", CMDLINE_PARSER_PACKAGE); | 
| 439 | + | return EXIT_FAILURE; | 
| 440 | + | } | 
| 441 | + |  | 
| 442 | + | if (args_info->help_given) | 
| 443 | + | write_into_file(outfile, "help", 0, 0 ); | 
| 444 | + | if (args_info->version_given) | 
| 445 | + | write_into_file(outfile, "version", 0, 0 ); | 
| 446 | + | if (args_info->input_given) | 
| 447 | + | write_into_file(outfile, "input", args_info->input_orig, 0); | 
| 448 | + | if (args_info->output_given) | 
| 449 | + | write_into_file(outfile, "output", args_info->output_orig, 0); | 
| 450 | + | if (args_info->step_given) | 
| 451 | + | write_into_file(outfile, "step", args_info->step_orig, 0); | 
| 452 | + | if (args_info->nbins_given) | 
| 453 | + | write_into_file(outfile, "nbins", args_info->nbins_orig, 0); | 
| 454 | + | if (args_info->nbins_x_given) | 
| 455 | + | write_into_file(outfile, "nbins_x", args_info->nbins_x_orig, 0); | 
| 456 | + | if (args_info->nbins_y_given) | 
| 457 | + | write_into_file(outfile, "nbins_y", args_info->nbins_y_orig, 0); | 
| 458 | + | if (args_info->nbins_z_given) | 
| 459 | + | write_into_file(outfile, "nbins_z", args_info->nbins_z_orig, 0); | 
| 460 | + | if (args_info->nanglebins_given) | 
| 461 | + | write_into_file(outfile, "nanglebins", args_info->nanglebins_orig, 0); | 
| 462 | + | if (args_info->rcut_given) | 
| 463 | + | write_into_file(outfile, "rcut", args_info->rcut_orig, 0); | 
| 464 | + | if (args_info->dz_given) | 
| 465 | + | write_into_file(outfile, "dz", args_info->dz_orig, 0); | 
| 466 | + | if (args_info->length_given) | 
| 467 | + | write_into_file(outfile, "length", args_info->length_orig, 0); | 
| 468 | + | if (args_info->zlength_given) | 
| 469 | + | write_into_file(outfile, "zlength", args_info->zlength_orig, 0); | 
| 470 | + | if (args_info->zoffset_given) | 
| 471 | + | write_into_file(outfile, "zoffset", args_info->zoffset_orig, 0); | 
| 472 | + | if (args_info->sele1_given) | 
| 473 | + | write_into_file(outfile, "sele1", args_info->sele1_orig, 0); | 
| 474 | + | if (args_info->sele2_given) | 
| 475 | + | write_into_file(outfile, "sele2", args_info->sele2_orig, 0); | 
| 476 | + | if (args_info->sele3_given) | 
| 477 | + | write_into_file(outfile, "sele3", args_info->sele3_orig, 0); | 
| 478 | + | if (args_info->refsele_given) | 
| 479 | + | write_into_file(outfile, "refsele", args_info->refsele_orig, 0); | 
| 480 | + | if (args_info->comsele_given) | 
| 481 | + | write_into_file(outfile, "comsele", args_info->comsele_orig, 0); | 
| 482 | + | if (args_info->seleoffset_given) | 
| 483 | + | write_into_file(outfile, "seleoffset", args_info->seleoffset_orig, 0); | 
| 484 | + | if (args_info->seleoffset2_given) | 
| 485 | + | write_into_file(outfile, "seleoffset2", args_info->seleoffset2_orig, 0); | 
| 486 | + | if (args_info->molname_given) | 
| 487 | + | write_into_file(outfile, "molname", args_info->molname_orig, 0); | 
| 488 | + | if (args_info->begin_given) | 
| 489 | + | write_into_file(outfile, "begin", args_info->begin_orig, 0); | 
| 490 | + | if (args_info->end_given) | 
| 491 | + | write_into_file(outfile, "end", args_info->end_orig, 0); | 
| 492 | + | if (args_info->radius_given) | 
| 493 | + | write_into_file(outfile, "radius", args_info->radius_orig, 0); | 
| 494 | + | if (args_info->bo_given) | 
| 495 | + | write_into_file(outfile, "bo", 0, 0 ); | 
| 496 | + | if (args_info->ior_given) | 
| 497 | + | write_into_file(outfile, "ior", 0, 0 ); | 
| 498 | + | if (args_info->for_given) | 
| 499 | + | write_into_file(outfile, "for", 0, 0 ); | 
| 500 | + | if (args_info->bad_given) | 
| 501 | + | write_into_file(outfile, "bad", 0, 0 ); | 
| 502 | + | if (args_info->count_given) | 
| 503 | + | write_into_file(outfile, "count", 0, 0 ); | 
| 504 | + | if (args_info->gofr_given) | 
| 505 | + | write_into_file(outfile, "gofr", 0, 0 ); | 
| 506 | + | if (args_info->gofz_given) | 
| 507 | + | write_into_file(outfile, "gofz", 0, 0 ); | 
| 508 | + | if (args_info->r_theta_given) | 
| 509 | + | write_into_file(outfile, "r_theta", 0, 0 ); | 
| 510 | + | if (args_info->r_omega_given) | 
| 511 | + | write_into_file(outfile, "r_omega", 0, 0 ); | 
| 512 | + | if (args_info->r_z_given) | 
| 513 | + | write_into_file(outfile, "r_z", 0, 0 ); | 
| 514 | + | if (args_info->theta_omega_given) | 
| 515 | + | write_into_file(outfile, "theta_omega", 0, 0 ); | 
| 516 | + | if (args_info->gxyz_given) | 
| 517 | + | write_into_file(outfile, "gxyz", 0, 0 ); | 
| 518 | + | if (args_info->twodgofr_given) | 
| 519 | + | write_into_file(outfile, "twodgofr", 0, 0 ); | 
| 520 | + | if (args_info->p2_given) | 
| 521 | + | write_into_file(outfile, "p2", 0, 0 ); | 
| 522 | + | if (args_info->rp2_given) | 
| 523 | + | write_into_file(outfile, "rp2", 0, 0 ); | 
| 524 | + | if (args_info->scd_given) | 
| 525 | + | write_into_file(outfile, "scd", 0, 0 ); | 
| 526 | + | if (args_info->density_given) | 
| 527 | + | write_into_file(outfile, "density", 0, 0 ); | 
| 528 | + | if (args_info->slab_density_given) | 
| 529 | + | write_into_file(outfile, "slab_density", 0, 0 ); | 
| 530 | + | if (args_info->p_angle_given) | 
| 531 | + | write_into_file(outfile, "p_angle", 0, 0 ); | 
| 532 | + | if (args_info->hxy_given) | 
| 533 | + | write_into_file(outfile, "hxy", 0, 0 ); | 
| 534 | + | if (args_info->rho_r_given) | 
| 535 | + | write_into_file(outfile, "rho_r", 0, 0 ); | 
| 536 | + | if (args_info->angle_r_given) | 
| 537 | + | write_into_file(outfile, "angle_r", 0, 0 ); | 
| 538 | + | if (args_info->hullvol_given) | 
| 539 | + | write_into_file(outfile, "hullvol", 0, 0 ); | 
| 540 | + | if (args_info->rodlength_given) | 
| 541 | + | write_into_file(outfile, "rodlength", 0, 0 ); | 
| 542 | + | if (args_info->tet_param_given) | 
| 543 | + | write_into_file(outfile, "tet_param", 0, 0 ); | 
| 544 | + | if (args_info->tet_param_z_given) | 
| 545 | + | write_into_file(outfile, "tet_param_z", 0, 0 ); | 
| 546 | + | if (args_info->rnemdz_given) | 
| 547 | + | write_into_file(outfile, "rnemdz", 0, 0 ); | 
| 548 | + | if (args_info->rnemdr_given) | 
| 549 | + | write_into_file(outfile, "rnemdr", 0, 0 ); | 
| 550 | + | if (args_info->rnemdrt_given) | 
| 551 | + | write_into_file(outfile, "rnemdrt", 0, 0 ); | 
| 552 | + | if (args_info->nitrile_given) | 
| 553 | + | write_into_file(outfile, "nitrile", 0, 0 ); | 
| 554 | + | if (args_info->multipole_given) | 
| 555 | + | write_into_file(outfile, "multipole", 0, 0 ); | 
| 556 | + |  | 
| 557 | + |  | 
| 558 | + | i = EXIT_SUCCESS; | 
| 559 | + | return i; | 
| 560 | + | } | 
| 561 | + |  | 
| 562 | + | int | 
| 563 |  | cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_info) | 
| 564 |  | { | 
| 565 |  | FILE *outfile; | 
| 573 |  | return EXIT_FAILURE; | 
| 574 |  | } | 
| 575 |  |  | 
| 576 | < | if (args_info->help_given) { | 
| 399 | < | fprintf(outfile, "%s\n", "help"); | 
| 400 | < | } | 
| 401 | < | if (args_info->version_given) { | 
| 402 | < | fprintf(outfile, "%s\n", "version"); | 
| 403 | < | } | 
| 404 | < | if (args_info->input_given) { | 
| 405 | < | if (args_info->input_orig) { | 
| 406 | < | fprintf(outfile, "%s=\"%s\"\n", "input", args_info->input_orig); | 
| 407 | < | } else { | 
| 408 | < | fprintf(outfile, "%s\n", "input"); | 
| 409 | < | } | 
| 410 | < | } | 
| 411 | < | if (args_info->output_given) { | 
| 412 | < | if (args_info->output_orig) { | 
| 413 | < | fprintf(outfile, "%s=\"%s\"\n", "output", args_info->output_orig); | 
| 414 | < | } else { | 
| 415 | < | fprintf(outfile, "%s\n", "output"); | 
| 416 | < | } | 
| 417 | < | } | 
| 418 | < | if (args_info->step_given) { | 
| 419 | < | if (args_info->step_orig) { | 
| 420 | < | fprintf(outfile, "%s=\"%s\"\n", "step", args_info->step_orig); | 
| 421 | < | } else { | 
| 422 | < | fprintf(outfile, "%s\n", "step"); | 
| 423 | < | } | 
| 424 | < | } | 
| 425 | < | if (args_info->nbins_given) { | 
| 426 | < | if (args_info->nbins_orig) { | 
| 427 | < | fprintf(outfile, "%s=\"%s\"\n", "nbins", args_info->nbins_orig); | 
| 428 | < | } else { | 
| 429 | < | fprintf(outfile, "%s\n", "nbins"); | 
| 430 | < | } | 
| 431 | < | } | 
| 432 | < | if (args_info->nbins_x_given) { | 
| 433 | < | if (args_info->nbins_x_orig) { | 
| 434 | < | fprintf(outfile, "%s=\"%s\"\n", "nbins_x", args_info->nbins_x_orig); | 
| 435 | < | } else { | 
| 436 | < | fprintf(outfile, "%s\n", "nbins_x"); | 
| 437 | < | } | 
| 438 | < | } | 
| 439 | < | if (args_info->nbins_y_given) { | 
| 440 | < | if (args_info->nbins_y_orig) { | 
| 441 | < | fprintf(outfile, "%s=\"%s\"\n", "nbins_y", args_info->nbins_y_orig); | 
| 442 | < | } else { | 
| 443 | < | fprintf(outfile, "%s\n", "nbins_y"); | 
| 444 | < | } | 
| 445 | < | } | 
| 446 | < | if (args_info->nanglebins_given) { | 
| 447 | < | if (args_info->nanglebins_orig) { | 
| 448 | < | fprintf(outfile, "%s=\"%s\"\n", "nanglebins", args_info->nanglebins_orig); | 
| 449 | < | } else { | 
| 450 | < | fprintf(outfile, "%s\n", "nanglebins"); | 
| 451 | < | } | 
| 452 | < | } | 
| 453 | < | if (args_info->length_given) { | 
| 454 | < | if (args_info->length_orig) { | 
| 455 | < | fprintf(outfile, "%s=\"%s\"\n", "length", args_info->length_orig); | 
| 456 | < | } else { | 
| 457 | < | fprintf(outfile, "%s\n", "length"); | 
| 458 | < | } | 
| 459 | < | } | 
| 460 | < | if (args_info->rcut_given) { | 
| 461 | < | if (args_info->rcut_orig) { | 
| 462 | < | fprintf(outfile, "%s=\"%s\"\n", "rcut", args_info->rcut_orig); | 
| 463 | < | } else { | 
| 464 | < | fprintf(outfile, "%s\n", "rcut"); | 
| 465 | < | } | 
| 466 | < | } | 
| 467 | < | if (args_info->zoffset_given) { | 
| 468 | < | if (args_info->zoffset_orig) { | 
| 469 | < | fprintf(outfile, "%s=\"%s\"\n", "zoffset", args_info->zoffset_orig); | 
| 470 | < | } else { | 
| 471 | < | fprintf(outfile, "%s\n", "zoffset"); | 
| 472 | < | } | 
| 473 | < | } | 
| 474 | < | if (args_info->sele1_given) { | 
| 475 | < | if (args_info->sele1_orig) { | 
| 476 | < | fprintf(outfile, "%s=\"%s\"\n", "sele1", args_info->sele1_orig); | 
| 477 | < | } else { | 
| 478 | < | fprintf(outfile, "%s\n", "sele1"); | 
| 479 | < | } | 
| 480 | < | } | 
| 481 | < | if (args_info->sele2_given) { | 
| 482 | < | if (args_info->sele2_orig) { | 
| 483 | < | fprintf(outfile, "%s=\"%s\"\n", "sele2", args_info->sele2_orig); | 
| 484 | < | } else { | 
| 485 | < | fprintf(outfile, "%s\n", "sele2"); | 
| 486 | < | } | 
| 487 | < | } | 
| 488 | < | if (args_info->sele3_given) { | 
| 489 | < | if (args_info->sele3_orig) { | 
| 490 | < | fprintf(outfile, "%s=\"%s\"\n", "sele3", args_info->sele3_orig); | 
| 491 | < | } else { | 
| 492 | < | fprintf(outfile, "%s\n", "sele3"); | 
| 493 | < | } | 
| 494 | < | } | 
| 495 | < | if (args_info->refsele_given) { | 
| 496 | < | if (args_info->refsele_orig) { | 
| 497 | < | fprintf(outfile, "%s=\"%s\"\n", "refsele", args_info->refsele_orig); | 
| 498 | < | } else { | 
| 499 | < | fprintf(outfile, "%s\n", "refsele"); | 
| 500 | < | } | 
| 501 | < | } | 
| 502 | < | if (args_info->molname_given) { | 
| 503 | < | if (args_info->molname_orig) { | 
| 504 | < | fprintf(outfile, "%s=\"%s\"\n", "molname", args_info->molname_orig); | 
| 505 | < | } else { | 
| 506 | < | fprintf(outfile, "%s\n", "molname"); | 
| 507 | < | } | 
| 508 | < | } | 
| 509 | < | if (args_info->begin_given) { | 
| 510 | < | if (args_info->begin_orig) { | 
| 511 | < | fprintf(outfile, "%s=\"%s\"\n", "begin", args_info->begin_orig); | 
| 512 | < | } else { | 
| 513 | < | fprintf(outfile, "%s\n", "begin"); | 
| 514 | < | } | 
| 515 | < | } | 
| 516 | < | if (args_info->end_given) { | 
| 517 | < | if (args_info->end_orig) { | 
| 518 | < | fprintf(outfile, "%s=\"%s\"\n", "end", args_info->end_orig); | 
| 519 | < | } else { | 
| 520 | < | fprintf(outfile, "%s\n", "end"); | 
| 521 | < | } | 
| 522 | < | } | 
| 523 | < | if (args_info->radius_given) { | 
| 524 | < | if (args_info->radius_orig) { | 
| 525 | < | fprintf(outfile, "%s=\"%s\"\n", "radius", args_info->radius_orig); | 
| 526 | < | } else { | 
| 527 | < | fprintf(outfile, "%s\n", "radius"); | 
| 528 | < | } | 
| 529 | < | } | 
| 530 | < | if (args_info->bo_given) { | 
| 531 | < | fprintf(outfile, "%s\n", "bo"); | 
| 532 | < | } | 
| 533 | < | if (args_info->bor_given) { | 
| 534 | < | fprintf(outfile, "%s\n", "bor"); | 
| 535 | < | } | 
| 536 | < | if (args_info->bad_given) { | 
| 537 | < | fprintf(outfile, "%s\n", "bad"); | 
| 538 | < | } | 
| 539 | < | if (args_info->gofr_given) { | 
| 540 | < | fprintf(outfile, "%s\n", "gofr"); | 
| 541 | < | } | 
| 542 | < | if (args_info->gofz_given) { | 
| 543 | < | fprintf(outfile, "%s\n", "gofz"); | 
| 544 | < | } | 
| 545 | < | if (args_info->r_theta_given) { | 
| 546 | < | fprintf(outfile, "%s\n", "r_theta"); | 
| 547 | < | } | 
| 548 | < | if (args_info->r_omega_given) { | 
| 549 | < | fprintf(outfile, "%s\n", "r_omega"); | 
| 550 | < | } | 
| 551 | < | if (args_info->theta_omega_given) { | 
| 552 | < | fprintf(outfile, "%s\n", "theta_omega"); | 
| 553 | < | } | 
| 554 | < | if (args_info->gxyz_given) { | 
| 555 | < | fprintf(outfile, "%s\n", "gxyz"); | 
| 556 | < | } | 
| 557 | < | if (args_info->p2_given) { | 
| 558 | < | fprintf(outfile, "%s\n", "p2"); | 
| 559 | < | } | 
| 560 | < | if (args_info->rp2_given) { | 
| 561 | < | fprintf(outfile, "%s\n", "rp2"); | 
| 562 | < | } | 
| 563 | < | if (args_info->scd_given) { | 
| 564 | < | fprintf(outfile, "%s\n", "scd"); | 
| 565 | < | } | 
| 566 | < | if (args_info->density_given) { | 
| 567 | < | fprintf(outfile, "%s\n", "density"); | 
| 568 | < | } | 
| 569 | < | if (args_info->slab_density_given) { | 
| 570 | < | fprintf(outfile, "%s\n", "slab_density"); | 
| 571 | < | } | 
| 572 | < | if (args_info->hxy_given) { | 
| 573 | < | fprintf(outfile, "%s\n", "hxy"); | 
| 574 | < | } | 
| 575 | < | if (args_info->rho_r_given) { | 
| 576 | < | fprintf(outfile, "%s\n", "rho_r"); | 
| 577 | < | } | 
| 578 | < | if (args_info->hullvol_given) { | 
| 579 | < | fprintf(outfile, "%s\n", "hullvol"); | 
| 580 | < | } | 
| 581 | < |  | 
| 576 | > | i = cmdline_parser_dump(outfile, args_info); | 
| 577 |  | fclose (outfile); | 
| 578 |  |  | 
| 584 | – | i = EXIT_SUCCESS; | 
| 579 |  | return i; | 
| 580 |  | } | 
| 581 |  |  | 
| 585 |  | cmdline_parser_release (args_info); | 
| 586 |  | } | 
| 587 |  |  | 
| 588 | < |  | 
| 595 | < | /* gengetopt_strdup() */ | 
| 596 | < | /* strdup.c replacement of strdup, which is not standard */ | 
| 588 | > | /** @brief replacement of strdup, which is not standard */ | 
| 589 |  | char * | 
| 590 |  | gengetopt_strdup (const char *s) | 
| 591 |  | { | 
| 592 | < | char *result = NULL; | 
| 592 | > | char *result = 0; | 
| 593 |  | if (!s) | 
| 594 |  | return result; | 
| 595 |  |  | 
| 601 |  | } | 
| 602 |  |  | 
| 603 |  | static void | 
| 612 | – | reset_group_staticProps(struct gengetopt_args_info *args_info); | 
| 613 | – |  | 
| 614 | – | static void | 
| 604 |  | reset_group_staticProps(struct gengetopt_args_info *args_info) | 
| 605 |  | { | 
| 606 |  | if (! args_info->staticProps_group_counter) | 
| 607 |  | return; | 
| 608 |  |  | 
| 609 |  | args_info->bo_given = 0 ; | 
| 610 | < | args_info->bor_given = 0 ; | 
| 610 | > | args_info->ior_given = 0 ; | 
| 611 | > | args_info->for_given = 0 ; | 
| 612 |  | args_info->bad_given = 0 ; | 
| 613 | + | args_info->count_given = 0 ; | 
| 614 |  | args_info->gofr_given = 0 ; | 
| 615 |  | args_info->gofz_given = 0 ; | 
| 616 |  | args_info->r_theta_given = 0 ; | 
| 617 |  | args_info->r_omega_given = 0 ; | 
| 618 | + | args_info->r_z_given = 0 ; | 
| 619 |  | args_info->theta_omega_given = 0 ; | 
| 620 |  | args_info->gxyz_given = 0 ; | 
| 621 | + | args_info->twodgofr_given = 0 ; | 
| 622 |  | args_info->p2_given = 0 ; | 
| 623 |  | args_info->rp2_given = 0 ; | 
| 624 |  | args_info->scd_given = 0 ; | 
| 625 |  | args_info->density_given = 0 ; | 
| 626 |  | args_info->slab_density_given = 0 ; | 
| 627 | + | args_info->p_angle_given = 0 ; | 
| 628 |  | args_info->hxy_given = 0 ; | 
| 629 |  | args_info->rho_r_given = 0 ; | 
| 630 | + | args_info->angle_r_given = 0 ; | 
| 631 |  | args_info->hullvol_given = 0 ; | 
| 632 | + | args_info->rodlength_given = 0 ; | 
| 633 | + | args_info->tet_param_given = 0 ; | 
| 634 | + | args_info->tet_param_z_given = 0 ; | 
| 635 | + | args_info->rnemdz_given = 0 ; | 
| 636 | + | args_info->rnemdr_given = 0 ; | 
| 637 | + | args_info->rnemdrt_given = 0 ; | 
| 638 | + | args_info->nitrile_given = 0 ; | 
| 639 | + | args_info->multipole_given = 0 ; | 
| 640 |  |  | 
| 641 |  | args_info->staticProps_group_counter = 0; | 
| 642 |  | } | 
| 643 |  |  | 
| 644 |  | int | 
| 645 | < | cmdline_parser (int argc, char * const *argv, struct gengetopt_args_info *args_info) | 
| 645 | > | cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info) | 
| 646 |  | { | 
| 647 |  | return cmdline_parser2 (argc, argv, args_info, 0, 1, 1); | 
| 648 |  | } | 
| 649 |  |  | 
| 650 |  | int | 
| 651 | < | cmdline_parser2 (int argc, char * const *argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required) | 
| 651 | > | cmdline_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info, | 
| 652 | > | struct cmdline_parser_params *params) | 
| 653 |  | { | 
| 654 |  | int result; | 
| 655 | + | result = cmdline_parser_internal (argc, argv, args_info, params, 0); | 
| 656 |  |  | 
| 657 | < | result = cmdline_parser_internal (argc, argv, args_info, override, initialize, check_required, NULL); | 
| 657 | > | if (result == EXIT_FAILURE) | 
| 658 | > | { | 
| 659 | > | cmdline_parser_free (args_info); | 
| 660 | > | exit (EXIT_FAILURE); | 
| 661 | > | } | 
| 662 | > |  | 
| 663 | > | return result; | 
| 664 | > | } | 
| 665 |  |  | 
| 666 | + | int | 
| 667 | + | cmdline_parser2 (int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required) | 
| 668 | + | { | 
| 669 | + | int result; | 
| 670 | + | struct cmdline_parser_params params; | 
| 671 | + |  | 
| 672 | + | params.override = override; | 
| 673 | + | params.initialize = initialize; | 
| 674 | + | params.check_required = check_required; | 
| 675 | + | params.check_ambiguity = 0; | 
| 676 | + | params.print_errors = 1; | 
| 677 | + |  | 
| 678 | + | result = cmdline_parser_internal (argc, argv, args_info, ¶ms, 0); | 
| 679 | + |  | 
| 680 |  | if (result == EXIT_FAILURE) | 
| 681 |  | { | 
| 682 |  | cmdline_parser_free (args_info); | 
| 691 |  | { | 
| 692 |  | int result = EXIT_SUCCESS; | 
| 693 |  |  | 
| 694 | < | if (cmdline_parser_required2(args_info, prog_name, NULL) > 0) | 
| 694 | > | if (cmdline_parser_required2(args_info, prog_name, 0) > 0) | 
| 695 |  | result = EXIT_FAILURE; | 
| 696 |  |  | 
| 697 |  | if (result == EXIT_FAILURE) | 
| 707 |  | cmdline_parser_required2 (struct gengetopt_args_info *args_info, const char *prog_name, const char *additional_error) | 
| 708 |  | { | 
| 709 |  | int error = 0; | 
| 710 | + | FIX_UNUSED (additional_error); | 
| 711 |  |  | 
| 712 |  | /* checks for required options */ | 
| 713 |  | if (! args_info->input_given) | 
| 718 |  |  | 
| 719 |  | if (args_info->staticProps_group_counter == 0) | 
| 720 |  | { | 
| 721 | < | fprintf (stderr, "%s: %d options of group staticProps were given. One is required.%s\n", prog_name, args_info->staticProps_group_counter, (additional_error ? additional_error : "")); | 
| 721 | > | fprintf (stderr, "%s: %d options of group staticProps were given. One is required%s.\n", prog_name, args_info->staticProps_group_counter, (additional_error ? additional_error : "")); | 
| 722 |  | error = 1; | 
| 723 |  | } | 
| 724 |  |  | 
| 728 |  | return error; | 
| 729 |  | } | 
| 730 |  |  | 
| 731 | + |  | 
| 732 | + | static char *package_name = 0; | 
| 733 | + |  | 
| 734 | + | /** | 
| 735 | + | * @brief updates an option | 
| 736 | + | * @param field the generic pointer to the field to update | 
| 737 | + | * @param orig_field the pointer to the orig field | 
| 738 | + | * @param field_given the pointer to the number of occurrence of this option | 
| 739 | + | * @param prev_given the pointer to the number of occurrence already seen | 
| 740 | + | * @param value the argument for this option (if null no arg was specified) | 
| 741 | + | * @param possible_values the possible values for this option (if specified) | 
| 742 | + | * @param default_value the default value (in case the option only accepts fixed values) | 
| 743 | + | * @param arg_type the type of this option | 
| 744 | + | * @param check_ambiguity @see cmdline_parser_params.check_ambiguity | 
| 745 | + | * @param override @see cmdline_parser_params.override | 
| 746 | + | * @param no_free whether to free a possible previous value | 
| 747 | + | * @param multiple_option whether this is a multiple option | 
| 748 | + | * @param long_opt the corresponding long option | 
| 749 | + | * @param short_opt the corresponding short option (or '-' if none) | 
| 750 | + | * @param additional_error possible further error specification | 
| 751 | + | */ | 
| 752 | + | static | 
| 753 | + | int update_arg(void *field, char **orig_field, | 
| 754 | + | unsigned int *field_given, unsigned int *prev_given, | 
| 755 | + | char *value, const char *possible_values[], | 
| 756 | + | const char *default_value, | 
| 757 | + | cmdline_parser_arg_type arg_type, | 
| 758 | + | int check_ambiguity, int override, | 
| 759 | + | int no_free, int multiple_option, | 
| 760 | + | const char *long_opt, char short_opt, | 
| 761 | + | const char *additional_error) | 
| 762 | + | { | 
| 763 | + | char *stop_char = 0; | 
| 764 | + | const char *val = value; | 
| 765 | + | int found; | 
| 766 | + | char **string_field; | 
| 767 | + | FIX_UNUSED (field); | 
| 768 | + |  | 
| 769 | + | stop_char = 0; | 
| 770 | + | found = 0; | 
| 771 | + |  | 
| 772 | + | if (!multiple_option && prev_given && (*prev_given || (check_ambiguity && *field_given))) | 
| 773 | + | { | 
| 774 | + | if (short_opt != '-') | 
| 775 | + | fprintf (stderr, "%s: `--%s' (`-%c') option given more than once%s\n", | 
| 776 | + | package_name, long_opt, short_opt, | 
| 777 | + | (additional_error ? additional_error : "")); | 
| 778 | + | else | 
| 779 | + | fprintf (stderr, "%s: `--%s' option given more than once%s\n", | 
| 780 | + | package_name, long_opt, | 
| 781 | + | (additional_error ? additional_error : "")); | 
| 782 | + | return 1; /* failure */ | 
| 783 | + | } | 
| 784 | + |  | 
| 785 | + | FIX_UNUSED (default_value); | 
| 786 | + |  | 
| 787 | + | if (field_given && *field_given && ! override) | 
| 788 | + | return 0; | 
| 789 | + | if (prev_given) | 
| 790 | + | (*prev_given)++; | 
| 791 | + | if (field_given) | 
| 792 | + | (*field_given)++; | 
| 793 | + | if (possible_values) | 
| 794 | + | val = possible_values[found]; | 
| 795 | + |  | 
| 796 | + | switch(arg_type) { | 
| 797 | + | case ARG_INT: | 
| 798 | + | if (val) *((int *)field) = strtol (val, &stop_char, 0); | 
| 799 | + | break; | 
| 800 | + | case ARG_DOUBLE: | 
| 801 | + | if (val) *((double *)field) = strtod (val, &stop_char); | 
| 802 | + | break; | 
| 803 | + | case ARG_STRING: | 
| 804 | + | if (val) { | 
| 805 | + | string_field = (char **)field; | 
| 806 | + | if (!no_free && *string_field) | 
| 807 | + | free (*string_field); /* free previous string */ | 
| 808 | + | *string_field = gengetopt_strdup (val); | 
| 809 | + | } | 
| 810 | + | break; | 
| 811 | + | default: | 
| 812 | + | break; | 
| 813 | + | }; | 
| 814 | + |  | 
| 815 | + | /* check numeric conversion */ | 
| 816 | + | switch(arg_type) { | 
| 817 | + | case ARG_INT: | 
| 818 | + | case ARG_DOUBLE: | 
| 819 | + | if (val && !(stop_char && *stop_char == '\0')) { | 
| 820 | + | fprintf(stderr, "%s: invalid numeric value: %s\n", package_name, val); | 
| 821 | + | return 1; /* failure */ | 
| 822 | + | } | 
| 823 | + | break; | 
| 824 | + | default: | 
| 825 | + | ; | 
| 826 | + | }; | 
| 827 | + |  | 
| 828 | + | /* store the original value */ | 
| 829 | + | switch(arg_type) { | 
| 830 | + | case ARG_NO: | 
| 831 | + | break; | 
| 832 | + | default: | 
| 833 | + | if (value && orig_field) { | 
| 834 | + | if (no_free) { | 
| 835 | + | *orig_field = value; | 
| 836 | + | } else { | 
| 837 | + | if (*orig_field) | 
| 838 | + | free (*orig_field); /* free previous string */ | 
| 839 | + | *orig_field = gengetopt_strdup (value); | 
| 840 | + | } | 
| 841 | + | } | 
| 842 | + | }; | 
| 843 | + |  | 
| 844 | + | return 0; /* OK */ | 
| 845 | + | } | 
| 846 | + |  | 
| 847 | + |  | 
| 848 |  | int | 
| 849 | < | cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required, const char *additional_error) | 
| 849 | > | cmdline_parser_internal ( | 
| 850 | > | int argc, char **argv, struct gengetopt_args_info *args_info, | 
| 851 | > | struct cmdline_parser_params *params, const char *additional_error) | 
| 852 |  | { | 
| 853 |  | int c;        /* Character of the parsed option.  */ | 
| 854 |  |  | 
| 855 |  | int error = 0; | 
| 856 |  | struct gengetopt_args_info local_args_info; | 
| 857 | + |  | 
| 858 | + | int override; | 
| 859 | + | int initialize; | 
| 860 | + | int check_required; | 
| 861 | + | int check_ambiguity; | 
| 862 | + |  | 
| 863 | + | package_name = argv[0]; | 
| 864 | + |  | 
| 865 | + | override = params->override; | 
| 866 | + | initialize = params->initialize; | 
| 867 | + | check_required = params->check_required; | 
| 868 | + | check_ambiguity = params->check_ambiguity; | 
| 869 |  |  | 
| 870 |  | if (initialize) | 
| 871 |  | cmdline_parser_init (args_info); | 
| 874 |  |  | 
| 875 |  | optarg = 0; | 
| 876 |  | optind = 0; | 
| 877 | < | opterr = 1; | 
| 877 | > | opterr = params->print_errors; | 
| 878 |  | optopt = '?'; | 
| 879 |  |  | 
| 880 |  | while (1) | 
| 881 |  | { | 
| 882 |  | int option_index = 0; | 
| 725 | – | char *stop_char; | 
| 883 |  |  | 
| 884 |  | static struct option long_options[] = { | 
| 885 |  | { "help",       0, NULL, 'h' }, | 
| 890 |  | { "nbins",      1, NULL, 'b' }, | 
| 891 |  | { "nbins_x",    1, NULL, 'x' }, | 
| 892 |  | { "nbins_y",    1, NULL, 'y' }, | 
| 893 | + | { "nbins_z",    1, NULL, 0 }, | 
| 894 |  | { "nanglebins", 1, NULL, 'a' }, | 
| 737 | – | { "length",     1, NULL, 0 }, | 
| 895 |  | { "rcut",       1, NULL, 'c' }, | 
| 896 | + | { "dz", 1, NULL, 0 }, | 
| 897 | + | { "length",     1, NULL, 0 }, | 
| 898 | + | { "zlength",    1, NULL, 0 }, | 
| 899 |  | { "zoffset",    1, NULL, 'z' }, | 
| 900 |  | { "sele1",      1, NULL, 0 }, | 
| 901 |  | { "sele2",      1, NULL, 0 }, | 
| 902 |  | { "sele3",      1, NULL, 0 }, | 
| 903 |  | { "refsele",    1, NULL, 0 }, | 
| 904 | + | { "comsele",    1, NULL, 0 }, | 
| 905 | + | { "seleoffset", 1, NULL, 0 }, | 
| 906 | + | { "seleoffset2",        1, NULL, 0 }, | 
| 907 |  | { "molname",    1, NULL, 0 }, | 
| 908 |  | { "begin",      1, NULL, 0 }, | 
| 909 |  | { "end",        1, NULL, 0 }, | 
| 910 |  | { "radius",     1, NULL, 0 }, | 
| 911 |  | { "bo", 0, NULL, 0 }, | 
| 912 | < | { "bor",        0, NULL, 0 }, | 
| 912 | > | { "ior",        0, NULL, 0 }, | 
| 913 | > | { "for",        0, NULL, 0 }, | 
| 914 |  | { "bad",        0, NULL, 0 }, | 
| 915 | + | { "count",      0, NULL, 0 }, | 
| 916 |  | { "gofr",       0, NULL, 'g' }, | 
| 917 |  | { "gofz",       0, NULL, 0 }, | 
| 918 |  | { "r_theta",    0, NULL, 0 }, | 
| 919 |  | { "r_omega",    0, NULL, 0 }, | 
| 920 | + | { "r_z",        0, NULL, 0 }, | 
| 921 |  | { "theta_omega",        0, NULL, 0 }, | 
| 922 |  | { "gxyz",       0, NULL, 0 }, | 
| 923 | + | { "twodgofr",   0, NULL, 0 }, | 
| 924 |  | { "p2", 0, NULL, 'p' }, | 
| 925 |  | { "rp2",        0, NULL, 0 }, | 
| 926 |  | { "scd",        0, NULL, 's' }, | 
| 927 |  | { "density",    0, NULL, 'd' }, | 
| 928 |  | { "slab_density",       0, NULL, 0 }, | 
| 929 | + | { "p_angle",    0, NULL, 0 }, | 
| 930 |  | { "hxy",        0, NULL, 0 }, | 
| 931 |  | { "rho_r",      0, NULL, 0 }, | 
| 932 | + | { "angle_r",    0, NULL, 0 }, | 
| 933 |  | { "hullvol",    0, NULL, 0 }, | 
| 934 | < | { NULL, 0, NULL, 0 } | 
| 934 | > | { "rodlength",  0, NULL, 0 }, | 
| 935 | > | { "tet_param",  0, NULL, 'Q' }, | 
| 936 | > | { "tet_param_z",        0, NULL, 0 }, | 
| 937 | > | { "rnemdz",     0, NULL, 0 }, | 
| 938 | > | { "rnemdr",     0, NULL, 0 }, | 
| 939 | > | { "rnemdrt",    0, NULL, 0 }, | 
| 940 | > | { "nitrile",    0, NULL, 0 }, | 
| 941 | > | { "multipole",  0, NULL, 'm' }, | 
| 942 | > | { 0,  0, 0, 0 } | 
| 943 |  | }; | 
| 944 |  |  | 
| 945 | < | stop_char = 0; | 
| 769 | < | c = getopt_long (argc, argv, "hVi:o:n:b:x:y:a:c:z:gpsd", long_options, &option_index); | 
| 945 | > | c = getopt_long (argc, argv, "hVi:o:n:b:x:y:a:c:z:gpsdQm", long_options, &option_index); | 
| 946 |  |  | 
| 947 |  | if (c == -1) break;       /* Exit from `while (1)' loop.  */ | 
| 948 |  |  | 
| 959 |  | exit (EXIT_SUCCESS); | 
| 960 |  |  | 
| 961 |  | case 'i':       /* input dump file.  */ | 
| 962 | < | if (local_args_info.input_given) | 
| 963 | < | { | 
| 964 | < | fprintf (stderr, "%s: `--input' (`-i') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); | 
| 965 | < | goto failure; | 
| 966 | < | } | 
| 967 | < | if (args_info->input_given && ! override) | 
| 968 | < | continue; | 
| 969 | < | local_args_info.input_given = 1; | 
| 970 | < | args_info->input_given = 1; | 
| 971 | < | if (args_info->input_arg) | 
| 796 | < | free (args_info->input_arg); /* free previous string */ | 
| 797 | < | args_info->input_arg = gengetopt_strdup (optarg); | 
| 798 | < | if (args_info->input_orig) | 
| 799 | < | free (args_info->input_orig); /* free previous string */ | 
| 800 | < | args_info->input_orig = gengetopt_strdup (optarg); | 
| 962 | > |  | 
| 963 | > |  | 
| 964 | > | if (update_arg( (void *)&(args_info->input_arg), | 
| 965 | > | &(args_info->input_orig), &(args_info->input_given), | 
| 966 | > | &(local_args_info.input_given), optarg, 0, 0, ARG_STRING, | 
| 967 | > | check_ambiguity, override, 0, 0, | 
| 968 | > | "input", 'i', | 
| 969 | > | additional_error)) | 
| 970 | > | goto failure; | 
| 971 | > |  | 
| 972 |  | break; | 
| 802 | – |  | 
| 973 |  | case 'o':       /* output file name.  */ | 
| 974 | < | if (local_args_info.output_given) | 
| 975 | < | { | 
| 976 | < | fprintf (stderr, "%s: `--output' (`-o') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); | 
| 977 | < | goto failure; | 
| 978 | < | } | 
| 979 | < | if (args_info->output_given && ! override) | 
| 980 | < | continue; | 
| 981 | < | local_args_info.output_given = 1; | 
| 982 | < | args_info->output_given = 1; | 
| 983 | < | if (args_info->output_arg) | 
| 814 | < | free (args_info->output_arg); /* free previous string */ | 
| 815 | < | args_info->output_arg = gengetopt_strdup (optarg); | 
| 816 | < | if (args_info->output_orig) | 
| 817 | < | free (args_info->output_orig); /* free previous string */ | 
| 818 | < | args_info->output_orig = gengetopt_strdup (optarg); | 
| 974 | > |  | 
| 975 | > |  | 
| 976 | > | if (update_arg( (void *)&(args_info->output_arg), | 
| 977 | > | &(args_info->output_orig), &(args_info->output_given), | 
| 978 | > | &(local_args_info.output_given), optarg, 0, 0, ARG_STRING, | 
| 979 | > | check_ambiguity, override, 0, 0, | 
| 980 | > | "output", 'o', | 
| 981 | > | additional_error)) | 
| 982 | > | goto failure; | 
| 983 | > |  | 
| 984 |  | break; | 
| 820 | – |  | 
| 985 |  | case 'n':       /* process every n frame.  */ | 
| 986 | < | if (local_args_info.step_given) | 
| 987 | < | { | 
| 988 | < | fprintf (stderr, "%s: `--step' (`-n') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); | 
| 989 | < | goto failure; | 
| 990 | < | } | 
| 991 | < | if (args_info->step_given && ! override) | 
| 992 | < | continue; | 
| 993 | < | local_args_info.step_given = 1; | 
| 830 | < | args_info->step_given = 1; | 
| 831 | < | args_info->step_arg = strtol (optarg, &stop_char, 0); | 
| 832 | < | if (!(stop_char && *stop_char == '\0')) { | 
| 833 | < | fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); | 
| 986 | > |  | 
| 987 | > |  | 
| 988 | > | if (update_arg( (void *)&(args_info->step_arg), | 
| 989 | > | &(args_info->step_orig), &(args_info->step_given), | 
| 990 | > | &(local_args_info.step_given), optarg, 0, "1", ARG_INT, | 
| 991 | > | check_ambiguity, override, 0, 0, | 
| 992 | > | "step", 'n', | 
| 993 | > | additional_error)) | 
| 994 |  | goto failure; | 
| 995 | < | } | 
| 836 | < | if (args_info->step_orig) | 
| 837 | < | free (args_info->step_orig); /* free previous string */ | 
| 838 | < | args_info->step_orig = gengetopt_strdup (optarg); | 
| 995 | > |  | 
| 996 |  | break; | 
| 840 | – |  | 
| 997 |  | case 'b':       /* number of bins (general purpose).  */ | 
| 998 | < | if (local_args_info.nbins_given) | 
| 999 | < | { | 
| 1000 | < | fprintf (stderr, "%s: `--nbins' (`-b') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); | 
| 1001 | < | goto failure; | 
| 1002 | < | } | 
| 1003 | < | if (args_info->nbins_given && ! override) | 
| 1004 | < | continue; | 
| 1005 | < | local_args_info.nbins_given = 1; | 
| 850 | < | args_info->nbins_given = 1; | 
| 851 | < | args_info->nbins_arg = strtol (optarg, &stop_char, 0); | 
| 852 | < | if (!(stop_char && *stop_char == '\0')) { | 
| 853 | < | fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); | 
| 998 | > |  | 
| 999 | > |  | 
| 1000 | > | if (update_arg( (void *)&(args_info->nbins_arg), | 
| 1001 | > | &(args_info->nbins_orig), &(args_info->nbins_given), | 
| 1002 | > | &(local_args_info.nbins_given), optarg, 0, "100", ARG_INT, | 
| 1003 | > | check_ambiguity, override, 0, 0, | 
| 1004 | > | "nbins", 'b', | 
| 1005 | > | additional_error)) | 
| 1006 |  | goto failure; | 
| 1007 | < | } | 
| 856 | < | if (args_info->nbins_orig) | 
| 857 | < | free (args_info->nbins_orig); /* free previous string */ | 
| 858 | < | args_info->nbins_orig = gengetopt_strdup (optarg); | 
| 1007 | > |  | 
| 1008 |  | break; | 
| 860 | – |  | 
| 1009 |  | case 'x':       /* number of bins in x axis.  */ | 
| 1010 | < | if (local_args_info.nbins_x_given) | 
| 1011 | < | { | 
| 1012 | < | fprintf (stderr, "%s: `--nbins_x' (`-x') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); | 
| 1013 | < | goto failure; | 
| 1014 | < | } | 
| 1015 | < | if (args_info->nbins_x_given && ! override) | 
| 1016 | < | continue; | 
| 1017 | < | local_args_info.nbins_x_given = 1; | 
| 870 | < | args_info->nbins_x_given = 1; | 
| 871 | < | args_info->nbins_x_arg = strtol (optarg, &stop_char, 0); | 
| 872 | < | if (!(stop_char && *stop_char == '\0')) { | 
| 873 | < | fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); | 
| 1010 | > |  | 
| 1011 | > |  | 
| 1012 | > | if (update_arg( (void *)&(args_info->nbins_x_arg), | 
| 1013 | > | &(args_info->nbins_x_orig), &(args_info->nbins_x_given), | 
| 1014 | > | &(local_args_info.nbins_x_given), optarg, 0, "100", ARG_INT, | 
| 1015 | > | check_ambiguity, override, 0, 0, | 
| 1016 | > | "nbins_x", 'x', | 
| 1017 | > | additional_error)) | 
| 1018 |  | goto failure; | 
| 1019 | < | } | 
| 876 | < | if (args_info->nbins_x_orig) | 
| 877 | < | free (args_info->nbins_x_orig); /* free previous string */ | 
| 878 | < | args_info->nbins_x_orig = gengetopt_strdup (optarg); | 
| 1019 | > |  | 
| 1020 |  | break; | 
| 880 | – |  | 
| 1021 |  | case 'y':       /* number of bins in y axis.  */ | 
| 1022 | < | if (local_args_info.nbins_y_given) | 
| 1023 | < | { | 
| 1024 | < | fprintf (stderr, "%s: `--nbins_y' (`-y') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); | 
| 1025 | < | goto failure; | 
| 1026 | < | } | 
| 1027 | < | if (args_info->nbins_y_given && ! override) | 
| 1028 | < | continue; | 
| 1029 | < | local_args_info.nbins_y_given = 1; | 
| 890 | < | args_info->nbins_y_given = 1; | 
| 891 | < | args_info->nbins_y_arg = strtol (optarg, &stop_char, 0); | 
| 892 | < | if (!(stop_char && *stop_char == '\0')) { | 
| 893 | < | fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); | 
| 1022 | > |  | 
| 1023 | > |  | 
| 1024 | > | if (update_arg( (void *)&(args_info->nbins_y_arg), | 
| 1025 | > | &(args_info->nbins_y_orig), &(args_info->nbins_y_given), | 
| 1026 | > | &(local_args_info.nbins_y_given), optarg, 0, "100", ARG_INT, | 
| 1027 | > | check_ambiguity, override, 0, 0, | 
| 1028 | > | "nbins_y", 'y', | 
| 1029 | > | additional_error)) | 
| 1030 |  | goto failure; | 
| 1031 | < | } | 
| 896 | < | if (args_info->nbins_y_orig) | 
| 897 | < | free (args_info->nbins_y_orig); /* free previous string */ | 
| 898 | < | args_info->nbins_y_orig = gengetopt_strdup (optarg); | 
| 1031 | > |  | 
| 1032 |  | break; | 
| 900 | – |  | 
| 1033 |  | case 'a':       /* number of bins for cos(angle).  */ | 
| 1034 | < | if (local_args_info.nanglebins_given) | 
| 1035 | < | { | 
| 1036 | < | fprintf (stderr, "%s: `--nanglebins' (`-a') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); | 
| 1037 | < | goto failure; | 
| 1038 | < | } | 
| 1039 | < | if (args_info->nanglebins_given && ! override) | 
| 1040 | < | continue; | 
| 1041 | < | local_args_info.nanglebins_given = 1; | 
| 910 | < | args_info->nanglebins_given = 1; | 
| 911 | < | args_info->nanglebins_arg = strtol (optarg, &stop_char, 0); | 
| 912 | < | if (!(stop_char && *stop_char == '\0')) { | 
| 913 | < | fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); | 
| 1034 | > |  | 
| 1035 | > |  | 
| 1036 | > | if (update_arg( (void *)&(args_info->nanglebins_arg), | 
| 1037 | > | &(args_info->nanglebins_orig), &(args_info->nanglebins_given), | 
| 1038 | > | &(local_args_info.nanglebins_given), optarg, 0, "50", ARG_INT, | 
| 1039 | > | check_ambiguity, override, 0, 0, | 
| 1040 | > | "nanglebins", 'a', | 
| 1041 | > | additional_error)) | 
| 1042 |  | goto failure; | 
| 1043 | < | } | 
| 916 | < | if (args_info->nanglebins_orig) | 
| 917 | < | free (args_info->nanglebins_orig); /* free previous string */ | 
| 918 | < | args_info->nanglebins_orig = gengetopt_strdup (optarg); | 
| 1043 | > |  | 
| 1044 |  | break; | 
| 920 | – |  | 
| 1045 |  | case 'c':       /* cutoff radius (rcut).  */ | 
| 1046 | < | if (local_args_info.rcut_given) | 
| 1047 | < | { | 
| 1048 | < | fprintf (stderr, "%s: `--rcut' (`-c') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); | 
| 1049 | < | goto failure; | 
| 1050 | < | } | 
| 1051 | < | if (args_info->rcut_given && ! override) | 
| 1052 | < | continue; | 
| 1053 | < | local_args_info.rcut_given = 1; | 
| 930 | < | args_info->rcut_given = 1; | 
| 931 | < | args_info->rcut_arg = strtod (optarg, &stop_char); | 
| 932 | < | if (!(stop_char && *stop_char == '\0')) { | 
| 933 | < | fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); | 
| 1046 | > |  | 
| 1047 | > |  | 
| 1048 | > | if (update_arg( (void *)&(args_info->rcut_arg), | 
| 1049 | > | &(args_info->rcut_orig), &(args_info->rcut_given), | 
| 1050 | > | &(local_args_info.rcut_given), optarg, 0, 0, ARG_DOUBLE, | 
| 1051 | > | check_ambiguity, override, 0, 0, | 
| 1052 | > | "rcut", 'c', | 
| 1053 | > | additional_error)) | 
| 1054 |  | goto failure; | 
| 1055 | < | } | 
| 936 | < | if (args_info->rcut_orig) | 
| 937 | < | free (args_info->rcut_orig); /* free previous string */ | 
| 938 | < | args_info->rcut_orig = gengetopt_strdup (optarg); | 
| 1055 | > |  | 
| 1056 |  | break; | 
| 940 | – |  | 
| 1057 |  | case 'z':       /* Where to set the zero for the slab_density calculation.  */ | 
| 1058 | < | if (local_args_info.zoffset_given) | 
| 1059 | < | { | 
| 1060 | < | fprintf (stderr, "%s: `--zoffset' (`-z') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); | 
| 1061 | < | goto failure; | 
| 1062 | < | } | 
| 1063 | < | if (args_info->zoffset_given && ! override) | 
| 1064 | < | continue; | 
| 1065 | < | local_args_info.zoffset_given = 1; | 
| 950 | < | args_info->zoffset_given = 1; | 
| 951 | < | args_info->zoffset_arg = strtod (optarg, &stop_char); | 
| 952 | < | if (!(stop_char && *stop_char == '\0')) { | 
| 953 | < | fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); | 
| 1058 | > |  | 
| 1059 | > |  | 
| 1060 | > | if (update_arg( (void *)&(args_info->zoffset_arg), | 
| 1061 | > | &(args_info->zoffset_orig), &(args_info->zoffset_given), | 
| 1062 | > | &(local_args_info.zoffset_given), optarg, 0, "0", ARG_DOUBLE, | 
| 1063 | > | check_ambiguity, override, 0, 0, | 
| 1064 | > | "zoffset", 'z', | 
| 1065 | > | additional_error)) | 
| 1066 |  | goto failure; | 
| 1067 | < | } | 
| 956 | < | if (args_info->zoffset_orig) | 
| 957 | < | free (args_info->zoffset_orig); /* free previous string */ | 
| 958 | < | args_info->zoffset_orig = gengetopt_strdup (optarg); | 
| 1067 | > |  | 
| 1068 |  | break; | 
| 960 | – |  | 
| 1069 |  | case 'g':       /* g(r).  */ | 
| 1070 | < | if (local_args_info.gofr_given) | 
| 963 | < | { | 
| 964 | < | fprintf (stderr, "%s: `--gofr' (`-g') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); | 
| 965 | < | goto failure; | 
| 966 | < | } | 
| 967 | < | if (args_info->gofr_given && ! override) | 
| 968 | < | continue; | 
| 969 | < | local_args_info.gofr_given = 1; | 
| 970 | < | args_info->gofr_given = 1; | 
| 1070 | > |  | 
| 1071 |  | if (args_info->staticProps_group_counter && override) | 
| 1072 |  | reset_group_staticProps (args_info); | 
| 1073 |  | args_info->staticProps_group_counter += 1; | 
| 1074 | + |  | 
| 1075 | + | if (update_arg( 0 , | 
| 1076 | + | 0 , &(args_info->gofr_given), | 
| 1077 | + | &(local_args_info.gofr_given), optarg, 0, 0, ARG_NO, | 
| 1078 | + | check_ambiguity, override, 0, 0, | 
| 1079 | + | "gofr", 'g', | 
| 1080 | + | additional_error)) | 
| 1081 | + | goto failure; | 
| 1082 | + |  | 
| 1083 |  | break; | 
| 1084 | < |  | 
| 1085 | < | case 'p':       /* p2 order parameter (--sele1 and --sele2 must be specified).  */ | 
| 977 | < | if (local_args_info.p2_given) | 
| 978 | < | { | 
| 979 | < | fprintf (stderr, "%s: `--p2' (`-p') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); | 
| 980 | < | goto failure; | 
| 981 | < | } | 
| 982 | < | if (args_info->p2_given && ! override) | 
| 983 | < | continue; | 
| 984 | < | local_args_info.p2_given = 1; | 
| 985 | < | args_info->p2_given = 1; | 
| 1084 | > | case 'p':       /* p2 order parameter (--sele1 must be specified, --sele2 is optional).  */ | 
| 1085 | > |  | 
| 1086 |  | if (args_info->staticProps_group_counter && override) | 
| 1087 |  | reset_group_staticProps (args_info); | 
| 1088 |  | args_info->staticProps_group_counter += 1; | 
| 1089 | + |  | 
| 1090 | + | if (update_arg( 0 , | 
| 1091 | + | 0 , &(args_info->p2_given), | 
| 1092 | + | &(local_args_info.p2_given), optarg, 0, 0, ARG_NO, | 
| 1093 | + | check_ambiguity, override, 0, 0, | 
| 1094 | + | "p2", 'p', | 
| 1095 | + | additional_error)) | 
| 1096 | + | goto failure; | 
| 1097 | + |  | 
| 1098 |  | break; | 
| 990 | – |  | 
| 1099 |  | case 's':       /* scd order parameter (either --sele1, --sele2, --sele3 are specified or --molname, --begin, --end are specified).  */ | 
| 1100 | < | if (local_args_info.scd_given) | 
| 993 | < | { | 
| 994 | < | fprintf (stderr, "%s: `--scd' (`-s') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); | 
| 995 | < | goto failure; | 
| 996 | < | } | 
| 997 | < | if (args_info->scd_given && ! override) | 
| 998 | < | continue; | 
| 999 | < | local_args_info.scd_given = 1; | 
| 1000 | < | args_info->scd_given = 1; | 
| 1100 | > |  | 
| 1101 |  | if (args_info->staticProps_group_counter && override) | 
| 1102 |  | reset_group_staticProps (args_info); | 
| 1103 |  | args_info->staticProps_group_counter += 1; | 
| 1104 | + |  | 
| 1105 | + | if (update_arg( 0 , | 
| 1106 | + | 0 , &(args_info->scd_given), | 
| 1107 | + | &(local_args_info.scd_given), optarg, 0, 0, ARG_NO, | 
| 1108 | + | check_ambiguity, override, 0, 0, | 
| 1109 | + | "scd", 's', | 
| 1110 | + | additional_error)) | 
| 1111 | + | goto failure; | 
| 1112 | + |  | 
| 1113 |  | break; | 
| 1005 | – |  | 
| 1114 |  | case 'd':       /* density plot.  */ | 
| 1115 | < | if (local_args_info.density_given) | 
| 1008 | < | { | 
| 1009 | < | fprintf (stderr, "%s: `--density' (`-d') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); | 
| 1010 | < | goto failure; | 
| 1011 | < | } | 
| 1012 | < | if (args_info->density_given && ! override) | 
| 1013 | < | continue; | 
| 1014 | < | local_args_info.density_given = 1; | 
| 1015 | < | args_info->density_given = 1; | 
| 1115 | > |  | 
| 1116 |  | if (args_info->staticProps_group_counter && override) | 
| 1117 |  | reset_group_staticProps (args_info); | 
| 1118 |  | args_info->staticProps_group_counter += 1; | 
| 1119 | + |  | 
| 1120 | + | if (update_arg( 0 , | 
| 1121 | + | 0 , &(args_info->density_given), | 
| 1122 | + | &(local_args_info.density_given), optarg, 0, 0, ARG_NO, | 
| 1123 | + | check_ambiguity, override, 0, 0, | 
| 1124 | + | "density", 'd', | 
| 1125 | + | additional_error)) | 
| 1126 | + | goto failure; | 
| 1127 | + |  | 
| 1128 |  | break; | 
| 1129 | + | case 'Q':       /* tetrahedrality order parameter (Qk).  */ | 
| 1130 | + |  | 
| 1131 | + | if (args_info->staticProps_group_counter && override) | 
| 1132 | + | reset_group_staticProps (args_info); | 
| 1133 | + | args_info->staticProps_group_counter += 1; | 
| 1134 | + |  | 
| 1135 | + | if (update_arg( 0 , | 
| 1136 | + | 0 , &(args_info->tet_param_given), | 
| 1137 | + | &(local_args_info.tet_param_given), optarg, 0, 0, ARG_NO, | 
| 1138 | + | check_ambiguity, override, 0, 0, | 
| 1139 | + | "tet_param", 'Q', | 
| 1140 | + | additional_error)) | 
| 1141 | + | goto failure; | 
| 1142 | + |  | 
| 1143 | + | break; | 
| 1144 | + | case 'm':       /* average multipole moments contained within cutoff spheres as a function of radius.  */ | 
| 1145 | + |  | 
| 1146 | + | if (args_info->staticProps_group_counter && override) | 
| 1147 | + | reset_group_staticProps (args_info); | 
| 1148 | + | args_info->staticProps_group_counter += 1; | 
| 1149 | + |  | 
| 1150 | + | if (update_arg( 0 , | 
| 1151 | + | 0 , &(args_info->multipole_given), | 
| 1152 | + | &(local_args_info.multipole_given), optarg, 0, 0, ARG_NO, | 
| 1153 | + | check_ambiguity, override, 0, 0, | 
| 1154 | + | "multipole", 'm', | 
| 1155 | + | additional_error)) | 
| 1156 | + | goto failure; | 
| 1157 | + |  | 
| 1158 | + | break; | 
| 1159 |  |  | 
| 1021 | – |  | 
| 1160 |  | case 0: /* Long option with no short option */ | 
| 1161 | < | /* maximum length (Defaults to 1/2 smallest length of first frame).  */ | 
| 1162 | < | if (strcmp (long_options[option_index].name, "length") == 0) | 
| 1161 | > | /* number of bins in z axis.  */ | 
| 1162 | > | if (strcmp (long_options[option_index].name, "nbins_z") == 0) | 
| 1163 |  | { | 
| 1164 | < | if (local_args_info.length_given) | 
| 1165 | < | { | 
| 1166 | < | fprintf (stderr, "%s: `--length' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); | 
| 1167 | < | goto failure; | 
| 1168 | < | } | 
| 1169 | < | if (args_info->length_given && ! override) | 
| 1170 | < | continue; | 
| 1171 | < | local_args_info.length_given = 1; | 
| 1034 | < | args_info->length_given = 1; | 
| 1035 | < | args_info->length_arg = strtod (optarg, &stop_char); | 
| 1036 | < | if (!(stop_char && *stop_char == '\0')) { | 
| 1037 | < | fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); | 
| 1164 | > |  | 
| 1165 | > |  | 
| 1166 | > | if (update_arg( (void *)&(args_info->nbins_z_arg), | 
| 1167 | > | &(args_info->nbins_z_orig), &(args_info->nbins_z_given), | 
| 1168 | > | &(local_args_info.nbins_z_given), optarg, 0, "100", ARG_INT, | 
| 1169 | > | check_ambiguity, override, 0, 0, | 
| 1170 | > | "nbins_z", '-', | 
| 1171 | > | additional_error)) | 
| 1172 |  | goto failure; | 
| 1173 | < | } | 
| 1040 | < | if (args_info->length_orig) | 
| 1041 | < | free (args_info->length_orig); /* free previous string */ | 
| 1042 | < | args_info->length_orig = gengetopt_strdup (optarg); | 
| 1173 | > |  | 
| 1174 |  | } | 
| 1175 | + | /* slab width (dz).  */ | 
| 1176 | + | else if (strcmp (long_options[option_index].name, "dz") == 0) | 
| 1177 | + | { | 
| 1178 | + |  | 
| 1179 | + |  | 
| 1180 | + | if (update_arg( (void *)&(args_info->dz_arg), | 
| 1181 | + | &(args_info->dz_orig), &(args_info->dz_given), | 
| 1182 | + | &(local_args_info.dz_given), optarg, 0, 0, ARG_DOUBLE, | 
| 1183 | + | check_ambiguity, override, 0, 0, | 
| 1184 | + | "dz", '-', | 
| 1185 | + | additional_error)) | 
| 1186 | + | goto failure; | 
| 1187 | + |  | 
| 1188 | + | } | 
| 1189 | + | /* maximum length (Defaults to 1/2 smallest length of first frame).  */ | 
| 1190 | + | else if (strcmp (long_options[option_index].name, "length") == 0) | 
| 1191 | + | { | 
| 1192 | + |  | 
| 1193 | + |  | 
| 1194 | + | if (update_arg( (void *)&(args_info->length_arg), | 
| 1195 | + | &(args_info->length_orig), &(args_info->length_given), | 
| 1196 | + | &(local_args_info.length_given), optarg, 0, 0, ARG_DOUBLE, | 
| 1197 | + | check_ambiguity, override, 0, 0, | 
| 1198 | + | "length", '-', | 
| 1199 | + | additional_error)) | 
| 1200 | + | goto failure; | 
| 1201 | + |  | 
| 1202 | + | } | 
| 1203 | + | /* maximum length (Defaults to 1/2 smallest length of first frame).  */ | 
| 1204 | + | else if (strcmp (long_options[option_index].name, "zlength") == 0) | 
| 1205 | + | { | 
| 1206 | + |  | 
| 1207 | + |  | 
| 1208 | + | if (update_arg( (void *)&(args_info->zlength_arg), | 
| 1209 | + | &(args_info->zlength_orig), &(args_info->zlength_given), | 
| 1210 | + | &(local_args_info.zlength_given), optarg, 0, 0, ARG_DOUBLE, | 
| 1211 | + | check_ambiguity, override, 0, 0, | 
| 1212 | + | "zlength", '-', | 
| 1213 | + | additional_error)) | 
| 1214 | + | goto failure; | 
| 1215 | + |  | 
| 1216 | + | } | 
| 1217 |  | /* select the first stuntdouble set.  */ | 
| 1218 |  | else if (strcmp (long_options[option_index].name, "sele1") == 0) | 
| 1219 |  | { | 
| 1220 | < | if (local_args_info.sele1_given) | 
| 1221 | < | { | 
| 1222 | < | fprintf (stderr, "%s: `--sele1' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); | 
| 1223 | < | goto failure; | 
| 1224 | < | } | 
| 1225 | < | if (args_info->sele1_given && ! override) | 
| 1226 | < | continue; | 
| 1227 | < | local_args_info.sele1_given = 1; | 
| 1228 | < | args_info->sele1_given = 1; | 
| 1229 | < | if (args_info->sele1_arg) | 
| 1057 | < | free (args_info->sele1_arg); /* free previous string */ | 
| 1058 | < | args_info->sele1_arg = gengetopt_strdup (optarg); | 
| 1059 | < | if (args_info->sele1_orig) | 
| 1060 | < | free (args_info->sele1_orig); /* free previous string */ | 
| 1061 | < | args_info->sele1_orig = gengetopt_strdup (optarg); | 
| 1220 | > |  | 
| 1221 | > |  | 
| 1222 | > | if (update_arg( (void *)&(args_info->sele1_arg), | 
| 1223 | > | &(args_info->sele1_orig), &(args_info->sele1_given), | 
| 1224 | > | &(local_args_info.sele1_given), optarg, 0, 0, ARG_STRING, | 
| 1225 | > | check_ambiguity, override, 0, 0, | 
| 1226 | > | "sele1", '-', | 
| 1227 | > | additional_error)) | 
| 1228 | > | goto failure; | 
| 1229 | > |  | 
| 1230 |  | } | 
| 1231 |  | /* select the second stuntdouble set.  */ | 
| 1232 |  | else if (strcmp (long_options[option_index].name, "sele2") == 0) | 
| 1233 |  | { | 
| 1234 | < | if (local_args_info.sele2_given) | 
| 1235 | < | { | 
| 1236 | < | fprintf (stderr, "%s: `--sele2' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); | 
| 1237 | < | goto failure; | 
| 1238 | < | } | 
| 1239 | < | if (args_info->sele2_given && ! override) | 
| 1240 | < | continue; | 
| 1241 | < | local_args_info.sele2_given = 1; | 
| 1242 | < | args_info->sele2_given = 1; | 
| 1243 | < | if (args_info->sele2_arg) | 
| 1076 | < | free (args_info->sele2_arg); /* free previous string */ | 
| 1077 | < | args_info->sele2_arg = gengetopt_strdup (optarg); | 
| 1078 | < | if (args_info->sele2_orig) | 
| 1079 | < | free (args_info->sele2_orig); /* free previous string */ | 
| 1080 | < | args_info->sele2_orig = gengetopt_strdup (optarg); | 
| 1234 | > |  | 
| 1235 | > |  | 
| 1236 | > | if (update_arg( (void *)&(args_info->sele2_arg), | 
| 1237 | > | &(args_info->sele2_orig), &(args_info->sele2_given), | 
| 1238 | > | &(local_args_info.sele2_given), optarg, 0, 0, ARG_STRING, | 
| 1239 | > | check_ambiguity, override, 0, 0, | 
| 1240 | > | "sele2", '-', | 
| 1241 | > | additional_error)) | 
| 1242 | > | goto failure; | 
| 1243 | > |  | 
| 1244 |  | } | 
| 1245 |  | /* select the third stuntdouble set.  */ | 
| 1246 |  | else if (strcmp (long_options[option_index].name, "sele3") == 0) | 
| 1247 |  | { | 
| 1248 | < | if (local_args_info.sele3_given) | 
| 1249 | < | { | 
| 1250 | < | fprintf (stderr, "%s: `--sele3' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); | 
| 1251 | < | goto failure; | 
| 1252 | < | } | 
| 1253 | < | if (args_info->sele3_given && ! override) | 
| 1254 | < | continue; | 
| 1255 | < | local_args_info.sele3_given = 1; | 
| 1256 | < | args_info->sele3_given = 1; | 
| 1257 | < | if (args_info->sele3_arg) | 
| 1095 | < | free (args_info->sele3_arg); /* free previous string */ | 
| 1096 | < | args_info->sele3_arg = gengetopt_strdup (optarg); | 
| 1097 | < | if (args_info->sele3_orig) | 
| 1098 | < | free (args_info->sele3_orig); /* free previous string */ | 
| 1099 | < | args_info->sele3_orig = gengetopt_strdup (optarg); | 
| 1248 | > |  | 
| 1249 | > |  | 
| 1250 | > | if (update_arg( (void *)&(args_info->sele3_arg), | 
| 1251 | > | &(args_info->sele3_orig), &(args_info->sele3_given), | 
| 1252 | > | &(local_args_info.sele3_given), optarg, 0, 0, ARG_STRING, | 
| 1253 | > | check_ambiguity, override, 0, 0, | 
| 1254 | > | "sele3", '-', | 
| 1255 | > | additional_error)) | 
| 1256 | > | goto failure; | 
| 1257 | > |  | 
| 1258 |  | } | 
| 1259 |  | /* select reference (use and only use with --gxyz).  */ | 
| 1260 |  | else if (strcmp (long_options[option_index].name, "refsele") == 0) | 
| 1261 |  | { | 
| 1262 | < | if (local_args_info.refsele_given) | 
| 1263 | < | { | 
| 1264 | < | fprintf (stderr, "%s: `--refsele' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); | 
| 1265 | < | goto failure; | 
| 1266 | < | } | 
| 1267 | < | if (args_info->refsele_given && ! override) | 
| 1268 | < | continue; | 
| 1269 | < | local_args_info.refsele_given = 1; | 
| 1270 | < | args_info->refsele_given = 1; | 
| 1271 | < | if (args_info->refsele_arg) | 
| 1114 | < | free (args_info->refsele_arg); /* free previous string */ | 
| 1115 | < | args_info->refsele_arg = gengetopt_strdup (optarg); | 
| 1116 | < | if (args_info->refsele_orig) | 
| 1117 | < | free (args_info->refsele_orig); /* free previous string */ | 
| 1118 | < | args_info->refsele_orig = gengetopt_strdup (optarg); | 
| 1262 | > |  | 
| 1263 | > |  | 
| 1264 | > | if (update_arg( (void *)&(args_info->refsele_arg), | 
| 1265 | > | &(args_info->refsele_orig), &(args_info->refsele_given), | 
| 1266 | > | &(local_args_info.refsele_given), optarg, 0, 0, ARG_STRING, | 
| 1267 | > | check_ambiguity, override, 0, 0, | 
| 1268 | > | "refsele", '-', | 
| 1269 | > | additional_error)) | 
| 1270 | > | goto failure; | 
| 1271 | > |  | 
| 1272 |  | } | 
| 1273 | + | /* select stunt doubles for center-of-mass reference point.  */ | 
| 1274 | + | else if (strcmp (long_options[option_index].name, "comsele") == 0) | 
| 1275 | + | { | 
| 1276 | + |  | 
| 1277 | + |  | 
| 1278 | + | if (update_arg( (void *)&(args_info->comsele_arg), | 
| 1279 | + | &(args_info->comsele_orig), &(args_info->comsele_given), | 
| 1280 | + | &(local_args_info.comsele_given), optarg, 0, 0, ARG_STRING, | 
| 1281 | + | check_ambiguity, override, 0, 0, | 
| 1282 | + | "comsele", '-', | 
| 1283 | + | additional_error)) | 
| 1284 | + | goto failure; | 
| 1285 | + |  | 
| 1286 | + | } | 
| 1287 | + | /* global index offset for a second object (used to define a vector between sites in molecule).  */ | 
| 1288 | + | else if (strcmp (long_options[option_index].name, "seleoffset") == 0) | 
| 1289 | + | { | 
| 1290 | + |  | 
| 1291 | + |  | 
| 1292 | + | if (update_arg( (void *)&(args_info->seleoffset_arg), | 
| 1293 | + | &(args_info->seleoffset_orig), &(args_info->seleoffset_given), | 
| 1294 | + | &(local_args_info.seleoffset_given), optarg, 0, 0, ARG_INT, | 
| 1295 | + | check_ambiguity, override, 0, 0, | 
| 1296 | + | "seleoffset", '-', | 
| 1297 | + | additional_error)) | 
| 1298 | + | goto failure; | 
| 1299 | + |  | 
| 1300 | + | } | 
| 1301 | + | /* global index offset for a third object (used to define a vector between sites in molecule).  */ | 
| 1302 | + | else if (strcmp (long_options[option_index].name, "seleoffset2") == 0) | 
| 1303 | + | { | 
| 1304 | + |  | 
| 1305 | + |  | 
| 1306 | + | if (update_arg( (void *)&(args_info->seleoffset2_arg), | 
| 1307 | + | &(args_info->seleoffset2_orig), &(args_info->seleoffset2_given), | 
| 1308 | + | &(local_args_info.seleoffset2_given), optarg, 0, 0, ARG_INT, | 
| 1309 | + | check_ambiguity, override, 0, 0, | 
| 1310 | + | "seleoffset2", '-', | 
| 1311 | + | additional_error)) | 
| 1312 | + | goto failure; | 
| 1313 | + |  | 
| 1314 | + | } | 
| 1315 |  | /* molecule name.  */ | 
| 1316 |  | else if (strcmp (long_options[option_index].name, "molname") == 0) | 
| 1317 |  | { | 
| 1318 | < | if (local_args_info.molname_given) | 
| 1319 | < | { | 
| 1320 | < | fprintf (stderr, "%s: `--molname' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); | 
| 1321 | < | goto failure; | 
| 1322 | < | } | 
| 1323 | < | if (args_info->molname_given && ! override) | 
| 1324 | < | continue; | 
| 1325 | < | local_args_info.molname_given = 1; | 
| 1326 | < | args_info->molname_given = 1; | 
| 1327 | < | if (args_info->molname_arg) | 
| 1133 | < | free (args_info->molname_arg); /* free previous string */ | 
| 1134 | < | args_info->molname_arg = gengetopt_strdup (optarg); | 
| 1135 | < | if (args_info->molname_orig) | 
| 1136 | < | free (args_info->molname_orig); /* free previous string */ | 
| 1137 | < | args_info->molname_orig = gengetopt_strdup (optarg); | 
| 1318 | > |  | 
| 1319 | > |  | 
| 1320 | > | if (update_arg( (void *)&(args_info->molname_arg), | 
| 1321 | > | &(args_info->molname_orig), &(args_info->molname_given), | 
| 1322 | > | &(local_args_info.molname_given), optarg, 0, 0, ARG_STRING, | 
| 1323 | > | check_ambiguity, override, 0, 0, | 
| 1324 | > | "molname", '-', | 
| 1325 | > | additional_error)) | 
| 1326 | > | goto failure; | 
| 1327 | > |  | 
| 1328 |  | } | 
| 1329 |  | /* begin internal index.  */ | 
| 1330 |  | else if (strcmp (long_options[option_index].name, "begin") == 0) | 
| 1331 |  | { | 
| 1332 | < | if (local_args_info.begin_given) | 
| 1333 | < | { | 
| 1334 | < | fprintf (stderr, "%s: `--begin' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); | 
| 1335 | < | goto failure; | 
| 1336 | < | } | 
| 1337 | < | if (args_info->begin_given && ! override) | 
| 1338 | < | continue; | 
| 1339 | < | local_args_info.begin_given = 1; | 
| 1150 | < | args_info->begin_given = 1; | 
| 1151 | < | args_info->begin_arg = strtol (optarg, &stop_char, 0); | 
| 1152 | < | if (!(stop_char && *stop_char == '\0')) { | 
| 1153 | < | fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); | 
| 1332 | > |  | 
| 1333 | > |  | 
| 1334 | > | if (update_arg( (void *)&(args_info->begin_arg), | 
| 1335 | > | &(args_info->begin_orig), &(args_info->begin_given), | 
| 1336 | > | &(local_args_info.begin_given), optarg, 0, 0, ARG_INT, | 
| 1337 | > | check_ambiguity, override, 0, 0, | 
| 1338 | > | "begin", '-', | 
| 1339 | > | additional_error)) | 
| 1340 |  | goto failure; | 
| 1341 | < | } | 
| 1156 | < | if (args_info->begin_orig) | 
| 1157 | < | free (args_info->begin_orig); /* free previous string */ | 
| 1158 | < | args_info->begin_orig = gengetopt_strdup (optarg); | 
| 1341 | > |  | 
| 1342 |  | } | 
| 1343 |  | /* end internal index.  */ | 
| 1344 |  | else if (strcmp (long_options[option_index].name, "end") == 0) | 
| 1345 |  | { | 
| 1346 | < | if (local_args_info.end_given) | 
| 1347 | < | { | 
| 1348 | < | fprintf (stderr, "%s: `--end' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); | 
| 1349 | < | goto failure; | 
| 1350 | < | } | 
| 1351 | < | if (args_info->end_given && ! override) | 
| 1352 | < | continue; | 
| 1353 | < | local_args_info.end_given = 1; | 
| 1171 | < | args_info->end_given = 1; | 
| 1172 | < | args_info->end_arg = strtol (optarg, &stop_char, 0); | 
| 1173 | < | if (!(stop_char && *stop_char == '\0')) { | 
| 1174 | < | fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); | 
| 1346 | > |  | 
| 1347 | > |  | 
| 1348 | > | if (update_arg( (void *)&(args_info->end_arg), | 
| 1349 | > | &(args_info->end_orig), &(args_info->end_given), | 
| 1350 | > | &(local_args_info.end_given), optarg, 0, 0, ARG_INT, | 
| 1351 | > | check_ambiguity, override, 0, 0, | 
| 1352 | > | "end", '-', | 
| 1353 | > | additional_error)) | 
| 1354 |  | goto failure; | 
| 1355 | < | } | 
| 1177 | < | if (args_info->end_orig) | 
| 1178 | < | free (args_info->end_orig); /* free previous string */ | 
| 1179 | < | args_info->end_orig = gengetopt_strdup (optarg); | 
| 1355 | > |  | 
| 1356 |  | } | 
| 1357 |  | /* nanoparticle radius.  */ | 
| 1358 |  | else if (strcmp (long_options[option_index].name, "radius") == 0) | 
| 1359 |  | { | 
| 1360 | < | if (local_args_info.radius_given) | 
| 1361 | < | { | 
| 1362 | < | fprintf (stderr, "%s: `--radius' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); | 
| 1363 | < | goto failure; | 
| 1364 | < | } | 
| 1365 | < | if (args_info->radius_given && ! override) | 
| 1366 | < | continue; | 
| 1367 | < | local_args_info.radius_given = 1; | 
| 1192 | < | args_info->radius_given = 1; | 
| 1193 | < | args_info->radius_arg = strtod (optarg, &stop_char); | 
| 1194 | < | if (!(stop_char && *stop_char == '\0')) { | 
| 1195 | < | fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); | 
| 1360 | > |  | 
| 1361 | > |  | 
| 1362 | > | if (update_arg( (void *)&(args_info->radius_arg), | 
| 1363 | > | &(args_info->radius_orig), &(args_info->radius_given), | 
| 1364 | > | &(local_args_info.radius_given), optarg, 0, 0, ARG_DOUBLE, | 
| 1365 | > | check_ambiguity, override, 0, 0, | 
| 1366 | > | "radius", '-', | 
| 1367 | > | additional_error)) | 
| 1368 |  | goto failure; | 
| 1369 | < | } | 
| 1198 | < | if (args_info->radius_orig) | 
| 1199 | < | free (args_info->radius_orig); /* free previous string */ | 
| 1200 | < | args_info->radius_orig = gengetopt_strdup (optarg); | 
| 1369 | > |  | 
| 1370 |  | } | 
| 1371 |  | /* bond order parameter (--rcut must be specified).  */ | 
| 1372 |  | else if (strcmp (long_options[option_index].name, "bo") == 0) | 
| 1373 |  | { | 
| 1374 | < | if (local_args_info.bo_given) | 
| 1206 | < | { | 
| 1207 | < | fprintf (stderr, "%s: `--bo' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); | 
| 1208 | < | goto failure; | 
| 1209 | < | } | 
| 1210 | < | if (args_info->bo_given && ! override) | 
| 1211 | < | continue; | 
| 1212 | < | local_args_info.bo_given = 1; | 
| 1213 | < | args_info->bo_given = 1; | 
| 1374 | > |  | 
| 1375 |  | if (args_info->staticProps_group_counter && override) | 
| 1376 |  | reset_group_staticProps (args_info); | 
| 1377 |  | args_info->staticProps_group_counter += 1; | 
| 1378 | < | break; | 
| 1378 | > |  | 
| 1379 | > | if (update_arg( 0 , | 
| 1380 | > | 0 , &(args_info->bo_given), | 
| 1381 | > | &(local_args_info.bo_given), optarg, 0, 0, ARG_NO, | 
| 1382 | > | check_ambiguity, override, 0, 0, | 
| 1383 | > | "bo", '-', | 
| 1384 | > | additional_error)) | 
| 1385 | > | goto failure; | 
| 1386 | > |  | 
| 1387 |  | } | 
| 1388 | < | /* bond order parameter as a function of radius (--rcut must be specified).  */ | 
| 1389 | < | else if (strcmp (long_options[option_index].name, "bor") == 0) | 
| 1388 | > | /* icosahedral bond order parameter as a function of radius (--rcut must be specified).  */ | 
| 1389 | > | else if (strcmp (long_options[option_index].name, "ior") == 0) | 
| 1390 |  | { | 
| 1391 | < | if (local_args_info.bor_given) | 
| 1223 | < | { | 
| 1224 | < | fprintf (stderr, "%s: `--bor' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); | 
| 1225 | < | goto failure; | 
| 1226 | < | } | 
| 1227 | < | if (args_info->bor_given && ! override) | 
| 1228 | < | continue; | 
| 1229 | < | local_args_info.bor_given = 1; | 
| 1230 | < | args_info->bor_given = 1; | 
| 1391 | > |  | 
| 1392 |  | if (args_info->staticProps_group_counter && override) | 
| 1393 |  | reset_group_staticProps (args_info); | 
| 1394 |  | args_info->staticProps_group_counter += 1; | 
| 1395 | < | break; | 
| 1395 | > |  | 
| 1396 | > | if (update_arg( 0 , | 
| 1397 | > | 0 , &(args_info->ior_given), | 
| 1398 | > | &(local_args_info.ior_given), optarg, 0, 0, ARG_NO, | 
| 1399 | > | check_ambiguity, override, 0, 0, | 
| 1400 | > | "ior", '-', | 
| 1401 | > | additional_error)) | 
| 1402 | > | goto failure; | 
| 1403 | > |  | 
| 1404 |  | } | 
| 1405 | + | /* FCC bond order parameter as a function of radius (--rcut must be specified).  */ | 
| 1406 | + | else if (strcmp (long_options[option_index].name, "for") == 0) | 
| 1407 | + | { | 
| 1408 | + |  | 
| 1409 | + | if (args_info->staticProps_group_counter && override) | 
| 1410 | + | reset_group_staticProps (args_info); | 
| 1411 | + | args_info->staticProps_group_counter += 1; | 
| 1412 | + |  | 
| 1413 | + | if (update_arg( 0 , | 
| 1414 | + | 0 , &(args_info->for_given), | 
| 1415 | + | &(local_args_info.for_given), optarg, 0, 0, ARG_NO, | 
| 1416 | + | check_ambiguity, override, 0, 0, | 
| 1417 | + | "for", '-', | 
| 1418 | + | additional_error)) | 
| 1419 | + | goto failure; | 
| 1420 | + |  | 
| 1421 | + | } | 
| 1422 |  | /* N(theta) bond angle density within (--rcut must be specified).  */ | 
| 1423 |  | else if (strcmp (long_options[option_index].name, "bad") == 0) | 
| 1424 |  | { | 
| 1425 | < | if (local_args_info.bad_given) | 
| 1240 | < | { | 
| 1241 | < | fprintf (stderr, "%s: `--bad' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); | 
| 1242 | < | goto failure; | 
| 1243 | < | } | 
| 1244 | < | if (args_info->bad_given && ! override) | 
| 1245 | < | continue; | 
| 1246 | < | local_args_info.bad_given = 1; | 
| 1247 | < | args_info->bad_given = 1; | 
| 1425 | > |  | 
| 1426 |  | if (args_info->staticProps_group_counter && override) | 
| 1427 |  | reset_group_staticProps (args_info); | 
| 1428 |  | args_info->staticProps_group_counter += 1; | 
| 1429 | < | break; | 
| 1429 | > |  | 
| 1430 | > | if (update_arg( 0 , | 
| 1431 | > | 0 , &(args_info->bad_given), | 
| 1432 | > | &(local_args_info.bad_given), optarg, 0, 0, ARG_NO, | 
| 1433 | > | check_ambiguity, override, 0, 0, | 
| 1434 | > | "bad", '-', | 
| 1435 | > | additional_error)) | 
| 1436 | > | goto failure; | 
| 1437 | > |  | 
| 1438 |  | } | 
| 1439 | + | /* count of molecules matching selection criteria (and associated statistics).  */ | 
| 1440 | + | else if (strcmp (long_options[option_index].name, "count") == 0) | 
| 1441 | + | { | 
| 1442 | + |  | 
| 1443 | + | if (args_info->staticProps_group_counter && override) | 
| 1444 | + | reset_group_staticProps (args_info); | 
| 1445 | + | args_info->staticProps_group_counter += 1; | 
| 1446 | + |  | 
| 1447 | + | if (update_arg( 0 , | 
| 1448 | + | 0 , &(args_info->count_given), | 
| 1449 | + | &(local_args_info.count_given), optarg, 0, 0, ARG_NO, | 
| 1450 | + | check_ambiguity, override, 0, 0, | 
| 1451 | + | "count", '-', | 
| 1452 | + | additional_error)) | 
| 1453 | + | goto failure; | 
| 1454 | + |  | 
| 1455 | + | } | 
| 1456 |  | /* g(z).  */ | 
| 1457 |  | else if (strcmp (long_options[option_index].name, "gofz") == 0) | 
| 1458 |  | { | 
| 1459 | < | if (local_args_info.gofz_given) | 
| 1257 | < | { | 
| 1258 | < | fprintf (stderr, "%s: `--gofz' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); | 
| 1259 | < | goto failure; | 
| 1260 | < | } | 
| 1261 | < | if (args_info->gofz_given && ! override) | 
| 1262 | < | continue; | 
| 1263 | < | local_args_info.gofz_given = 1; | 
| 1264 | < | args_info->gofz_given = 1; | 
| 1459 | > |  | 
| 1460 |  | if (args_info->staticProps_group_counter && override) | 
| 1461 |  | reset_group_staticProps (args_info); | 
| 1462 |  | args_info->staticProps_group_counter += 1; | 
| 1463 | < | break; | 
| 1463 | > |  | 
| 1464 | > | if (update_arg( 0 , | 
| 1465 | > | 0 , &(args_info->gofz_given), | 
| 1466 | > | &(local_args_info.gofz_given), optarg, 0, 0, ARG_NO, | 
| 1467 | > | check_ambiguity, override, 0, 0, | 
| 1468 | > | "gofz", '-', | 
| 1469 | > | additional_error)) | 
| 1470 | > | goto failure; | 
| 1471 | > |  | 
| 1472 |  | } | 
| 1473 |  | /* g(r, cos(theta)).  */ | 
| 1474 |  | else if (strcmp (long_options[option_index].name, "r_theta") == 0) | 
| 1475 |  | { | 
| 1476 | < | if (local_args_info.r_theta_given) | 
| 1274 | < | { | 
| 1275 | < | fprintf (stderr, "%s: `--r_theta' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); | 
| 1276 | < | goto failure; | 
| 1277 | < | } | 
| 1278 | < | if (args_info->r_theta_given && ! override) | 
| 1279 | < | continue; | 
| 1280 | < | local_args_info.r_theta_given = 1; | 
| 1281 | < | args_info->r_theta_given = 1; | 
| 1476 | > |  | 
| 1477 |  | if (args_info->staticProps_group_counter && override) | 
| 1478 |  | reset_group_staticProps (args_info); | 
| 1479 |  | args_info->staticProps_group_counter += 1; | 
| 1480 | < | break; | 
| 1480 | > |  | 
| 1481 | > | if (update_arg( 0 , | 
| 1482 | > | 0 , &(args_info->r_theta_given), | 
| 1483 | > | &(local_args_info.r_theta_given), optarg, 0, 0, ARG_NO, | 
| 1484 | > | check_ambiguity, override, 0, 0, | 
| 1485 | > | "r_theta", '-', | 
| 1486 | > | additional_error)) | 
| 1487 | > | goto failure; | 
| 1488 | > |  | 
| 1489 |  | } | 
| 1490 |  | /* g(r, cos(omega)).  */ | 
| 1491 |  | else if (strcmp (long_options[option_index].name, "r_omega") == 0) | 
| 1492 |  | { | 
| 1493 | < | if (local_args_info.r_omega_given) | 
| 1291 | < | { | 
| 1292 | < | fprintf (stderr, "%s: `--r_omega' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); | 
| 1293 | < | goto failure; | 
| 1294 | < | } | 
| 1295 | < | if (args_info->r_omega_given && ! override) | 
| 1296 | < | continue; | 
| 1297 | < | local_args_info.r_omega_given = 1; | 
| 1298 | < | args_info->r_omega_given = 1; | 
| 1493 | > |  | 
| 1494 |  | if (args_info->staticProps_group_counter && override) | 
| 1495 |  | reset_group_staticProps (args_info); | 
| 1496 |  | args_info->staticProps_group_counter += 1; | 
| 1497 | < | break; | 
| 1497 | > |  | 
| 1498 | > | if (update_arg( 0 , | 
| 1499 | > | 0 , &(args_info->r_omega_given), | 
| 1500 | > | &(local_args_info.r_omega_given), optarg, 0, 0, ARG_NO, | 
| 1501 | > | check_ambiguity, override, 0, 0, | 
| 1502 | > | "r_omega", '-', | 
| 1503 | > | additional_error)) | 
| 1504 | > | goto failure; | 
| 1505 | > |  | 
| 1506 |  | } | 
| 1507 | + | /* g(r, z).  */ | 
| 1508 | + | else if (strcmp (long_options[option_index].name, "r_z") == 0) | 
| 1509 | + | { | 
| 1510 | + |  | 
| 1511 | + | if (args_info->staticProps_group_counter && override) | 
| 1512 | + | reset_group_staticProps (args_info); | 
| 1513 | + | args_info->staticProps_group_counter += 1; | 
| 1514 | + |  | 
| 1515 | + | if (update_arg( 0 , | 
| 1516 | + | 0 , &(args_info->r_z_given), | 
| 1517 | + | &(local_args_info.r_z_given), optarg, 0, 0, ARG_NO, | 
| 1518 | + | check_ambiguity, override, 0, 0, | 
| 1519 | + | "r_z", '-', | 
| 1520 | + | additional_error)) | 
| 1521 | + | goto failure; | 
| 1522 | + |  | 
| 1523 | + | } | 
| 1524 |  | /* g(cos(theta), cos(omega)).  */ | 
| 1525 |  | else if (strcmp (long_options[option_index].name, "theta_omega") == 0) | 
| 1526 |  | { | 
| 1527 | < | if (local_args_info.theta_omega_given) | 
| 1308 | < | { | 
| 1309 | < | fprintf (stderr, "%s: `--theta_omega' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); | 
| 1310 | < | goto failure; | 
| 1311 | < | } | 
| 1312 | < | if (args_info->theta_omega_given && ! override) | 
| 1313 | < | continue; | 
| 1314 | < | local_args_info.theta_omega_given = 1; | 
| 1315 | < | args_info->theta_omega_given = 1; | 
| 1527 | > |  | 
| 1528 |  | if (args_info->staticProps_group_counter && override) | 
| 1529 |  | reset_group_staticProps (args_info); | 
| 1530 |  | args_info->staticProps_group_counter += 1; | 
| 1531 | < | break; | 
| 1531 | > |  | 
| 1532 | > | if (update_arg( 0 , | 
| 1533 | > | 0 , &(args_info->theta_omega_given), | 
| 1534 | > | &(local_args_info.theta_omega_given), optarg, 0, 0, ARG_NO, | 
| 1535 | > | check_ambiguity, override, 0, 0, | 
| 1536 | > | "theta_omega", '-', | 
| 1537 | > | additional_error)) | 
| 1538 | > | goto failure; | 
| 1539 | > |  | 
| 1540 |  | } | 
| 1541 |  | /* g(x, y, z).  */ | 
| 1542 |  | else if (strcmp (long_options[option_index].name, "gxyz") == 0) | 
| 1543 |  | { | 
| 1544 | < | if (local_args_info.gxyz_given) | 
| 1325 | < | { | 
| 1326 | < | fprintf (stderr, "%s: `--gxyz' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); | 
| 1327 | < | goto failure; | 
| 1328 | < | } | 
| 1329 | < | if (args_info->gxyz_given && ! override) | 
| 1330 | < | continue; | 
| 1331 | < | local_args_info.gxyz_given = 1; | 
| 1332 | < | args_info->gxyz_given = 1; | 
| 1544 | > |  | 
| 1545 |  | if (args_info->staticProps_group_counter && override) | 
| 1546 |  | reset_group_staticProps (args_info); | 
| 1547 |  | args_info->staticProps_group_counter += 1; | 
| 1548 | < | break; | 
| 1548 | > |  | 
| 1549 | > | if (update_arg( 0 , | 
| 1550 | > | 0 , &(args_info->gxyz_given), | 
| 1551 | > | &(local_args_info.gxyz_given), optarg, 0, 0, ARG_NO, | 
| 1552 | > | check_ambiguity, override, 0, 0, | 
| 1553 | > | "gxyz", '-', | 
| 1554 | > | additional_error)) | 
| 1555 | > | goto failure; | 
| 1556 | > |  | 
| 1557 |  | } | 
| 1558 | + | /* 2D g(r) (Slab width --dz must be specified).  */ | 
| 1559 | + | else if (strcmp (long_options[option_index].name, "twodgofr") == 0) | 
| 1560 | + | { | 
| 1561 | + |  | 
| 1562 | + | if (args_info->staticProps_group_counter && override) | 
| 1563 | + | reset_group_staticProps (args_info); | 
| 1564 | + | args_info->staticProps_group_counter += 1; | 
| 1565 | + |  | 
| 1566 | + | if (update_arg( 0 , | 
| 1567 | + | 0 , &(args_info->twodgofr_given), | 
| 1568 | + | &(local_args_info.twodgofr_given), optarg, 0, 0, ARG_NO, | 
| 1569 | + | check_ambiguity, override, 0, 0, | 
| 1570 | + | "twodgofr", '-', | 
| 1571 | + | additional_error)) | 
| 1572 | + | goto failure; | 
| 1573 | + |  | 
| 1574 | + | } | 
| 1575 |  | /* rp2 order parameter (--sele1 and --sele2 must be specified).  */ | 
| 1576 |  | else if (strcmp (long_options[option_index].name, "rp2") == 0) | 
| 1577 |  | { | 
| 1578 | < | if (local_args_info.rp2_given) | 
| 1342 | < | { | 
| 1343 | < | fprintf (stderr, "%s: `--rp2' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); | 
| 1344 | < | goto failure; | 
| 1345 | < | } | 
| 1346 | < | if (args_info->rp2_given && ! override) | 
| 1347 | < | continue; | 
| 1348 | < | local_args_info.rp2_given = 1; | 
| 1349 | < | args_info->rp2_given = 1; | 
| 1578 | > |  | 
| 1579 |  | if (args_info->staticProps_group_counter && override) | 
| 1580 |  | reset_group_staticProps (args_info); | 
| 1581 |  | args_info->staticProps_group_counter += 1; | 
| 1582 | < | break; | 
| 1582 | > |  | 
| 1583 | > | if (update_arg( 0 , | 
| 1584 | > | 0 , &(args_info->rp2_given), | 
| 1585 | > | &(local_args_info.rp2_given), optarg, 0, 0, ARG_NO, | 
| 1586 | > | check_ambiguity, override, 0, 0, | 
| 1587 | > | "rp2", '-', | 
| 1588 | > | additional_error)) | 
| 1589 | > | goto failure; | 
| 1590 | > |  | 
| 1591 |  | } | 
| 1592 |  | /* slab density.  */ | 
| 1593 |  | else if (strcmp (long_options[option_index].name, "slab_density") == 0) | 
| 1594 |  | { | 
| 1595 | < | if (local_args_info.slab_density_given) | 
| 1359 | < | { | 
| 1360 | < | fprintf (stderr, "%s: `--slab_density' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); | 
| 1361 | < | goto failure; | 
| 1362 | < | } | 
| 1363 | < | if (args_info->slab_density_given && ! override) | 
| 1364 | < | continue; | 
| 1365 | < | local_args_info.slab_density_given = 1; | 
| 1366 | < | args_info->slab_density_given = 1; | 
| 1595 | > |  | 
| 1596 |  | if (args_info->staticProps_group_counter && override) | 
| 1597 |  | reset_group_staticProps (args_info); | 
| 1598 |  | args_info->staticProps_group_counter += 1; | 
| 1599 | < | break; | 
| 1599 | > |  | 
| 1600 | > | if (update_arg( 0 , | 
| 1601 | > | 0 , &(args_info->slab_density_given), | 
| 1602 | > | &(local_args_info.slab_density_given), optarg, 0, 0, ARG_NO, | 
| 1603 | > | check_ambiguity, override, 0, 0, | 
| 1604 | > | "slab_density", '-', | 
| 1605 | > | additional_error)) | 
| 1606 | > | goto failure; | 
| 1607 | > |  | 
| 1608 |  | } | 
| 1609 | + | /* p(cos(theta)) (--sele1 must be specified, --sele2 is optional).  */ | 
| 1610 | + | else if (strcmp (long_options[option_index].name, "p_angle") == 0) | 
| 1611 | + | { | 
| 1612 | + |  | 
| 1613 | + | if (args_info->staticProps_group_counter && override) | 
| 1614 | + | reset_group_staticProps (args_info); | 
| 1615 | + | args_info->staticProps_group_counter += 1; | 
| 1616 | + |  | 
| 1617 | + | if (update_arg( 0 , | 
| 1618 | + | 0 , &(args_info->p_angle_given), | 
| 1619 | + | &(local_args_info.p_angle_given), optarg, 0, 0, ARG_NO, | 
| 1620 | + | check_ambiguity, override, 0, 0, | 
| 1621 | + | "p_angle", '-', | 
| 1622 | + | additional_error)) | 
| 1623 | + | goto failure; | 
| 1624 | + |  | 
| 1625 | + | } | 
| 1626 |  | /* hxy.  */ | 
| 1627 |  | else if (strcmp (long_options[option_index].name, "hxy") == 0) | 
| 1628 |  | { | 
| 1629 | < | if (local_args_info.hxy_given) | 
| 1376 | < | { | 
| 1377 | < | fprintf (stderr, "%s: `--hxy' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); | 
| 1378 | < | goto failure; | 
| 1379 | < | } | 
| 1380 | < | if (args_info->hxy_given && ! override) | 
| 1381 | < | continue; | 
| 1382 | < | local_args_info.hxy_given = 1; | 
| 1383 | < | args_info->hxy_given = 1; | 
| 1629 | > |  | 
| 1630 |  | if (args_info->staticProps_group_counter && override) | 
| 1631 |  | reset_group_staticProps (args_info); | 
| 1632 |  | args_info->staticProps_group_counter += 1; | 
| 1633 | < | break; | 
| 1633 | > |  | 
| 1634 | > | if (update_arg( 0 , | 
| 1635 | > | 0 , &(args_info->hxy_given), | 
| 1636 | > | &(local_args_info.hxy_given), optarg, 0, 0, ARG_NO, | 
| 1637 | > | check_ambiguity, override, 0, 0, | 
| 1638 | > | "hxy", '-', | 
| 1639 | > | additional_error)) | 
| 1640 | > | goto failure; | 
| 1641 | > |  | 
| 1642 |  | } | 
| 1643 |  | /* rho of R.  */ | 
| 1644 |  | else if (strcmp (long_options[option_index].name, "rho_r") == 0) | 
| 1645 |  | { | 
| 1646 | < | if (local_args_info.rho_r_given) | 
| 1393 | < | { | 
| 1394 | < | fprintf (stderr, "%s: `--rho_r' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); | 
| 1395 | < | goto failure; | 
| 1396 | < | } | 
| 1397 | < | if (args_info->rho_r_given && ! override) | 
| 1398 | < | continue; | 
| 1399 | < | local_args_info.rho_r_given = 1; | 
| 1400 | < | args_info->rho_r_given = 1; | 
| 1646 | > |  | 
| 1647 |  | if (args_info->staticProps_group_counter && override) | 
| 1648 |  | reset_group_staticProps (args_info); | 
| 1649 |  | args_info->staticProps_group_counter += 1; | 
| 1650 | < | break; | 
| 1650 | > |  | 
| 1651 | > | if (update_arg( 0 , | 
| 1652 | > | 0 , &(args_info->rho_r_given), | 
| 1653 | > | &(local_args_info.rho_r_given), optarg, 0, 0, ARG_NO, | 
| 1654 | > | check_ambiguity, override, 0, 0, | 
| 1655 | > | "rho_r", '-', | 
| 1656 | > | additional_error)) | 
| 1657 | > | goto failure; | 
| 1658 | > |  | 
| 1659 |  | } | 
| 1660 | + | /* angle of R.  */ | 
| 1661 | + | else if (strcmp (long_options[option_index].name, "angle_r") == 0) | 
| 1662 | + | { | 
| 1663 | + |  | 
| 1664 | + | if (args_info->staticProps_group_counter && override) | 
| 1665 | + | reset_group_staticProps (args_info); | 
| 1666 | + | args_info->staticProps_group_counter += 1; | 
| 1667 | + |  | 
| 1668 | + | if (update_arg( 0 , | 
| 1669 | + | 0 , &(args_info->angle_r_given), | 
| 1670 | + | &(local_args_info.angle_r_given), optarg, 0, 0, ARG_NO, | 
| 1671 | + | check_ambiguity, override, 0, 0, | 
| 1672 | + | "angle_r", '-', | 
| 1673 | + | additional_error)) | 
| 1674 | + | goto failure; | 
| 1675 | + |  | 
| 1676 | + | } | 
| 1677 |  | /* hull volume of nanoparticle.  */ | 
| 1678 |  | else if (strcmp (long_options[option_index].name, "hullvol") == 0) | 
| 1679 |  | { | 
| 1680 | < | if (local_args_info.hullvol_given) | 
| 1410 | < | { | 
| 1411 | < | fprintf (stderr, "%s: `--hullvol' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); | 
| 1412 | < | goto failure; | 
| 1413 | < | } | 
| 1414 | < | if (args_info->hullvol_given && ! override) | 
| 1415 | < | continue; | 
| 1416 | < | local_args_info.hullvol_given = 1; | 
| 1417 | < | args_info->hullvol_given = 1; | 
| 1680 | > |  | 
| 1681 |  | if (args_info->staticProps_group_counter && override) | 
| 1682 |  | reset_group_staticProps (args_info); | 
| 1683 |  | args_info->staticProps_group_counter += 1; | 
| 1684 | < | break; | 
| 1684 | > |  | 
| 1685 | > | if (update_arg( 0 , | 
| 1686 | > | 0 , &(args_info->hullvol_given), | 
| 1687 | > | &(local_args_info.hullvol_given), optarg, 0, 0, ARG_NO, | 
| 1688 | > | check_ambiguity, override, 0, 0, | 
| 1689 | > | "hullvol", '-', | 
| 1690 | > | additional_error)) | 
| 1691 | > | goto failure; | 
| 1692 | > |  | 
| 1693 |  | } | 
| 1694 | + | /* length of nanorod.  */ | 
| 1695 | + | else if (strcmp (long_options[option_index].name, "rodlength") == 0) | 
| 1696 | + | { | 
| 1697 |  |  | 
| 1698 | + | if (args_info->staticProps_group_counter && override) | 
| 1699 | + | reset_group_staticProps (args_info); | 
| 1700 | + | args_info->staticProps_group_counter += 1; | 
| 1701 | + |  | 
| 1702 | + | if (update_arg( 0 , | 
| 1703 | + | 0 , &(args_info->rodlength_given), | 
| 1704 | + | &(local_args_info.rodlength_given), optarg, 0, 0, ARG_NO, | 
| 1705 | + | check_ambiguity, override, 0, 0, | 
| 1706 | + | "rodlength", '-', | 
| 1707 | + | additional_error)) | 
| 1708 | + | goto failure; | 
| 1709 | + |  | 
| 1710 | + | } | 
| 1711 | + | /* spatially-resolved tetrahedrality order parameter Qk(z).  */ | 
| 1712 | + | else if (strcmp (long_options[option_index].name, "tet_param_z") == 0) | 
| 1713 | + | { | 
| 1714 | + |  | 
| 1715 | + | if (args_info->staticProps_group_counter && override) | 
| 1716 | + | reset_group_staticProps (args_info); | 
| 1717 | + | args_info->staticProps_group_counter += 1; | 
| 1718 | + |  | 
| 1719 | + | if (update_arg( 0 , | 
| 1720 | + | 0 , &(args_info->tet_param_z_given), | 
| 1721 | + | &(local_args_info.tet_param_z_given), optarg, 0, 0, ARG_NO, | 
| 1722 | + | check_ambiguity, override, 0, 0, | 
| 1723 | + | "tet_param_z", '-', | 
| 1724 | + | additional_error)) | 
| 1725 | + | goto failure; | 
| 1726 | + |  | 
| 1727 | + | } | 
| 1728 | + | /* slab-resolved RNEMD statistics (temperature, density, velocity).  */ | 
| 1729 | + | else if (strcmp (long_options[option_index].name, "rnemdz") == 0) | 
| 1730 | + | { | 
| 1731 | + |  | 
| 1732 | + | if (args_info->staticProps_group_counter && override) | 
| 1733 | + | reset_group_staticProps (args_info); | 
| 1734 | + | args_info->staticProps_group_counter += 1; | 
| 1735 | + |  | 
| 1736 | + | if (update_arg( 0 , | 
| 1737 | + | 0 , &(args_info->rnemdz_given), | 
| 1738 | + | &(local_args_info.rnemdz_given), optarg, 0, 0, ARG_NO, | 
| 1739 | + | check_ambiguity, override, 0, 0, | 
| 1740 | + | "rnemdz", '-', | 
| 1741 | + | additional_error)) | 
| 1742 | + | goto failure; | 
| 1743 | + |  | 
| 1744 | + | } | 
| 1745 | + | /* shell-resolved RNEMD statistics (temperature, density, angular velocity).  */ | 
| 1746 | + | else if (strcmp (long_options[option_index].name, "rnemdr") == 0) | 
| 1747 | + | { | 
| 1748 | + |  | 
| 1749 | + | if (args_info->staticProps_group_counter && override) | 
| 1750 | + | reset_group_staticProps (args_info); | 
| 1751 | + | args_info->staticProps_group_counter += 1; | 
| 1752 | + |  | 
| 1753 | + | if (update_arg( 0 , | 
| 1754 | + | 0 , &(args_info->rnemdr_given), | 
| 1755 | + | &(local_args_info.rnemdr_given), optarg, 0, 0, ARG_NO, | 
| 1756 | + | check_ambiguity, override, 0, 0, | 
| 1757 | + | "rnemdr", '-', | 
| 1758 | + | additional_error)) | 
| 1759 | + | goto failure; | 
| 1760 | + |  | 
| 1761 | + | } | 
| 1762 | + | /* shell and angle-resolved RNEMD statistics (temperature, density, angular velocity).  */ | 
| 1763 | + | else if (strcmp (long_options[option_index].name, "rnemdrt") == 0) | 
| 1764 | + | { | 
| 1765 | + |  | 
| 1766 | + | if (args_info->staticProps_group_counter && override) | 
| 1767 | + | reset_group_staticProps (args_info); | 
| 1768 | + | args_info->staticProps_group_counter += 1; | 
| 1769 | + |  | 
| 1770 | + | if (update_arg( 0 , | 
| 1771 | + | 0 , &(args_info->rnemdrt_given), | 
| 1772 | + | &(local_args_info.rnemdrt_given), optarg, 0, 0, ARG_NO, | 
| 1773 | + | check_ambiguity, override, 0, 0, | 
| 1774 | + | "rnemdrt", '-', | 
| 1775 | + | additional_error)) | 
| 1776 | + | goto failure; | 
| 1777 | + |  | 
| 1778 | + | } | 
| 1779 | + | /* electrostatic potential to frequency map based on the Cho nitrile fits.  */ | 
| 1780 | + | else if (strcmp (long_options[option_index].name, "nitrile") == 0) | 
| 1781 | + | { | 
| 1782 | + |  | 
| 1783 | + | if (args_info->staticProps_group_counter && override) | 
| 1784 | + | reset_group_staticProps (args_info); | 
| 1785 | + | args_info->staticProps_group_counter += 1; | 
| 1786 | + |  | 
| 1787 | + | if (update_arg( 0 , | 
| 1788 | + | 0 , &(args_info->nitrile_given), | 
| 1789 | + | &(local_args_info.nitrile_given), optarg, 0, 0, ARG_NO, | 
| 1790 | + | check_ambiguity, override, 0, 0, | 
| 1791 | + | "nitrile", '-', | 
| 1792 | + | additional_error)) | 
| 1793 | + | goto failure; | 
| 1794 | + |  | 
| 1795 | + | } | 
| 1796 | + |  | 
| 1797 |  | break; | 
| 1798 |  | case '?':       /* Invalid option.  */ | 
| 1799 |  | /* `getopt_long' already printed an error message.  */ | 
| 1807 |  |  | 
| 1808 |  | if (args_info->staticProps_group_counter > 1) | 
| 1809 |  | { | 
| 1810 | < | fprintf (stderr, "%s: %d options of group staticProps were given. One is required.%s\n", argv[0], args_info->staticProps_group_counter, (additional_error ? additional_error : "")); | 
| 1810 | > | fprintf (stderr, "%s: %d options of group staticProps were given. One is required%s.\n", argv[0], args_info->staticProps_group_counter, (additional_error ? additional_error : "")); | 
| 1811 |  | error = 1; | 
| 1812 |  | } | 
| 1813 |  |  |