ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/include/shstr.h
(Generate patch)

Comparing deliantra/server/include/shstr.h (file contents):
Revision 1.2 by root, Sat Aug 26 23:36:32 2006 UTC vs.
Revision 1.4 by root, Thu Aug 31 17:54:14 2006 UTC

1#ifndef SHSTR_H__ 1#ifndef SHSTR_H__
2#define SHSTR_H__ 2#define SHSTR_H__
3
4//// OLD STUFF
3 5
4/* The size of the shared strings hashtable. This must be smaller than 6/* The size of the shared strings hashtable. This must be smaller than
5 * 32767, but 947 ought to be plenty enough. 7 * 32767, but 947 ought to be plenty enough.
6 */ 8 */
7#define TABLESIZE 4133 9#define TABLESIZE 4133
55 57
56#define PADDING ((2 * sizeof(long) - sizeof(REFCOUNT_TYPE)) % sizeof(long)) + 1 58#define PADDING ((2 * sizeof(long) - sizeof(REFCOUNT_TYPE)) % sizeof(long)) + 1
57 59
58typedef struct _shared_string { 60typedef struct _shared_string {
59 union { 61 union {
60 struct _shared_string **array; 62 struct _shared_string **array;
61 struct _shared_string *previous; 63 struct _shared_string *previous;
62 } u; 64 } u;
63 struct _shared_string *next; 65 struct _shared_string *next;
64 /* The top bit of "refcount" is used to signify that "u.array" points 66 /* The top bit of "refcount" is used to signify that "u.array" points
65 * at the array entry. 67 * at the array entry.
66 */ 68 */
80extern void free_string(const char *str); 82extern void free_string(const char *str);
81extern void ss_dump_statistics(void); 83extern void ss_dump_statistics(void);
82extern const char *ss_dump_table(int what); 84extern const char *ss_dump_table(int what);
83extern int buf_overflow(const char *buf1, const char *buf2, int bufsize); 85extern int buf_overflow(const char *buf1, const char *buf2, int bufsize);
84 86
87//// NEW STUFF
88
89#if 0
90struct shstr
91{
92 const char *s;
93 operator const char *() const { return s; };
94 shstr &operator =(const char *str) { s = str; };
95};
96#else
97typedef const char *shstr;
85#endif 98#endif
86 99
100#endif
101

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines