home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / forth / pfe-0.000 / pfe-0 / pfe-0.9.13 / src / lined.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-17  |  2.5 KB  |  62 lines

  1. /*
  2.  * This file is part of the portable Forth environment written in ANSI C.
  3.  * Copyright (C) 1995  Dirk Uwe Zoller
  4.  *
  5.  * This library is free software; you can redistribute it and/or
  6.  * modify it under the terms of the GNU Library General Public
  7.  * License as published by the Free Software Foundation; either
  8.  * version 2 of the License, or (at your option) any later version.
  9.  *
  10.  * This library is distributed in the hope that it will be useful,
  11.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13.  * See the GNU Library General Public License for more details.
  14.  *
  15.  * You should have received a copy of the GNU Library General Public
  16.  * License along with this library; if not, write to the Free
  17.  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  *
  19.  * This file is version 0.9.13 of 17-July-95
  20.  * Check for the latest version of this package via anonymous ftp at
  21.  *    roxi.rz.fht-mannheim.de:/pub/languages/forth/pfe-VERSION.tar.gz
  22.  * or    sunsite.unc.edu:/pub/languages/forth/pfe-VERSION.tar.gz
  23.  * or    ftp.cygnus.com:/pub/forth/pfe-VERSION.tar.gz
  24.  *
  25.  * Please direct any comments via internet to
  26.  *    duz@roxi.rz.fht-mannheim.de.
  27.  * Thank You.
  28.  */
  29. /*
  30.  * lined.h --- declarations for line editor
  31.  * (duz 08Jun93)
  32.  */
  33.  
  34. /* Simple input of one line only: initialize the members string and max_length
  35.    and all others with 0, then call lined().
  36.    For luxury: before first call to lined() initialize history and
  37.    history_max with a static or malloc()-ed memory area, all others with 0.
  38.    Then don't touch the components between further calls to lined()
  39. */
  40.  
  41. struct lined
  42. {
  43.   char *string;            /* where to place the result */
  44.   int max_length;        /* maximum chars to input */
  45.   char *history;        /* where the history is kept */
  46.   int history_max;        /* size of history area */
  47.   int (*complete)        /* called on tab key for completion */
  48.     (char *in,            /* string typed so far */
  49.      char *out,            /* possible completion */
  50.      int display);        /* flag: display alternatives */
  51.   void (**executes) (int);    /* NULL or list of functions bound to keys */
  52.   int length;            /* output: how many chars actually typed */
  53.   char overtype, caps, hidden;    /* flags */
  54.   /* these are for internal use only: */
  55.   int cursor,            /* position in the string */
  56.   history_length,        /* how much history is available */
  57.   history_read,            /* when using arrow up and down: */
  58.   history_write;        /* where you are in that mass of strings. */
  59. };
  60.  
  61. int lined (struct lined *l, char *dflt);
  62.