diff options
Diffstat (limited to 'src/libs/dutil/WixToolset.DUtil/inc/queutil.h')
| -rw-r--r-- | src/libs/dutil/WixToolset.DUtil/inc/queutil.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/queutil.h b/src/libs/dutil/WixToolset.DUtil/inc/queutil.h new file mode 100644 index 00000000..3b88825e --- /dev/null +++ b/src/libs/dutil/WixToolset.DUtil/inc/queutil.h | |||
| @@ -0,0 +1,52 @@ | |||
| 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 ReleaseQueue(qh, pfn, pv) if (qh) { QueDestroy(qh, pfn, pv); } | ||
| 10 | #define ReleaseNullQue(qh, pfv, pv) if (qh) { QueDestroy(qh, pfn, pv); qh = NULL; } | ||
| 11 | |||
| 12 | typedef void* QUEUTIL_QUEUE_HANDLE; | ||
| 13 | |||
| 14 | typedef void(CALLBACK* PFNQUEUTIL_QUEUE_RELEASE_VALUE)( | ||
| 15 | __in void* pvValue, | ||
| 16 | __in void* pvContext | ||
| 17 | ); | ||
| 18 | |||
| 19 | extern const int QUEUTIL_QUEUE_HANDLE_BYTES; | ||
| 20 | |||
| 21 | /******************************************************************** | ||
| 22 | QueCreate - Creates a simple queue. It is not thread safe. | ||
| 23 | |||
| 24 | ********************************************************************/ | ||
| 25 | HRESULT DAPI QueCreate( | ||
| 26 | __out_bcount(QUEUTIL_QUEUE_HANDLE_BYTES) QUEUTIL_QUEUE_HANDLE* phQueue | ||
| 27 | ); | ||
| 28 | |||
| 29 | HRESULT DAPI QueEnqueue( | ||
| 30 | __in_bcount(QUEUTIL_QUEUE_HANDLE_BYTES) QUEUTIL_QUEUE_HANDLE hQueue, | ||
| 31 | __in void* pvValue | ||
| 32 | ); | ||
| 33 | |||
| 34 | /******************************************************************** | ||
| 35 | QueDequeue - Returns the value from the beginning of the queue, | ||
| 36 | or E_NOMOREITEMS if the queue is empty. | ||
| 37 | |||
| 38 | ********************************************************************/ | ||
| 39 | HRESULT DAPI QueDequeue( | ||
| 40 | __in_bcount(QUEUTIL_QUEUE_HANDLE_BYTES) QUEUTIL_QUEUE_HANDLE hQueue, | ||
| 41 | __out void** ppvValue | ||
| 42 | ); | ||
| 43 | |||
| 44 | void DAPI QueDestroy( | ||
| 45 | __in_bcount(QUEUTIL_QUEUE_HANDLE_BYTES) QUEUTIL_QUEUE_HANDLE hQueue, | ||
| 46 | __in_opt PFNQUEUTIL_QUEUE_RELEASE_VALUE pfnReleaseValue, | ||
| 47 | __in_opt void* pvContext | ||
| 48 | ); | ||
| 49 | |||
| 50 | #ifdef __cplusplus | ||
| 51 | } | ||
| 52 | #endif | ||
