home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / jove-4.16-src.tgz / tar.out / bsd / jove / util.h < prev    next >
C/C++ Source or Header  |  1996-09-28  |  3KB  |  95 lines

  1. /************************************************************************
  2.  * This program is Copyright (C) 1986-1996 by Jonathan Payne.  JOVE is  *
  3.  * 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 int
  11.     fnamecomp proto((UnivConstPtr, UnivConstPtr));    /* order file names */
  12.  
  13. #define IsModified(b)    ((b)->b_modified)
  14. #define SavLine(a, b)    ((a)->l_dline = putline((b)))
  15. #define SetLine(line)    DotTo((line), 0)
  16. #define bobp()        (firstp(curline) && bolp())
  17. #define bolp()        (curchar == 0)
  18. #define eobp()        (lastp(curline) && eolp())
  19. #define eolp()        (linebuf[curchar] == '\0')
  20. #define firstp(line)    ((line) == curbuf->b_first)
  21. #define getDOT()    getline(curline->l_dline, linebuf)
  22. #define lastp(line)    ((line) == curbuf->b_last)
  23.  
  24. extern UnivPtr
  25.     emalloc proto((size_t size)),
  26.     erealloc proto((UnivPtr ptr, size_t size));
  27.  
  28. extern char
  29.     *IOerr proto((char *err, char *file)),
  30.     *basename proto((char *f)),
  31.     *copystr proto((const char *str)),
  32.     *filename proto((Buffer *b)),
  33.     *get_time proto((time_t *timep,char *buf,int from,int to)),
  34.     *lcontents proto((LinePtr line)),
  35.     *ltobuf proto((LinePtr line,char *buf));
  36.  
  37. extern int
  38.     inorder proto((LinePtr nextp,int char1,LinePtr endp,int char2)),
  39.     LineDist proto((LinePtr nextp,LinePtr endp)),
  40.     LinesTo proto((LinePtr from, LinePtr to)),
  41.     length proto((LinePtr line)),
  42.     max proto((int a,int b)),
  43.     min proto((int a,int b)),
  44.     numcomp proto((char *s1,char *s2)),
  45.     numcompcase proto((char *s1,char *s2));
  46.  
  47. extern ZXchar
  48.     DecodePair proto((ZXchar first, ZXchar second));
  49.  
  50. extern bool
  51.     caseeqn proto((const char *s1, const char *s2, size_t n)),
  52.     TwoBlank proto((void)),
  53.     blnkp proto((char *buf)),
  54.     within_indent proto((void)),
  55.     fixorder proto((LinePtr  *line1,int *char1,LinePtr  *line2,int *char2)),
  56.     inlist proto((LinePtr first,LinePtr what)),
  57.     sindex proto((char *pattern,char *string)),
  58.     ModBufs proto((bool allp));
  59.  
  60. extern void
  61.     DOTsave proto((Bufpos *buf)),
  62.     DotTo proto((LinePtr line,int col)),
  63.     PushPntp proto((LinePtr line)),
  64.     SetDot proto((Bufpos *bp)),
  65.     ToFirst proto((void)),
  66.     ToLast proto((void)),
  67.     ins_c proto((DAPchar c,char *buf,int atchar,int num,int max)),
  68.     len_error proto((int flag)),
  69.     linecopy proto((char *onto,int atchar,char *from)),
  70. #if 0
  71.     make_argv proto((char * *argv, va_list ap)),
  72. #endif
  73.     modify proto((void)),
  74.     diverge proto((Buffer *buf, bool d)),
  75.     null_ncpy proto((char *to, const char *from, size_t n)),
  76. #ifdef UNIX
  77.     dopipe proto((int *p)),
  78.     pipeclose proto((int *p)),
  79. #endif
  80.     pop_env proto((jmp_buf)),
  81.     push_env proto((jmp_buf)),
  82.     to_word proto((int dir)),
  83.     unmodify proto((void));
  84.  
  85. extern UnivPtr
  86.     freealloc proto((UnivPtr obj, size_t size));
  87.  
  88. /* Variables: */
  89.  
  90. extern int    MarkThresh;        /* VAR: moves greater than MarkThresh will SetMark */
  91.  
  92. /* externs.h:
  93.  *    strerror (ifdef NO_STRERROR)
  94.  */
  95.