-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathutils.h
More file actions
61 lines (46 loc) · 1.13 KB
/
utils.h
File metadata and controls
61 lines (46 loc) · 1.13 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef UTILS_H
#define UTILS_H
#include "stdbool.h"
#include <libnm/NetworkManager.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define INITIAL_SIZE 64
#define SIZE_MAX 4096
#define RENDER_LIST_SIZE 512
#define MAX_ENTRIES 100
typedef void *(*onValidate)(void *);
struct _RenderString {
char *string;
size_t size;
int length;
};
typedef struct _RenderString RenderString;
struct _RenderList {
char **List;
onValidate *callbackArray;
int length;
int size;
};
typedef struct _RenderList RenderList;
struct _SessionContext {
NMClient *client;
NMDeviceWifi *device;
RenderString *RenderString;
RenderList *RenderList;
GMainLoop *loop;
bool RegisteredActions;
char *Input;
char *ActiveSsid;
int Index;
bool PerformedActions;
};
typedef struct _SessionContext SessionContext;
RenderString *InitRenderString(void);
RenderList *InitRenderList(void);
void AddRenderEntry(char *ssid, int strength, bool active,
SessionContext *SessionContext, onValidate callback);
NMClient *CreateClient();
void Terminate(SessionContext *global_ctx);
void NotifyGeneric(char *message);
#endif