source: azure_iot_hub/trunk/azure_iothub/c-utility/inc/azure_c_shared_utility/doublylinkedlist.h@ 389

Last change on this file since 389 was 389, checked in by coas-nagasima, 5 years ago

ビルドが通るよう更新

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-chdr;charset=UTF-8
File size: 1.4 KB
Line 
1// Copyright (c) Microsoft. All rights reserved.
2// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
4#ifndef DOUBLYLINKEDLIST_H
5#define DOUBLYLINKEDLIST_H
6
7#ifdef __cplusplus
8#include <cstddef>
9extern "C"
10{
11#else
12#include <stddef.h>
13#endif
14
15#include <stdint.h>
16#include "azure_c_shared_utility/umock_c_prod.h"
17
18typedef struct DLIST_ENTRY_TAG
19{
20 struct DLIST_ENTRY_TAG *Flink;
21 struct DLIST_ENTRY_TAG *Blink;
22} DLIST_ENTRY, *PDLIST_ENTRY;
23
24MOCKABLE_FUNCTION(, void, DList_InitializeListHead, PDLIST_ENTRY, listHead);
25MOCKABLE_FUNCTION(, int, DList_IsListEmpty, const PDLIST_ENTRY, listHead);
26MOCKABLE_FUNCTION(, void, DList_InsertTailList, PDLIST_ENTRY, listHead, PDLIST_ENTRY, listEntry);
27MOCKABLE_FUNCTION(, void, DList_InsertHeadList, PDLIST_ENTRY, listHead, PDLIST_ENTRY, listEntry);
28MOCKABLE_FUNCTION(, void, DList_AppendTailList, PDLIST_ENTRY, listHead, PDLIST_ENTRY, ListToAppend);
29MOCKABLE_FUNCTION(, int, DList_RemoveEntryList, PDLIST_ENTRY, listEntry);
30MOCKABLE_FUNCTION(, PDLIST_ENTRY, DList_RemoveHeadList, PDLIST_ENTRY, listHead);
31
32//
33// Calculate the address of the base of the structure given its type, and an
34// address of a field within the structure.
35//
36#define containingRecord(address, type, field) ((type *)((uintptr_t)(address) - offsetof(type,field)))
37
38#ifdef __cplusplus
39}
40#endif
41
42#endif /* DOUBLYLINKEDLIST_H */
Note: See TracBrowser for help on using the repository browser.