summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/net.h10
-rw-r--r--include/purple.h27
-rw-r--r--include/settings.h15
3 files changed, 46 insertions, 6 deletions
diff --git a/include/net.h b/include/net.h
index 59071a5..e4ca0a6 100644
--- a/include/net.h
+++ b/include/net.h
@@ -22,7 +22,7 @@
#ifndef USURPATION_NET_H_INCLUDED
#define USURPATION_NET_H_INCLUDED
-#define dgsize 512
+#define MTU 1500
enum response {
ERROR = -1,
@@ -34,7 +34,7 @@ enum response {
};
/**
- * Initialises connection with daemon and returns a network descriptor.
+ * Initialises a listening socket and returns the associated network descriptor.
*/
int net_init(const unsigned short int port);
@@ -45,9 +45,9 @@ int net_close(int nd);
/**
* Get last data received from connection associated with network descriptor.
- * Function mallocates a buffer for data received from packet. Don't forget to
- * free the buffer.
+ * If the pointer pointed by data is NULL, a buffer is allocated by the function
+ * and needs to be free()'d later. Otherwise, the supplied buffer is reused.
*/
-int net_getlastdata(int nd, char * const data);
+int net_getlastdata(int nd, char ** const data);
#endif /* USURPATION_NET_H_INCLUDED */
diff --git a/include/purple.h b/include/purple.h
new file mode 100644
index 0000000..1fa8a91
--- /dev/null
+++ b/include/purple.h
@@ -0,0 +1,27 @@
+/*
+ * Usurpation – server daemon IM module, private header
+ *
+ * Copyright (C) 2019 Gediminas Jakutis
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; version 2.1
+ * of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef USURPATION_PURPLE_H
+#define USURPATION_PURPLE_H
+
+int purple_init(void);
+void purple_close(void);
+
+#endif /* USURPATION_PURPLE_H */
diff --git a/include/settings.h b/include/settings.h
index 72addd0..e2e9644 100644
--- a/include/settings.h
+++ b/include/settings.h
@@ -22,9 +22,22 @@
#ifndef USURPATION_SETTINGS_H
#define USURPATION_SETTINGS_H
+enum verbosity {
+ SILENT = 0,
+ ERR = 1,
+ WARN,
+ DEBUG,
+ ALL
+};
+
void settings_init(void);
int setting_detach(void);
-unsigned short int setting_port(void);
int setting_verbose(void);
+unsigned short int setting_port(void);
+char *setting_progname(void);
+char *setting_im_user(void);
+char *setting_im_password(void);
+char *setting_im_proto(void);
+void settings_cleanup(void);
#endif /* USURPATION_SETTINGS_H */