-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmain.c
46 lines (39 loc) · 869 Bytes
/
main.c
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
/**
* @file
* @copyright (c) 2013 Stephan Brenner
* @license This project is released under the MIT License.
*
* This is the main file of the project containing the entry point.
*/
#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "logic.h"
/**
* Entry point for the executable
*/
int main()
{
proxy_config config;
#ifdef __linux__
if (!setlocale(LC_ALL, "en_US.UTF-8"))
{
fprintf(stderr, "Error: Unable to configure UTF-8.\n");
return 3;
}
#endif
printf("Detecting proxy configuration...\n");
if (detect_proxy_config(&config))
{
fprintf(stderr, "Error: Unable to detect proxy configuration.\n");
return 1;
}
if (write_proxy_config(&config))
{
fprintf(stderr, "Error: Unable to write batch file.\n");
return 2;
}
free_proxy_config(&config);
return 0;
}