|
Atrinik Server 2.5
|
Go to the source code of this file.
Functions | |
| void | init_hash_table () |
| static unsigned long | hashstr (const char *str) |
| static shared_string * | new_shared_string (const char *str) |
| shstr * | add_string (const char *str) |
| shstr * | add_refcount (shstr *str) |
| int | query_refcount (shstr *str) |
| shstr * | find_string (const char *str) |
| void | free_string_shared (shstr *str) |
| void | ss_dump_statistics (char *buf, size_t size) |
| void | ss_dump_table (int what, char *buf, size_t size) |
Variables | |
| static shared_string * | hash_table [TABLESIZE] |
This is a simple shared strings package with a simple interface.
Definition in file shstr.c.
This will increase the refcount of the string str.
| str | String which must have been returned from a previous add_string(). |
| shstr* add_string | ( | const char * | str | ) |
| shstr* find_string | ( | const char * | str | ) |
| void free_string_shared | ( | shstr * | str | ) |
This will reduce the refcount, and if it has reached 0, str will be freed.
| str | String to release, which must have been returned from a previous add_string(). |
| static unsigned long hashstr | ( | const char * | str | ) | [static] |
Hashing function used by the shared string library.
| str | String to hash. |
| void init_hash_table | ( | ) |
| static shared_string* new_shared_string | ( | const char * | str | ) | [static] |
| int query_refcount | ( | shstr * | str | ) |
This will return the refcount of the string str.
| str | String which must have been returned from a previous add_string(). |
| void ss_dump_statistics | ( | char * | buf, |
| size_t | size | ||
| ) |
| void ss_dump_table | ( | int | what, |
| char * | buf, | ||
| size_t | size | ||
| ) |
Dump the contents of the shared string tables.
| what | Combination of flags:
|
| buf | Buffer that will contain total information if (what & SS_DUMP_TABLE). Left untouched else. |
| size | Buffer's size. |
shared_string* hash_table[TABLESIZE] [static] |
1.7.4