home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR41 / CBASE11.ZIP / XTEND.H < prev    next >
C/C++ Source or Header  |  1993-01-01  |  2KB  |  84 lines

  1. /*
  2.  *    Copyright (c) 1989-1992 Citadel Software, Inc.
  3.  *    All Rights Reserved
  4.  */
  5.  
  6. /*man---------------------------------------------------------------------------
  7. NAME
  8.      xstring.h -
  9.  
  10. SYNOPSIS
  11.      #include "xstring.h"
  12.  
  13. DESCRIPTION
  14.  
  15. SEE ALSO
  16.  
  17. ------------------------------------------------------------------------------*/
  18. #ifndef H_XTEND
  19. #define H_XTEND
  20.  
  21. /* #ident    "@(#)xtend.h    1.7 - 93/01/01" */
  22.  
  23. #include <port.h>
  24.  
  25. /* standard headers */
  26. #include <ctype.h>
  27.  
  28. /* macros */
  29. /* macro for number elements in a static array */
  30. #define nelems(v)    (sizeof(v) / sizeof(*(v)))
  31.  
  32. #define NUL        ('\0')        /* nul character */
  33.  
  34. /* macro for sizeof a structure member */
  35. #define sizeofm(struct_t, member) ((size_t)(sizeof(((struct_t *)0)->member)))
  36.  
  37. /* cvtss m macros */
  38. #define CVT_TP        (0x0001)    /* trim the parity bit */
  39. #define CVT_XSP        (0x0002)    /* discard spaces and tabs */
  40. #define CVT_XCTL    (0x0004)    /* discard control characters */
  41. #define CVT_XLEADSP    (0x0008)    /* discard leading spaces and tabs */
  42. #define CVT_1SP        (0x0010)    /* reduce spaces, tabs to one space */
  43. #define CVT_UPPER    (0x0020)    /* convert lowercase to uppercase */
  44. #define CVT_BTOP    (0x0040)    /* convert [ to ( and ] to ) */
  45. #define CVT_XTRAILSP    (0x0080)    /* discard trailing spaces and tabs */
  46. #define CVT_QUOTES    (0x0100)    /* do not alter chars inside single or
  47.                      double quotes except for parity bit
  48.                      trimming */
  49.  
  50. /* function declarations */
  51. #ifdef AC_PROTO
  52. int        cvtss(char *t, const char *s, int m, int n);
  53. void        errlog(const char *file, int line, const char *msg, ...);
  54. int        fmltolfm(char *t, const char *s, size_t n);
  55. int        lfmtofml(char *t, const char *s, size_t n);
  56. size_t        strnlen(const char *s, size_t n);
  57. void PTR_FAR *    xcalloc(unsigned long n, unsigned long size);
  58. void        xfree(void PTR_FAR *p);
  59. void PTR_FAR *    xmalloc(unsigned long size);
  60. void        xperror(const char *s);
  61. void PTR_FAR *    xrealloc(void PTR_FAR *p, unsigned long size);
  62. const char *    xstrerror(int errno);
  63. #else
  64. int        cvtss();
  65. void        errlog();
  66. int        fmltolfm();
  67. int        lfmtofml();
  68. size_t        strnlen();
  69. void PTR_FAR *    xcalloc();
  70. void        xfree();
  71. void PTR_FAR *    xmalloc();
  72. void        xperror();
  73. void PTR_FAR *    xrealloc();
  74. const char *    xstrerror();
  75. #endif
  76.  
  77. /* global data declarations */
  78. extern const int
  79.         xsys_nerr;
  80. extern const char * const
  81.         xsys_errlist[];
  82.  
  83. #endif    /* #ifndef H_XTEND */
  84.