1al_cstr(3)                 Library Functions Manual                 al_cstr(3)
2
3
4

NAME

6       al_cstr
7

SYNOPSIS

9              #include <allegro5/allegro.h>
10
11              const char *al_cstr(const ALLEGRO_USTR *us)
12

DESCRIPTION

14       Get  a  char * pointer to the data in a string.  This pointer will only
15       be valid while the underlying string is not modified and not destroyed.
16       The  pointer may be passed to functions expecting C-style strings, with
17       the following caveats:
18
19       · ALLEGRO_USTRs are allowed to contain embedded NUL (`\0') bytes.  That
20         means al_ustr_size(u) and strlen(al_cstr(u)) may not agree.
21
22       · An  ALLEGRO_USTR may be created in such a way that it is not NUL ter‐
23         minated.  A string which is dynamically allocated will always be  NUL
24         terminated,  but  a  string  which  references  the middle of another
25         string or region of memory will not be NUL terminated.
26
27       · If the ALLEGRO_USTR references another string, the returned  c-string
28         will  point into the referenced string, the length of the string will
29         be ignored.
30

SEE ALSO

32       al_ustr_to_buffer(3), al_cstr_dup(3)
33
34
35
36Allegro reference manual                                            al_cstr(3)
Impressum