From d997be67fd8771f21791be73ef6e7bfd08105416 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 28 Mar 2014 07:59:47 -0700 Subject: Use al_string to handle mmdevapi and dsound device names --- Alc/alstring.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'Alc/alstring.h') 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 + #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 +/* Windows-only methods to deal with WideChar strings. */ +void al_string_copy_wcstr(al_string *str, const wchar_t *from); +#endif + #endif /* ALSTRING_H */ -- cgit v1.2.3