libgaim/stringref.h

changeset 14988
66b34458d49e
parent 14254
77edc7a6191a
child 20470
77693555855f
equal deleted inserted replaced
14987:1f3e20245da1 14988:66b34458d49e
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 *
141 * 126 *
142 * @return The length of the string in stringref 127 * @return The length of the string in stringref
143 */ 128 */
144 size_t gaim_stringref_len(const GaimStringref *stringref); 129 size_t gaim_stringref_len(const GaimStringref *stringref);
145 130
131 #ifdef __cplusplus
132 }
133 #endif
134
146 #endif /* _GAIM_STRINGREF_H_ */ 135 #endif /* _GAIM_STRINGREF_H_ */

mercurial