fieker-DuValspielwiese
Last change
on this file since 046a94 was
a8b8d03,
checked in by Hans Schoenemann <hannes@…>, 13 years ago
|
fix: feOptStruct
|
-
Property mode set to
100644
|
File size:
1.5 KB
|
Line | |
---|
1 | /**************************************** |
---|
2 | * Computer Algebra System SINGULAR * |
---|
3 | ****************************************/ |
---|
4 | /* $Id$ */ |
---|
5 | /* |
---|
6 | * ABSTRACT: Implementation of option buisness |
---|
7 | */ |
---|
8 | |
---|
9 | #include <string.h> |
---|
10 | #include <stdlib.h> |
---|
11 | |
---|
12 | #include <kernel/mod2.h> |
---|
13 | |
---|
14 | #define FE_OPT_STRUCTURE |
---|
15 | |
---|
16 | #include "feOptGen.h" |
---|
17 | |
---|
18 | #include "fehelp.h" |
---|
19 | |
---|
20 | const char SHORT_OPTS_STRING[] = "bdhqstvxec:r:u:"; |
---|
21 | |
---|
22 | ////////////////////////////////////////////////////////////// |
---|
23 | // |
---|
24 | // Generation of feOptIndex |
---|
25 | // |
---|
26 | #include <stdio.h> |
---|
27 | #include <unistd.h> |
---|
28 | #include <stdlib.h> |
---|
29 | int main() |
---|
30 | { |
---|
31 | FILE* fd; |
---|
32 | #ifdef ESINGULAR |
---|
33 | fd = fopen("feOptES.xx", "w"); |
---|
34 | #elif defined(TSINGULAR) |
---|
35 | fd = fopen("feOptTS.xx", "w"); |
---|
36 | #else |
---|
37 | fd = fopen("feOpt.xx", "w"); |
---|
38 | #endif |
---|
39 | |
---|
40 | if (fd == NULL) exit(1); |
---|
41 | |
---|
42 | int i = 0; |
---|
43 | |
---|
44 | fputs("typedef enum\n{\n", fd); |
---|
45 | |
---|
46 | while (feOptSpec[i].name != NULL) |
---|
47 | { |
---|
48 | const char* name = feOptSpec[i].name; |
---|
49 | fputs("FE_OPT_", fd); |
---|
50 | while (*name != 0) |
---|
51 | { |
---|
52 | if (*name == '-') |
---|
53 | { |
---|
54 | putc('_', fd); |
---|
55 | } |
---|
56 | else if (*name >= 97 && *name <= 122) |
---|
57 | { |
---|
58 | putc(*name - 32, fd); |
---|
59 | } |
---|
60 | else |
---|
61 | { |
---|
62 | putc(*name, fd); |
---|
63 | } |
---|
64 | name++; |
---|
65 | } |
---|
66 | if (i == 0) |
---|
67 | { |
---|
68 | fputs("=0", fd); |
---|
69 | } |
---|
70 | i++; |
---|
71 | fputs(",\n ", fd); |
---|
72 | } |
---|
73 | |
---|
74 | fprintf(fd, "FE_OPT_UNDEF\n} feOptIndex;\n"); |
---|
75 | fclose(fd); |
---|
76 | #ifdef ESINGULAR |
---|
77 | rename("feOptES.xx", "feOptES.inc"); |
---|
78 | #elif defined(TSINGULAR) |
---|
79 | rename("feOptTS.xx", "feOptTS.inc"); |
---|
80 | #else |
---|
81 | rename("feOpt.xx", "feOpt.inc"); |
---|
82 | #endif |
---|
83 | return(0); |
---|
84 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.