summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/main.c b/main.c
index 887680a..5fa11e8 100644
--- a/main.c
+++ b/main.c
@@ -132,6 +132,41 @@ int main(const int argc, char const * argv[]) {
132 int port = atoi(argc > 1 ? argv[1] : "8080"); 132 int port = atoi(argc > 1 ? argv[1] : "8080");
133 0 == port ? port = 8080 : port; 133 0 == port ? port = 8080 : port;
134 134
135
136 // char * pidfile = NULL;
137
138
139 // char ** next_param = NULL;
140 // for(int i=1; i<argc; i++) {
141 // switch(strspn(argv[i], "-")) {
142 // case 1: // one minus (short param)
143 // if(argv[i][2] != '\0') // one minus, one param and a null char
144 // break;
145 // if(next_param)
146 // err(EXIT_FAILURE, "wrong parameter: %s\n", argv[i]);
147 // switch(argv[i][1]) {
148 // case 't': puts("t was chosen"); break;
149 // case 'e': puts("e was chosen"); break;
150 // case 's': puts("s was chosen"); break;
151 // }
152 // break;
153 // case 2: // two minus (long param)
154 // if(next_param)
155 // err(EXIT_FAILURE, "wrong parameter: %s\n", argv[i]);
156 // if(0 == strcmp("pidfile", &argv[i][2])) {
157 // next_param = &pidfile;
158 // }
159 // break;
160 // default:
161 // // pidfile = (char*) argv[i];
162 // *next_param = (char*) argv[i];
163 // }
164 // }
165
166 // printf("pidfile is '%s'\n", pidfile);
167
168 // return EXIT_SUCCESS;
169
135 struct sockaddr_in address = { 170 struct sockaddr_in address = {
136 .sin_family = AF_INET, 171 .sin_family = AF_INET,
137 .sin_addr.s_addr = INADDR_ANY, 172 .sin_addr.s_addr = INADDR_ANY,
..