X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=lib%2Freadline%2Fexamples%2Ffileman.c;h=0702a5badc767a6eba24a40c14f7deaac3310215;hb=d166f048818e10cf3799aa24a174fb22835f1acc;hp=8709120dfa14ad74692f8bcd373c33a9614beed3;hpb=ccc6cda312fea9f0468ee65b8f368e9653e1380b;p=platform%2Fupstream%2Fbash.git diff --git a/lib/readline/examples/fileman.c b/lib/readline/examples/fileman.c index 8709120..0702a5b 100644 --- a/lib/readline/examples/fileman.c +++ b/lib/readline/examples/fileman.c @@ -1,15 +1,38 @@ /* fileman.c -- A tiny application which demonstrates how to use the GNU Readline library. This application interactively allows users to manipulate files and their modes. */ +/* + * Remove the next line if you're compiling this against an installed + * libreadline.a + */ +#define READLINE_LIBRARY + +#ifdef HAVE_CONFIG_H +#include +#endif -#include #include +#ifdef HAVE_SYS_FILE_H #include +#endif #include -#include -#include -#include +#include +#include + +#if defined (HAVE_STRING_H) +# include +#else /* !HAVE_STRING_H */ +# include +#endif /* !HAVE_STRING_H */ + +#ifdef READLINE_LIBRARY +# include "readline.h" +# include "history.h" +#else +# include +# include +#endif extern char *getwd (); extern char *xmalloc (); @@ -54,7 +77,7 @@ int done; char * dupstr (s) - int s; + char *s; { char *r; @@ -304,7 +327,8 @@ com_stat (arg) printf ("Statistics for `%s':\n", arg); - printf ("%s has %d link%s, and is %d byte%s in length.\n", arg, + printf ("%s has %d link%s, and is %d byte%s in length.\n", + arg, finfo.st_nlink, (finfo.st_nlink == 1) ? "" : "s", finfo.st_size,