5 #ifndef CORELINKCONST_H 6 #define CORELINKCONST_H 16 #include "corelink/corelink_dll.h" 23 static int streamStateToBitIndex(
int state) {
24 return CorelinkDLL::streamStateToBitIndex(state);
27 static std::string streamStateName(
int state) {
32 len = CorelinkDLL::streamStateNameLen(state);
33 if (len == 0) {
return ""; }
34 buffer =
new char[len];
35 CorelinkDLL::streamStateNameStr(state, buffer);
37 name = std::string(buffer, len - 1);
41 return std::string(CorelinkDLL::streamStateName(state));
50 static std::string errorCodeName(
int errorCode) {
55 len = CorelinkDLL::errorCodeNameLen(errorCode);
56 if (len == 0) {
return ""; }
57 buffer =
new char[len];
58 CorelinkDLL::errorCodeNameStr(errorCode, buffer);
60 name = std::string(buffer, len - 1);
64 return std::string(CorelinkDLL::errorCodeName(errorCode));
71 static const int STREAM_STATE_NONE = CorelinkDLL::STREAM_STATE_NONE;
72 static const int STREAM_STATE_SEND_UDP = CorelinkDLL::STREAM_STATE_SEND_UDP;
73 static const int STREAM_STATE_RECV_UDP = CorelinkDLL::STREAM_STATE_RECV_UDP;
74 static const int STREAM_STATE_SEND_TCP = CorelinkDLL::STREAM_STATE_SEND_TCP;
75 static const int STREAM_STATE_RECV_TCP = CorelinkDLL::STREAM_STATE_RECV_TCP;
76 static const int STREAM_STATE_SEND_WS = CorelinkDLL::STREAM_STATE_SEND_WS;
77 static const int STREAM_STATE_RECV_WS = CorelinkDLL::STREAM_STATE_RECV_WS;
78 static const int STREAM_STATE_UDP = CorelinkDLL::STREAM_STATE_UDP;
79 static const int STREAM_STATE_TCP = CorelinkDLL::STREAM_STATE_TCP;
80 static const int STREAM_STATE_WS = CorelinkDLL::STREAM_STATE_WS;
81 static const int STREAM_STATE_SEND = CorelinkDLL::STREAM_STATE_SEND;
82 static const int STREAM_STATE_RECV = CorelinkDLL::STREAM_STATE_RECV;
83 static const int STREAM_STATE_ALL = CorelinkDLL::STREAM_STATE_ALL;
85 static const int ERROR_CODE_NONE = CorelinkDLL::ERROR_CODE_NONE;
86 static const int ERROR_CODE_STATE = CorelinkDLL::ERROR_CODE_STATE;
87 static const int ERROR_CODE_VALUE = CorelinkDLL::ERROR_CODE_VALUE;
88 static const int ERROR_CODE_SOCKET = CorelinkDLL::ERROR_CODE_SOCKET;
89 static const int ERROR_CODE_COMM = CorelinkDLL::ERROR_CODE_COMM;
90 static const int ERROR_CODE_NO_TOKEN = CorelinkDLL::ERROR_CODE_NO_TOKEN;
92 static const int CALLBACK_DROPPED = CorelinkDLL::CALLBACK_DROPPED;
93 static const int CALLBACK_STALE = CorelinkDLL::CALLBACK_STALE;
94 static const int CALLBACK_SUBSCRIBE = CorelinkDLL::CALLBACK_SUBSCRIBE;
95 static const int CALLBACK_UPDATE = CorelinkDLL::CALLBACK_UPDATE;
97 static const std::string ErrorCodeString[6] = {