#include "mbconfig.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "ac/f2c.h"
Go to the source code of this file.
|  | 
| int | femgen (char outname[73], int32_t *iimd, int32_t *iimv, int32_t *idxm) | 
|  | 
| static void | usage (FILE *outf, int rc) | 
|  | 
| int | main (int argc, char *argv[]) | 
|  | 
      
        
          | int femgen | ( | char | outname[73], | 
        
          |  |  | int32_t * | iimd, | 
        
          |  |  | int32_t * | iimv, | 
        
          |  |  | int32_t * | idxm | 
        
          |  | ) |  |  | 
      
 
 
      
        
          | int main | ( | int | argc, | 
        
          |  |  | char * | argv[] | 
        
          |  | ) |  |  | 
      
 
Definition at line 59 of file femgen.c.
References femgen(), getopt(), optarg, optind, and usage().
   61         char outname[73] = { 
' ' };
 
   63         int32_t iimd = 1, iimv = 1, idxm = 0;
 
   66                 int opt = 
getopt(argc, argv, 
"dhm:o:");
 
   79                         usage(stdout, EXIT_SUCCESS);
 
   83                                 usage(stderr, EXIT_FAILURE);
 
  104                                 fprintf(stderr, 
"femgen: unhandled parameter '%c' for option '-m'\n", 
optarg[0]);
 
  105                                 usage(stderr, EXIT_FAILURE);
 
  110                         size_t len = strlen(
optarg);
 
  111                         if (len >= 
sizeof(outname)) {
 
  112                                 fprintf(stderr, 
"femgen: output file name '%s' too long; trim to 72 bytes or less\n", 
optarg);
 
  116                         strncpy(outname, 
optarg, len + 1);
 
  120                         fprintf(stderr, 
"femgen: unhandled option '%c'\n", opt);
 
  121                         usage(stderr, EXIT_FAILURE);
 
  126                 if (outname[0] != 
' ') {
 
  127                         fprintf(stderr, 
"femgen: output file name already set using '-o' option\n");
 
  131                         size_t len = strlen(argv[
optind]);
 
  132                         if (len >= 
sizeof(outname)) {
 
  133                                 fprintf(stderr, 
"femgen: output file name '%s' too long; trim to 72 bytes or less\n", argv[
optind]);
 
  137                         strncpy(outname, argv[
optind], len + 1);
 
  143                 fprintf(stderr, 
"femgen: extra args ignored\n");
 
  146         return __FC_DECL__(
femgen)(outname, &iimd, &iimv, &idxm);
 
int femgen(char outname[73], int32_t *iimd, int32_t *iimv, int32_t *idxm)
static void usage(FILE *outf, int rc)
int getopt(int argc, char *const argv[], const char *opts)
 
 
 
  
  | 
        
          | static void usage | ( | FILE * | outf, |  
          |  |  | int | rc |  
          |  | ) |  |  |  | static | 
 
Definition at line 44 of file femgen.c.
Referenced by main().
   47 "usage: femgen [-hd] [-m {cxyz}] [[-o] <outfile>]\n" 
   48 "\t-d\t\tno initial modal displacements/velocities\n" 
   49 "\t-h\t\tthis message\n" 
   50 "\t-m <idx>\tindex of \"mass\" component to be used\n" 
   51 "\t\t\t('x', 'y', 'z'; 'c' to check consistency)\n" 
   52 "\t-o <outfile>\toutput file name (up to 72 characters long)\n"