home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / lib / libpics / htstring.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  4.7 KB  |  129 lines

  1.  
  2. /*  W3 Copyright statement 
  3. Copyright 1995 by: Massachusetts Institute of Technology (MIT), INRIA</H2>
  4.  
  5. This W3C software is being provided by the copyright holders under the
  6. following license. By obtaining, using and/or copying this software,
  7. you agree that you have read, understood, and will comply with the
  8. following terms and conditions: 
  9.  
  10. Permission to use, copy, modify, and distribute this software and its
  11. documentation for any purpose and without fee or royalty is hereby
  12. granted, provided that the full text of this NOTICE appears on
  13. <EM>ALL</EM> copies of the software and documentation or portions
  14. thereof, including modifications, that you make. 
  15.  
  16. <B>THIS SOFTWARE IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO
  17. REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED.  BY WAY OF EXAMPLE,
  18. BUT NOT LIMITATION, COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR
  19. WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR
  20. THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY
  21. THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
  22. COPYRIGHT HOLDERS WILL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE
  23. OR DOCUMENTATION.
  24.  
  25. The name and trademarks of copyright holders may NOT be used
  26. in advertising or publicity pertaining to the software without
  27. specific, written prior permission.  Title to copyright in this
  28. software and any associated documentation will at all times remain
  29. with copyright holders. 
  30. */
  31. /*                                     W3C Reference Library libwww Generic String Management
  32.                                 GENERIC STRING MANAGEMENT
  33.                                              
  34.  */
  35. /*
  36. **      (c) COPYRIGHT MIT 1995.
  37. **      Please first read the full copyright statement in the file COPYRIGH.
  38. */
  39. /*
  40.  
  41.    These functions provide functionality for case-independent string comparison and
  42.    allocations with copies etc.
  43.    
  44.    This module is implemented by HTString.c, and it is a part of the W3C Reference
  45.    Library.
  46.    
  47.  */
  48. #ifndef HTSTRING_H
  49. #define HTSTRING_H
  50. /*
  51.  
  52. DYNAMIC STRING MANIPULATION
  53.  
  54.    These two functions are dynamic versions of strcpyand strcat. They use mallocfor
  55.    allocating space for the string. If StrAllocCopyis called with a non-NULL dest, then
  56.    this is freed before the new value is assigned so that only the laststring created has
  57.    to be freed by the user. If StrAllocCatis called with a NULL pointer as destination
  58.    then it is equivalent to StrAllocCopy.
  59.    
  60.  */
  61. /* --- BEGIN removed by mharmsen@netscape.com on 7/9/97 --- */
  62. /* #define StrAllocCopy(dest, src) HTSACopy (&(dest), src) */
  63. /* #define StrAllocCat(dest, src)  HTSACat  (&(dest), src) */
  64. /* --- END removed by mharmsen@netscape.com on 7/9/97 --- */
  65.  
  66. extern char * HTSACopy (char **dest, const char *src);
  67. extern char * HTSACat  (char **dest, const char *src);
  68. /*
  69.  
  70. CASE-INSENSITIVE STRING COMPARISON
  71.  
  72.    The usual routines (comp instead of cmp) had some problem.
  73.    
  74.  */
  75. /* --- BEGIN removed by mharmsen@netscape.com on 7/9/97 --- */
  76. /* extern int strcasecomp  (const char *a, const char *b); */
  77. /* extern int strncasecomp (const char *a, const char *b, int n); */
  78. /* --- END removed by mharmsen@netscape.com on 7/9/97 --- */
  79. /*
  80.  
  81. STRING COMPARISON WITH WILD CARD MATCH
  82.  
  83.    String comparison function for file names with one wildcard * in the template.
  84.    Arguments are:
  85.    
  86.   tmpl                   is a template string to match the name against. agaist, may
  87.                          contain a single wildcard character * which matches zero or more
  88.                          arbitrary characters.
  89.                          
  90.   name                   is the name to be matched agaist the template.
  91.                          
  92.    Returns empty string ("") if perfect match, pointer to part matched by wildcard if any,
  93.    or NULL if no match. This is basically the same as YES if match, else NO.
  94.    
  95.  */
  96. extern char * HTStrMatch        (const char * tmpl, const char * name);
  97. extern char * HTStrCaseMatch    (const char * tmpl, const char * name);
  98. /*
  99.  
  100. CASE-INSENSITIVE STRSTR
  101.  
  102.    This works like strstr()but is not case-sensitive.
  103.    
  104.  */
  105. /* --- BEGIN removed by mharmsen@netscape.com on 7/9/97 --- */
  106. /* extern char * strcasestr (char * s1, char * s2); */
  107. /* --- END removed by mharmsen@netscape.com on 7/9/97 --- */
  108. /*
  109.  
  110. STRIP WHITE SPACE OFF A STRING
  111.  
  112.    Return value points to first non-white character, or to '/0' if none. All trailing
  113.    white space is OVERWRITTEN with zero.
  114.    
  115.  */
  116. extern char * HTStrip (char * s);
  117. /*
  118.  
  119.  */
  120. #endif
  121. /*
  122.  
  123.    
  124.    ___________________________________
  125.    
  126.                           @(#) $Id: htstring.h,v 3.1 1998/03/28 03:32:08 ltabb Exp $
  127.                                                                                           
  128.     */
  129.