Code

Include config.h in source files.
[sysdb.git] / src / tools / sysdb / scanner.l
index c9b527e7d9cdb74785f891b6ea99553ff478a9b3..4d9fea5bc6c1f501371739a40f09a4ebd017b40a 100644 (file)
  * find queries (terminated by semicolon).
  */
 
+#if HAVE_CONFIG_H
+#      include "config.h"
+#endif /* HAVE_CONFIG_H */
+
 #include "tools/sysdb/input.h"
-#include "tools/sysdb/command.h"
 
 #include <string.h>
 
 #      undef YY_INPUT
 #endif
 #define YY_INPUT(buf, result, max_size) \
-       sdb_input_readline(sdb_input, (buf), &(result), (max_size))
+       sdb_input_readline((buf), &(result), (max_size))
 
 #define APPEND() \
        do { \
-               sdb_input->query_len += strlen(yytext); \
+               sysdb_input->query_len += strlen(yytext); \
        } while (0)
 
-static sdb_input_t *sdb_input;
-
 %}
 
 %option interactive
@@ -90,17 +91,11 @@ identifier  ([A-Za-z_][A-Za-z_0-9$]*)
         * The following rules are specific to the command line tool.
         */
 
-";"    { APPEND(); sdb_command_exec(sdb_input); }
+";"    { APPEND(); sdb_input_exec_query(); }
 
 .      { APPEND(); }
 
 %%
 
-void
-sdb_input_set(sdb_input_t *new_input)
-{
-       sdb_input = new_input;
-} /* sdb_input_set */
-
 /* vim: set tw=78 sw=4 ts=4 noexpandtab : */