summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
15e4710)
library versions without the completition functionality
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4904
4a8a32a2-be11-0410-ad9d-
d568d2c75423
+2007-08-23 Borut Razem <borut.razem AT siol.net>
+
+ * debugger/mcs51/sdcdb.c: fixed compilation with older readline
+ library versions without the completition functionality
+
2007-08-22 Raphael Neider <rneider AT web.de>
* device/include/pic16/pic18f1220.h,
2007-08-22 Raphael Neider <rneider AT web.de>
* device/include/pic16/pic18f1220.h,
#include "break.h"
#include "cmd.h"
#include "newalloc.h"
#include "break.h"
#include "cmd.h"
#include "newalloc.h"
+#if defined HAVE_LIBREADLINE && HAVE_LIBREADLINE != -1
+#define HAVE_READLINE_COMPLETITION 1
+#endif
#ifdef HAVE_LIBREADLINE
#include <readline/readline.h>
#include <readline/history.h>
#ifdef HAVE_LIBREADLINE
#include <readline/readline.h>
#include <readline/history.h>
int fatalError = 0;
static void commandLoop(FILE *cmdfile);
int fatalError = 0;
static void commandLoop(FILE *cmdfile);
+#ifdef HAVE_READLINE_COMPLETITION
char *completionCmdSource(const char *text, int state);
char *completionCmdFile(const char *text, int state);
char *completionCmdInfo(const char *text, int state);
char *completionCmdSource(const char *text, int state);
char *completionCmdFile(const char *text, int state);
char *completionCmdInfo(const char *text, int state);
#define completionCmdUnDisplay NULL
#define completionCmdSetUserBp NULL
#define completionCmdSetOption NULL
#define completionCmdUnDisplay NULL
#define completionCmdSetUserBp NULL
#define completionCmdSetOption NULL
-#endif /* HAVE_LIBREADLINE */
+#endif /* HAVE_READLINE_COMPLETITION */
/* command table */
struct cmdtab
{
char *cmd ; /* command the user will enter */
int (*cmdfunc)(char *,context *); /* function to execute when command is entered */
/* command table */
struct cmdtab
{
char *cmd ; /* command the user will enter */
int (*cmdfunc)(char *,context *); /* function to execute when command is entered */
+#ifdef HAVE_READLINE_COMPLETITION
rl_compentry_func_t *completion_func;
#else
void *dummy;
rl_compentry_func_t *completion_func;
#else
void *dummy;
-#endif /* HAVE_LIBREADLINE */
+#endif /* HAVE_READLINE_COMPLETITION */
char *htxt ; /* short help text */
} cmdTab[] = {
char *htxt ; /* short help text */
} cmdTab[] = {
+#ifdef HAVE_READLINE_COMPLETITION
// helper function for doing readline completion.
// input: toknum=index of token to find (0=first token)
// output: *start=first character index of the token,
// helper function for doing readline completion.
// input: toknum=index of token to find (0=first token)
// output: *start=first character index of the token,
return (*compl_func)(text,state);
}
return (*compl_func)(text,state);
}
-#endif /* HAVE_LIBREADLINE */
+#endif /* HAVE_READLINE_COMPLETITION */
/*-----------------------------------------------------------------*/
/* commandLoop - the main command loop or loop over command file */
/*-----------------------------------------------------------------*/
/* commandLoop - the main command loop or loop over command file */
FILE *old_rl_instream, *old_rl_outstream;
actualcmdfile = cmdfile;
FILE *old_rl_instream, *old_rl_outstream;
actualcmdfile = cmdfile;
+#ifdef HAVE_READLINE_COMPLETITION
rl_completion_entry_function = completionMain;
rl_completion_entry_function = completionMain;
+#endif /* HAVE_READLINE_COMPLETITION */
rl_readline_name = "sdcdb"; // Allow conditional parsing of the ~/.inputrc file.
// save readline's input/output streams
rl_readline_name = "sdcdb"; // Allow conditional parsing of the ~/.inputrc file.
// save readline's input/output streams