X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Ftools%2Fsysdb%2Finput.h;h=6002c1f3d5464f992c01bae48aa38b55819a0eae;hb=eeecbb1672352c4dc15af2ca345f2bb5cc5a5f66;hp=0aeabf8b7b653197f98ffa0678d13b769e0c21e2;hpb=865b0a3b20fe3c1eb014e22e4b1f45f4fa931ce5;p=sysdb.git diff --git a/src/tools/sysdb/input.h b/src/tools/sysdb/input.h index 0aeabf8..6002c1f 100644 --- a/src/tools/sysdb/input.h +++ b/src/tools/sysdb/input.h @@ -33,17 +33,20 @@ typedef struct { sdb_client_t *client; - const char *user; + char *user; sdb_strbuf_t *input; size_t tokenizer_pos; size_t query_len; + /* indicates that we've had non-empty input */ + bool have_input; + bool interactive; bool eof; } sdb_input_t; -#define SDB_INPUT_INIT { NULL, NULL, NULL, 0, 0, 1, 0 } +#define SDB_INPUT_INIT { NULL, NULL, NULL, 0, 0, 0, 1, 0 } /* * sysdb_input: @@ -58,6 +61,14 @@ extern sdb_input_t *sysdb_input; int sdb_input_init(sdb_input_t *input); +/* + * sdb_input_reset: + * Reset the input handler and free all dynamically allocated memory. The + * input handler object itself will not be freed. + */ +void +sdb_input_reset(sdb_input_t *input); + /* * sdb_input_mainloop: * Wait for and handle all user and server input until end-of-file is read