summaryrefslogtreecommitdiff
path: root/src/global.h
blob: a6073dd53b57975cdea766c9b4d47ae8547c5ef1 (plain)
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
62
63
64
65
66
67
68
#ifndef __GLOBAL_H
#define __GLOBAL_H

#include "config.h"
#include <termios.h>
#include "utils.h"
#include "log.h"

#ifdef __MAIN_FILE_C
#define GLOBAL_EXTERN
#else
#define GLOBAL_EXTERN extern
#endif

#define ICCID_LEN           23
#define ICCID_SIZE         (ICCID_LEN + 1)
#define MODEL_LEN           1023
#define MODEL_SIZE         (MODEL_LEN + 1)
#define MANUFACTURER_LEN    1023
#define MANUFACTURER_SIZE  (MANUFACTURER_LEN + 1)

struct global_user {
	char *name;
	char *email;
};

struct global_core {
	speed_t baud_rate;
	int read_timeout;
	int sms_init;
	char *device;
	int verbose;
	int interactive;

	char *msg_store_read;
	char *msg_store_send;
	char *msg_store_new;
	char *pb_store;
	char model[MODEL_SIZE];
	char iccid[ICCID_SIZE];  /* Needed for LNA3/Verizon */
	char manufacturer[MANUFACTURER_SIZE];  /* Needed to pick proper manufacturer-specific commands */

	char *editor;
	char *edit_file;
};

struct global_smtp {
	char *server;
	int port;
	char *user;
	char *passwd;
	char *encryption;
};

struct global_send_email {
	char *domain;
};

struct global_config {
	struct global_user user;
	struct global_core core;
	struct global_smtp smtp;
	struct global_send_email send_email;
};

GLOBAL_EXTERN struct global_config Global;

#endif /* ~__GLOBAL_H */