00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include "Core/precomp.h"
00016
00017 #ifdef USE_NETWORK
00018
00019 #include <iostream>
00020 #include <netdb.h>
00021 #include <signal.h>
00022
00023 #include <Network/Generic/network_generic.h>
00024 #include <Network/Unix/connection_provider_unix.h>
00025 #include <Network/Unix/network_unix.h>
00026 #include <Core/System/Unix/implementation.h>
00027
00028 void signal_pipe(int)
00029 {
00030
00031
00032
00033
00034
00035 }
00036
00037 CL_Network_Generic *CL_Network_Unix::network = NULL;
00038
00039 extern "C"
00040 {
00041 DL_PREFIX char *clan_module_identify() {
00042 return "Clanlib Network implementation";
00043 }
00044
00045 DL_PREFIX char *clan_module_abbreviation() {
00046 return "net";
00047 }
00048
00049 DL_PREFIX void clan_module_init() {
00050 CL_Implementation_Network::add_network();
00051 }
00052 }
00053
00054 char *network_identify() {
00055 return clan_module_identify();
00056 }
00057
00058 char *network_abbreviation() {
00059 return clan_module_abbreviation();
00060 }
00061
00062 void network_init() {
00063 clan_module_init();
00064 }
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112 void CL_Implementation_Network::add_network()
00113 {
00114 CL_Connections_Unix *connections = new CL_Connections_Unix(NULL);
00115
00116 signal(SIGPIPE, signal_pipe);
00117
00118 CL_Network_Unix::network = new CL_Network_Generic(connections);
00119 }
00120
00121 void CL_Implementation_Network::remove_network()
00122 {
00123 if (CL_Network_Unix::network != NULL) delete CL_Network_Unix::network;
00124 CL_Network_Unix::network = NULL;
00125 }
00126
00127 #endif // USE_NETWORK