| 1 | #pragma once |
| 2 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. |
| 3 | |
| 4 | |
| 5 | #ifdef __cplusplus |
| 6 | extern "C" { |
| 7 | #endif |
| 8 | |
| 9 | #define ReleaseDict(sdh) if (sdh) { DictDestroy(sdh); } |
| 10 | #define ReleaseNullDict(sdh) if (sdh) { DictDestroy(sdh); sdh = NULL; } |
| 11 | |
| 12 | typedef void* STRINGDICT_HANDLE; |
| 13 | typedef const void* C_STRINGDICT_HANDLE; |
| 14 | |
| 15 | extern const int STRINGDICT_HANDLE_BYTES; |
| 16 | |
| 17 | typedef enum DICT_FLAG |
| 18 | { |
| 19 | DICT_FLAG_NONE = 0, |
| 20 | DICT_FLAG_CASEINSENSITIVE = 1 |
| 21 | } DICT_FLAG; |
| 22 | |
| 23 | HRESULT DAPI DictCreateWithEmbeddedKey( |
| 24 | __out_bcount(STRINGDICT_HANDLE_BYTES) STRINGDICT_HANDLE* psdHandle, |
| 25 | __in DWORD dwNumExpectedItems, |
| 26 | __in_opt void **ppvArray, |
| 27 | __in size_t cByteOffset, |
| 28 | __in DICT_FLAG dfFlags |
| 29 | ); |
| 30 | HRESULT DAPI DictCreateStringList( |
| 31 | __out_bcount(STRINGDICT_HANDLE_BYTES) STRINGDICT_HANDLE* psdHandle, |
| 32 | __in DWORD dwNumExpectedItems, |
| 33 | __in DICT_FLAG dfFlags |
| 34 | ); |
| 35 | HRESULT DAPI DictCreateStringListFromArray( |
| 36 | __out_bcount(STRINGDICT_HANDLE_BYTES) STRINGDICT_HANDLE* psdHandle, |
| 37 | __in_ecount(cStringArray) const LPCWSTR* rgwzStringArray, |
| 38 | __in const DWORD cStringArray, |
| 39 | __in DICT_FLAG dfFlags |
| 40 | ); |
| 41 | HRESULT DAPI DictCompareStringListToArray( |
| 42 | __in_bcount(STRINGDICT_HANDLE_BYTES) STRINGDICT_HANDLE sdStringList, |
| 43 | __in_ecount(cStringArray) const LPCWSTR* rgwzStringArray, |
| 44 | __in const DWORD cStringArray |
| 45 | ); |
| 46 | HRESULT DAPI DictAddKey( |
| 47 | __in_bcount(STRINGDICT_HANDLE_BYTES) STRINGDICT_HANDLE sdHandle, |
| 48 | __in_z LPCWSTR szString |
| 49 | ); |
| 50 | HRESULT DAPI DictAddValue( |
| 51 | __in_bcount(STRINGDICT_HANDLE_BYTES) STRINGDICT_HANDLE sdHandle, |
| 52 | __in void *pvValue |
| 53 | ); |
| 54 | HRESULT DAPI DictKeyExists( |
| 55 | __in_bcount(STRINGDICT_HANDLE_BYTES) C_STRINGDICT_HANDLE sdHandle, |
| 56 | __in_z LPCWSTR szString |
| 57 | ); |
| 58 | HRESULT DAPI DictGetValue( |
| 59 | __in_bcount(STRINGDICT_HANDLE_BYTES) C_STRINGDICT_HANDLE sdHandle, |
| 60 | __in_z LPCWSTR szString, |
| 61 | __out void **ppvValue |
| 62 | ); |
| 63 | void DAPI DictDestroy( |
| 64 | __in_bcount(STRINGDICT_HANDLE_BYTES) STRINGDICT_HANDLE sdHandle |
| 65 | ); |
| 66 | |
| 67 | #ifdef __cplusplus |
| 68 | } |
| 69 | #endif |