| 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 comparisons |
| 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 |
|
| 38 |
#define HTAtom_name(a) ((a)->name) |
| 39 |
|
| 40 |
/* |
| 41 |
|
| 42 |
The HTFormat type |
| 43 |
|
| 44 |
We use the HTAtom object for holding representations. This allows faster manipulation |
| 45 |
(comparison and copying) that if we stayed with strings. |
| 46 |
|
| 47 |
*/ |
| 48 |
typedef HTAtom *HTFormat; |
| 49 |
|
| 50 |
#ifdef __cplusplus |
| 51 |
} |
| 52 |
#endif |
| 53 |
#endif /* HTATOM_H */ |