aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2019-05-18 17:41:36 +0200
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2019-05-18 17:41:36 +0200
commitae108d4500ac2b179462e0f33587a1e53e50e8a3 (patch)
tree91abdc4102bceaa1f27f2dd521b07f089e3f7a4b /src/main.c
parent5bf1de3227199c7f300a93035b5ed65df7209d0d (diff)
downloadbbs-ae108d4500ac2b179462e0f33587a1e53e50e8a3.tar.gz
seperated main
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c45
1 files changed, 1 insertions, 44 deletions
diff --git a/src/main.c b/src/main.c
index b2dbbe7..f583d63 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,47 +1,4 @@
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <sys/socket.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <netinet/in.h>
-#include <stdint.h>
-#include <errno.h>
-#include <string.h>
-#include <signal.h>
-#include <arpa/inet.h>
-
-#define _DEF_MAX_BACKLOG 20
-#define _DEF_PORT 23
-#define _DEF_IP 0
-#define _DEF_CONFIG_FILE "/etc/bbs.conf"
-
-#ifdef _DEBUG
-//DEBUG Macros
-#warning "Compiling in DEBUG mode"
-#define DEBUG_PRINTF( ... ) { \
- printf("%s:%d: ", __FILE__, __LINE__); \
- printf(__VA_ARGS__ ); }
-#define PRINT_ERROR( str ) { \
- printf("%s:%d: %s: %s\n", __FILE__, __LINE__, str, strerror(errno)); }
-#else
-//Release Macros
-#define DEBUG_PRINTF( ... ) { }
-#define PRINT_ERROR( str ) { printf("%s: %s\n", str, strerror(errno)); }
-#endif
-
-struct prog_params
-{
- uint8_t telnet;
- uint16_t port;
- uint16_t backlog;
- char* ip;
- char** run_argv;
- int run_argc;
-
- uint8_t serial;
- char* serial_port;
-};
+#include "main.h"
struct prog_params parse_args(int argc, char* argv[])
{