]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/lex.h
19July06
[bacula/bacula] / bacula / src / lib / lex.h
index 49274ed93a0e01065700da2595f57b54aa936ca0..1a05225d0ea65a003674a0f113edbe0ebbcaf70f 100644 (file)
@@ -1,30 +1,25 @@
 /*
- *   lex.h  
+ *   lex.h
  *
  *    Lexical scanning of configuration files, used by parsers.
  *
- *   Kern Sibbald, MM  
+ *   Kern Sibbald, MM
  *
  *   Version $Id$
  *
  */
 /*
-   Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
+   Copyright (C) 2000-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License as
-   published by the Free Software Foundation; either version 2 of
-   the License, or (at your option) any later version.
+   modify it under the terms of the GNU General Public License
+   version 2 as amended with additional clauses defined in the
+   file LICENSE in the main source directory.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-   General Public License for more details.
-
-   You should have received a copy of the GNU General Public
-   License along with this program; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-   MA 02111-1307, USA.
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
+   the file LICENSE for additional details.
 
  */
 
@@ -36,7 +31,7 @@
 #define L_EOL                         (-2)
 
 /* Internal tokens */
-#define T_NONE                        100                              
+#define T_NONE                        100
 
 /* Tokens returned by get_token() */
 #define T_EOF                         101
@@ -53,7 +48,7 @@
 #define T_ERROR                       200
 /*
  * The following will be returned only if
- * the appropriate expect flag has been set   
+ * the appropriate expect flag has been set
  */
 #define T_SKIP_EOL                    113  /* scan through EOLs */
 #define T_PINT32                      114  /* positive integer */
@@ -79,6 +74,7 @@ enum lex_state {
 
 /* Lex scan options */
 #define LOPT_NO_IDENT            0x1  /* No Identifiers -- use string */
+#define LOPT_STRING              0x2  /* Force scan for string */
 
 /* Lexical context */
 typedef struct s_lex_context {
@@ -100,6 +96,7 @@ typedef struct s_lex_context {
    int32_t int32_val;
    int64_t int64_val;
    void (*scan_error)(const char *file, int line, struct s_lex_context *lc, const char *msg, ...);
+   int err_type;                      /* message level for scan_error (M_..) */
    void *caller_ctx;                  /* caller private data */
 } LEX;