aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plpftp/rlcrap.c18
-rw-r--r--plpftp/rlcrap.h21
2 files changed, 39 insertions, 0 deletions
diff --git a/plpftp/rlcrap.c b/plpftp/rlcrap.c
new file mode 100644
index 0000000..519daf3
--- /dev/null
+++ b/plpftp/rlcrap.c
@@ -0,0 +1,18 @@
+/*
+ * Woraround for crappy readline.h which defines wrong prototypes.
+ */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#if HAVE_LIBREADLINE
+#include <stdio.h>
+#include "rlcrap.h"
+
+CPFunction *cmdgen_ptr;
+CPFunction *fnmgen_ptr;
+
+void rlcrap_setpointers(CorrectFunProto cgp, CorrectFunProto fgp) {
+ cmdgen_ptr = cgp;
+ fnmgen_ptr = fgp;
+}
+#endif
diff --git a/plpftp/rlcrap.h b/plpftp/rlcrap.h
new file mode 100644
index 0000000..92df659
--- /dev/null
+++ b/plpftp/rlcrap.h
@@ -0,0 +1,21 @@
+/*
+ * Woraround for crappy readline.h which defines wrong prototypes.
+ */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#if HAVE_LIBREADLINE
+#include <readline/readline.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+extern CPFunction *cmdgen_ptr;
+extern CPFunction *fnmgen_ptr;
+
+typedef char *(*CorrectFunProto)(char *, int);
+
+extern void rlcrap_setpointers(CorrectFunProto, CorrectFunProto);
+#ifdef __cplusplus
+}
+#endif
+#endif