blob: b8bef88cc16f7021c64c7befc5077dd7d3c76579 (
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
|
#include <sys/socket.h>
#include <sys/un.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include "error/error.h"
#include "parameters/parameters.h"
#include "server/server.h"
#include "pervasive.h"
static void print_help (const char runnable [const restrict static 1])
{
printf
(
"JabberHive - Lowercase\n"
"Software Version %d\n"
"Protocol Version %d\n"
"\nUsages:\n"
" JH GATEWAY:\t%s SOCKET_NAME DESTINATION\n"
" SHOW HELP:\tAnything else.\n"
"\nParameters:\n"
" SOCKET_NAME:\tValid UNIX socket.\n"
" DESTINATION:\tValid UNIX socket.\n",
JH_PROGRAM_VERSION,
JH_PROTOCOL_VERSION,
runnable
);
}
int main (int const argc, const char * argv [const static argc])
{
struct JH_parameters params;
if (JH_parameters_initialize(¶ms, argc, argv) < 0)
{
print_help(argv[0]);
return -1;
}
if (JH_server_main(¶ms) < 0)
{
return -1;
}
return 0;
}
|