source: trunk/drmaa_utils/drmaa_utils/conf_impl.h @ 1

Revision 1, 2.3 KB checked in by mmamonski, 13 years ago (diff)

Torque/PBS DRMAA initial commit

Line 
1/* $Id: conf_impl.h 2 2009-10-12 09:51:22Z mamonski $ */
2/*
3 *  FedStage DRMAA utilities library
4 *  Copyright (C) 2006-2008  FedStage Systems
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
29typedef struct fsd_conf_parser_s fsd_conf_parser_t;
30typedef struct fsd_conf_lexer_s fsd_conf_lexer_t;
31union YYSTYPE;
32struct YYLTYPE;
33typedef unsigned char uchar;
34
35
36int
37fsd_conf_parse( fsd_conf_parser_t *parser, fsd_conf_lexer_t *lexer );
38
39int
40fsd_conf_lex( union YYSTYPE *lvalp, struct YYLTYPE *locp,
41                fsd_conf_lexer_t *lexer );
42
43void
44fsd_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. */
52struct 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. */
63struct 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
75typedef 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
Note: See TracBrowser for help on using the repository browser.