home *** CD-ROM | disk | FTP | other *** search
/ ftp.uv.es / 2014.11.ftp.uv.es.tar / ftp.uv.es / pub / unix / pine4.10.tar.gz / pine4.10.tar / pine4.10 / imap / src / c-client / misc.h < prev    next >
C/C++ Source or Header  |  1998-09-16  |  3KB  |  88 lines

  1. /*
  2.  * Program:    Miscellaneous utility routines
  3.  *
  4.  * Author:    Mark Crispin
  5.  *        Networks and Distributed Computing
  6.  *        Computing & Communications
  7.  *        University of Washington
  8.  *        Administration Building, AG-44
  9.  *        Seattle, WA  98195
  10.  *        Internet: MRC@CAC.Washington.EDU
  11.  *
  12.  * Date:    5 July 1988
  13.  * Last Edited:    19 June 1998
  14.  *
  15.  * Sponsorship:    The original version of this work was developed in the
  16.  *        Symbolic Systems Resources Group of the Knowledge Systems
  17.  *        Laboratory at Stanford University in 1987-88, and was funded
  18.  *        by the Biomedical Research Technology Program of the National
  19.  *        Institutes of Health under grant number RR-00785.
  20.  *
  21.  * Original version Copyright 1988 by The Leland Stanford Junior University
  22.  * Copyright 1998 by the University of Washington
  23.  *
  24.  *  Permission to use, copy, modify, and distribute this software and its
  25.  * documentation for any purpose and without fee is hereby granted, provided
  26.  * that the above copyright notices appear in all copies and that both the
  27.  * above copyright notices and this permission notice appear in supporting
  28.  * documentation, and that the name of the University of Washington or The
  29.  * Leland Stanford Junior University not be used in advertising or publicity
  30.  * pertaining to distribution of the software without specific, written prior
  31.  * permission.  This software is made available "as is", and
  32.  * THE UNIVERSITY OF WASHINGTON AND THE LELAND STANFORD JUNIOR UNIVERSITY
  33.  * DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD TO THIS SOFTWARE,
  34.  * INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
  35.  * FITNESS FOR A PARTICULAR PURPOSE, AND IN NO EVENT SHALL THE UNIVERSITY OF
  36.  * WASHINGTON OR THE LELAND STANFORD JUNIOR UNIVERSITY BE LIABLE FOR ANY
  37.  * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
  38.  * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
  39.  * CONTRACT, TORT (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF
  40.  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  41.  *
  42.  */
  43.  
  44. /* KLUDGE ALERT!!!
  45.  *
  46.  * Yes, write() is overridden here instead of in osdep.  This
  47.  * is because misc.h is one of the last files that most things #include, so
  48.  * this should avoid problems with some system #include file.
  49.  */
  50.  
  51. #define write safe_write
  52.  
  53.  
  54. /* Some C compilers have these as macros */
  55.  
  56. #undef min
  57. #undef max
  58.  
  59.  
  60. /* And some C libraries have these as int functions */
  61.  
  62. #define min Min
  63. #define max Max
  64.  
  65.  
  66. /* Compatibility definitions */
  67.  
  68. #define pmatch(s,pat) \
  69.   pmatch_full (s,pat,NIL)
  70.  
  71.  
  72. /* Function prototypes */
  73.  
  74. char *ucase (char *string);
  75. char *lcase (char *string);
  76. char *cpystr (const char *string);
  77. char *cpytxt (SIZEDTEXT *dst,char *text,unsigned long size);
  78. char *textcpy (SIZEDTEXT *dst,SIZEDTEXT *src);
  79. char *textcpystring (SIZEDTEXT *text,STRING *bs);
  80. char *textcpyoffstring (SIZEDTEXT *text,STRING *bs,unsigned long offset,
  81.             unsigned long size);
  82. unsigned long find_rightmost_bit (unsigned long *valptr);
  83. long min (long i,long j);
  84. long max (long i,long j);
  85. long search (unsigned char *base,long basec,unsigned char *pat,long patc);
  86. long pmatch_full (char *s,char *pat,char delim);
  87. long dmatch (char *s,char *pat,char delim);
  88.