1 /*
2  * Copyright © 2011 Mozilla Foundation
3  *
4  * This program is made available under an ISC-style license.  See the
5  * accompanying file LICENSE for details.
6  */
7 
8 #ifndef CUBEB_STRINGS_H
9 #define CUBEB_STRINGS_H
10 
11 #include "cubeb/cubeb.h"
12 
13 #if defined(__cplusplus)
14 extern "C" {
15 #endif
16 
17 /** Opaque handle referencing interned string storage. */
18 typedef struct cubeb_strings cubeb_strings;
19 
20 /** Initialize an interned string structure.
21     @param strings An out param where an opaque pointer to the
22     interned string storage will be returned.
23     @retval CUBEB_OK in case of success.
24     @retval CUBEB_ERROR in case of error. */
25 CUBEB_EXPORT int
26 cubeb_strings_init(cubeb_strings ** strings);
27 
28 /** Destroy an interned string structure freeing all associated memory.
29     @param strings An opaque pointer to the interned string storage to
30                    destroy. */
31 CUBEB_EXPORT void
32 cubeb_strings_destroy(cubeb_strings * strings);
33 
34 /** Add string to internal storage.
35     @param strings Opaque pointer to interned string storage.
36     @param s String to add to storage.
37     @retval CUBEB_OK
38     @retval CUBEB_ERROR
39  */
40 CUBEB_EXPORT char const *
41 cubeb_strings_intern(cubeb_strings * strings, char const * s);
42 
43 #if defined(__cplusplus)
44 }
45 #endif
46 
47 #endif // !CUBEB_STRINGS_H
48