| 24 * |
24 * |
| 25 */ |
25 */ |
| 26 #ifndef _GAIM_STRINGREF_H_ |
26 #ifndef _GAIM_STRINGREF_H_ |
| 27 #define _GAIM_STRINGREF_H_ |
27 #define _GAIM_STRINGREF_H_ |
| 28 |
28 |
| 29 /** |
29 #ifdef __cplusplus |
| 30 * The internal representation of a stringref. |
30 extern "C" { |
| 31 * |
31 #endif |
| 32 * @note For this structure to be useful, the string contained within |
32 |
| 33 * it must be immutable -- for this reason, do _not_ access it |
33 typedef struct _GaimStringref GaimStringref; |
| 34 * directly! |
|
| 35 */ |
|
| 36 typedef struct _GaimStringref { |
|
| 37 guint32 ref; /**< The reference count of this string. |
|
| 38 * Note that reference counts are only |
|
| 39 * 31 bits, and the high-order bit |
|
| 40 * indicates whether this string is up |
|
| 41 * for GC at the next idle handler... |
|
| 42 * But you aren't going to touch this |
|
| 43 * anyway, right? */ |
|
| 44 char value[1]; /**< The string contained in this ref. |
|
| 45 * Notice that it is simply "hanging |
|
| 46 * off the end" of the ref ... this |
|
| 47 * is to save an allocation. */ |
|
| 48 } GaimStringref; |
|
| 49 |
34 |
| 50 /** |
35 /** |
| 51 * Creates an immutable reference-counted string object. The newly |
36 * Creates an immutable reference-counted string object. The newly |
| 52 * created object will have a reference count of 1. |
37 * created object will have a reference count of 1. |
| 53 * |
38 * |