-
Notifications
You must be signed in to change notification settings - Fork 0
/
List.h
38 lines (35 loc) · 1.1 KB
/
List.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
36
37
38
#ifndef _List
#define _List
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
typedef enum Type { Char, Int, Float, Double, Long, String, Object } TypeOfList;
typedef struct List List;
struct List
{
void* List;
TypeOfList Type;
size_t sizeOfListVal;
size_t Capacity;
size_t Count;
};
List* CreateNewList(TypeOfList Type, unsigned long long Size, size_t Capacity);
static bool AddValue(List** list, void* value);
static void* GetValue(List* list, size_t Index);
char* ToString(List* list);
void* GetObject(List* list, size_t Index);
char GetChar(List* list, size_t Index);
int GetInt(List* list, size_t Index);
float GetFloat(List* list, size_t Index);
double GetDouble(List* list, size_t Index);
long long GetLong(List* list, size_t Index);
char* GetString(List* list, size_t Index);
bool AddObject(List** list, void* value);
bool AddChar(List** list, char value);
bool AddInt(List** list, int value);
bool AddFloat(List** list, float value);
bool AddDouble(List** list, double value);
bool AddLong(List** list, long long value);
bool AddString(List** list, char* value);
#endif //_List