string_ty Struct Reference
[String]

#include <str.h>


Data Fields

str_hash_ty str_hash
string_tystr_next
long str_references
size_t str_length
char str_text [1]


Detailed Description

The string_ty struct is used to remember information about strings. Users should always refer to strings as pointers. The only members within the struct that should be accessed are the str_text member, which is a NUL terminated array of characters, and the str_length member, which contains the length of the string's text (not including the NUL terminator).

It is guaranteed that all equal strings will not only have the same hash, but will, if fact, be exactly the same sting. The reference count is how many strings currently exist with this value. Thus, the commonest string test, a string equality test becomes a pointer equality test.

Thou shalt not modify any member of a string struct, or the forces of evil shall wreak misery in thy life.

Definition at line 52 of file str.h.


Field Documentation

The hash of the string. Used internally by the string table, users shall never access this member.

Definition at line 58 of file str.h.

The next string in a hash bucket. Used internally by the string table, users shall never access this member.

Definition at line 64 of file str.h.

The reference count for this string. It is guaranteed that all equal strings will not only have the same hash, but will, if fact, be exactly the same sting. The reference count is how many strings currently exist with this value. Used internally by the string table, users shall never access this member.

Definition at line 73 of file str.h.

The length of the string (not including the terminating NUL). Read-only access permitted to users.

Definition at line 79 of file str.h.

The text value of the string. It's actually longer than its declaration when the string length is more than zero. Read-only access permitted to users.

Definition at line 86 of file str.h.


The documentation for this struct was generated from the following file:

Generated on Wed Mar 12 23:37:44 2008 for Aegis by  doxygen 1.5.5