Code

sysdbd.conf: Added 'PluginDir' config option.
[sysdb.git] / src / tools / sysdb / input.h
index ef60bf4d22fa47c0f800c60d4c7da9e192daf02a..40bd7c0c6d869129b0435febc10271a071e1a9de 100644 (file)
@@ -37,9 +37,11 @@ typedef struct {
        sdb_strbuf_t *input;
        size_t tokenizer_pos;
        size_t query_len;
+
+       _Bool eof;
 } sdb_input_t;
 
-#define SDB_INPUT_INIT { NULL, NULL, 0, 0 }
+#define SDB_INPUT_INIT { NULL, NULL, 0, 0, 0 }
 
 /*
  * sysdb_input:
@@ -54,6 +56,18 @@ extern sdb_input_t *sysdb_input;
 int
 sdb_input_init(sdb_input_t *input);
 
+/*
+ * sdb_input_mainloop:
+ * Wait for and handle all user and server input until end-of-file is read
+ * from the user (on the standard input channel).
+ *
+ * Returns:
+ *  - 0 on success
+ *  - a negative value else
+ */
+int
+sdb_input_mainloop(void);
+
 /*
  * sdb_input_readline:
  * This function is supposed to be used with a flex scanner's YY_INPUT. It