Don't try to use the non-standard alloca.h
[openal-soft.git] / Alc / alstring.h
blob5b37a4839a677be7102764ec7d1ad539eff54e19
1 #ifndef ALSTRING_H
2 #define ALSTRING_H
4 #include <string.h>
6 #include "vector.h"
9 typedef char al_string_char_type;
10 DECL_VECTOR(al_string_char_type)
12 typedef vector_al_string_char_type al_string;
13 typedef const_vector_al_string_char_type const_al_string;
15 #define AL_STRING_INIT(_x) VECTOR_INIT(_x)
16 #define AL_STRING_DEINIT(_x) VECTOR_DEINIT(_x)
18 inline ALsizei al_string_length(const_al_string str)
19 { return VECTOR_SIZE(str); }
21 inline ALboolean al_string_empty(const_al_string str)
22 { return al_string_length(str) == 0; }
24 inline const al_string_char_type *al_string_get_cstr(const_al_string str)
25 { return str ? &VECTOR_FRONT(str) : ""; }
27 void al_string_clear(al_string *str);
29 int al_string_cmp(const_al_string str1, const_al_string str2);
30 int al_string_cmp_cstr(const_al_string str1, const al_string_char_type *str2);
32 void al_string_copy(al_string *str, const_al_string from);
33 void al_string_copy_cstr(al_string *str, const al_string_char_type *from);
35 void al_string_append_char(al_string *str, const al_string_char_type c);
36 void al_string_append_cstr(al_string *str, const al_string_char_type *from);
37 void al_string_append_range(al_string *str, const al_string_char_type *from, const al_string_char_type *to);
39 #ifdef _WIN32
40 #include <wchar.h>
41 /* Windows-only methods to deal with WideChar strings. */
42 void al_string_copy_wcstr(al_string *str, const wchar_t *from);
43 #endif
46 DECL_VECTOR(al_string)
48 #endif /* ALSTRING_H */