home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / vile-src.zip / vile-8.1 / api.h < prev    next >
C/C++ Source or Header  |  1998-07-01  |  3KB  |  65 lines

  1. /*
  2.  * $Header: /usr/build/vile/vile/RCS/api.h,v 1.11 1998/07/01 23:52:51 tom Exp $
  3.  */
  4.  
  5. /*
  6.  * The VileBuf structure is used by an extension language (such
  7.  * as Perl) interface to provide an interface to BUFFER.  In this
  8.  * structure, we have a pointer to a BUFFER as well as other fields.
  9.  *
  10.  * In particular, the fwp (fake window pointer) is needed because
  11.  * most of vile's editing operations will not work right unless there
  12.  * is also an associated window.  We don't necessarily want to change
  13.  * the user visible windows, so we create a fake window (and then
  14.  * later destroy it) for the express purpose of fooling the rest of
  15.  * vile into thinking that it's working on a real window.  Care
  16.  * must be taken not to enter any display code, however, since these
  17.  * fake windows use negative numbers to denote the top line of the
  18.  * screen.
  19.  */
  20.  
  21. typedef struct {
  22.     BUFFER    * bp;
  23.     WINDOW    * fwp;        /* fake window pointer */
  24.     REGION      region;        /* Region to traverse */
  25.     REGIONSHAPE regionshape;
  26.     int         inplace_edit;    /* Delete after get? */
  27.     int         dot_inited;        /* Has dot been initialized
  28.                                        for api_dotgline? */
  29.     int         changed;        /* Were any changes done? */
  30.     int         dot_changed;    /* DOT explicitly changed --
  31.                        implies that DOT should
  32.                        be propogated */
  33.     int        ndel;        /* number of characters to delete upon
  34.                        setup; related to the inplace_edit
  35.                        stuff */
  36. #if OPT_PERL
  37.     void      * perl_handle;    /* perl visible handle to this
  38.                        data structure */
  39. #endif
  40. } VileBuf;
  41.  
  42. extern    int    api_aline(VileBuf *, int, char *, int);
  43. extern    int    api_edit(char *fname, VileBuf **retspp);
  44. extern    int    api_dline(VileBuf *, int);
  45. extern    int    api_gline(VileBuf *, int, char **, int *);
  46. extern    int    api_sline(VileBuf *, int, char *, int);
  47. extern    int    api_iline(VileBuf *, int, char *, int);
  48. extern    int    api_lline(VileBuf *, int *);
  49. extern    int    api_swscreen(VileBuf *, VileBuf *);
  50. extern    VileBuf *api_fscreen(char *);
  51. extern    VileBuf *api_bp2vbp(BUFFER *bp);
  52. extern    void    api_command_cleanup(void);
  53. extern    int    api_dotinsert(VileBuf *sp, char *text, int len);
  54. extern    int    api_dotgline(VileBuf *, char **, int *, int *);
  55. extern    int    api_gotoline(VileBuf *sp, int lno);
  56. extern    void    api_setup_fake_win(VileBuf *sp, int do_delete);
  57. extern    int    api_delregion(VileBuf *vbp);
  58. extern    int    api_motion(VileBuf *vbp, char *mstr);
  59. extern    void    api_update(void);
  60.  
  61. extern    WINDOW *curwp_visible;
  62.  
  63. #define vbp2bp(sp) (((VileBuf *)(sp))->bp)
  64. #define bp2vbp(bp) ((VileBuf *) (bp)->b_api_private)
  65.