Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix make distcheck
[simgrid.git] / include / surf / surfxml_parse.h
1 /* Copyright (c) 2006-2014. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #ifndef _SURF_SURFXML_PARSE_H
8 #define _SURF_SURFXML_PARSE_H
9
10 #include <stdio.h>              /* to have FILE */
11 #include "xbt/misc.h"
12 #include "xbt/function_types.h"
13 #include "xbt/dict.h"
14
15 SG_BEGIN_DECL()
16 #include "surf/simgrid_dtd.h"
17
18 #ifndef YY_TYPEDEF_YY_SIZE_T
19 #define YY_TYPEDEF_YY_SIZE_T
20 typedef size_t yy_size_t;
21 #endif
22
23 XBT_PUBLIC(void) surf_parse_open(const char *file);
24 XBT_PUBLIC(void) surf_parse_close(void);
25 XBT_PUBLIC(void) surf_parse_assert(bool cond, const char *fmt, ...) XBT_ATTRIB_PRINTF(2,3);
26 XBT_PUBLIC(void) XBT_ATTRIB_NORETURN surf_parse_error(const char *msg,...) XBT_ATTRIB_PRINTF(1,2);
27 XBT_PUBLIC(void) surf_parse_warn(const char *msg,...) XBT_ATTRIB_PRINTF(1,2);
28
29 XBT_PUBLIC(double) surf_parse_get_double(const char *string);
30 XBT_PUBLIC(int) surf_parse_get_int(const char *string);
31 XBT_PUBLIC(double) surf_parse_get_time(const char *string, const char *entity_kind, const char *name);
32 XBT_PUBLIC(double) surf_parse_get_size(const char *string, const char *entity_kind, const char *name);
33 XBT_PUBLIC(double) surf_parse_get_bandwidth(const char *string, const char *entity_kind, const char *name);
34 XBT_PUBLIC(double) surf_parse_get_speed(const char *string, const char *entity_kind, const char *name);
35
36 /* Prototypes of the functions offered by flex */
37 XBT_PUBLIC(int) surf_parse_lex(void);
38 XBT_PUBLIC(int) surf_parse_get_lineno(void);
39 XBT_PUBLIC(FILE *) surf_parse_get_in(void);
40 XBT_PUBLIC(FILE *) surf_parse_get_out(void);
41 XBT_PUBLIC(yy_size_t) surf_parse_get_leng(void);
42 XBT_PUBLIC(char *) surf_parse_get_text(void);
43 XBT_PUBLIC(void) surf_parse_set_lineno(int line_number);
44 XBT_PUBLIC(void) surf_parse_set_in(FILE * in_str);
45 XBT_PUBLIC(void) surf_parse_set_out(FILE * out_str);
46 XBT_PUBLIC(int) surf_parse_get_debug(void);
47 XBT_PUBLIC(void) surf_parse_set_debug(int bdebug);
48 XBT_PUBLIC(int) surf_parse_lex_destroy(void);
49
50 /* What is needed to bypass the parser. */
51 XBT_PUBLIC_DATA(int_f_void_t) surf_parse;       /* Entry-point to the parser. Set this to your function. */
52
53 SG_END_DECL()
54 #endif