Annotation of libwww/Library/src/HTString.html, revision 2.11
2.11 ! frystyk 1: <HTML>
! 2: <HEAD>
! 3: <TITLE>String handling for libwww</TITLE>
! 4: </HEAD>
2.6 timbl 5: <BODY>
2.9 frystyk 6:
7: <H1>String Management</H1>
2.11 ! frystyk 8:
! 9: <PRE>
! 10: /*
! 11: ** (c) COPYRIGHT CERN 1994.
! 12: ** Please first read the full copyright statement in the file COPYRIGH.
! 13: */
! 14: </PRE>
2.9 frystyk 15:
16: These functions provide functionality for case-independent string
17: comparison and allocations with copies etc. <P>
18:
19: This module is implemented by <A HREF="HTString.c">HTString.c</A>, and
20: it is a part of the <A NAME="z10"
21: HREF="http://info.cern.ch/hypertext/WWW/Library/User/Guide/Guide.html">Library
22: of Common Code</A>. <P>
23:
2.8 frystyk 24: <PRE>
25: #ifndef HTSTRING_H
2.1 timbl 26: #define HTSTRING_H
27:
28: #include "HTUtils.h"
29:
30: extern CONST char * HTLibraryVersion; /* String for help screen etc */
2.9 frystyk 31: </PRE>
32:
33: <H2>Dynamic String Manipulation</H2>
34:
35: These two functions are dynamic versions of <CODE>strcpy</CODE> and
36: <CODE>strcat</CODE>. They use <CODE>malloc</CODE> for allocating space
37: for the string. If <CODE>StrAllocCopy</CODE> is called with a non-NULL
38: dest, then this is freed before the new value is assigned so that only
39: the <EM>last</EM> string created has to be freed by the user. If
40: <CODE>StrAllocCat</CODE> is called with a NULL pointer as destination
41: then it is equivalent to <CODE>StrAllocCopy</CODE>.
2.1 timbl 42:
2.9 frystyk 43: <PRE>
44: #define StrAllocCopy(dest, src) HTSACopy (&(dest), src)
45: #define StrAllocCat(dest, src) HTSACat (&(dest), src)
46: extern char * HTSACopy PARAMS ((char **dest, CONST char *src));
47: extern char * HTSACat PARAMS ((char **dest, CONST char *src));
2.6 timbl 48: </PRE>
2.1 timbl 49:
2.9 frystyk 50: <H2>Case-insensitive String Comparison</H2>
51:
52: The usual routines (comp instead of cmp) had some problem.
2.7 luotonen 53:
54: <PRE>
2.9 frystyk 55: extern int strcasecomp PARAMS((CONST char *a, CONST char *b));
56: extern int strncasecomp PARAMS((CONST char *a, CONST char *b, int n));
2.7 luotonen 57: </PRE>
58:
2.9 frystyk 59: <H2>Case-insensitive strstr</H2>
2.7 luotonen 60:
2.9 frystyk 61: This works like <CODE>strstr()</CODE> but is not case-sensitive.
2.1 timbl 62:
2.9 frystyk 63: <PRE>
2.10 frystyk 64: extern char * strcasestr PARAMS((char * s1, char * s2));
2.6 timbl 65: </PRE>
2.9 frystyk 66:
2.6 timbl 67: <H2>Next word or quoted string</H2>
2.9 frystyk 68: <PRE>
69: extern char * HTNextField PARAMS ((char** pstr));
70: #endif
71: </PRE>
2.1 timbl 72:
2.6 timbl 73: </BODY>
2.9 frystyk 74: </HTML>
Webmaster