home *** CD-ROM | disk | FTP | other *** search
/ ftp.ncftp.com / ftp.ncftp.com.zip / ftp.ncftp.com / libncftp / older_versions / libncftp-3.1.5-src.tar.gz / libncftp-3.1.5-src.tar / libncftp-3.1.5 / Strn / Strn.h < prev    next >
C/C++ Source or Header  |  2002-06-28  |  2KB  |  83 lines

  1. /* Strn.h */
  2.  
  3. #ifndef _Strn_h_
  4. #define _Strn_h_ 1
  5.  
  6. #ifdef __cplusplus
  7. extern "C"
  8. {
  9. #endif    /* __cplusplus */
  10.  
  11. /* You could define this from the Makefile. */
  12. #ifndef STRN_ZERO_PAD
  13. #    define STRN_ZERO_PAD 1
  14. #endif
  15.  
  16. /* You could define this from the Makefile. */
  17. #ifndef STRNP_ZERO_PAD
  18. #    define STRNP_ZERO_PAD 0
  19. #endif
  20.  
  21. /* Strncat.c */
  22. char *Strncat(char *const, const char *const, const size_t);
  23.  
  24. /* Strncpy.c */
  25. char *Strncpy(char *const, const char *const, const size_t);
  26.  
  27. /* Strnpcat.c */
  28. char *Strnpcat(char *const, const char *const, size_t);
  29.  
  30. /* Strnpcpy.c */
  31. char *Strnpcpy(char *const, const char *const, size_t);
  32.  
  33. /* Strntok.c */
  34. char *Strtok(char *, const char *);
  35. int Strntok(char *, size_t, char *, const char *);
  36.  
  37. /* strtokc.c */
  38. char *strtokc(char *, const char *, char **);
  39. size_t strntokc(char *, size_t, char *, const char *, char **);
  40.  
  41. /* Dynscat.c */
  42. char * Dynscat(char **dst, ...);
  43.  
  44. /* Dynscpy.c */
  45. char * Dynscpy(char **dst, ...);
  46.  
  47. /* Dynsrecpy.c */
  48. char * Dynsrecpy(char **dst, ...);
  49.  
  50. /* StrFree.c */
  51. void StrFree(char **dst);
  52.  
  53. #ifndef _DStrInternal_h_
  54. typedef struct DStr {
  55.     /* All of these structure fields are read-only; do not modify
  56.      * them directly.
  57.      */
  58.     char *s;
  59.     size_t len;
  60.     size_t allocSize;
  61. } DStr, *DStrPtr;
  62. #endif
  63.  
  64. void DStrInit(DStr *const dst);
  65. void DStrFree(DStr *const dst);
  66. void DStrClear(DStr *const dst);
  67. int DStrNew(DStr *const dst, const size_t srcLen);
  68. const char *DStrCpy(DStr *const dst, const char *const src);
  69. const char *DStrCat(DStr *const dst, const char *const src);
  70. const char *DStrCatList(DStr *const dst, ...);
  71. const char *DStrCpyList(DStr *const dst, ...);
  72.  
  73. #ifdef __cplusplus
  74. }
  75. #endif    /* __cplusplus */
  76.  
  77. #define STRNCPY(d,s) Strncpy((d), (s), (size_t) sizeof(d))
  78. #define STRNCAT(d,s) Strncat((d), (s), (size_t) sizeof(d))
  79.  
  80. #endif    /* _Strn_h_ */
  81.  
  82. /* eof Strn.h */
  83.