1 | /* $Id: conf_impl.h 13 2011-04-20 15:41:43Z mmamonski $ */ |
---|
2 | /* |
---|
3 | * PSNC DRMAA 2.0 utilities library |
---|
4 | * Copyright (C) 2012 Poznan Supercomputing and Networking Center |
---|
5 | * |
---|
6 | * This program is free software: you can redistribute it and/or modify |
---|
7 | * it under the terms of the GNU General Public License as published by |
---|
8 | * the Free Software Foundation, either version 3 of the License, or |
---|
9 | * (at your option) any later version. |
---|
10 | * |
---|
11 | * This program is distributed in the hope that it will be useful, |
---|
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
14 | * GNU General Public License for more details. |
---|
15 | * |
---|
16 | * You should have received a copy of the GNU General Public License |
---|
17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
---|
18 | */ |
---|
19 | |
---|
20 | #ifndef __DRMAA_UTILS__CONF_IMPL_H |
---|
21 | #define __DRMAA_UTILS__CONF_IMPL_H |
---|
22 | |
---|
23 | #ifdef HAVE_CONFIG_H |
---|
24 | # include <config.h> |
---|
25 | #endif |
---|
26 | |
---|
27 | #include <drmaa_utils/conf.h> |
---|
28 | |
---|
29 | typedef struct fsd_conf_parser_s fsd_conf_parser_t; |
---|
30 | typedef struct fsd_conf_lexer_s fsd_conf_lexer_t; |
---|
31 | union YYSTYPE; |
---|
32 | struct YYLTYPE; |
---|
33 | typedef unsigned char uchar; |
---|
34 | |
---|
35 | |
---|
36 | int |
---|
37 | fsd_conf_parse( fsd_conf_parser_t *parser, fsd_conf_lexer_t *lexer ); |
---|
38 | |
---|
39 | int |
---|
40 | fsd_conf_lex( union YYSTYPE *lvalp, struct YYLTYPE *locp, |
---|
41 | fsd_conf_lexer_t *lexer ); |
---|
42 | |
---|
43 | void |
---|
44 | fsd_conf_error( |
---|
45 | struct YYLTYPE *locp, |
---|
46 | fsd_conf_parser_t *parser, fsd_conf_lexer_t *lexer, |
---|
47 | const char *fmt, ... |
---|
48 | ); |
---|
49 | |
---|
50 | |
---|
51 | /** DRMAA configuration file parser data. */ |
---|
52 | struct fsd_conf_parser_s { |
---|
53 | fsd_conf_lexer_t *lexer; |
---|
54 | |
---|
55 | /** Parsing result - root of syntax tree. */ |
---|
56 | fsd_conf_dict_t *result; |
---|
57 | |
---|
58 | int n_errors; /**< Number of parse/lexical errors. */ |
---|
59 | char **errors; |
---|
60 | }; |
---|
61 | |
---|
62 | /** DRMAA configuration file lexical analyzer data. */ |
---|
63 | struct fsd_conf_lexer_s { |
---|
64 | fsd_conf_parser_t *parser; /**< Parser which use this lexer. */ |
---|
65 | const char *filename; /**< Name of configuration file. */ |
---|
66 | |
---|
67 | const uchar *buffer; /**< Entire content of parsed configuration file. */ |
---|
68 | size_t buflen; /**< Length of \a buffer. */ |
---|
69 | |
---|
70 | const uchar *pos; /**< Current position of lexical analyzer. */ |
---|
71 | int lineno; /**< Current line number (counted from 1). */ |
---|
72 | const uchar *cline; /**< Points to first character (byte) of current line. */ |
---|
73 | }; |
---|
74 | |
---|
75 | typedef struct fsd_conf_pair_s { |
---|
76 | char *key; |
---|
77 | fsd_conf_option_t *value; |
---|
78 | } fsd_conf_pair_t; |
---|
79 | |
---|
80 | #endif /* __DRMAA_UTILS__CONF_IMPL_H */ |
---|
81 | |
---|