Ext
 All Files Functions
main.c
1 
3 #include <stdio.h>
4 #include <stdlib.h>
5 #include "server/server.h"
6 
7 
8 int main(int argc, char** argv) {
9  long port = 8000;
10  if (argc == 1) {
11  fprintf(stderr, "You should provide port and path to fs file as arguments. Using default 8000 port. Using default name\n");
12  const char* fs_file_path = "test_fs";
13  return server_loop(8000, fs_file_path);
14  }
15 
16  if (argc == 2) {
17  const char* fs_file_path = argv[1];
18  fprintf(stderr, "You should provide port as argument. Using default 8000 port\n");
19  return server_loop(8000, fs_file_path);
20  }
21 
22  const char* fs_file_path = argv[1];
23  port = strtol(argv[2], NULL, 10);
24  return server_loop(port, fs_file_path);
25 }
int server_loop(long port, const char *fs_file_path)
Definition: server.c:169