1 /* */ 2 3 /* Atoms: Names to numbers HTAtom.h 4 * ======================= 5 * 6 * Atoms are names which are given representative pointer values 7 * so that they can be stored more efficiently, and compaisons 8 * for equality done more efficiently. 9 * 10 * HTAtom_for(string) returns a representative value such that it 11 * will always (within one run of the program) return the same 12 * value for the same given string. 13 * 14 * Authors: 15 * TBL Tim Berners-Lee, WorldWideWeb project, CERN 16 * 17 * (c) Copyright CERN 1991 - See Copyright.html 18 * 19 */ 20 21 #ifndef HTATOM_H 22 #define HTATOM_H 23 24 #include <HTList.h> 25 26 #ifdef __cplusplus 27 extern "C" { 28 #endif 29 typedef struct _HTAtom HTAtom; 30 31 struct _HTAtom { 32 HTAtom *next; 33 char *name; 34 }; /* struct _HTAtom */ 35 36 extern HTAtom *HTAtom_for(const char *string); 37 extern HTList *HTAtom_templateMatches(const char *templ); 38 39 #define HTAtom_name(a) ((a)->name) 40 41 /* 42 43 The HTFormat type 44 45 We use the HTAtom object for holding representations. This allows faster manipulation 46 (comparison and copying) that if we stayed with strings. 47 48 */ 49 typedef HTAtom *HTFormat; 50 51 #ifdef __cplusplus 52 } 53 #endif 54 #endif /* HTATOM_H */ 55