source: azure_iot_hub_f767zi/trunk/azure_iot_sdk/c-utility/inc/azure_c_shared_utility/doublylinkedlist.h@ 457

Last change on this file since 457 was 457, checked in by coas-nagasima, 4 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>
9#else
10#include <stddef.h>
11#endif
12
13#include <stdint.h>
14#include "umock_c/umock_c_prod.h"
15
16#ifdef __cplusplus
17extern "C"
18{
19#endif
20
21typedef struct DLIST_ENTRY_TAG
22{
23 struct DLIST_ENTRY_TAG *Flink;
24 struct DLIST_ENTRY_TAG *Blink;
25} DLIST_ENTRY, *PDLIST_ENTRY;
26
27MOCKABLE_FUNCTION(, void, DList_InitializeListHead, PDLIST_ENTRY, listHead);
28MOCKABLE_FUNCTION(, int, DList_IsListEmpty, const PDLIST_ENTRY, listHead);
29MOCKABLE_FUNCTION(, void, DList_InsertTailList, PDLIST_ENTRY, listHead, PDLIST_ENTRY, listEntry);
30MOCKABLE_FUNCTION(, void, DList_InsertHeadList, PDLIST_ENTRY, listHead, PDLIST_ENTRY, listEntry);
31MOCKABLE_FUNCTION(, void, DList_AppendTailList, PDLIST_ENTRY, listHead, PDLIST_ENTRY, ListToAppend);
32MOCKABLE_FUNCTION(, int, DList_RemoveEntryList, PDLIST_ENTRY, listEntry);
33MOCKABLE_FUNCTION(, PDLIST_ENTRY, DList_RemoveHeadList, PDLIST_ENTRY, listHead);
34
35//
36// Calculate the address of the base of the structure given its type, and an
37// address of a field within the structure.
38//
39#define containingRecord(address, type, field) ((type *)((uintptr_t)(address) - offsetof(type,field)))
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* DOUBLYLINKEDLIST_H */
Note: See TracBrowser for help on using the repository browser.