pidgin  2.14.10
stringref.h
Go to the documentation of this file.
1 /* TODO: Can we just replace this whole thing with a GCache */
2 
8 /* purple
9  *
10  * Purple is the legal property of its developers, whose names are too numerous
11  * to list here. Please refer to the COPYRIGHT file distributed with this
12  * source distribution.
13  *
14  * This program is free software; you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as published by
16  * the Free Software Foundation; either version 2 of the License, or
17  * (at your option) any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU General Public License for more details.
23  *
24  * You should have received a copy of the GNU General Public License
25  * along with this program; if not, write to the Free Software
26  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
27  *
28  */
29 #ifndef _PURPLE_STRINGREF_H_
30 #define _PURPLE_STRINGREF_H_
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 typedef struct _PurpleStringref PurpleStringref;
37 
48 PurpleStringref *purple_stringref_new(const char *value);
49 
62 PurpleStringref *purple_stringref_new_noref(const char *value);
63 
74 PurpleStringref *purple_stringref_printf(const char *format, ...);
75 
83 PurpleStringref *purple_stringref_ref(PurpleStringref *stringref);
84 
92 void purple_stringref_unref(PurpleStringref *stringref);
93 
110 const char *purple_stringref_value(const PurpleStringref *stringref);
111 
123 int purple_stringref_cmp(const PurpleStringref *s1, const PurpleStringref *s2);
124 
132 size_t purple_stringref_len(const PurpleStringref *stringref);
133 
134 #ifdef __cplusplus
135 }
136 #endif
137 
138 #endif /* _PURPLE_STRINGREF_H_ */
const char * purple_stringref_value(const PurpleStringref *stringref)
Retrieve the value of a stringref.
PurpleStringref * purple_stringref_new_noref(const char *value)
Creates an immutable reference-counted string object.
PurpleStringref * purple_stringref_new(const char *value)
Creates an immutable reference-counted string object.
PurpleStringref * purple_stringref_printf(const char *format,...)
Creates an immutable reference-counted string object from a printf format specification and arguments...
PurpleStringref * purple_stringref_ref(PurpleStringref *stringref)
Increase the reference count of the given stringref.
void purple_stringref_unref(PurpleStringref *stringref)
Decrease the reference count of the given stringref.
size_t purple_stringref_len(const PurpleStringref *stringref)
Find the length of the string inside a stringref.
int purple_stringref_cmp(const PurpleStringref *s1, const PurpleStringref *s2)
Compare two stringrefs for string equality.