index 40bd7c0c6d869129b0435febc10271a071e1a9de..ba2b32d8d3553dad528bfda657d7f18f79b20234 100644 (file)
--- a/src/tools/sysdb/input.h
+++ b/src/tools/sysdb/input.h
typedef struct {
sdb_client_t *client;
typedef struct {
sdb_client_t *client;
+ char *user;
sdb_strbuf_t *input;
size_t tokenizer_pos;
size_t query_len;
sdb_strbuf_t *input;
size_t tokenizer_pos;
size_t query_len;
- _Bool eof;
+ /* indicates that we've had non-empty input */
+ bool have_input;
+
+ bool interactive;
+ bool eof;
} sdb_input_t;
} sdb_input_t;
-#define SDB_INPUT_INIT { NULL, NULL, 0, 0, 0 }
+#define SDB_INPUT_INIT { NULL, NULL, NULL, 0, 0, 0, 1, 0 }
/*
* sysdb_input:
/*
* sysdb_input:
* - A negative value in case of an error.
*/
ssize_t
* - A negative value in case of an error.
*/
ssize_t
-sdb_input_readline(char *buf, int *n_chars, size_t max_chars);
+sdb_input_readline(char *buf, size_t *n_chars, size_t max_chars);
/*
* sdb_input_exec_query:
/*
* sdb_input_exec_query:
int
sdb_input_exec_query(void);
int
sdb_input_exec_query(void);
+/*
+ * sdb_input_reconnect:
+ * Let the client reconnect to the server using the settings stored in
+ * sysdb_input.
+ */
+int
+sdb_input_reconnect(void);
+
#endif /* SYSDB_INPUT_H */
/* vim: set tw=78 sw=4 ts=4 noexpandtab : */
#endif /* SYSDB_INPUT_H */
/* vim: set tw=78 sw=4 ts=4 noexpandtab : */