]> git.jsancho.org Git - gacela.git/blob - gacela.c
(no commit message)
[gacela.git] / gacela.c
1 #include <stdio.h>
2 #include <readline/readline.h>
3
4 /* Read-Send-Print-Loop */
5 void rspl ()
6 {
7   static char *line = (char *)NULL;
8   int exit = 0;
9
10   while (!exit)
11     {
12       if (line)
13         {
14           free (line);
15           line = (char *)NULL;
16         }
17       
18       line = readline ("gacela>");
19
20       if (line && *line)
21         {
22           add_history (line);
23           if (strcmp (line, "(quit)") == 0)
24             exit = 1;
25         }
26     }
27 }
28
29 int main (int argc, char *argv[])
30 {
31   rspl ();
32   return 0;
33 }