stringref.h
Go to the documentation of this file.
/* TODO: Can we just replace this whole thing with a GCache */
/* purple
*
* Purple is the legal property of its developers, whose names are too numerous
* to list here. Please refer to the COPYRIGHT file distributed with this
* source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*
*/
#ifndef _PURPLE_STRINGREF_H_
#define _PURPLE_STRINGREF_H_
#ifdef __cplusplus
extern "C" {
#endif
typedef struct _PurpleStringref PurpleStringref;
PurpleStringref *purple_stringref_new(const char *value);
PurpleStringref *purple_stringref_new_noref(const char *value);
PurpleStringref *purple_stringref_printf(const char *format, ...);
PurpleStringref *purple_stringref_ref(PurpleStringref *stringref);
void purple_stringref_unref(PurpleStringref *stringref);
const char *purple_stringref_value(const PurpleStringref *stringref);
int purple_stringref_cmp(const PurpleStringref *s1, const PurpleStringref *s2);
size_t purple_stringref_len(const PurpleStringref *stringref);
#ifdef __cplusplus
}
#endif
#endif /* _PURPLE_STRINGREF_H_ */
purple_stringref_value
const char * purple_stringref_value(const PurpleStringref *stringref)
Retrieve the value of a stringref.
purple_stringref_new_noref
PurpleStringref * purple_stringref_new_noref(const char *value)
Creates an immutable reference-counted string object.
purple_stringref_new
PurpleStringref * purple_stringref_new(const char *value)
Creates an immutable reference-counted string object.
purple_stringref_printf
PurpleStringref * purple_stringref_printf(const char *format,...)
Creates an immutable reference-counted string object from a printf format specification and arguments...
purple_stringref_ref
PurpleStringref * purple_stringref_ref(PurpleStringref *stringref)
Increase the reference count of the given stringref.
purple_stringref_unref
void purple_stringref_unref(PurpleStringref *stringref)
Decrease the reference count of the given stringref.
purple_stringref_len
size_t purple_stringref_len(const PurpleStringref *stringref)
Find the length of the string inside a stringref.
purple_stringref_cmp
int purple_stringref_cmp(const PurpleStringref *s1, const PurpleStringref *s2)
Compare two stringrefs for string equality.