A few more files added as part of the conversion to C++.

This commit is contained in:
W. Eric Norum
2000-12-18 15:35:10 +00:00
parent ad7dc7153c
commit f89e77438d
2 changed files with 78 additions and 0 deletions
+49
View File
@@ -0,0 +1,49 @@
/* epicsReadline.c */
/* Author: Eric Norum Date: 18DEC2000 */
/*
* Wrappers around readline calls to work around the fact that
* on many machines readline.h declares functions with old-style
* (i.e. non-prototype) syntax. The old syntax is incompatible
* with C++.
*/
#include <stdio.h>
#include "epicsReadline.h"
#ifdef IOCSH_USE_READLINE
#include <readline/readline.h>
#include <readline/history.h>
#else
/*
* Fake versions of some readline/history routines
*/
#define readline(p) do { } while(0)
#define stifle_history(n) do { } while(0)
#define add_history(l) do { } while(0)
#define rl_bind_key(c,f) do { } while(0)
#endif
char *epics_readline (const char *prompt)
{
return readline (prompt);
}
void epics_stifle_history (int n)
{
stifle_history (n);
}
void epics_add_history (const char *line)
{
add_history (line);
}
void epics_bind_keys (void)
{
rl_bind_key ('\t', rl_insert);
}
+29
View File
@@ -0,0 +1,29 @@
/* epicsReadline.h */
/* Author: Eric Norum Date: 18DEC2000 */
/*
* Wrappers around readline calls to work around the fact that
* on many machines readline.h declares functions with old-style
* (i.e. non-prototype) syntax. The old syntax is incompatible
* with C++.
*/
#ifndef _EPICS_READLINE_H_
#define _EPICS_READLINE_H_
#include <shareLib.h>
#ifdef __cplusplus
extern "C" {
#endif
epicsShareFunc char * epicsShareAPI epics_readline (const char *prompt);
epicsShareFunc void epicsShareAPI epics_stifle_history (int n);
epicsShareFunc void epicsShareAPI epics_add_history (const char *line);
epicsShareFunc void epicsShareAPI epics_bind_keys (void);
#ifdef __cplusplus
}
#endif
#endif /* _EPICS_READLINE_H_ */