aboutsummaryrefslogtreecommitdiff
path: root/mpiosh/readline.c
diff options
context:
space:
mode:
authorcrunchy <crunchy>2003-04-23 08:34:01 +0000
committercrunchy <crunchy>2003-04-23 08:34:01 +0000
commit4412ca091e6379def8bc836163c6b580df76619c (patch)
tree35f529177db9512ad1d195276dc9d818a8e23d87 /mpiosh/readline.c
parent16e3a07e9cdfe050819cc4fdd5061486cb48767d (diff)
downloadmpiosh-4412ca091e6379def8bc836163c6b580df76619c.tar.gz
mpiosh-4412ca091e6379def8bc836163c6b580df76619c.tar.bz2
mpiosh-4412ca091e6379def8bc836163c6b580df76619c.zip
start restructuring
Diffstat (limited to 'mpiosh/readline.c')
-rw-r--r--mpiosh/readline.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/mpiosh/readline.c b/mpiosh/readline.c
index d10209b..afc78c0 100644
--- a/mpiosh/readline.c
+++ b/mpiosh/readline.c
@@ -2,7 +2,7 @@
*
* Author: Andreas Büsching <crunchy@tzi.de>
*
- * $Id: readline.c,v 1.6 2003/04/06 23:09:20 germeier Exp $
+ * $Id: readline.c,v 1.7 2003/04/23 08:34:16 crunchy Exp $
*
* Copyright (C) 2001 Andreas Büsching <crunchy@tzi.de>
*
@@ -39,6 +39,29 @@ mpiosh_readline_init(void)
}
char *
+mpiosh_readline_comp_onoff(const char *text, int state)
+{
+ static const char * states[] = { "on", "off", NULL };
+ static const char ** st = states;
+ const char * ret = NULL;
+
+ if (state == 0) {
+ st = states;
+ }
+
+ while (*st) {
+ if (!strncmp(text, *st, strlen(text))) {
+ ret = *st;
+ st++;
+ break;
+ }
+ st++;
+ }
+
+ return (ret ? strdup(ret) : NULL);
+}
+
+char *
mpiosh_readline_comp_cmd(const char *text, int state)
{
static struct mpiosh_cmd_t *cmd = NULL;