File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / readline / examples / rlbasic.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Wed Mar 17 01:01:01 2021 UTC (3 years, 3 months ago) by misho
Branches: readline, MAIN
CVS tags: v8_2p0, v8_1p0, HEAD
readline 8.1

    1: #include <stdlib.h>
    2: #include <unistd.h>
    3: #include <stdio.h>
    4: #include <string.h>
    5: 
    6: #if defined (READLINE_LIBRARY)
    7: #  include "readline.h"
    8: #  include "history.h"
    9: #else
   10: #  include <readline/readline.h>
   11: #  include <readline/history.h>
   12: #endif
   13: 
   14: int
   15: main (int c, char **v)
   16: {
   17: 	char *input;
   18: 
   19: 	for (;;) {
   20: 		input = readline ((char *)NULL);
   21: 		if (input == 0)
   22: 			break;
   23: 		printf ("%s\n", input);
   24: 		if (strcmp (input, "exit") == 0)
   25: 			break;
   26: 		free (input);
   27: 	}
   28: 	exit (0);
   29: }

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>