]> arthur.barton.de Git - netatalk.git/blobdiff - etc/spotlight/spotlight_rawquery_lexer.c
Spotlight: use async Tracker SPARQL API
[netatalk.git] / etc / spotlight / spotlight_rawquery_lexer.c
index 84c99367aa0891e275bbadf7f3c862a7cd0d80c1..b13b721b74b7616373bbe560f77d5126ed5766c1 100644 (file)
@@ -14,7 +14,7 @@
 #define FLEX_SCANNER
 #define YY_FLEX_MAJOR_VERSION 2
 #define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 35
+#define YY_FLEX_SUBMINOR_VERSION 37
 #if YY_FLEX_SUBMINOR_VERSION > 0
 #define FLEX_BETA
 #endif
@@ -59,7 +59,6 @@ typedef int flex_int32_t;
 typedef unsigned char flex_uint8_t; 
 typedef unsigned short int flex_uint16_t;
 typedef unsigned int flex_uint32_t;
-#endif /* ! C99 */
 
 /* Limits of integral types. */
 #ifndef INT8_MIN
@@ -90,6 +89,8 @@ typedef unsigned int flex_uint32_t;
 #define UINT32_MAX             (4294967295U)
 #endif
 
+#endif /* ! C99 */
+
 #endif /* ! FLEXINT_H */
 
 #ifdef __cplusplus
@@ -158,7 +159,12 @@ typedef unsigned int flex_uint32_t;
 typedef struct yy_buffer_state *YY_BUFFER_STATE;
 #endif
 
-extern int yyleng;
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
+
+extern yy_size_t yyleng;
 
 extern FILE *yyin, *yyout;
 
@@ -184,11 +190,6 @@ extern FILE *yyin, *yyout;
 
 #define unput(c) yyunput( c, (yytext_ptr)  )
 
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
 #ifndef YY_STRUCT_YY_BUFFER_STATE
 #define YY_STRUCT_YY_BUFFER_STATE
 struct yy_buffer_state
@@ -206,7 +207,7 @@ struct yy_buffer_state
        /* Number of characters read into yy_ch_buf, not including EOB
         * characters.
         */
-       int yy_n_chars;
+       yy_size_t yy_n_chars;
 
        /* Whether we "own" the buffer - i.e., we know we created it,
         * and can realloc() it to grow it, and should free() it to
@@ -276,8 +277,8 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
 
 /* yy_hold_char holds the character lost when yytext is formed. */
 static char yy_hold_char;
-static int yy_n_chars;         /* number of characters read into yy_ch_buf */
-int yyleng;
+static yy_size_t yy_n_chars;           /* number of characters read into yy_ch_buf */
+yy_size_t yyleng;
 
 /* Points to current character in buffer. */
 static char *yy_c_buf_p = (char *) 0;
@@ -305,7 +306,7 @@ static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file  );
 
 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,int len  );
+YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len  );
 
 void *yyalloc (yy_size_t  );
 void *yyrealloc (void *,yy_size_t  );
@@ -501,16 +502,11 @@ char *yytext;
 #include <gio/gio.h>
 #include <atalk/talloc.h>
 #include <atalk/spotlight.h>
-#ifdef HAVE_TRACKER_SPARQL
-#include "slmod_sparql_parser.h"
+#ifdef HAVE_TRACKER
+#include "sparql_parser.h"
 #define SLQ_VAR ssp_slq
 #endif
-#ifdef HAVE_TRACKER_RDF
-#include <tracker.h>
-#include "slmod_rdf_parser.h"
-#define SLQ_VAR srp_slq
-#endif
-#line 514 "spotlight_rawquery_lexer.c"
+#line 510 "spotlight_rawquery_lexer.c"
 
 #define INITIAL 0
 
@@ -549,7 +545,7 @@ FILE *yyget_out (void );
 
 void yyset_out  (FILE * out_str  );
 
-int yyget_leng (void );
+yy_size_t yyget_leng (void );
 
 char *yyget_text (void );
 
@@ -599,7 +595,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 fwrite( yytext, yyleng, 1, yyout )
+#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
 #endif
 
 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
@@ -610,7 +606,7 @@ static int input (void );
        if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
                { \
                int c = '*'; \
-               int n; \
+               size_t n; \
                for ( n = 0; n < max_size && \
                             (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
                        buf[n] = (char) c; \
@@ -692,9 +688,9 @@ YY_DECL
        register char *yy_cp, *yy_bp;
        register int yy_act;
     
-#line 32 "spotlight_rawquery_lexer.l"
+#line 27 "spotlight_rawquery_lexer.l"
 
-#line 698 "spotlight_rawquery_lexer.c"
+#line 694 "spotlight_rawquery_lexer.c"
 
        if ( !(yy_init) )
                {
@@ -779,91 +775,91 @@ do_action:        /* This label is used only to access EOF actions. */
 
 case 1:
 YY_RULE_SETUP
-#line 33 "spotlight_rawquery_lexer.l"
+#line 28 "spotlight_rawquery_lexer.l"
 return FUNC_INRANGE;
        YY_BREAK
 case 2:
 YY_RULE_SETUP
-#line 34 "spotlight_rawquery_lexer.l"
+#line 29 "spotlight_rawquery_lexer.l"
 return DATE_ISO;
        YY_BREAK
 case 3:
 YY_RULE_SETUP
-#line 35 "spotlight_rawquery_lexer.l"
+#line 30 "spotlight_rawquery_lexer.l"
 {yylval.bval = false; return BOOL;}
        YY_BREAK
 case 4:
 YY_RULE_SETUP
-#line 36 "spotlight_rawquery_lexer.l"
+#line 31 "spotlight_rawquery_lexer.l"
 {yylval.bval = true; return BOOL;}
        YY_BREAK
 case 5:
 YY_RULE_SETUP
-#line 37 "spotlight_rawquery_lexer.l"
+#line 32 "spotlight_rawquery_lexer.l"
 return QUOTE;
        YY_BREAK
 case 6:
 YY_RULE_SETUP
-#line 38 "spotlight_rawquery_lexer.l"
+#line 33 "spotlight_rawquery_lexer.l"
 return OBRACE;
        YY_BREAK
 case 7:
 YY_RULE_SETUP
-#line 39 "spotlight_rawquery_lexer.l"
+#line 34 "spotlight_rawquery_lexer.l"
 return CBRACE;
        YY_BREAK
 case 8:
 YY_RULE_SETUP
-#line 40 "spotlight_rawquery_lexer.l"
+#line 35 "spotlight_rawquery_lexer.l"
 return AND;
        YY_BREAK
 case 9:
 YY_RULE_SETUP
-#line 41 "spotlight_rawquery_lexer.l"
+#line 36 "spotlight_rawquery_lexer.l"
 return OR;
        YY_BREAK
 case 10:
 YY_RULE_SETUP
-#line 42 "spotlight_rawquery_lexer.l"
+#line 37 "spotlight_rawquery_lexer.l"
 return EQUAL;
        YY_BREAK
 case 11:
 YY_RULE_SETUP
-#line 43 "spotlight_rawquery_lexer.l"
+#line 38 "spotlight_rawquery_lexer.l"
 return UNEQUAL;
        YY_BREAK
 case 12:
 YY_RULE_SETUP
-#line 44 "spotlight_rawquery_lexer.l"
+#line 39 "spotlight_rawquery_lexer.l"
 return LT;
        YY_BREAK
 case 13:
 YY_RULE_SETUP
-#line 45 "spotlight_rawquery_lexer.l"
+#line 40 "spotlight_rawquery_lexer.l"
 return GT;
        YY_BREAK
 case 14:
 YY_RULE_SETUP
-#line 46 "spotlight_rawquery_lexer.l"
+#line 41 "spotlight_rawquery_lexer.l"
 return COMMA;
        YY_BREAK
 case 15:
 YY_RULE_SETUP
-#line 47 "spotlight_rawquery_lexer.l"
+#line 42 "spotlight_rawquery_lexer.l"
 {yylval.sval = talloc_strdup(SLQ_VAR, yytext); return WORD;}
        YY_BREAK
 case 16:
 /* rule 16 can match eol */
 YY_RULE_SETUP
-#line 48 "spotlight_rawquery_lexer.l"
+#line 43 "spotlight_rawquery_lexer.l"
 /* ignore */
        YY_BREAK
 case 17:
 YY_RULE_SETUP
-#line 49 "spotlight_rawquery_lexer.l"
+#line 44 "spotlight_rawquery_lexer.l"
 ECHO;
        YY_BREAK
-#line 867 "spotlight_rawquery_lexer.c"
+#line 863 "spotlight_rawquery_lexer.c"
 case YY_STATE_EOF(INITIAL):
        yyterminate();
 
@@ -1049,21 +1045,21 @@ static int yy_get_next_buffer (void)
 
        else
                {
-                       int num_to_read =
+                       yy_size_t num_to_read =
                        YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
 
                while ( num_to_read <= 0 )
                        { /* Not enough room in the buffer - grow it. */
 
                        /* just a shorter name for the current buffer */
-                       YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
+                       YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
 
                        int yy_c_buf_p_offset =
                                (int) ((yy_c_buf_p) - b->yy_ch_buf);
 
                        if ( b->yy_is_our_buffer )
                                {
-                               int new_size = b->yy_buf_size * 2;
+                               yy_size_t new_size = b->yy_buf_size * 2;
 
                                if ( new_size <= 0 )
                                        b->yy_buf_size += b->yy_buf_size / 8;
@@ -1094,7 +1090,7 @@ static int yy_get_next_buffer (void)
 
                /* Read in more data. */
                YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
-                       (yy_n_chars), (size_t) num_to_read );
+                       (yy_n_chars), num_to_read );
 
                YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
                }
@@ -1189,7 +1185,7 @@ static int yy_get_next_buffer (void)
        yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
        yy_is_jam = (yy_current_state == 56);
 
-       return yy_is_jam ? 0 : yy_current_state;
+               return yy_is_jam ? 0 : yy_current_state;
 }
 
     static void yyunput (int c, register char * yy_bp )
@@ -1204,7 +1200,7 @@ static int yy_get_next_buffer (void)
        if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
                { /* need to shift things up to make room */
                /* +2 for EOB chars. */
-               register int number_to_move = (yy_n_chars) + 2;
+               register yy_size_t number_to_move = (yy_n_chars) + 2;
                register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
                                        YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
                register char *source =
@@ -1253,7 +1249,7 @@ static int yy_get_next_buffer (void)
 
                else
                        { /* need more input */
-                       int offset = (yy_c_buf_p) - (yytext_ptr);
+                       yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
                        ++(yy_c_buf_p);
 
                        switch ( yy_get_next_buffer(  ) )
@@ -1413,10 +1409,6 @@ static void yy_load_buffer_state  (void)
        yyfree((void *) b  );
 }
 
-#ifndef __cplusplus
-extern int isatty (int );
-#endif /* __cplusplus */
-    
 /* Initializes or reinitializes a buffer.
  * This function is sometimes called more than once on the same buffer,
  * such as during a yyrestart() or at EOF.
@@ -1529,7 +1521,7 @@ void yypop_buffer_state (void)
  */
 static void yyensure_buffer_stack (void)
 {
-       int num_to_alloc;
+       yy_size_t num_to_alloc;
     
        if (!(yy_buffer_stack)) {
 
@@ -1621,17 +1613,17 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
 
 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
  * scan from a @e copy of @a bytes.
- * @param bytes the byte buffer to scan
- * @param len the number of bytes in the buffer pointed to by @a bytes.
+ * @param yybytes the byte buffer to scan
+ * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
  * 
  * @return the newly allocated buffer state object.
  */
-YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
+YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, yy_size_t  _yybytes_len )
 {
        YY_BUFFER_STATE b;
        char *buf;
        yy_size_t n;
-       int i;
+       yy_size_t i;
     
        /* Get memory for full buffer, including space for trailing EOB's. */
        n = _yybytes_len + 2;
@@ -1713,7 +1705,7 @@ FILE *yyget_out  (void)
 /** Get the length of the current token.
  * 
  */
-int yyget_leng  (void)
+yy_size_t yyget_leng  (void)
 {
         return yyleng;
 }
@@ -1861,7 +1853,7 @@ void yyfree (void * ptr )
 
 #define YYTABLES_NAME "yytables"
 
-#line 49 "spotlight_rawquery_lexer.l"
+#line 44 "spotlight_rawquery_lexer.l"