Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
284224fc05e97e195ccae10c2d2e3dd2596415ba
[simgrid.git] / src / include / surf / surf_parse.h
1 /*      $Id$     */
2
3 /* Copyright (c) 2004 Arnaud Legrand. All rights reserved.                  */
4
5 /* This program is free software; you can redistribute it and/or modify it
6  * under the terms of the license (GNU LGPL) which comes with this package. */
7
8 #ifndef _SURF_SURF_PARSE_H
9 #define _SURF_SURF_PARSE_H
10
11 #include "xbt/misc.h"
12 #include "surf/trace_mgr.h"
13
14 typedef enum {
15   TOKEN_EMPTY = 0,
16   TOKEN_LP = 512,
17   TOKEN_RP,
18   TOKEN_BEGIN_SECTION,
19   TOKEN_END_SECTION,
20   TOKEN_CLOSURE,
21   TOKEN_WORD,
22   TOKEN_NEWLINE,
23   TOKEN_ERROR
24 } e_surf_token_t;
25
26 #define MAX_STR_CONST 1024
27
28 extern char *surf_parse_text;
29 extern int surf_line_pos;
30 extern int surf_char_pos;
31 extern int surf_tok_num;
32
33 e_surf_token_t surf_parse(void);
34 void find_section(const char *file, const char *section_name);
35 void close_section(const char *section_name);
36 void surf_parse_double(double *value);
37 void surf_parse_trace(tmgr_trace_t * trace);
38 void surf_parse_deployment_line(char **host, int *argc, char ***argv);
39
40
41 /* Should not be called if you use the previous "section" functions */
42 void surf_parse_open(const char *file);
43 void surf_parse_close(void);
44
45 /* Prototypes of the functions offered by flex */
46 int surf_parse_lex(void);
47 int surf_parse_get_lineno(void);
48 FILE *surf_parse_get_in(void);
49 FILE *surf_parse_get_out(void);
50 int surf_parse_get_leng(void);
51 char *surf_parse_get_text(void);
52 void surf_parse_set_lineno(int line_number);
53 void surf_parse_set_in(FILE * in_str);
54 void surf_parse_set_out(FILE * out_str);
55 int surf_parse_get_debug(void);
56 void surf_parse_set_debug(int bdebug);
57 int surf_parse_lex_destroy(void);
58
59
60 #endif