Mercurial > masqmail
comparison src/mservdetect.c @ 10:26e34ae9a3e3
changed indention and line wrapping to a more consistent style
author | meillo@marmaro.de |
---|---|
date | Mon, 27 Oct 2008 16:23:10 +0100 |
parents | 08114f7dcc23 |
children | 5b621742b2e7 |
comparison
equal
deleted
inserted
replaced
9:31cc8a89cb74 | 10:26e34ae9a3e3 |
---|---|
30 #include "mserver.c" | 30 #include "mserver.c" |
31 #else | 31 #else |
32 #include "masqmail.h" | 32 #include "masqmail.h" |
33 #include "readsock.h" | 33 #include "readsock.h" |
34 #include "mserver.h" | 34 #include "mserver.h" |
35 #endif /* ENABLE_MSERVER */ | 35 #endif /* ENABLE_MSERVER */ |
36 | 36 |
37 void logwrite(int pri, const char *fmt, ...) | 37 void |
38 logwrite(int pri, const char *fmt, ...) | |
38 { | 39 { |
39 va_list args; | 40 va_list args; |
40 va_start(args, fmt); | 41 va_start(args, fmt); |
41 | 42 |
42 vfprintf(stdout, fmt, args); | 43 vfprintf(stdout, fmt, args); |
43 | 44 |
44 va_end(args); | 45 va_end(args); |
45 } | 46 } |
46 | 47 |
47 void debugf(const char *fmt, ...) | 48 void |
49 debugf(const char *fmt, ...) | |
48 { | 50 { |
49 va_list args; | 51 va_list args; |
50 va_start(args, fmt); | 52 va_start(args, fmt); |
51 | 53 |
52 vfprintf(stdout, fmt, args); | 54 vfprintf(stdout, fmt, args); |
53 | 55 |
54 va_end(args); | 56 va_end(args); |
55 } | 57 } |
56 | 58 |
57 int main(int argc, char *argv[]) | 59 int |
60 main(int argc, char *argv[]) | |
58 { | 61 { |
59 if(argc == 3){ | 62 if (argc == 3) { |
60 interface iface; | 63 interface iface; |
61 gchar *name; | 64 gchar *name; |
62 | 65 |
63 iface.address = g_strdup(argv[1]); | 66 iface.address = g_strdup(argv[1]); |
64 iface.port = atoi(argv[2]); | 67 iface.port = atoi(argv[2]); |
65 | 68 |
66 name = mserver_detect_online(&iface); | 69 name = mserver_detect_online(&iface); |
67 | 70 |
68 printf("%s\n", name); | 71 printf("%s\n", name); |
69 | 72 |
70 exit(EXIT_SUCCESS); | 73 exit(EXIT_SUCCESS); |
71 }else{ | 74 } else { |
72 fprintf(stderr, "usage %s <host> <port>\n", argv[0]); | 75 fprintf(stderr, "usage %s <host> <port>\n", argv[0]); |
73 exit(EXIT_FAILURE); | 76 exit(EXIT_FAILURE); |
74 } | 77 } |
75 } | 78 } |
76 |