aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/alstring.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-03-28 07:59:47 -0700
committerChris Robinson <[email protected]>2014-03-28 07:59:47 -0700
commitd997be67fd8771f21791be73ef6e7bfd08105416 (patch)
treef1918452df42a2ff08ec3ff81e59a2b3d178c0f7 /Alc/alstring.h
parentaf8fda8a4a19e7d51506bf873c719361277249d2 (diff)
Use al_string to handle mmdevapi and dsound device names
Diffstat (limited to 'Alc/alstring.h')
-rw-r--r--Alc/alstring.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/Alc/alstring.h b/Alc/alstring.h
index b393a8f4..8f7d1655 100644
--- a/Alc/alstring.h
+++ b/Alc/alstring.h
@@ -1,8 +1,11 @@
#ifndef ALSTRING_H
#define ALSTRING_H
+#include <string.h>
+
#include "vector.h"
+
typedef char al_string_char_type;
DECL_VECTOR(al_string_char_type)
@@ -23,10 +26,23 @@ inline const al_string_char_type *al_string_get_cstr(const_al_string str)
void al_string_clear(al_string *str);
+inline int al_string_cmp(const_al_string str1, const_al_string str2)
+{ return strcmp(al_string_get_cstr(str1), al_string_get_cstr(str2)); }
+
+inline int al_string_cmp_cstr(const_al_string str1, const al_string_char_type *str2)
+{ return strcmp(al_string_get_cstr(str1), str2); }
+
void al_string_copy(al_string *str, const_al_string from);
void al_string_copy_cstr(al_string *str, const al_string_char_type *from);
void al_string_append_char(al_string *str, const al_string_char_type c);
+void al_string_append_cstr(al_string *str, const al_string_char_type *from);
void al_string_append_range(al_string *str, const al_string_char_type *from, const al_string_char_type *to);
+#ifdef _WIN32
+#include <wchar.h>
+/* Windows-only methods to deal with WideChar strings. */
+void al_string_copy_wcstr(al_string *str, const wchar_t *from);
+#endif
+
#endif /* ALSTRING_H */