X-Git-Url: https://git.distorted.org.uk/~mdw/xtoys/blobdiff_plain/d0639ab5f11f3fc56f426893270d7f4b8ae6408f..d0499b4efd7fd2731d1b6fbe10e7503709f7501a:/xgetline.c diff --git a/xgetline.c b/xgetline.c index 1e060cc..9c02fa9 100644 --- a/xgetline.c +++ b/xgetline.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: xgetline.c,v 1.11 1999/08/20 07:30:33 mdw Exp $ + * $Id: xgetline.c,v 1.13 2004/04/08 01:36:29 mdw Exp $ * * Fetch a line of text from the user * @@ -26,46 +26,6 @@ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*----- Revision history --------------------------------------------------* - * - * $Log: xgetline.c,v $ - * Revision 1.11 1999/08/20 07:30:33 mdw - * Miscellaneous changes, mostly concerning options parsing. - * - * Revision 1.10 1999/05/21 22:09:19 mdw - * Take advantage of new dynamic string macros. - * - * Revision 1.9 1999/05/05 18:54:37 mdw - * Keep blank lines out of the history list. - * - * Revision 1.8 1998/12/16 19:58:53 mdw - * Stop the dropdown list from dropping down when you press enter. - * - * Revision 1.7 1998/12/11 09:53:02 mdw - * Updates for mLib/mgLib. Support history files for recalling past - * entries, using a drop-down list. - * - * Revision 1.6 1998/12/03 00:56:29 mdw - * Set focus on the entry field, rather than leaving things to luck. - * - * Revision 1.5 1998/12/03 00:39:44 mdw - * Force focus when starting up. - * - * Revision 1.4 1998/11/30 22:36:47 mdw - * Tidy up tabbing in help texts very slightly. - * - * Revision 1.3 1998/11/21 22:30:20 mdw - * Support GNU-style long options throughout, and introduce proper help - * text to all programs. Update manual pages to match. - * - * Revision 1.2 1998/11/18 21:25:30 mdw - * Remove bogus `-h' option from the options list. - * - * Revision 1.1 1998/11/16 23:00:49 mdw - * Initial versions. - * - */ - /*----- Header files ------------------------------------------------------*/ #include @@ -179,14 +139,12 @@ int main(int argc, char *argv[]) const char *list = 0; int histmax = 20; - GList *hist; + GList *hist = 0; - enum { - f_invis = 1, - f_duff = 2, - f_history = 4, - f_nochoice = 8 - }; +#define f_invis 1u +#define f_duff 2u +#define f_history 4u +#define f_nochoice 8u /* --- User interface bits --- */ @@ -351,7 +309,6 @@ Options available are:\n\ * Inability to open the file is not a disaster. */ - hist = 0; if (fp) { dstr d = DSTR_INIT;