1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2026-01-03 17:13:16 +00:00

Updated metadata

This commit is contained in:
Bryan Roe
2021-01-28 02:11:05 -08:00
parent 5be208f5b5
commit 704edbb802
13 changed files with 27 additions and 26 deletions

View File

@@ -2455,7 +2455,7 @@ void ILibDuktape_ChainViewer_Push(duk_context *ctx, void *chain)
duk_push_object(ctx); // [viewer]
ILibTransport *t = (ILibTransport*)ILibChain_Link_Allocate(sizeof(ILibTransport), 2*sizeof(void*));
t->ChainLink.MetaData = "ILibDuktape_ChainViewer";
t->ChainLink.MetaData = ILibMemory_SmartAllocate_FromString("ILibDuktape_ChainViewer");
t->ChainLink.PostSelectHandler = ILibDuktape_ChainViewer_PostSelect;
((void**)t->ChainLink.ExtraMemoryPtr)[0] = ctx;
((void**)t->ChainLink.ExtraMemoryPtr)[1] = duk_get_heapptr(ctx, -1);

View File

@@ -2009,7 +2009,7 @@ duk_ret_t ILibDuktape_fs_watch(duk_context *ctx)
else
{
notifyDispatcher = ILibMemory_Allocate(sizeof(ILibDuktape_fs_linuxWatcher), 0, NULL, NULL);
notifyDispatcher->chainLink.MetaData = "ILibDuktape_fs_linuxWatcher";
notifyDispatcher->chainLink.MetaData = ILibMemory_SmartAllocate_FromString("ILibDuktape_fs_linuxWatcher");
notifyDispatcher->chainLink.PreSelectHandler = ILibDuktape_fs_notifyDispatcher_PreSelect;
notifyDispatcher->chainLink.PostSelectHandler = ILibDuktape_fs_notifyDispatcher_PostSelect;
notifyDispatcher->chainLink.DestroyHandler = ILibDuktape_fs_notifyDispatcher_Destroy;

View File

@@ -633,7 +633,7 @@ ILibAsyncServerSocket_ServerModule ILibCreateAsyncServerSocketModuleWithMemoryEx
// Instantiate a new AsyncServer module
RetVal = (struct ILibAsyncServerSocketModule*)ILibChain_Link_Allocate(sizeof(struct ILibAsyncServerSocketModule), ServerUserMappedMemorySize);
RetVal->ChainLink.MetaData = "ILibAsyncServerSocket";
RetVal->ChainLink.MetaData = ILibMemory_SmartAllocate_FromString("ILibAsyncServerSocket");
RetVal->ChainLink.PreSelectHandler = &ILibAsyncServerSocket_PreSelect;
RetVal->ChainLink.PostSelectHandler = &ILibAsyncServerSocket_PostSelect;
RetVal->ChainLink.DestroyHandler = &ILibAsyncServerSocket_Destroy;

View File

@@ -445,7 +445,7 @@ ILibTransport_DoneState ILibAsyncSocket_TransportSend(void *transport, char* buf
ILibAsyncSocket_SocketModule ILibCreateAsyncSocketModuleWithMemory(void *Chain, int initialBufferSize, ILibAsyncSocket_OnData OnData, ILibAsyncSocket_OnConnect OnConnect, ILibAsyncSocket_OnDisconnect OnDisconnect, ILibAsyncSocket_OnSendOK OnSendOK, int UserMappedMemorySize)
{
struct ILibAsyncSocketModule *RetVal = (struct ILibAsyncSocketModule*)ILibChain_Link_Allocate(sizeof(struct ILibAsyncSocketModule), UserMappedMemorySize);
RetVal->Transport.ChainLink.MetaData = "ILibAsyncSocket";
RetVal->Transport.ChainLink.MetaData = ILibMemory_SmartAllocate_FromString("ILibAsyncSocket");
RetVal->Transport.IdentifierFlags = ILibTransports_AsyncSocket;
RetVal->Transport.SendPtr = &ILibAsyncSocket_TransportSend;
RetVal->Transport.ClosePtr = &ILibAsyncSocket_Disconnect;

View File

@@ -138,7 +138,7 @@ void ILibIPAddressMonitor_PostSelect(void* object, int slct, fd_set *readset, fd
ILibIPAddressMonitor ILibIPAddressMonitor_Create(void *chain, ILibIPAddressMonitor_Handler handler, void *user)
{
_ILibIPAddressMonitor *obj = (_ILibIPAddressMonitor*)ILibChain_Link_Allocate(ILibMemory_IPAddressMonitor_CONTAINER_SIZE, 0);
obj->chainLink.MetaData = "ILibIPAddressMonitor";
obj->chainLink.MetaData = ILibMemory_SmartAllocate_FromString("ILibIPAddressMonitor");
#ifndef NO_IPADDR_MONITOR
obj->onUpdate = handler;

View File

@@ -298,7 +298,7 @@ struct ILibMulticastSocket_StateModule *ILibMulticastSocket_Create(void *Chain,
addr6.sin6_port = htons(LocalPort);
// Setup the multicasting module
module->ChainLink.MetaData = "ILibMulticastSocket";
module->ChainLink.MetaData = ILibMemory_SmartAllocate_FromString("ILibMulticastSocket");
module->ChainLink.DestroyHandler = &ILibMulticastSocket_Destroy;
module->ChainLink.ParentChain = Chain;
module->LocalPort = LocalPort;

View File

@@ -1009,7 +1009,15 @@ void* ILibMemory_InitEx(void *ptr, size_t primarySize, size_t extraSize, ILibMem
return(ILibMemory_Init(ptr, primarySize, extraSize, memType));
}
#endif
char* ILibMemory_SmartAllocate_FromStringEx(char *str, size_t strLen)
{
if (str == NULL) { return(NULL); }
if (strLen == 0) { strLen = strnlen_s(str, sizeof(ILibScratchPad)); }
char *ret = (char*)ILibMemory_SmartAllocate(1+strLen);
memcpy_s(ret, strLen + 1, str, strLen);
return(ret);
}
void* ILibMemory_AllocateA_Init(void *buffer)
{
((void**)buffer)[0] = (char*)buffer + sizeof(void*);
@@ -1867,7 +1875,7 @@ int ILibChain_AddSignalHandler(void *chain, int signum, ILibChain_SignalHandler
{
if (g_signalHandlers[signum] == NULL) { g_signalHandlers[signum] = ILibLinkedList_Create(); }
data = (ILibChain_SignalHandlerData*)ILibChain_Link_Allocate(sizeof(ILibChain_SignalHandlerData), 0);
data->link.MetaData = "ILibChain_SignalHandler";
data->link.MetaData = ILibMemory_SmartAllocate_FromString("ILibChain_SignalHandler");
data->link.PreSelectHandler = ILibChain_SignalHandler_PreSelect;
data->link.PostSelectHandler = ILibChain_SignalHandler_PostSelect;
data->link.DestroyHandler = ILibChain_SignalHandler_DestroySelect;
@@ -7748,7 +7756,7 @@ void *ILibCreateLifeTime(void *Chain)
if ((RetVal = (struct ILibLifeTime*)malloc(sizeof(struct ILibLifeTime))) == NULL) ILIBCRITICALEXIT(254);
memset(RetVal,0,sizeof(struct ILibLifeTime));
RetVal->ChainLink.MetaData = "ILibLifeTime";
RetVal->ChainLink.MetaData = ILibMemory_SmartAllocate_FromString("ILibLifeTime");
RetVal->ObjectList = ILibLinkedList_Create();
RetVal->ChainLink.PreSelectHandler = &ILibLifeTime_Check;
RetVal->ChainLink.DestroyHandler = &ILibLifeTime_Destroy;
@@ -9195,13 +9203,6 @@ char* ILibString_Copy(const char *inString, size_t length)
RetVal[length] = 0;
return RetVal;
}
char* ILibString_CopyEx(const char *inString, size_t length)
{
if (length == 0 || length == (size_t)(-1)) { length = strnlen_s(inString, sizeof(ILibScratchPad)); }
char *retVal = ILibMemory_SmartAllocate(length + 1);
memcpy_s(retVal, length + 1, inString, length);
return(retVal);
}
/*! \fn ILibString_ToUpper(const char *inString, int length)
\brief Coverts the given string to upper case
\par

View File

@@ -480,6 +480,8 @@ int ILibIsRunningOnChainThread(void* chain);
void* ILibMemory_Init(void *ptr, size_t primarySize, size_t extraSize, ILibMemory_Types memType);
#define ILibMemory_SmartAllocate(len) ILibMemory_InitEx(ILibMemory_Size_Validate(len,0)?malloc(ILibMemory_Init_Size(len, 0)):NULL, (int)len, 0, ILibMemory_Types_HEAP)
#define ILibMemory_SmartAllocateEx(primaryLen, extraLen) ILibMemory_InitEx(ILibMemory_Size_Validate(primaryLen,extraLen)?malloc(ILibMemory_Init_Size(primaryLen, extraLen)):NULL, (int)primaryLen, (int)extraLen, ILibMemory_Types_HEAP)
#define ILibMemory_SmartAllocate_FromString(str) ILibMemory_SmartAllocate_FromStringEx(str, 0)
char* ILibMemory_SmartAllocate_FromStringEx(char *str, size_t strLen);
void* ILibMemory_SmartReAllocate(void *ptr, size_t len);
void* ILibMemory_SmartAllocateEx_ResizeExtra(void *ptr, size_t extraSize);
@@ -1419,7 +1421,6 @@ int ILibIsRunningOnChainThread(void* chain);
char* ILibString_Cat(const char *inString1, size_t inString1Len, const char *inString2, size_t inString2Len);
char* ILibString_Cat_s(char *destination, size_t destinationSize, char *source);
char* ILibString_Copy(const char *inString, size_t length);
char* ILibString_CopyEx(const char *inString, size_t length);
int ILibString_Copy_s(char *destination, size_t destinationSize, char *source);
int ILibString_n_Copy_s(char *destination, size_t destinationSize, char *source, size_t count);
int ILibString_EndsWith(const char *inString, size_t inStringLength, const char *endWithString, size_t endWithStringLength);

View File

@@ -270,8 +270,7 @@ ILibProcessPipe_Manager ILibProcessPipe_Manager_Create(void *chain)
if ((retVal = (ILibProcessPipe_Manager_Object*)malloc(sizeof(ILibProcessPipe_Manager_Object))) == NULL) { ILIBCRITICALEXIT(254); }
memset(retVal, 0, sizeof(ILibProcessPipe_Manager_Object));
//retVal->ChainLink.MetaData = "ILibProcessPipe_Manager";
retVal->ChainLink.MetaData = ILibString_CopyEx("ILibProcessPipe_Manager", 0);
retVal->ChainLink.MetaData = ILibMemory_SmartAllocate_FromString("ILibProcessPipe_Manager");
retVal->ChainLink.ParentChain = chain;
retVal->ActivePipes = ILibLinkedList_CreateEx(sizeof(int));

View File

@@ -2478,7 +2478,7 @@ ILibWebClient_RequestManager ILibCreateWebClient(int PoolSize, void *Chain)
if ((RetVal = (struct ILibWebClientManager*)malloc(sizeof(struct ILibWebClientManager))) == NULL) ILIBCRITICALEXIT(254);
memset(RetVal, 0, sizeof(struct ILibWebClientManager));
RetVal->MaxConnectionsToSameServer = 1;
RetVal->ChainLink.MetaData = "ILibWebClient";
RetVal->ChainLink.MetaData = ILibMemory_SmartAllocate_FromString("ILibWebClient");
RetVal->ChainLink.DestroyHandler = &ILibDestroyWebClient;
RetVal->ChainLink.PreSelectHandler = &ILibWebClient_PreProcess;
//RetVal->PostSelect = &ILibWebClient_PreProcess;

View File

@@ -6381,7 +6381,7 @@ void* ILibStunClient_Start(void *Chain, unsigned short LocalPort, ILibStunClient
memset(obj, 0, sizeof(struct ILibStun_Module));
obj->State = STUN_STATUS_NOT_TESTED;
obj->StunUsers = ILibLinkedList_Create();
obj->ChainLink.MetaData = "ILibWebRTC";
obj->ChainLink.MetaData = ILibMemory_SmartAllocate_FromString("ILibWebRTC");
obj->OnResult = OnResult;
obj->LocalIf.sin_family = AF_INET;
obj->LocalIf.sin_port = htons(LocalPort);
@@ -7058,7 +7058,7 @@ ILibTURN_ClientModule ILibTURN_CreateTurnClient(void* chain, ILibTURN_OnConnectT
retVal->OnChannelDataCallback = OnChannelData;
retVal->transactionData = ILibInitHashTree();
retVal->ChainLink.ParentChain = chain;
retVal->ChainLink.MetaData = "ILibWebRTC_TURN_Client";
retVal->ChainLink.MetaData = ILibMemory_SmartAllocate_FromString("ILibWebRTC_TURN_Client");
ILibAddToChain(chain, retVal);
return retVal;

View File

@@ -459,7 +459,7 @@ void ILibWebServer_OnConnect(void *AsyncServerSocketModule, void *ConnectionToke
wsm = (struct ILibWebServer_StateModule*)ILibAsyncServerSocket_GetTag(AsyncServerSocketModule);
ws = (struct ILibWebServer_Session*)ILibChain_Link_Allocate(ILibMemory_WEBSERVERSESSION_CONTAINERSIZE, ILibMemory_GetExtraMemorySize(wsm->ChainLink.ExtraMemoryPtr));
ws->Reserved_Transport.ChainLink.MetaData = "ILibWebServer_Session";
ws->Reserved_Transport.ChainLink.MetaData = ILibMemory_SmartAllocate_FromString("ILibWebServer_Session");
ws->Reserved_Transport.ChainLink.ParentChain = wsm->ChainLink.ParentChain;
ws->Reserved_Transport.IdentifierFlags = (unsigned int)ILibTransports_WebServer;
ws->Reserved_Transport.ClosePtr = (ILibTransport_ClosePtr)&ILibWebServer_DisconnectSession;
@@ -1052,7 +1052,7 @@ void ILibWebServer_SetTLS(ILibWebServer_ServerToken object, void *ssl_ctx)
ILibExportMethod ILibWebServer_ServerToken ILibWebServer_CreateEx2(void *Chain, int MaxConnections, unsigned short PortNumber, int loopbackFlag, ILibWebServer_Session_OnSession OnSession, int ExtraMemorySize, void *User)
{
struct ILibWebServer_StateModule *RetVal = (struct ILibWebServer_StateModule *)ILibChain_Link_Allocate(sizeof(struct ILibWebServer_StateModule), ExtraMemorySize);
RetVal->ChainLink.MetaData = "ILibWebServer";
RetVal->ChainLink.MetaData = ILibMemory_SmartAllocate_FromString("ILibWebServer");
RetVal->ChainLink.DestroyHandler = &ILibWebServer_Destroy;
RetVal->ChainLink.ParentChain = Chain;
RetVal->OnSession = OnSession;

View File

@@ -758,7 +758,7 @@ int ILibWrapper_WebRTC_OnDataChannel(void *StunModule, void* WebRTCModule, unsig
if((dataChannel = (ILibWrapper_WebRTC_DataChannel*)ILibSparseArray_Get(obj->DataChannels, (int)StreamId))==NULL)
{
dataChannel = (ILibWrapper_WebRTC_DataChannel*)ILibChain_Link_Allocate(sizeof(ILibWrapper_WebRTC_DataChannel), (int)ILibMemory_ExtraSize(obj));
dataChannel->Header.transport.ChainLink.MetaData = "ILibWrapper_WebRTC_DataChannel";
dataChannel->Header.transport.ChainLink.MetaData = ILibMemory_SmartAllocate_FromString("ILibWrapper_WebRTC_DataChannel");
dataChannel->parent = obj;
dataChannel->streamId = StreamId;
if((dataChannel->channelName = (char*)malloc(ChannelNameLength+1))==NULL){ILIBCRITICALEXIT(254);}
@@ -852,7 +852,7 @@ ILibWrapper_WebRTC_ConnectionFactory ILibWrapper_WebRTC_ConnectionFactory_Create
if (retVal == NULL) { ILIBCRITICALEXIT(254); }
memset(retVal, 0, sizeof(ILibWrapper_WebRTC_ConnectionFactoryStruct));
retVal->ChainLink.MetaData = "ILibWrapper_WebRTC_ConnectionFactory";
retVal->ChainLink.MetaData = ILibMemory_SmartAllocate_FromString("ILibWrapper_WebRTC_ConnectionFactory");
retVal->ChainLink.DestroyHandler = &ILibWrapper_WebRTC_ConnectionFactory_OnDestroy;
ILibAddToChain(chain, retVal);
@@ -1258,7 +1258,7 @@ void ILibWrapper_WebRTC_DataChannel_Close(ILibWrapper_WebRTC_DataChannel* dataCh
ILibWrapper_WebRTC_DataChannel* ILibWrapper_WebRTC_DataChannel_CreateEx(ILibWrapper_WebRTC_Connection connection, char* channelName, int channelNameLen, unsigned short streamId, ILibWrapper_WebRTC_DataChannel_OnDataChannelAck OnAckHandler)
{
ILibWrapper_WebRTC_DataChannel *retVal = (ILibWrapper_WebRTC_DataChannel*)ILibChain_Link_Allocate(sizeof(ILibWrapper_WebRTC_DataChannel), (int)ILibMemory_ExtraSize(connection));
retVal->Header.transport.ChainLink.MetaData = "ILibWrapper_WebRTC_DataChannel";
retVal->Header.transport.ChainLink.MetaData = ILibMemory_SmartAllocate_FromString("ILibWrapper_WebRTC_DataChannel");
retVal->parent = connection;
if ((retVal->channelName = (char*)malloc(channelNameLen + 1)) == NULL) { ILIBCRITICALEXIT(254); }
memcpy_s(retVal->channelName, channelNameLen + 1, channelName, channelNameLen);