-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.h
65 lines (52 loc) · 2.02 KB
/
config.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/* _\|/_
(o o)
+----oOO-{_}-OOo--------------------------------------------------------------+
| |
| P L I M U S C I R C U S |
| |
| Alumnos : Isaac Jurado Peinado [C2H5OH] |
| Esteban Martínez Tristancho [Tito Houzy] |
| Asignatura: Informática Gráfica I |
| Profesor : Jose María Buades Rubio |
| Curso : 2003/2004 |
| Estudios : Ingeniería Técnica en Informática de Gestión (TIG2) |
| Facultad : Universitat de les Illes Balears (UIB) |
| |
+----------------------------------------------------------------------------*/
/*
* config.h
*
* Definición de los parámetros configurables del circo.
*/
#ifndef _CONFIG_H_
#define _CONFIG_H_
#include "conf_keys.h" /* Las variables que definen se hacen visibles aquí */
/* Tipos privados */
struct nodo;
enum tipo { CFG_NODO, CFG_ENTERO, CFG_DECIMAL, CFG_CADENA };
union valor {
struct nodo *sig;
int entero;
float decimal;
char *cadena;
};
struct item {
char c;
enum tipo t;
union valor v;
};
struct nodo {
struct item *d;
int tam;
int ult;
};
/* Tipos exportados */
typedef struct nodo *config_t;
/* Primitivas */
extern config_t leer_config (char *fichero);
extern char *valor_cadena (config_t cfg, const char *k);
extern int valor_entero (config_t cfg, const char *k);
extern float valor_decimal (config_t cfg, const char *k);
/* Sólo para debug */
extern struct item *consulta (config_t cfg, const char *k);
#endif /* _CONFIG_H_ */