home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / gnu / src / baseline / jove-4.14.6.lha / jove-4.14.6 / util.h < prev    next >
C/C++ Source or Header  |  1992-01-10  |  3KB  |  94 lines

  1. /***************************************************************************
  2.  * This program is Copyright (C) 1986, 1987, 1988 by Jonathan Payne.  JOVE *
  3.  * is provided to you without charge, and with no warranty.  You may give  *
  4.  * away copies of JOVE, including sources, provided that this notice is    *
  5.  * included in all the files.                                              *
  6.  ***************************************************************************/
  7.  
  8. /* some utility functions, as macros, to be included by jove.h */
  9.  
  10. extern char    key_strokes[100],
  11.         *keys_p;
  12.  
  13. extern int    ModCount;
  14.  
  15. #define init_strokes()    { keys_p = key_strokes; *keys_p = '\0'; }
  16. #define add_stroke(c)    { \
  17.     if (keys_p < &key_strokes[sizeof (key_strokes) - 1]) { \
  18.         *keys_p++ = (c); \
  19.         *keys_p = '\0'; \
  20.     } \
  21. }
  22.  
  23. #define IsModified(b)    ((b)->b_modified)
  24. #define SavLine(a, b)    ((a)->l_dline = putline((b)))
  25. #define SetLine(line)    DotTo((line), 0)
  26. #define bobp()        (firstp(curline) && bolp())
  27. #define bolp()        (curchar == 0)
  28. #define eobp()        (lastp(curline) && eolp())
  29. #define eolp()        (linebuf[curchar] == '\0')
  30. #define firstp(line)    ((line) == curbuf->b_first)
  31. #define getDOT()    getline(curline->l_dline, linebuf)
  32. #define lastp(line)    ((line) == curbuf->b_last)
  33.  
  34. extern UnivPtr
  35.     emalloc proto((size_t size)),
  36.     erealloc proto((UnivPtr ptr, size_t size));
  37.  
  38. extern char
  39.     *IOerr proto((char *err, char *file)),
  40.     *StrIndex proto((int dir,char *buf,int charpos, int what)),
  41.     *basename proto((char *f)),
  42.     *copystr proto((char *str)),
  43.     *filename proto((struct buffer *b)),
  44.     *get_time proto((time_t *timep,char *buf,int from,int to)),
  45.     *itoa proto((int num)),
  46.     *lcontents proto((struct line *line)),
  47.     *ltobuf proto((struct line *line,char *buf));
  48.  
  49. extern int
  50.     LineDist proto((struct line *nextp,struct line *endp)),
  51.     TwoBlank proto((void)),
  52.     casecmp proto((char *s1,char *s2)),
  53.     casencmp proto((char *s1,char *s2, size_t n)),
  54.     inorder proto((struct line *nextp,int char1,struct line *endp,int char2)),
  55.     length proto((struct line *line)),
  56.     max proto((int a,int b)),
  57.     min proto((int a,int b)),
  58.     numcomp proto((char *s1,char *s2)),
  59.     pnt_line proto((void)),
  60.     waitchar proto((int *slow));
  61.  
  62. extern bool
  63.     blnkp proto((char *buf)),
  64.     within_indent proto((void)),
  65.     fixorder proto((struct line * *line1,int *char1,struct line * *line2,int *char2)),
  66.     inlist proto((struct line *first,struct line *what)),
  67.     sindex proto((char *pattern,char *string)),
  68.     ModBufs proto((bool allp));
  69.  
  70. extern void
  71.     DOTsave proto((struct position *buf)),
  72.     DotTo proto((struct line *line,int col)),
  73.     ExecCmd proto((struct data_obj *cp)),
  74.     PushPntp proto((struct line *line)),
  75.     SetDot proto((struct position *bp)),
  76.     ToFirst proto((void)),
  77.     ToLast proto((void)),
  78.     ins_c proto((int c,char *buf,int atchar,int num,int max)),
  79.     len_error proto((int flag)),
  80.     linecopy proto((char *onto,int atchar,char *from)),
  81.     make_argv proto((char * *argv,char *ap)),
  82.     modify proto((void)),
  83.     SitFor proto((int delay)),
  84.     null_ncpy proto((char *to, char *from, size_t n)),
  85. #ifdef    UNIX
  86.     dopipe proto((int *p)),
  87.     pipeclose proto((int *p)),
  88. #endif
  89.     pop_env proto((jmp_buf)),
  90.     push_env proto((jmp_buf)),
  91.     to_word proto((int dir)),
  92.     unmodify proto((void)),
  93.     pp_key_strokes proto((char *buffer, size_t size));
  94.