-
Notifications
You must be signed in to change notification settings - Fork 0
/
strlist10.h
35 lines (28 loc) · 967 Bytes
/
strlist10.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
* File : strlist10.h
* Version : 1.0
* Description : Simple and dumb multithread-safe string list / header file
* Created on : Jan 3, 2021
* Author : Uldis Rinkevichs
*/
#pragma once
#ifndef _STRLIST10H_
#define _STRLIST10H_
#include <Windows.h>
typedef struct _USTRLIST_ENTRY {
struct _USTRLIST_ENTRY* Next;
WCHAR Str[1];
} USTRLIST_ENTRY, * PUSTRLIST_ENTRY;
typedef struct _USTRLIST {
HANDLE ListHeap;
HANDLE Lock;
ULONG_PTR StringsCount;
PUSTRLIST_ENTRY Strings;
} USTRLIST, * PUSTRLIST;
BOOL UStrListCreate(PUSTRLIST List);
ULONG_PTR UStrListAdd(PUSTRLIST List, const PWCHAR Str);
ULONG_PTR UStrListInsert(PUSTRLIST List, ULONG_PTR Index, const PWCHAR Str);
PWCHAR UStrListGet(PUSTRLIST List, ULONG_PTR Index);
BOOL UStrListDelete(PUSTRLIST List, ULONG_PTR Index);
BOOL UStrListDestroy(PUSTRLIST List);
#endif // _STRLIST10H_