diff options
author | vysheng <vysheng@users.noreply.github.com> | 2015-07-30 12:59:59 +0300 |
---|---|---|
committer | vysheng <vysheng@users.noreply.github.com> | 2015-07-30 12:59:59 +0300 |
commit | ce511b8b94168bf1bc83c503ac64c734813bae9d (patch) | |
tree | ef7f581435112ca1f6178e886e0d009785102e84 /tgl.h | |
parent | 58602973ffdee85405de571524c2ae2bf2fda5e1 (diff) | |
parent | fb57e30bf6267bb8658e85d35a2ddeb82fba9f8f (diff) |
Merge pull request #33 from hedayat/flexible_get_string
Replace get_string with get_values
Diffstat (limited to 'tgl.h')
-rw-r--r-- | tgl.h | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -84,11 +84,22 @@ extern struct tgl_allocator tgl_allocator_release; extern struct tgl_allocator tgl_allocator_debug; struct tgl_state; +enum tgl_value_type { + tgl_phone_number, // user phone number + tgl_code, // telegram login code, or 'call' for phone call request + tgl_register_info, // "Y/n" register?, first name, last name + tgl_new_password, // new pass, confirm new pass + tgl_cur_and_new_password, // curr pass, new pass, confirm new pass + tgl_cur_password, // current pass + tgl_bot_hash +}; + struct tgl_update_callback { void (*new_msg)(struct tgl_state *TLS, struct tgl_message *M); void (*marked_read)(struct tgl_state *TLS, int num, struct tgl_message *list[]); void (*logprintf)(const char *format, ...) __attribute__ ((format (printf, 1, 2))); - void (*get_string)(struct tgl_state *TLS, const char *prompt, int flags, void (*callback)(struct tgl_state *TLS, const char *string, void *arg), void *arg); + void (*get_values)(struct tgl_state *TLS, enum tgl_value_type type, const char *prompt, int num_values, + void (*callback)(struct tgl_state *TLS, const char *string[], void *arg), void *arg); void (*logged_in)(struct tgl_state *TLS); void (*started)(struct tgl_state *TLS); void (*type_notification)(struct tgl_state *TLS, struct tgl_user *U, enum tgl_typing_status status); |