My Project
Toggle main menu visibility
Loading...
Searching...
No Matches
Singular
feOpt.h
Go to the documentation of this file.
1
#ifndef FEOPTS_H
2
#define FEOPTS_H
3
/****************************************
4
* Computer Algebra System SINGULAR *
5
****************************************/
6
/*
7
* ABSTRACT: Declarations for working with Options
8
*/
9
10
#include "
resources/fegetopt.h
"
11
12
#include "
Singular/feOptTab.h
"
13
14
extern
const
char
SHORT_OPTS_STRING
[];
15
16
/* specifies format of options */
17
EXTERN_VAR
struct
fe_option
feOptSpec
[];
18
19
/* provides feOptIndex enum type for fast accesses to feOptSpec */
20
#if ! defined(GENERATE_DEPEND)
21
22
# ifdef ESINGULAR
23
# include "Singular/feOptES.inc"
24
# elif defined(TSINGULAR)
25
# include "Singular/feOptTS.inc"
26
# else
27
# include "Singular/feOpt.inc"
28
# endif
29
30
#else
31
typedef
enum
{
FE_OPT_UNDEF
}
feOptIndex
;
32
#endif
33
34
35
void
feOptHelp
(
const
char
*
name
);
36
void
feOptDumpVersionTuple
(
void
);
37
38
#ifdef __cplusplus
39
40
static
inline
void
*
feOptValue
(
feOptIndex
opt)
41
{
42
return
feOptSpec
[(int)opt].
value
;
43
}
44
inline
int
feOptValue
(
feOptIndex
opt,
char
**
val
)
45
{
46
if
(opt !=
FE_OPT_UNDEF
&&
feOptSpec
[(
int
)opt].
type
==
feOptString
)
47
{
48
*
val
= (
char
*)
feOptSpec
[(
int
)opt].value;
49
return
TRUE
;
50
}
51
*
val
=
NULL
;
52
return
FALSE
;
53
}
54
inline
int
feOptValue
(
feOptIndex
opt,
int
*
val
)
55
{
56
if
(opt !=
FE_OPT_UNDEF
&&
feOptSpec
[(
int
)opt].
type
!=
feOptString
)
57
{
58
*
val
= (int) ((
long
)(
feOptSpec
[(
int
)opt].
value
));
59
return
TRUE
;
60
}
61
*
val
= 0;
62
return
FALSE
;
63
}
64
65
// maps name to options
66
feOptIndex
feGetOptIndex
(
const
char
*
name
);
67
feOptIndex
feGetOptIndex
(
int
optc);
68
69
// Setting option values:
70
// Return: NULL -- everything ok
71
// "error-string" on error
72
73
// opt->type must be feOptInt or feOptBool
74
const
char
*
feSetOptValue
(
feOptIndex
opt,
int
optarg);
75
// for opt->type != feOptString, optarg is converted
76
// to an int
77
const
char
*
feSetOptValue
(
feOptIndex
opt,
char
* optarg);
78
79
void
fePrintOptValues
();
80
81
#endif
/* __cplusplus */
82
83
#endif
/* FEOPTS_H */
TRUE
#define TRUE
Definition
auxiliary.h:101
FALSE
#define FALSE
Definition
auxiliary.h:97
feOptIndex
feOptIndex
Definition
feOptGen.h:15
FE_OPT_UNDEF
@ FE_OPT_UNDEF
Definition
feOptGen.h:15
feOptTab.h
SHORT_OPTS_STRING
const char SHORT_OPTS_STRING[]
Definition
feOpt.cc:29
feOptValue
static void * feOptValue(feOptIndex opt)
Definition
feOpt.h:40
feSetOptValue
const char * feSetOptValue(feOptIndex opt, int optarg)
Definition
feOpt.cc:188
fePrintOptValues
void fePrintOptValues()
Definition
feOpt.cc:344
feGetOptIndex
feOptIndex feGetOptIndex(const char *name)
Definition
feOpt.cc:104
feOptSpec
EXTERN_VAR struct fe_option feOptSpec[]
Definition
feOpt.h:17
feOptDumpVersionTuple
void feOptDumpVersionTuple(void)
Definition
feOpt.cc:430
feOptHelp
void feOptHelp(const char *name)
Definition
feOpt.cc:379
fegetopt.h
feOptString
@ feOptString
Definition
fegetopt.h:77
fe_option::val
int val
Definition
fegetopt.h:88
fe_option::type
feOptType type
Definition
fegetopt.h:92
fe_option::value
void * value
Definition
fegetopt.h:93
fe_option
Definition
fegetopt.h:79
EXTERN_VAR
#define EXTERN_VAR
Definition
globaldefs.h:6
NULL
#define NULL
Definition
omList.c:12
name
int name
New type name for int.
Definition
templateForC.h:21
Generated on
for My Project by
doxygen 1.17.0
for
Singular