My Project
Loading...
Searching...
No Matches
Macros | Functions | Variables
feOptGen.cc File Reference
#include "kernel/mod2.h"
#include "feOptGen.h"
#include "fehelp.h"
#include <stdio.h>
#include <stdlib.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 11 of file feOptGen.cc.

Function Documentation

◆ main()

int main ( )

Definition at line 25 of file feOptGen.cc.

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

Variable Documentation

◆ SHORT_OPTS_STRING

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

Definition at line 17 of file feOptGen.cc.