mimedir-utils

Name

mimedir-utils -- 

Synopsis


#include <mimedir/mimedir-utils.h>


gchar*      mimedir_utils_strcat_list       (GSList *list,
                                             const gchar *separator);
GSList*     mimedir_utils_copy_string_slist (GSList *list);
void        mimedir_utils_free_string_slist (GSList *list);
GSList*     mimedir_utils_copy_object_slist (GSList *list);
void        mimedir_utils_free_object_slist (GSList *list);
gboolean    mimedir_utils_is_token          (const gchar *string);
gboolean    mimedir_utils_is_safe           (const gchar *string);
gboolean    mimedir_utils_is_qsafe          (const gchar *string);

Description

Details

mimedir_utils_strcat_list ()

gchar*      mimedir_utils_strcat_list       (GSList *list,
                                             const gchar *separator);

Concatenates a list of strings, optionally separating them with another string. The returned string must be freed with g_free().

list : a list of gchar pointers
separator : the delimiter to use between the concatenated strings or NULL if no delimiter is desired
Returns : the concatenated string


mimedir_utils_copy_string_slist ()

GSList*     mimedir_utils_copy_string_slist (GSList *list);

Makes a deep copy of the supplied GSList, i.e. it copies the list, treating its elements as string pointers and copying them. The returned list may be freed using mimedir_utils_free_string_list().

list : a list of gchar pointers
Returns : the copied list


mimedir_utils_free_string_slist ()

void        mimedir_utils_free_string_slist (GSList *list);

Frees the supplied list and the strings it contains.

list : a list of gchar pointers


mimedir_utils_copy_object_slist ()

GSList*     mimedir_utils_copy_object_slist (GSList *list);

Makes a shallow copy of the supplied GSList, i.e. it copies the list, treating its elements as objects and reffing them. The returned list may be freed using mimedir_utils_free_object_list().

list : a list of objects
Returns : the copied list


mimedir_utils_free_object_slist ()

void        mimedir_utils_free_object_slist (GSList *list);

Frees the supplied GSList and unrefs the objects it contains.

list : a list of objects


mimedir_utils_is_token ()

gboolean    mimedir_utils_is_token          (const gchar *string);

Checks whether the supplied string matches the criteria of a token (i.e. matches the pattern 1*(ALPHA / DIGIT / "-")).

string : a string
Returns : TRUE is the string is a token, FALSE otherwise


mimedir_utils_is_safe ()

gboolean    mimedir_utils_is_safe           (const gchar *string);

Checks whether the supplied string contains only "safe" characters (i.e. any character except CTLs, DQUOTE, ";", ":", ",").

string : a string
Returns : TRUE is the string contains only safe characters, FALSE otherwise


mimedir_utils_is_qsafe ()

gboolean    mimedir_utils_is_qsafe          (const gchar *string);

Checks whether the supplied string contains only "qsafe" characters (i.e. any character except CTLs, DQUOTE).

string : a string
Returns : TRUE is the string contains only qsafe characters, FALSE otherwise