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

Revision 1, 2.1 KB checked in by mmamonski, 14 years ago (diff)

Torque/PBS DRMAA initial commit

Line 
1/* $Id: datetime_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/**
21 * @file datetime_impl.h
22 * DRMAA date/time parser - Bison interface functions.
23 */
24#ifndef __DRMAA_UTILS__DATETIME_IMPL_H
25#define __DRMAA_UTILS__DATETIME_IMPL_H
26
27#ifdef HAVE_CONFIG_H
28#       include <config.h>
29#endif
30
31#include <drmaa_utils/datetime.h>
32
33/** @addtogroup datetime */
34/* @{ */
35
36typedef struct fsd_dt_parser_s fsd_dt_parser_t;
37typedef struct fsd_dt_lexer_s fsd_dt_lexer_t;
38union YYSTYPE;
39
40/** Date/time parser data. */
41struct fsd_dt_parser_s {
42        fsd_dt_lexer_t *lexer;  /**< Lexical analyzer. */
43        fsd_datetime_t result;  /**< Parsing result. */
44        int n_errors; /**< Number of parse errors. */
45};
46
47/** Date/time lexical analyzer. */
48struct fsd_dt_lexer_s {
49        fsd_dt_parser_t *parser;  /**< Date/time parser. */
50        const unsigned char *begin; /**< Begin of parsed string. */
51        const unsigned char *end;   /**< End of parsed string. */
52        const unsigned char *p;     /**< Scanner position
53                (points to first not parsed character). */
54};
55
56/** Parser interface function (Bison generated). */
57int fsd_dt_parse( fsd_dt_parser_t *parser, fsd_dt_lexer_t *lexer );
58
59/**
60 * Error reporting function (hand written).
61 */
62void fsd_dt_error(
63                fsd_dt_parser_t *parser, fsd_dt_lexer_t *lexer,
64                const char *fmt, ...
65                );
66
67/** Lexer interface (hand written). */
68int fsd_dt_lex( union YYSTYPE *lvalp, fsd_dt_lexer_t *lexer );
69
70/* @} */
71
72#endif /* __DRMAA_UTILS__DATETIME_IMPL_H */
73
Note: See TracBrowser for help on using the repository browser.