-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhandleTable.h
More file actions
34 lines (23 loc) · 807 Bytes
/
handleTable.h
File metadata and controls
34 lines (23 loc) · 807 Bytes
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
#ifndef HANDLETABLE_INC
#define HANDLETABLE_INC
#include <stdint.h>
struct handlerEntry {
char* handleName;
uint8_t handleSize;
int socketNo;
};
struct hTable {
int length;
int capacity;
struct handlerEntry* arr;
};
void handleTable_setup();
int handleTable_push(struct handlerEntry newEntry);//return -1 on failure (repeat handler), 0 on success
int handleTableNameToSocket( char* name, uint8_t nameLength);
int handleTable_getLength();
int handleTable_getEntry_socketNo(int index); //gets the entry in location index of the handler table
char* handleTable_getEntry_handleName(int index);
uint8_t handleTable_getEntry_handleSize(int index);
int handleTable_removeBySocket(int socketNo); //return -1 on fail. Should never fail (ideally)
void handleTable_free();
#endif