[SCM] Samba Shared Repository - branch master updated
Ralph Böhme
slow at samba.org
Sat Jan 21 12:14:02 UTC 2017
The branch, master has been updated
via 35460d9 s3/rpc_server/mdssvc: prefix public flex and bison global symbols
via 7933c2a s3/rpc_server/mdssvc: use flex noyyalloc noyyrealloc
from 98d05dc smbcontrol: add ringbuf-log
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 35460d92bbf3ee0af00b10a0a3a72887049f09ff
Author: Ralph Boehme <slow at samba.org>
Date: Wed Jan 18 19:18:40 2017 +0100
s3/rpc_server/mdssvc: prefix public flex and bison global symbols
This fixes a clash with a parser in Heimdal when building with
--nonshared-binary=smbd/smbd:
...
[3139/3620] Linking default/source3/smbd/smbd
...
default/source4/heimdal/lib/hx509/sel-lex_116.o: In function `yy_get_previous_state':
/usr/build/packages/samba-4.5/bin/../source4/heimdal/lib/hx509/sel-lex.c:1122:multiple definition of `yyin'
default/source3/rpc_server/mdssvc/sparql_lexer_28.o:/usr/build/packages/samba-4.5/bin/sparql_lexer.c:1149:first defined here
...
The fix is to use namespace prefixes in the parser and the lexer as
described here:
<https://www.gnu.org/software/bison/manual/html_node/Multiple-Parsers.html>
Bug: https://bugzilla.samba.org/show_bug.cgi?id=12528
Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: David Disseldorp <ddiss at samba.org>
Autobuild-User(master): Ralph Böhme <slow at samba.org>
Autobuild-Date(master): Sat Jan 21 13:13:19 CET 2017 on sn-devel-144
commit 7933c2a60fed8b18e88957cfc267990d8d7f0041
Author: Ralph Boehme <slow at samba.org>
Date: Thu Jan 19 07:39:37 2017 +0100
s3/rpc_server/mdssvc: use flex noyyalloc noyyrealloc
Redefine the symbols used for malloc and realloc in the flex source
instead of running sed over the generated one.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=12528
Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: David Disseldorp <ddiss at samba.org>
-----------------------------------------------------------------------
Summary of changes:
source3/rpc_server/mdssvc/Makefile | 3 -
source3/rpc_server/mdssvc/sparql_lexer.c | 561 ++++++++++++++++--------------
source3/rpc_server/mdssvc/sparql_lexer.l | 10 +-
source3/rpc_server/mdssvc/sparql_parser.c | 152 ++++----
source3/rpc_server/mdssvc/sparql_parser.h | 24 +-
source3/rpc_server/mdssvc/sparql_parser.y | 25 +-
6 files changed, 412 insertions(+), 363 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/rpc_server/mdssvc/Makefile b/source3/rpc_server/mdssvc/Makefile
index 3b0983f..3de4a46 100644
--- a/source3/rpc_server/mdssvc/Makefile
+++ b/source3/rpc_server/mdssvc/Makefile
@@ -1,6 +1,5 @@
BISON=bison
FLEX=flex
-SED=sed
PARSER=sparql_parser
LEXER=sparql_lexer
@@ -12,5 +11,3 @@ $(PARSER).c: $(PARSER).y
$(LEXER).c: $(LEXER).l
$(FLEX) -o $@ $<
- $(SED) -i s/malloc/SMB_MALLOC/g $@
- $(SED) -i s/realloc/SMB_REALLOC/g $@
diff --git a/source3/rpc_server/mdssvc/sparql_lexer.c b/source3/rpc_server/mdssvc/sparql_lexer.c
index 34bc0ca..39539c5 100644
--- a/source3/rpc_server/mdssvc/sparql_lexer.c
+++ b/source3/rpc_server/mdssvc/sparql_lexer.c
@@ -6,10 +6,29 @@
/* A lexical scanner generated by flex */
+#define yy_create_buffer mdsyy_create_buffer
+#define yy_delete_buffer mdsyy_delete_buffer
+#define yy_flex_debug mdsyy_flex_debug
+#define yy_init_buffer mdsyy_init_buffer
+#define yy_flush_buffer mdsyy_flush_buffer
+#define yy_load_buffer_state mdsyy_load_buffer_state
+#define yy_switch_to_buffer mdsyy_switch_to_buffer
+#define yyin mdsyyin
+#define yyleng mdsyyleng
+#define yylex mdsyylex
+#define yylineno mdsyylineno
+#define yyout mdsyyout
+#define yyrestart mdsyyrestart
+#define yytext mdsyytext
+#define yywrap mdsyywrap
+#define yyalloc mdsyyalloc
+#define yyrealloc mdsyyrealloc
+#define yyfree mdsyyfree
+
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
-#define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 37
+#define YY_FLEX_MINOR_VERSION 6
+#define YY_FLEX_SUBMINOR_VERSION 0
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
@@ -136,13 +155,21 @@ typedef unsigned int flex_uint32_t;
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
/* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE yyrestart(yyin )
+#define YY_NEW_FILE mdsyyrestart(mdsyyin )
#define YY_END_OF_BUFFER_CHAR 0
/* Size of default input buffer. */
#ifndef YY_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k.
+ * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
+ * Ditto for the __ia64__ case accordingly.
+ */
+#define YY_BUF_SIZE 32768
+#else
#define YY_BUF_SIZE 16384
+#endif /* __ia64__ */
#endif
/* The state buf must be large enough to hold one state per character in the main buffer.
@@ -159,27 +186,28 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE;
typedef size_t yy_size_t;
#endif
-extern yy_size_t yyleng;
+extern yy_size_t mdsyyleng;
-extern FILE *yyin, *yyout;
+extern FILE *mdsyyin, *mdsyyout;
#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
#define EOB_ACT_LAST_MATCH 2
#define YY_LESS_LINENO(n)
+ #define YY_LINENO_REWIND_TO(ptr)
/* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \
do \
{ \
- /* Undo effects of setting up yytext. */ \
- int yyless_macro_arg = (n); \
+ /* Undo effects of setting up mdsyytext. */ \
+ yy_size_t yyless_macro_arg = (n); \
YY_LESS_LINENO(yyless_macro_arg);\
*yy_cp = (yy_hold_char); \
YY_RESTORE_YY_MORE_OFFSET \
(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
- YY_DO_BEFORE_ACTION; /* set up yytext again */ \
+ YY_DO_BEFORE_ACTION; /* set up mdsyytext again */ \
} \
while ( 0 )
@@ -205,7 +233,7 @@ struct yy_buffer_state
yy_size_t yy_n_chars;
/* Whether we "own" the buffer - i.e., we know we created it,
- * and can SMB_REALLOC() it to grow it, and should free() it to
+ * and can realloc() it to grow it, and should free() it to
* delete it.
*/
int yy_is_our_buffer;
@@ -242,8 +270,8 @@ struct yy_buffer_state
* possible backing-up.
*
* When we actually see the EOF, we change the status to "new"
- * (via yyrestart()), so that the user can continue scanning by
- * just pointing yyin at a new input file.
+ * (via mdsyyrestart()), so that the user can continue scanning by
+ * just pointing mdsyyin at a new input file.
*/
#define YY_BUFFER_EOF_PENDING 2
@@ -270,51 +298,51 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
*/
#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
-/* yy_hold_char holds the character lost when yytext is formed. */
+/* yy_hold_char holds the character lost when mdsyytext is formed. */
static char yy_hold_char;
static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
-yy_size_t yyleng;
+yy_size_t mdsyyleng;
/* Points to current character in buffer. */
static char *yy_c_buf_p = (char *) 0;
static int yy_init = 0; /* whether we need to initialize */
static int yy_start = 0; /* start state number */
-/* Flag which is used to allow yywrap()'s to do buffer switches
- * instead of setting up a fresh yyin. A bit of a hack ...
+/* Flag which is used to allow mdsyywrap()'s to do buffer switches
+ * instead of setting up a fresh mdsyyin. A bit of a hack ...
*/
static int yy_did_buffer_switch_on_eof;
-void yyrestart (FILE *input_file );
-void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
-YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
-void yy_delete_buffer (YY_BUFFER_STATE b );
-void yy_flush_buffer (YY_BUFFER_STATE b );
-void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
-void yypop_buffer_state (void );
+void mdsyyrestart (FILE *input_file );
+void mdsyy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
+YY_BUFFER_STATE mdsyy_create_buffer (FILE *file,int size );
+void mdsyy_delete_buffer (YY_BUFFER_STATE b );
+void mdsyy_flush_buffer (YY_BUFFER_STATE b );
+void mdsyypush_buffer_state (YY_BUFFER_STATE new_buffer );
+void mdsyypop_buffer_state (void );
-static void yyensure_buffer_stack (void );
-static void yy_load_buffer_state (void );
-static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
+static void mdsyyensure_buffer_stack (void );
+static void mdsyy_load_buffer_state (void );
+static void mdsyy_init_buffer (YY_BUFFER_STATE b,FILE *file );
-#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
+#define YY_FLUSH_BUFFER mdsyy_flush_buffer(YY_CURRENT_BUFFER )
-YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
-YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
-YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len );
+YY_BUFFER_STATE mdsyy_scan_buffer (char *base,yy_size_t size );
+YY_BUFFER_STATE mdsyy_scan_string (yyconst char *yy_str );
+YY_BUFFER_STATE mdsyy_scan_bytes (yyconst char *bytes,yy_size_t len );
-void *yyalloc (yy_size_t );
-void *yySMB_REALLOC (void *,yy_size_t );
-void yyfree (void * );
+void *mdsyyalloc (yy_size_t );
+void *mdsyyrealloc (void *,yy_size_t );
+void mdsyyfree (void * );
-#define yy_new_buffer yy_create_buffer
+#define yy_new_buffer mdsyy_create_buffer
#define yy_set_interactive(is_interactive) \
{ \
if ( ! YY_CURRENT_BUFFER ){ \
- yyensure_buffer_stack (); \
+ mdsyyensure_buffer_stack (); \
YY_CURRENT_BUFFER_LVALUE = \
- yy_create_buffer(yyin,YY_BUF_SIZE ); \
+ mdsyy_create_buffer(mdsyyin,YY_BUF_SIZE ); \
} \
YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
}
@@ -322,9 +350,9 @@ void yyfree (void * );
#define yy_set_bol(at_bol) \
{ \
if ( ! YY_CURRENT_BUFFER ){\
- yyensure_buffer_stack (); \
+ mdsyyensure_buffer_stack (); \
YY_CURRENT_BUFFER_LVALUE = \
- yy_create_buffer(yyin,YY_BUF_SIZE ); \
+ mdsyy_create_buffer(mdsyyin,YY_BUF_SIZE ); \
} \
YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
}
@@ -335,28 +363,34 @@ void yyfree (void * );
typedef unsigned char YY_CHAR;
-FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
+FILE *mdsyyin = (FILE *) 0, *mdsyyout = (FILE *) 0;
typedef int yy_state_type;
-extern int yylineno;
+extern int mdsyylineno;
-int yylineno = 1;
+int mdsyylineno = 1;
-extern char *yytext;
-#define yytext_ptr yytext
+extern char *mdsyytext;
+#ifdef yytext_ptr
+#undef yytext_ptr
+#endif
+#define yytext_ptr mdsyytext
static yy_state_type yy_get_previous_state (void );
static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
static int yy_get_next_buffer (void );
+#if defined(__GNUC__) && __GNUC__ >= 3
+__attribute__((__noreturn__))
+#endif
static void yy_fatal_error (yyconst char msg[] );
/* Done after the current pattern has been matched and before the
- * corresponding action - sets up yytext.
+ * corresponding action - sets up mdsyytext.
*/
#define YY_DO_BEFORE_ACTION \
(yytext_ptr) = yy_bp; \
- yyleng = (size_t) (yy_cp - yy_bp); \
+ mdsyyleng = (size_t) (yy_cp - yy_bp); \
(yy_hold_char) = *yy_cp; \
*yy_cp = '\0'; \
(yy_c_buf_p) = yy_cp;
@@ -380,7 +414,7 @@ static yyconst flex_int16_t yy_accept[57] =
16, 0, 1, 0, 2, 0
} ;
-static yyconst flex_int32_t yy_ec[256] =
+static yyconst YY_CHAR yy_ec[256] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 2, 2,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -412,7 +446,7 @@ static yyconst flex_int32_t yy_ec[256] =
1, 1, 1, 1, 1
} ;
-static yyconst flex_int32_t yy_meta[35] =
+static yyconst YY_CHAR yy_meta[35] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 2, 1,
2, 1, 1, 1, 2, 2, 2, 2, 2, 2,
@@ -420,7 +454,7 @@ static yyconst flex_int32_t yy_meta[35] =
1, 2, 2, 2
} ;
-static yyconst flex_int16_t yy_base[58] =
+static yyconst flex_uint16_t yy_base[58] =
{ 0,
0, 0, 91, 92, 92, 77, 92, 61, 82, 92,
92, 3, 92, 92, 74, 92, 14, 25, 15, 56,
@@ -440,7 +474,7 @@ static yyconst flex_int16_t yy_def[58] =
17, 56, 17, 56, 56, 0, 56
} ;
-static yyconst flex_int16_t yy_nxt[127] =
+static yyconst flex_uint16_t yy_nxt[127] =
{ 0,
4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
12, 14, 15, 16, 17, 12, 12, 12, 18, 12,
@@ -479,8 +513,8 @@ static yyconst flex_int16_t yy_chk[127] =
static yy_state_type yy_last_accepting_state;
static char *yy_last_accepting_cpos;
-extern int yy_flex_debug;
-int yy_flex_debug = 0;
+extern int mdsyy_flex_debug;
+int mdsyy_flex_debug = 0;
/* The intent behind this definition is that it'll catch
* any uses of REJECT which flex missed.
@@ -489,7 +523,7 @@ int yy_flex_debug = 0;
#define yymore() yymore_used_but_not_detected
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
-char *yytext;
+char *mdsyytext;
#line 1 "sparql_lexer.l"
/*
Unix SMB/CIFS implementation.
@@ -515,7 +549,9 @@ char *yytext;
#include "sparql_parser.h"
#define YY_NO_INPUT
-#line 519 "sparql_lexer.c"
+#define mdsyyalloc SMB_MALLOC
+#define mdsyyrealloc SMB_REALLOC
+#line 555 "sparql_lexer.c"
#define INITIAL 0
@@ -536,31 +572,31 @@ static int yy_init_globals (void );
/* Accessor methods to globals.
These are made visible to non-reentrant scanners for convenience. */
-int yylex_destroy (void );
+int mdsyylex_destroy (void );
-int yyget_debug (void );
+int mdsyyget_debug (void );
-void yyset_debug (int debug_flag );
+void mdsyyset_debug (int debug_flag );
-YY_EXTRA_TYPE yyget_extra (void );
+YY_EXTRA_TYPE mdsyyget_extra (void );
-void yyset_extra (YY_EXTRA_TYPE user_defined );
+void mdsyyset_extra (YY_EXTRA_TYPE user_defined );
-FILE *yyget_in (void );
+FILE *mdsyyget_in (void );
-void yyset_in (FILE * in_str );
+void mdsyyset_in (FILE * _in_str );
-FILE *yyget_out (void );
+FILE *mdsyyget_out (void );
-void yyset_out (FILE * out_str );
+void mdsyyset_out (FILE * _out_str );
-yy_size_t yyget_leng (void );
+yy_size_t mdsyyget_leng (void );
-char *yyget_text (void );
+char *mdsyyget_text (void );
-int yyget_lineno (void );
+int mdsyyget_lineno (void );
-void yyset_lineno (int line_number );
+void mdsyyset_lineno (int _line_number );
/* Macros after this point can all be overridden by user definitions in
* section 1.
@@ -568,10 +604,14 @@ void yyset_lineno (int line_number );
#ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus
-extern "C" int yywrap (void );
+extern "C" int mdsyywrap (void );
#else
-extern int yywrap (void );
+extern int mdsyywrap (void );
+#endif
#endif
+
+#ifndef YY_NO_UNPUT
+
#endif
#ifndef yytext_ptr
@@ -594,7 +634,12 @@ static int input (void );
/* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k */
+#define YY_READ_BUF_SIZE 16384
+#else
#define YY_READ_BUF_SIZE 8192
+#endif /* __ia64__ */
#endif
/* Copy whatever the last rule matched to the standard output. */
@@ -602,7 +647,7 @@ static int input (void );
/* This used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite().
*/
-#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
+#define ECHO do { if (fwrite( mdsyytext, mdsyyleng, 1, mdsyyout )) {} } while (0)
#endif
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
@@ -615,18 +660,18 @@ static int input (void );
int c = '*'; \
size_t n; \
for ( n = 0; n < max_size && \
- (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
+ (c = getc( mdsyyin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
if ( c == '\n' ) \
buf[n++] = (char) c; \
- if ( c == EOF && ferror( yyin ) ) \
+ if ( c == EOF && ferror( mdsyyin ) ) \
YY_FATAL_ERROR( "input in flex scanner failed" ); \
result = n; \
} \
else \
{ \
errno=0; \
- while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
+ while ( (result = fread(buf, 1, max_size, mdsyyin))==0 && ferror(mdsyyin)) \
{ \
if( errno != EINTR) \
{ \
@@ -634,7 +679,7 @@ static int input (void );
break; \
} \
errno=0; \
- clearerr(yyin); \
+ clearerr(mdsyyin); \
} \
}\
\
@@ -667,12 +712,12 @@ static int input (void );
#ifndef YY_DECL
#define YY_DECL_IS_OURS 1
-extern int yylex (void);
+extern int mdsyylex (void);
-#define YY_DECL int yylex (void)
+#define YY_DECL int mdsyylex (void)
#endif /* !YY_DECL */
-/* Code executed at the beginning of each rule, after yytext and yyleng
+/* Code executed at the beginning of each rule, after mdsyytext and mdsyyleng
* have been set up.
*/
#ifndef YY_USER_ACTION
@@ -681,7 +726,7 @@ extern int yylex (void);
/* Code executed at the end of each rule. */
#ifndef YY_BREAK
-#define YY_BREAK break;
+#define YY_BREAK /*LINTED*/break;
#endif
#define YY_RULE_SETUP \
@@ -691,14 +736,10 @@ extern int yylex (void);
*/
YY_DECL
{
- register yy_state_type yy_current_state;
- register char *yy_cp, *yy_bp;
- register int yy_act;
+ yy_state_type yy_current_state;
+ char *yy_cp, *yy_bp;
+ int yy_act;
-#line 39 "sparql_lexer.l"
-
-#line 701 "sparql_lexer.c"
-
if ( !(yy_init) )
{
(yy_init) = 1;
@@ -710,26 +751,31 @@ YY_DECL
if ( ! (yy_start) )
(yy_start) = 1; /* first start state */
- if ( ! yyin )
- yyin = stdin;
+ if ( ! mdsyyin )
+ mdsyyin = stdin;
- if ( ! yyout )
- yyout = stdout;
+ if ( ! mdsyyout )
+ mdsyyout = stdout;
if ( ! YY_CURRENT_BUFFER ) {
--
Samba Shared Repository
More information about the samba-cvs
mailing list