Commit 9e7b137d7b084826e8e4d99aee9ea2056afbce0a

Authored by Georg Hopp
1 parent 68bd42e3

make create response and request also callable vith an va_list argument.

... ... @@ -47,7 +47,9 @@ TR_INTERFACE(TR_Protocol) {
47 47 };
48 48
49 49 TR_ProtoMessage TR_protoCreateMessage(void *, TR_Socket);
  50 +TR_ProtoMessage TR_vprotoCreateRequest(void *, TR_Socket, va_list*);
50 51 TR_ProtoMessage TR_protoCreateRequest(void *, TR_Socket, ...);
  52 +TR_ProtoMessage TR_vprotoCreateResponse(void *, TR_Socket, va_list*);
51 53 TR_ProtoMessage TR_protoCreateResponse(void *, TR_Socket, ...);
52 54 size_t TR_protoParse(void *, TR_ProtoMessage, TR_RemoteData);
53 55 TR_RemoteData TR_protoCompose(void *, TR_ProtoMessage);
... ...
... ... @@ -42,34 +42,46 @@ TR_protoCreateMessage(void * _this, TR_Socket remote)
42 42 }
43 43
44 44 TR_ProtoMessage
45   -TR_protoCreateRequest(void * _this, TR_Socket remote, ...)
  45 +TR_vprotoCreateRequest(void * _this, TR_Socket remote, va_list * params)
46 46 {
47 47 TR_ProtoMessage callret;
48   - va_list params;
49   -
50   - va_start(params, remote);
51   - TR_RETCALL(_this, TR_Protocol, createRequest, callret, &params);
  48 + TR_RETCALL(_this, TR_Protocol, createRequest, callret, params);
52 49 if (callret != NULL) {
53 50 callret->remote = remote;
54 51 }
55   - va_end(params);
56   -
57 52 return callret;
58 53 }
59 54
60 55 TR_ProtoMessage
61   -TR_protoCreateResponse(void * _this, TR_Socket remote, ...)
  56 +TR_protoCreateRequest(void * _this, TR_Socket remote, ...)
62 57 {
63 58 TR_ProtoMessage callret;
64 59 va_list params;
65   -
66 60 va_start(params, remote);
  61 + callret = TR_vprotoCreateRequest(_this, remote, &params);
  62 + va_end(params);
  63 + return callret;
  64 +}
  65 +
  66 +TR_ProtoMessage
  67 +TR_vprotoCreateResponse(void * _this, TR_Socket remote, va_list * params)
  68 +{
  69 + TR_ProtoMessage callret;
67 70 TR_RETCALL(_this, TR_Protocol, createResponse, callret, &params);
68 71 if (callret != NULL) {
69 72 callret->remote = remote;
70 73 }
71   - va_end(params);
  74 + return callret;
  75 +}
72 76
  77 +TR_ProtoMessage
  78 +TR_protoCreateResponse(void * _this, TR_Socket remote, ...)
  79 +{
  80 + TR_ProtoMessage callret;
  81 + va_list params;
  82 + va_start(params, remote);
  83 + callret = TR_vprotoCreateResponse(_this, remote, &params);
  84 + va_end(params);
73 85 return callret;
74 86 }
75 87
... ...
Please register or login to post a comment