My Project
debian-1:4.1.1-p2+ds-4build2
Singular
feOptGen.cc
Go to the documentation of this file.
1
/****************************************
2
* Computer Algebra System SINGULAR *
3
****************************************/
4
/*
5
* ABSTRACT: Implementation of option business
6
*/
7
8
9
#include "
kernel/mod2.h
"
10
11
#define FE_OPT_STRUCTURE
12
13
#include "
feOptGen.h
"
14
15
#include "
fehelp.h
"
16
17
const
char
SHORT_OPTS_STRING
[] =
"bdhqstvxec:r:u:"
;
18
19
//////////////////////////////////////////////////////////////
20
//
21
// Generation of feOptIndex
22
//
23
#include <stdio.h>
24
#include <stdlib.h>
25
int
main
()
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
}
main
int main()
Definition:
feOptGen.cc:25
fehelp.h
feOptGen.h
fe_option::name
char * name
Definition:
fegetopt.h:83
i
int i
Definition:
cfEzgcd.cc:125
mod2.h
feOptSpec
struct fe_option feOptSpec[]
name
char name(const Variable &v)
Definition:
factory.h:180
NULL
#define NULL
Definition:
omList.c:10
SHORT_OPTS_STRING
const char SHORT_OPTS_STRING[]
Definition:
feOptGen.cc:17
fd
int status int fd
Definition:
si_signals.h:59
Generated on Tue Mar 24 2020 14:10:46 for My Project by
doxygen 1.8.17
for
Singular debian-1:4.1.1-p2+ds-4build2