Commit f4c630f613e23d40f661a03f82923c4e7ffdd30c
1 parent
2a917f84
initialize static instance creation
Showing
3 changed files
with
9 additions
and
0 deletions
@@ -38,6 +38,8 @@ TR_CLASS(TR_RemoteData) { | @@ -38,6 +38,8 @@ TR_CLASS(TR_RemoteData) { | ||
38 | socklen_t addrlen; | 38 | socklen_t addrlen; |
39 | }; | 39 | }; |
40 | 40 | ||
41 | +TR_INSTANCE_INIT(TR_RemoteData); | ||
42 | + | ||
41 | extern TR_RemoteData TR_emptyRemoteData; | 43 | extern TR_RemoteData TR_emptyRemoteData; |
42 | 44 | ||
43 | void TR_remoteDataSetData(TR_RemoteData, unsigned char *, size_t); | 45 | void TR_remoteDataSetData(TR_RemoteData, unsigned char *, size_t); |
@@ -58,6 +58,8 @@ TR_CLASS(TR_Socket) { | @@ -58,6 +58,8 @@ TR_CLASS(TR_Socket) { | ||
58 | TR_SocketFin fin_state; | 58 | TR_SocketFin fin_state; |
59 | }; | 59 | }; |
60 | 60 | ||
61 | +TR_INSTANCE_INIT(TR_Socket); | ||
62 | + | ||
61 | #define TR_socketLog(socket) (((TR_Socket)(socket))->log) | 63 | #define TR_socketLog(socket) (((TR_Socket)(socket))->log) |
62 | #define TR_socketFlags(socket) (((TR_Socket)(socket))->flags) | 64 | #define TR_socketFlags(socket) (((TR_Socket)(socket))->flags) |
63 | #define TR_socketType(socket) (((TR_Socket)(socket))->type) | 65 | #define TR_socketType(socket) (((TR_Socket)(socket))->type) |
@@ -82,10 +84,14 @@ TR_CLASS(TR_TcpSocket) { | @@ -82,10 +84,14 @@ TR_CLASS(TR_TcpSocket) { | ||
82 | int connected; | 84 | int connected; |
83 | }; | 85 | }; |
84 | 86 | ||
87 | +TR_INSTANCE_INIT(TR_TcpSocket); | ||
88 | + | ||
85 | TR_CLASS(TR_UdpSocket) { | 89 | TR_CLASS(TR_UdpSocket) { |
86 | TR_EXTENDS(TR_Socket); | 90 | TR_EXTENDS(TR_Socket); |
87 | }; | 91 | }; |
88 | 92 | ||
93 | +TR_INSTANCE_INIT(TR_UdpSocket); | ||
94 | + | ||
89 | typedef int (* TR_socketAction_fptr)(void *); | 95 | typedef int (* TR_socketAction_fptr)(void *); |
90 | 96 | ||
91 | int TR_socketInit(TR_Socket, TR_socketAction_fptr); | 97 | int TR_socketInit(TR_Socket, TR_socketAction_fptr); |
@@ -40,6 +40,7 @@ TR_CLASS(TR_Stream) { | @@ -40,6 +40,7 @@ TR_CLASS(TR_Stream) { | ||
40 | SSL * ssl; | 40 | SSL * ssl; |
41 | } handle; | 41 | } handle; |
42 | }; | 42 | }; |
43 | +TR_INSTANCE_INIT(TR_Stream); | ||
43 | 44 | ||
44 | ssize_t TR_streamRead(TR_Stream, void *, size_t); | 45 | ssize_t TR_streamRead(TR_Stream, void *, size_t); |
45 | ssize_t TR_streamWrite(TR_Stream, void *, size_t); | 46 | ssize_t TR_streamWrite(TR_Stream, void *, size_t); |
Please
register
or
login
to post a comment