.\" Automatically generated by Pandoc 3.1.3 .\" .\" Define V font for inline verbatim, using C font in formats .\" that render this, and otherwise B font. .ie "\f[CB]x\f[]"x" \{\ . ftr V B . ftr VI BI . ftr VB B . ftr VBI BI .\} .el \{\ . ftr V CR . ftr VI CI . ftr VB CB . ftr VBI CBI .\} .TH "al_cstr" "3alleg5" "" "Allegro reference manual" "" .hy .SH NAME .PP al_cstr - Allegro 5 API .SH SYNOPSIS .IP .nf \f[C] #include const char *al_cstr(const ALLEGRO_USTR *us) \f[R] .fi .SH DESCRIPTION .PP Get a \f[V]char *\f[R] pointer to the data in a string. This pointer will only be valid while the ALLEGRO_USTR(3alleg5) object is not modified and not destroyed. The pointer may be passed to functions expecting C-style strings, with the following caveats: .IP \[bu] 2 ALLEGRO_USTRs are allowed to contain embedded NUL (\f[V]\[aq]\[rs]0\[aq]\f[R]) bytes. That means \f[V]al_ustr_size(u)\f[R] and \f[V]strlen(al_cstr(u))\f[R] may not agree. .IP \[bu] 2 An ALLEGRO_USTR may be created in such a way that it is not NUL terminated. A string which is dynamically allocated will always be NUL terminated, but a string which references the middle of another string or region of memory will \f[I]not\f[R] be NUL terminated. .IP \[bu] 2 If the ALLEGRO_USTR references another string, the returned C string will point into the referenced string. Again, no NUL terminator will be added to the referenced string. .SH SEE ALSO .PP al_ustr_to_buffer(3alleg5), al_cstr_dup(3alleg5)