summaryrefslogtreecommitdiff
path: root/src/global.h
diff options
context:
space:
mode:
authorJames Maki <jmaki@multitech.com>2010-04-23 11:58:20 -0500
committerJames Maki <jmaki@multitech.com>2010-04-23 11:58:20 -0500
commit14fb44b17123b27e562379f51b75ee889982688d (patch)
tree3c2344f5c42396ab839638ee12f7c2f66a2656cb /src/global.h
downloadsms-utils-14fb44b17123b27e562379f51b75ee889982688d.tar.gz
sms-utils-14fb44b17123b27e562379f51b75ee889982688d.tar.bz2
sms-utils-14fb44b17123b27e562379f51b75ee889982688d.zip
initial commit
Diffstat (limited to 'src/global.h')
-rw-r--r--src/global.h92
1 files changed, 92 insertions, 0 deletions
diff --git a/src/global.h b/src/global.h
new file mode 100644
index 0000000..ccfb6b4
--- /dev/null
+++ b/src/global.h
@@ -0,0 +1,92 @@
+#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
+
+struct global_user {
+ char *name;
+ char *email;
+};
+
+struct global_core {
+ speed_t baud_rate;
+ int read_timeout;
+ char *device;
+ int verbose;
+ int interactive;
+
+ char *msg_store_read;
+ char *msg_store_send;
+ char *msg_store_new;
+ char *pb_store;
+
+ 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;
+};
+
+#if __MAIN_FILE_C
+struct global_config Global = {
+ .user = {
+ .name = NULL,
+ .email = NULL,
+ },
+ .core = {
+ .verbose = false,
+ .interactive = true,
+ .baud_rate = B115200,
+ .read_timeout = 5000,
+ .device = DEFAULT_DEVICE,
+ .msg_store_read = "MT",
+ .msg_store_send = "MT",
+ .msg_store_new = "MT",
+ .pb_store = "ME",
+ .editor = "vi",
+ .edit_file = "${HOME}/.smsmsg",
+ },
+ .smtp = {
+ .server = NULL,
+ .port = 0,
+ .user = NULL,
+ .passwd = NULL,
+ .encryption = NULL,
+ },
+ .send_email = {
+ .domain = NULL,
+ },
+};
+#else
+extern struct global_config Global;
+#endif
+
+
+
+#endif /* ~__GLOBAL_H */
+