aboutsummaryrefslogtreecommitdiff
path: root/readline/examples
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>1999-08-02 23:48:02 +0000
committerJason Molenda <jmolenda@apple.com>1999-08-02 23:48:02 +0000
commitc862e87b3ec8647ab6c1bb08443088ea81c74225 (patch)
tree8e5828b091fea3257c7ffc20a5c95f1d62b93267 /readline/examples
parentc95b01a9b04837dbfc8986afbbccc4c7d2b4ebf8 (diff)
downloadgdb-c862e87b3ec8647ab6c1bb08443088ea81c74225.zip
gdb-c862e87b3ec8647ab6c1bb08443088ea81c74225.tar.gz
gdb-c862e87b3ec8647ab6c1bb08443088ea81c74225.tar.bz2
import gdb-1999-08-02 snapshot
Diffstat (limited to 'readline/examples')
-rw-r--r--readline/examples/Makefile.in13
-rw-r--r--readline/examples/rl.c3
-rw-r--r--readline/examples/rlversion.c21
3 files changed, 32 insertions, 5 deletions
diff --git a/readline/examples/Makefile.in b/readline/examples/Makefile.in
index 1848673..879aa49 100644
--- a/readline/examples/Makefile.in
+++ b/readline/examples/Makefile.in
@@ -1,6 +1,6 @@
# This is the Makefile for the examples subdirectory of readline. -*- text -*-
#
-SHELL = /bin/sh
+SHELL = @MAKE_SHELL@
RM = rm -f
srcdir = @srcdir@
@@ -14,7 +14,7 @@ CFLAGS = @CFLAGS@
LOCAL_CFLAGS = @LOCAL_CFLAGS@
CPPFLAGS = @CPPFLAGS@
-INCLUDES = -I $(srcdir) -I $(top_srcdir) -I..
+INCLUDES = -I$(srcdir) -I$(top_srcdir) -I..
CCFLAGS = $(DEFS) $(LOCAL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(CFLAGS)
LDFLAGS = -g -L..
@@ -22,10 +22,11 @@ LDFLAGS = -g -L..
TERMCAP_LIB = @TERMCAP_LIB@
.c.o:
+ ${RM} $@
$(CC) $(CCFLAGS) -c $<
-EXECUTABLES = fileman rltest rl
-OBJECTS = fileman.o rltest.o rl.o
+EXECUTABLES = fileman rltest rl rlversion
+OBJECTS = fileman.o rltest.o rl.o rlversion.o
all: $(EXECUTABLES)
@@ -38,6 +39,9 @@ fileman: fileman.o
rltest: rltest.o
$(CC) $(LDFLAGS) -o $@ rltest.o -lreadline $(TERMCAP_LIB)
+rlversion: rlversion.o
+ $(CC) $(LDFLAGS) -o $@ rlversion.o -lreadline $(TERMCAP_LIB)
+
clean mostlyclean:
$(RM) $(OBJECTS)
$(RM) $(EXECUTABLES)
@@ -48,3 +52,4 @@ distclean maintainer-clean: clean
fileman.o: fileman.c
rltest.o: rltest.c
rl.o: rl.c
+rlversion.o: rlversion.c
diff --git a/readline/examples/rl.c b/readline/examples/rl.c
index ccddd0f..17a6343 100644
--- a/readline/examples/rl.c
+++ b/readline/examples/rl.c
@@ -42,6 +42,7 @@ set_deftext ()
}
}
+static void
usage()
{
fprintf (stderr, "%s: usage: %s [-p prompt] [-u unit] [-d default]\n",
@@ -54,7 +55,7 @@ main (argc, argv)
{
char *temp, *prompt;
struct stat sb;
- int done, opt, fd;
+ int opt, fd;
FILE *ifp;
progname = strrchr(argv[0], '/');
diff --git a/readline/examples/rlversion.c b/readline/examples/rlversion.c
new file mode 100644
index 0000000..2d73a96
--- /dev/null
+++ b/readline/examples/rlversion.c
@@ -0,0 +1,21 @@
+/*
+ * rlversion -- print out readline's version number
+ */
+
+#define READLINE_LIBRARY
+
+#if defined (HAVE_CONFIG_H)
+# include <config.h>
+#endif
+
+#include <stdio.h>
+#include <sys/types.h>
+#include "posixstat.h"
+
+#include "readline.h"
+
+main()
+{
+ printf ("%s\n", rl_library_version ? rl_library_version : "unknown");
+ exit (0);
+}