|
Server 0.0.1
HTTP/REST server implementation
|
00001 00023 #include <stdarg.h> 00024 #include <openssl/ssl.h> 00025 00026 #include "class.h" 00027 #include "stream/stream.h" 00028 00029 00030 static 00031 int 00032 streamCtor(void * _this, va_list * params) 00033 { 00034 Stream this = _this; 00035 this->type = va_arg(* params, StreamHandleType); 00036 00037 switch(this->type) { 00038 case STREAM_FD: 00039 (this->handle).fd = va_arg(* params, int); 00040 break; 00041 00042 case STREAM_SSL: 00043 (this->handle).ssl = va_arg(* params, SSL*); 00044 break; 00045 00046 default: 00047 return -1; 00048 } 00049 00050 return 0; 00051 } 00052 00053 static 00054 void 00055 streamDtor(void * _this) 00056 { 00057 } 00058 00059 INIT_IFACE(Class, streamCtor, streamDtor, NULL); 00060 CREATE_CLASS(Stream, NULL, IFACE(Class)); 00061 00062 // vim: set ts=4 sw=4: