316aad90e9df5cf7291ec2f64a72da92832ab04e
[reactos.git] / reactos / dll / appcompat / apphelp / sdbstringtable.h
1 /*
2 * Copyright 2016 Mark Jansen
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 */
18
19 #ifndef SDBSTRINGTABLE_H
20 #define SDBSTRINGTABLE_H
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26
27 /**
28 * Destroy the hashtable and release all resources.
29 *
30 * @param [in] table Pointer to table pointer, will be cleared after use
31 *
32 */
33 void SdbpTableDestroy(struct SdbStringHashTable* * table);
34
35 /**
36 * Find an entry in the stringtable, or allocate it when an entry could not be found.
37 * - When the string specified does not yet exist, a new entry will be added to the table,
38 * and the pTagid specified will be associated with this string.
39 * - When the string specified does already exist,
40 * the TAGID associated with this string will be returned in pTagid.
41 *
42 *
43 * @param [in] table Pointer to table pointer, will be allocated when needed.
44 * @param [in] str The string to search for
45 * @param [in,out] pTagid
46 * the data written (in bytes)
47 *
48 * @return TRUE if the string was added to the table, FALSE if it already existed
49 */
50 BOOL SdbpAddStringToTable(struct SdbStringHashTable* * table, const WCHAR* str, TAGID* pTagid);
51
52
53 #ifdef __cplusplus
54 } // extern "C"
55 #endif
56
57 #endif // SDBSTRINGTABLE_H