26 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
26 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
27 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
27 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
28 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ |
29 */ |
30 |
30 |
|
31 #include "main.h" |
|
32 |
|
33 #ifndef _WIN32 |
|
34 # include <sys/select.h> |
|
35 #else |
|
36 # include <winsock2.h> |
|
37 #endif |
|
38 |
31 #include <time.h> |
39 #include <time.h> |
32 #include <sys/select.h> |
|
33 #include "main.h" |
|
34 #include "network/rconsession.h" |
40 #include "network/rconsession.h" |
35 #include "huffman.h" |
41 #include "huffman.h" |
36 #include "interface.h" |
42 #include "interface.h" |
37 |
43 |
38 // ------------------------------------------------------------------------------------------------- |
44 // ------------------------------------------------------------------------------------------------- |
39 // |
45 // |
40 FUNCTION |
46 FUNCTION |
41 main (int argc, char* argv[]) -> int |
47 main (int argc, char* argv[]) -> int |
42 { |
48 { |
|
49 #ifdef _WIN32 |
|
50 FreeConsole(); |
|
51 |
|
52 WSADATA wsaData; |
|
53 int result = WSAStartup (MAKEWORD (2, 2), &wsaData); |
|
54 |
|
55 if (result != 0) |
|
56 { |
|
57 fprintf (stderr, "WSAStartup failed: %d\n", result); |
|
58 return 1; |
|
59 } |
|
60 #endif |
|
61 |
43 HUFFMAN_Construct(); |
62 HUFFMAN_Construct(); |
44 |
63 |
45 if (argc != 1 and argc != 3) |
64 if (argc != 1 and argc != 3) |
46 { |
65 { |
47 fprintf (stderr, "usage: %s\nusage: %s <address> <password>\n", argv[0], argv[0]); |
66 fprintf (stderr, "usage: %s\nusage: %s <address> <password>\n", argv[0], argv[0]); |