Dokan 3.0.0
User mode file system library for windows with FUSE Wrapper
Loading...
Searching...
No Matches
dokan_vector.h
1/*
2 Dokan : user-mode file system library for Windows
3
4 Copyright (C) 2016 Keith Newton
5 Copyright (C) 2022 - 2025 Google, Inc.
6
7 http://dokan-dev.github.io
8
9This program is free software; you can redistribute it and/or modify it under
10the terms of the GNU Lesser General Public License as published by the Free
11Software Foundation; either version 3 of the License, or (at your option) any
12later version.
13
14This program is distributed in the hope that it will be useful, but WITHOUT ANY
15WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
17
18You should have received a copy of the GNU Lesser General Public License along
19with this program. If not, see <http://www.gnu.org/licenses/>.
20*/
21
22#ifndef DOKAN_VECTOR_H_
23#define DOKAN_VECTOR_H_
24
25typedef struct _DOKAN_VECTOR {
26 PVOID Items;
27 size_t ItemCount;
28 size_t ItemSize;
29 size_t MaxItems;
30 BOOL IsStackAllocated;
31} DOKAN_VECTOR, *PDOKAN_VECTOR;
32
33// Creates a new instance of DOKAN_VECTOR with default values.
34DOKAN_VECTOR *DokanVector_Alloc(size_t ItemSize);
35
36// Creates a new instance of DOKAN_VECTOR with default values.
37DOKAN_VECTOR *DokanVector_AllocWithCapacity(size_t ItemSize, size_t MaxItems);
38
39// Releases the memory associated with a DOKAN_VECTOR;
40VOID DokanVector_Free(PDOKAN_VECTOR Vector);
41
42// Appends an item to the vector at the Front. Expensive, please use PushBack instead.
43BOOL DokanVector_PushFront(PDOKAN_VECTOR Vector, PVOID Item);
44
45// Appends an array of items to the vector at the Front.
46BOOL DokanVector_PushFrontArray(PDOKAN_VECTOR Vector, PVOID Items, size_t Count);
47
48// Appends an item to the vector.
49BOOL DokanVector_PushBack(PDOKAN_VECTOR Vector, PVOID Item);
50
51// Appends an array of items to the vector.
52BOOL DokanVector_PushBackArray(PDOKAN_VECTOR Vector, PVOID Items, size_t Count);
53
54// Removes an item from the end of the vector.
55VOID DokanVector_PopBack(PDOKAN_VECTOR Vector);
56
57// Removes multiple items from the end of the vector.
58VOID DokanVector_PopBackArray(PDOKAN_VECTOR Vector, size_t Count);
59
60// Clears all items in the vector.
61VOID DokanVector_Clear(PDOKAN_VECTOR Vector);
62
63// Retrieves the item at the specified index
64PVOID DokanVector_GetItem(PDOKAN_VECTOR Vector, size_t Index);
65
66// Retrieves the last item the vector.
67PVOID DokanVector_GetLastItem(PDOKAN_VECTOR Vector);
68
69// Retrieves the number of items in the vector.
70size_t DokanVector_GetCount(PDOKAN_VECTOR Vector);
71
72// Retrieves the current capacity of the vector.
73size_t DokanVector_GetCapacity(PDOKAN_VECTOR Vector);
74
75// Retrieves the size of items within the vector.
76size_t DokanVector_GetItemSize(PDOKAN_VECTOR Vector);
77
78#endif
Definition dokan_vector.h:25