Annotation of libwww/Library/src/HTString.html, revision 2.14

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"
2.14    ! frystyk    21: HREF="http://www.w3.org/hypertext/WWW/Library/User/Guide/Guide.html">Library
2.9       frystyk    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: extern CONST char * HTLibraryVersion;  /* String for help screen etc */
2.9       frystyk    29: </PRE>
                     30: 
                     31: <H2>Dynamic String Manipulation</H2>
                     32: 
                     33: These two functions are dynamic versions of <CODE>strcpy</CODE> and
                     34: <CODE>strcat</CODE>. They use <CODE>malloc</CODE> for allocating space
                     35: for the string. If <CODE>StrAllocCopy</CODE> is called with a non-NULL
                     36: dest, then this is freed before the new value is assigned so that only
                     37: the <EM>last</EM> string created has to be freed by the user. If
                     38: <CODE>StrAllocCat</CODE> is called with a NULL pointer as destination
                     39: then it is equivalent to <CODE>StrAllocCopy</CODE>.
2.1       timbl      40: 
2.9       frystyk    41: <PRE>
                     42: #define StrAllocCopy(dest, src) HTSACopy (&amp;(dest), src)
                     43: #define StrAllocCat(dest, src)  HTSACat  (&amp;(dest), src)
                     44: extern char * HTSACopy PARAMS ((char **dest, CONST char *src));
                     45: extern char * HTSACat  PARAMS ((char **dest, CONST char *src));
2.6       timbl      46: </PRE>
2.1       timbl      47: 
2.9       frystyk    48: <H2>Case-insensitive String Comparison</H2>
                     49: 
                     50: The usual routines (comp instead of cmp) had some problem.
2.7       luotonen   51: 
                     52: <PRE>
2.9       frystyk    53: extern int strcasecomp  PARAMS((CONST char *a, CONST char *b));
                     54: extern int strncasecomp PARAMS((CONST char *a, CONST char *b, int n));
2.7       luotonen   55: </PRE>
                     56: 
2.9       frystyk    57: <H2>Case-insensitive strstr</H2>
2.7       luotonen   58: 
2.9       frystyk    59: This works like <CODE>strstr()</CODE> but is not case-sensitive.
2.1       timbl      60: 
2.9       frystyk    61: <PRE>
2.10      frystyk    62: extern char * strcasestr PARAMS((char *        s1, char * s2));
2.6       timbl      63: </PRE>
2.9       frystyk    64: 
2.6       timbl      65: <H2>Next word or quoted string</H2>
2.14    ! frystyk    66: 
        !            67: This function returns a RFC822 word separated by space, comma, or
        !            68: semi-colons.
        !            69: 
2.9       frystyk    70: <PRE>
                     71: extern char * HTNextField PARAMS ((char** pstr));
2.14    ! frystyk    72: </PRE>
        !            73: 
        !            74: <H2>RFC1123 Date/Time Stamp String</H2>
        !            75: 
        !            76: Returns a pointer to a static area!
        !            77: 
        !            78: <PRE>
        !            79: extern CONST char *HTDateTimeStr PARAMS((time_t *calendar, BOOL local));
        !            80: </PRE>
        !            81: 
        !            82: 
        !            83: <H2>Timezone Offset</H2>
        !            84: 
        !            85: Calculates the offset from GMT in seconds. This is called from <A
        !            86: HREF="HTAccess.html#Library">HTLibInit()</A>.
        !            87: 
        !            88: <PRE>
        !            89: extern long HTGetTimeZoneOffset NOPARAMS;
        !            90: </PRE>
        !            91: 
        !            92: <H2>Parse a Date/Time String</H2>
        !            93: 
        !            94: Converts a string representation in GMT to a local representation of
        !            95: localtime <CODE>time_t</CODE>.
        !            96: 
        !            97: <PRE>
        !            98: extern time_t HTParseTime PARAMS((CONST char * str));
        !            99: </PRE>
        !           100: 
        !           101: 
        !           102: <H2>Unique Message-ID String</H2>
        !           103: 
        !           104: <PRE>
        !           105: extern CONST char *HTMessageIdStr NOPARAMS;
2.9       frystyk   106: #endif
                    107: </PRE>
2.14    ! frystyk   108: 
        !           109: End of declaration module
2.1       timbl     110: 
2.6       timbl     111: </BODY>
2.9       frystyk   112: </HTML>

Webmaster