13 typedef char al_string_char_type
;
14 TYPEDEF_VECTOR(al_string_char_type
, al_string
)
15 TYPEDEF_VECTOR(al_string
, vector_al_string
)
17 inline void alstr_reset(al_string
*str
)
18 { VECTOR_DEINIT(*str
); }
19 #define AL_STRING_INIT(_x) do { (_x) = (al_string)NULL; } while(0)
20 #define AL_STRING_INIT_STATIC() ((al_string)NULL)
21 #define AL_STRING_DEINIT(_x) alstr_reset(&(_x))
23 inline size_t alstr_length(const_al_string str
)
24 { return VECTOR_SIZE(str
); }
26 inline ALboolean
alstr_empty(const_al_string str
)
27 { return alstr_length(str
) == 0; }
29 inline const al_string_char_type
*alstr_get_cstr(const_al_string str
)
30 { return str
? &VECTOR_FRONT(str
) : ""; }
32 void alstr_clear(al_string
*str
);
34 int alstr_cmp(const_al_string str1
, const_al_string str2
);
35 int alstr_cmp_cstr(const_al_string str1
, const al_string_char_type
*str2
);
37 void alstr_copy(al_string
*str
, const_al_string from
);
38 void alstr_copy_cstr(al_string
*str
, const al_string_char_type
*from
);
39 void alstr_copy_range(al_string
*str
, const al_string_char_type
*from
, const al_string_char_type
*to
);
41 void alstr_append_char(al_string
*str
, const al_string_char_type c
);
42 void alstr_append_cstr(al_string
*str
, const al_string_char_type
*from
);
43 void alstr_append_range(al_string
*str
, const al_string_char_type
*from
, const al_string_char_type
*to
);
47 /* Windows-only methods to deal with WideChar strings. */
48 void alstr_copy_wcstr(al_string
*str
, const wchar_t *from
);
49 void alstr_append_wcstr(al_string
*str
, const wchar_t *from
);
50 void alstr_copy_wrange(al_string
*str
, const wchar_t *from
, const wchar_t *to
);
51 void alstr_append_wrange(al_string
*str
, const wchar_t *from
, const wchar_t *to
);
58 #endif /* ALSTRING_H */