summaryrefslogtreecommitdiff
path: root/mysql-client/mysql/downstream/readline.h
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2024-03-01 23:26:43 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2024-03-07 14:25:58 +0300
commit176d224b694b4f6ec2933fc9b8e3b76043659744 (patch)
treeb19c272941adef7fcdc7d2e4ee2d55d9c7235908 /mysql-client/mysql/downstream/readline.h
parent0f00acbca40c056dcbba89423ac88dd819d222d9 (diff)
Release version 8.0.15+13v8.0.15+13
Add mysql-client package. Minor cleanups of the libmysqlclient library.
Diffstat (limited to 'mysql-client/mysql/downstream/readline.h')
-rw-r--r--mysql-client/mysql/downstream/readline.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/mysql-client/mysql/downstream/readline.h b/mysql-client/mysql/downstream/readline.h
new file mode 100644
index 0000000..1540200
--- /dev/null
+++ b/mysql-client/mysql/downstream/readline.h
@@ -0,0 +1,59 @@
+/* file : mysql/downstream/readline.h
+ * license : GPLv2 with Universal FOSS Exception; see accompanying LICENSE file
+ */
+
+#ifndef MYSQL_DOWNSTREAM_READLINE_H
+#define MYSQL_DOWNSTREAM_READLINE_H
+
+/*
+ * Reduced implementation of the libedit library based on libisocline.
+ *
+ * Specially, only the basic line editing functionality is supported (no
+ * completion, history, etc).
+ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Thin wrapper around libisocline's ic_readline().
+ */
+char*
+readline (const char* prompt);
+
+/*
+ * Reading function stubs.
+ */
+typedef char** rl_completion_func_t (const char*, int, int);
+typedef char* rl_compentry_func_t (const char*, int);
+typedef int rl_command_func_t (int, int);
+typedef char* rl_compentry_func_t (const char*, int);
+
+int rl_insert (int, int);
+int rl_add_defun (const char*, rl_command_func_t*, int);
+char** rl_completion_matches (const char*, rl_compentry_func_t*);
+
+extern char* rl_readline_name;
+extern rl_completion_func_t* rl_attempted_completion_function;
+extern rl_compentry_func_t* rl_completion_entry_function;
+
+/*
+ * Hstory function stubs.
+ */
+typedef struct _hist_entry {
+ const char *line;
+ const char *data;
+} HIST_ENTRY;
+
+int add_history (const char*);
+int read_history (const char*);
+int write_history (const char*);
+HIST_ENTRY* history_get (int);
+
+extern int history_length;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* MYSQL_DOWNSTREAM_READLINE_H */