Add 'restrict' to another parameter
[openal-soft.git] / Alc / alstring.h
blob6167f5ce1610b58c8e312b133521bc6ba82fb49d
1 #ifndef ALSTRING_H
2 #define ALSTRING_H
4 #include <string.h>
6 #include "vector.h"
9 typedef char al_string_char_type;
10 TYPEDEF_VECTOR(al_string_char_type, al_string)
11 TYPEDEF_VECTOR(al_string, vector_al_string)
13 inline void al_string_deinit(al_string *str)
14 { VECTOR_DEINIT(*str); }
15 #define AL_STRING_INIT(_x) do { (_x) = (al_string)NULL; } while(0)
16 #define AL_STRING_INIT_STATIC() ((al_string)NULL)
17 #define AL_STRING_DEINIT(_x) al_string_deinit(&(_x))
19 inline size_t al_string_length(const_al_string str)
20 { return VECTOR_SIZE(str); }
22 inline ALboolean al_string_empty(const_al_string str)
23 { return al_string_length(str) == 0; }
25 inline const al_string_char_type *al_string_get_cstr(const_al_string str)
26 { return str ? &VECTOR_FRONT(str) : ""; }
28 void al_string_clear(al_string *str);
30 int al_string_cmp(const_al_string str1, const_al_string str2);
31 int al_string_cmp_cstr(const_al_string str1, const al_string_char_type *str2);
33 void al_string_copy(al_string *str, const_al_string from);
34 void al_string_copy_cstr(al_string *str, const al_string_char_type *from);
35 void al_string_copy_range(al_string *str, const al_string_char_type *from, const al_string_char_type *to);
37 void al_string_append_char(al_string *str, const al_string_char_type c);
38 void al_string_append_cstr(al_string *str, const al_string_char_type *from);
39 void al_string_append_range(al_string *str, const al_string_char_type *from, const al_string_char_type *to);
41 #ifdef _WIN32
42 #include <wchar.h>
43 /* Windows-only methods to deal with WideChar strings. */
44 void al_string_copy_wcstr(al_string *str, const wchar_t *from);
45 void al_string_append_wcstr(al_string *str, const wchar_t *from);
46 void al_string_append_wrange(al_string *str, const wchar_t *from, const wchar_t *to);
47 #endif
49 #endif /* ALSTRING_H */