X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Ftools%2Fsysdb%2Finput.h;h=ba2b32d8d3553dad528bfda657d7f18f79b20234;hb=bab2df9bbe43cb2a4d8c1ca246e0d2a843655ba4;hp=ccdce039881ca27893c53e3d5e0cb6ee6ea4cca0;hpb=498c6c0d39c932b38a6ba1641119c0b5f97d1399;p=sysdb.git diff --git a/src/tools/sysdb/input.h b/src/tools/sysdb/input.h index ccdce03..ba2b32d 100644 --- a/src/tools/sysdb/input.h +++ b/src/tools/sysdb/input.h @@ -33,16 +33,20 @@ typedef struct { sdb_client_t *client; + char *user; sdb_strbuf_t *input; size_t tokenizer_pos; size_t query_len; - _Bool interactive; - _Bool eof; + /* indicates that we've had non-empty input */ + bool have_input; + + bool interactive; + bool eof; } sdb_input_t; -#define SDB_INPUT_INIT { NULL, NULL, 0, 0, 1, 0 } +#define SDB_INPUT_INIT { NULL, NULL, NULL, 0, 0, 0, 1, 0 } /* * sysdb_input: @@ -91,6 +95,14 @@ sdb_input_readline(char *buf, size_t *n_chars, size_t max_chars); 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 : */