yw_string_get_cstring

Name

yw_string_get_cstring -- get value of string in given encoding

Synopsis


     #include <yw/string.h>
   

int yw_string_get_cstring(const YwString *s, const char *enc, char **chars, int *len);

DESCRIPTION

This function fetches value of *s in encoding given in enc parameter and stores pointer to yw_malloc()ed vactor of characters at *chars. Length in bytes is stored at *len, if it's not NULL. When enc is NULL -- default, locale-based, encoding is used (see yw_get_default_encoding(3) for more details, on how it is determined).

RETURN VALUE

This function returns 0 in case of success or one of yw_convert(3) return codes when there is an error in parametrs encoding (in the later case neither *chars nor *len is touched). Note, that it's up to the caller to yw_free(3) resulting vactor, which *chars is pointing at.

SEE ALSO

yw_free (3),

INFO

Generated from: string.c,v 1.6 2001/05/23 08:46:01 malekith Exp.