Adding upstream version 8.2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
This commit is contained in:
parent
d2b2af6dd3
commit
3a96b6e8dc
160 changed files with 152075 additions and 0 deletions
37
examples/rlbasic.c
Normal file
37
examples/rlbasic.c
Normal file
|
@ -0,0 +1,37 @@
|
|||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef HAVE_LOCALE_H
|
||||
# include <locale.h>
|
||||
#endif
|
||||
|
||||
#if defined (READLINE_LIBRARY)
|
||||
# include "readline.h"
|
||||
# include "history.h"
|
||||
#else
|
||||
# include <readline/readline.h>
|
||||
# include <readline/history.h>
|
||||
#endif
|
||||
|
||||
int
|
||||
main (int c, char **v)
|
||||
{
|
||||
char *input;
|
||||
|
||||
#ifdef HAVE_SETLOCALE
|
||||
setlocale (LC_ALL, "");
|
||||
#endif
|
||||
|
||||
for (;;) {
|
||||
input = readline ((char *)NULL);
|
||||
if (input == 0)
|
||||
break;
|
||||
printf ("%s\n", input);
|
||||
if (strcmp (input, "exit") == 0)
|
||||
break;
|
||||
free (input);
|
||||
}
|
||||
exit (0);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue