]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/lex.h
Big backport from Enterprise
[bacula/bacula] / bacula / src / lib / lex.h
index c4ab32434608bc6fe77fbdb384cf4cfe13956617..ae73ad13718ef2344dbd02bb02315c6e5a6e6a55 100644 (file)
@@ -1,3 +1,21 @@
+/*
+   Bacula(R) - The Network Backup Solution
+
+   Copyright (C) 2000-2016 Kern Sibbald
+
+   The original author of Bacula is Kern Sibbald, with contributions
+   from many others, a complete list can be found in the file AUTHORS.
+
+   You may use this file and others of this release according to the
+   license defined in the LICENSE file, which includes the Affero General
+   Public License, v3.0 ("AGPLv3") and some additional permissions and
+   terms pursuant to its AGPLv3 Section 7.
+
+   This notice must be preserved when any source code is 
+   conveyed and/or propagated.
+
+   Bacula(R) is a registered trademark of Kern Sibbald.
+*/
 /*
  *   lex.h
  *
@@ -5,27 +23,6 @@
  *
  *   Kern Sibbald, MM
  *
- *   Version $Id$
- *
- */
-/*
-   Copyright (C) 2000-2005 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.
-
-   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.
-
  */
 
 #ifndef _LEX_H
@@ -51,6 +48,9 @@
 #define T_COMMA                       111
 #define T_EOL                         112
 #define T_ERROR                       200
+#define T_UTF8_BOM                    201 /* File starts with a UTF-8 BOM*/
+#define T_UTF16_BOM                   202 /* File starts with a UTF-16LE BOM*/
+
 /*
  * The following will be returned only if
  * the appropriate expect flag has been set
@@ -62,6 +62,8 @@
 #define T_INT64                       117  /* 64 bit integer */
 #define T_NAME                        118  /* name max 128 chars */
 #define T_STRING                      119  /* string */
+#define T_PINT64_RANGE                120  /* positive integer range */
+#define T_PINT64                      121  /* positive integer range */
 
 #define T_ALL                           0  /* no expectations */
 
@@ -74,12 +76,19 @@ enum lex_state {
    lex_identifier,
    lex_string,
    lex_quoted_string,
-   lex_include
+   lex_include_quoted_string,
+   lex_include,
+   lex_utf8_bom,      /* we are parsing out a utf8 byte order mark */
+   lex_utf16_le_bom   /* we are parsing out a utf-16 (little endian) byte order mark */
 };
 
 /* Lex scan options */
 #define LOPT_NO_IDENT            0x1  /* No Identifiers -- use string */
 #define LOPT_STRING              0x2  /* Force scan for string */
+#define LOPT_NO_EXTERN           0x4  /* Don't follow @ command */
+#define LOPT_NO_MD5              0x8  /* Do not encode passwords with MD5 */
+
+class BPIPE;                          /* forward reference */
 
 /* Lexical context */
 typedef struct s_lex_context {
@@ -87,8 +96,8 @@ typedef struct s_lex_context {
    int options;                       /* scan options */
    char *fname;                       /* filename */
    FILE *fd;                          /* file descriptor */
-   char line[MAXSTRING];              /* input line */
-   char str[MAXSTRING];               /* string being scanned */
+   POOLMEM *line;                     /* input line */
+   POOLMEM *str;                      /* string being scanned */
    int str_len;                       /* length of string */
    int line_no;                       /* file line number */
    int col_no;                        /* char position on line */
@@ -100,9 +109,12 @@ typedef struct s_lex_context {
    uint32_t pint32_val2;
    int32_t int32_val;
    int64_t int64_val;
+   uint64_t pint64_val;
+   uint64_t pint64_val2;
    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 */
+   BPIPE *bpipe;                      /* set if we are piping */
 } LEX;
 
 typedef void (LEX_ERROR_HANDLER)(const char *file, int line, LEX *lc, const char *msg, ...);
@@ -118,5 +130,6 @@ typedef void (LEX_ERROR_HANDLER)(const char *file, int line, LEX *lc, const char
 
 void scan_to_eol(LEX *lc);
 int scan_to_next_not_eol(LEX * lc);
+void lex_store_clear_passwords(LEX *lf);
 
 #endif /* _LEX_H */