Annotation of libwww/Library/src/HTAtom.html, revision 2.28

2.7       frystyk     1: <HTML>
                      2: <HEAD>
2.24      frystyk     3:   <!-- Changed by: Henrik Frystyk Nielsen, 23-Mar-1996 -->
2.25      frystyk     4:   <TITLE>W3C Sample Code Library libwww Atom Class</TITLE>
2.7       frystyk     5: </HEAD>
                      6: <BODY>
2.24      frystyk     7: <H1>
                      8:   The Atom Class
                      9: </H1>
2.9       frystyk    10: <PRE>
                     11: /*
2.15      frystyk    12: **     (c) COPYRIGHT MIT 1995.
2.9       frystyk    13: **     Please first read the full copyright statement in the file COPYRIGH.
                     14: */
                     15: </PRE>
2.24      frystyk    16: <P>
                     17: The <CODE>Atom Class defines s</CODE>trings which are given representative
                     18: pointer values so that they can be stored more efficiently, and comparisons
2.27      kahan      19: for equality done more efficiently. The list of <CODE>atoms</CODE> is stored
                     20: in a hash table, so when asking for a new atom you might in fact get back an
2.24      frystyk    21: existing one.
                     22: <P>
                     23: <B>Note</B>: There are a whole bunch of
                     24: <A HREF="HTFormat.html#FormatTypes">MIME-types</A> defined as
                     25: <CODE>atoms</CODE>, so please use them!
                     26: <P>
                     27: This module is implemented by <A HREF="HTAtom.c">HTAtom.c</A>, and it is
2.26      frystyk    28: a part of the <A HREF="http://www.w3.org/Library/"> W3C Sample Code
2.24      frystyk    29: Library</A>.
1.1       timbl      30: <PRE>
                     31: #ifndef HTATOM_H
                     32: #define HTATOM_H
                     33: 
2.6       luotonen   34: #include "HTList.h"
                     35: 
2.28    ! vbancrof   36: #ifdef __cplusplus
        !            37: extern "C" { 
        !            38: #endif 
        !            39: 
1.1       timbl      40: typedef struct _HTAtom HTAtom;
                     41: struct _HTAtom {
                     42:        HTAtom *        next;
                     43:        char *          name;
                     44: }; /* struct _HTAtom */
2.7       frystyk    45: </PRE>
2.24      frystyk    46: <H3>
                     47:   Get an Atom
                     48: </H3>
                     49: <P>
                     50: This function returns a representative value (an <CODE>atom</CODE>) such
                     51: that it will always (within one run of the program) return the same value
                     52: for the same given string. The former is case sensitive, the latter is case
                     53: insensitive.
2.7       frystyk    54: <PRE>
2.21      frystyk    55: extern HTAtom * HTAtom_for     (const char * string);
                     56: extern HTAtom * HTAtom_caseFor (const char * string);
2.7       frystyk    57: </PRE>
2.24      frystyk    58: <H3>
                     59:   Get Content of an Atom
                     60: </H3>
2.7       frystyk    61: <PRE>
2.24      frystyk    62: #define HTAtom_name(a) ((a) ? (a)-&gt;name : NULL)
2.7       frystyk    63: </PRE>
2.24      frystyk    64: <P>
2.7       frystyk    65: This macro returns the string pointed to by the <CODE>atom</CODE>.
2.24      frystyk    66: <H3>
                     67:   Search For Atoms
                     68: </H3>
                     69: <P>
                     70: Returns a list of <CODE>atoms</CODE> which matches the template given. It
                     71: is especially made for MIME-types so that for example a template like
                     72: <CODE>text&lt;slash&gt;&lt;star&gt;</CODE> returns a list of all MIME-types
                     73: of type <CODE>text</CODE>.
2.7       frystyk    74: <PRE>
2.21      frystyk    75: extern HTList * HTAtom_templateMatches (const char * templ);
2.10      frystyk    76: </PRE>
2.24      frystyk    77: <H3>
                     78:   Cleanup Memory
                     79: </H3>
                     80: <P>
                     81: In order to cleanup memory, call this function. This is done automaticly
                     82: from the <A HREF="HTReq.html#Library">HTLibTerminate</A> function.
2.10      frystyk    83: <PRE>
2.20      frystyk    84: extern void HTAtom_deleteAll (void);
1.1       timbl      85: 
2.28    ! vbancrof   86: #ifdef __cplusplus
        !            87: }
        !            88: #endif
        !            89: 
2.7       frystyk    90: #endif
1.1       timbl      91: </PRE>
2.24      frystyk    92: <P>
                     93:   <HR>
2.23      frystyk    94: <ADDRESS>
2.28    ! vbancrof   95:   @(#) $Id: HTAtom.html,v 2.27 2000/07/04 15:23:24 kahan Exp $
2.23      frystyk    96: </ADDRESS>
2.24      frystyk    97: </BODY></HTML>

Webmaster