Macros | Functions | Variables
feOptGen.cc File Reference
#include <string.h>
#include <stdlib.h>
#include <kernel/mod2.h>
#include "feOptGen.h"
#include "fehelp.h"
#include <stdio.h>
#include <unistd.h>

Go to the source code of this file.

Macros

#define FE_OPT_STRUCTURE
 

Functions

int main ()
 

Variables

const char SHORT_OPTS_STRING [] = "bdhqstvxec:r:u:"
 

Macro Definition Documentation

§ FE_OPT_STRUCTURE

#define FE_OPT_STRUCTURE

Definition at line 16 of file feOptGen.cc.

Function Documentation

§ main()

int main ( void  )

Definition at line 31 of file feOptGen.cc.

32 {
33  FILE* fd;
34 #ifdef ESINGULAR
35  fd = fopen("feOptES.xx", "w");
36 #elif defined(TSINGULAR)
37  fd = fopen("feOptTS.xx", "w");
38 #else
39  fd = fopen("feOpt.xx", "w");
40 #endif
41 
42  if (fd == NULL) exit(1);
43 
44  int i = 0;
45 
46  fputs("typedef enum\n{\n", fd);
47 
48  while (feOptSpec[i].name != NULL)
49  {
50  const char* name = feOptSpec[i].name;
51  fputs("FE_OPT_", fd);
52  while (*name != 0)
53  {
54  if (*name == '-')
55  {
56  putc('_', fd);
57  }
58  else if (*name >= 97 && *name <= 122)
59  {
60  putc(*name - 32, fd);
61  }
62  else
63  {
64  putc(*name, fd);
65  }
66  name++;
67  }
68  if (i == 0)
69  {
70  fputs("=0", fd);
71  }
72  i++;
73  fputs(",\n ", fd);
74  }
75 
76  fprintf(fd, "FE_OPT_UNDEF\n} feOptIndex;\n");
77  fclose(fd);
78 #ifdef ESINGULAR
79  rename("feOptES.xx", "feOptES.inc");
80 #elif defined(TSINGULAR)
81  rename("feOptTS.xx", "feOptTS.inc");
82 #else
83  rename("feOpt.xx", "feOpt.inc");
84 #endif
85  return(0);
86 }
int status int fd
Definition: si_signals.h:59
char * name
Definition: fegetopt.h:83
struct fe_option feOptSpec[]
int i
Definition: cfEzgcd.cc:123
char name(const Variable &v)
Definition: factory.h:178
#define NULL
Definition: omList.c:10

Variable Documentation

§ SHORT_OPTS_STRING

const char SHORT_OPTS_STRING[] = "bdhqstvxec:r:u:"

Definition at line 22 of file feOptGen.cc.