本文整理汇总了C++中ListFree函数的典型用法代码示例。如果您正苦于以下问题:C++ ListFree函数的具体用法?C++ ListFree怎么用?C++ ListFree使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ListFree函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ServerFree
void
ServerFree(TServer * const serverP) {
struct _TServer * const srvP = serverP->srvP;
if (srvP->weCreatedListenSocket)
SocketDestroy(srvP->listenSocketP);
xmlrpc_strfree(srvP->name);
xmlrpc_strfree(srvP->filespath);
ListFree(&srvP->defaultfilenames);
terminateHandlers(&srvP->handlers);
ListFree(&srvP->handlers);
logClose(srvP);
if (srvP->logfilename)
xmlrpc_strfree(srvP->logfilename);
free(srvP);
}
示例2: ListRemoveEntry
void ListRemoveEntry(struct List **hist, int *count)
{
struct List *temp, *temp2;
if(*hist) {
if(!(*hist)->prev) {
temp = (*hist)->next;
ListFree(hist);
*hist = temp;
if(*hist) (*hist)->prev = NULL;
} else {
if(!(*hist)->next) {
temp = (struct List *)(*hist)->prev;
ListFree(hist);
*hist = (struct List *)temp;
if(*hist) (*hist)->next = NULL;
} else {
temp = (struct List *)(*hist)->prev;
temp2 = (struct List *)(*hist)->next;
ListFree(hist);
temp->next = (struct List *)temp2;
temp2->prev = (struct List *)temp;
*hist = temp;
}
}
if(count)
--(*count);
}
}
示例3: main
int main(int argc, char *args[])
{
char *buffer = (char *)malloc(MAX_LINE_LEN);;
char *result = (char *)malloc(MAX_LINE_LEN);;
int number;
int dwnum;
dwnum = GetPrice();
if(dwnum != 0)
{
return dwnum;
}
list_t *L = ListInit();
if(L == NULL)
{
return ERRNO_NULL_POINTER;
}
while(fgets(buffer, MAX_LINE_LEN, stdin))
{
number = 0;
memset(result, 0, MAX_LINE_LEN);
dwnum = ParseLine(buffer, result, &number);
if(dwnum == 0)
{
item_t* curnode;
if((curnode = ListIsNodeInListById(L, result)) != NULL)
{
curnode->count += number;
continue;
}
item_t * node = ItemMakeitem(result, number);
if(node == NULL)
{
return ERRNO_MAKEITEM_FAIL;
}
dwnum = ListPushBack(L, (void*) node);
if(dwnum != 0)
{
return ERRNO_LISTPUSHBACK_FAIL;
}
}
}
dwnum = CalculateSum(L);
if(dwnum != 0)
{
return ERRNO_CALCULATESUM_FAIL;
}
ListFree(L);
ListFree(my_price);
free(buffer);
free(result);
return 0;
}
示例4: heapDestroy
void heapDestroy (heap_t *h)
{
ListFree(h->empty);
ListFree(h->full);
free(h->base);
free(h);
return;
}
示例5: RequestFree
void
RequestFree(TSession * const sessionP) {
if (sessionP->validRequest)
freeRequestInfo(&sessionP->requestInfo);
ListFree(&sessionP->cookies);
ListFree(&sessionP->ranges);
TableFree(&sessionP->requestHeaderFields);
TableFree(&sessionP->responseHeaderFields);
StringFree(&(sessionP->header));
}
示例6: Socket_outTerminate
/**
* Terminate the socket module
*/
void Socket_outTerminate()
{
FUNC_ENTRY;
ListFree(s.connect_pending);
ListFree(s.write_pending);
ListFree(s.clientsds);
SocketBuffer_terminate();
#if defined(WIN32) || defined(WIN64)
WSACleanup();
#endif
FUNC_EXIT;
}
示例7: MIMETypeTerm
void
MIMETypeTerm(void) {
if (globalMimeTypeP == NULL)
abort();
ListFree(&globalMimeTypeP->extList);
ListFree(&globalMimeTypeP->typeList);
MIMETypeDestroy(globalMimeTypeP);
globalMimeTypeP = NULL;
}
示例8: ProcMemFini
static int ProcMemFini( void )
{
ListFree( Directive_List );
ListFree( Files_List );
ListFree( Obj_List );
ListFree( Libs_List );
MemFree( Map_Name );
MemFree( Obj_Name );
MemFree( Link_Name );
MemFree( SystemName );
MemFree( StackSize );
return( 0 );
}
示例9: WdeSOP
void WdeSOP( OBJPTR obj, OBJPTR parent )
{
LIST *ilist, *tlist, *clist;
WdeResInfo *info;
RECT orect;
OBJPTR sib;
OBJ_ID id;
bool clear;
POINT origin;
info = WdeGetCurrentRes();
if( info == NULL ) {
return;
}
GetClientRect( info->edit_win, &orect );
GetOffset( &origin );
OffsetRect( &orect, origin.x, origin.y );
if( parent == NULL ) {
GetObjectParent( obj, &parent );
if( parent == NULL ) {
return;
}
}
Forward( parent, GET_SUBOBJ_LIST, &tlist, NULL );
if( tlist != NULL && WdeFindObjectsInRect( &orect, &ilist, tlist ) && ilist != NULL ) {
clist = NULL;
tlist = NULL;
for( ; ilist != NULL; ilist = ListConsume( ilist ) ) {
sib = ListElement( ilist );
if( (Forward( sib, IS_OBJECT_CLEAR, &clear, NULL ) && clear) ||
(Forward( sib, IDENTIFY, &id, NULL ) && id == DIALOG_OBJ) ) {
WdeInsertObject( &clist, sib );
} else {
WdeInsertObject( &tlist, sib );
}
}
if( clist != NULL ) {
WdeListConcat( &tlist, clist, 0 );
ListFree( clist );
}
if( tlist != NULL ) {
WdeReorderObjectWindows( tlist );
ListFree( tlist );
}
}
}
示例10: MQTTProtocol_freeMessageList
/**
* Empty and free up all storage used by a message list
* @param msgList the message list to empty and free
*/
void MQTTProtocol_freeMessageList(List* msgList)
{
FUNC_ENTRY;
MQTTProtocol_emptyMessageList(msgList);
ListFree(msgList);
FUNC_EXIT;
}
示例11: Log_terminate
/**
* Terminate the log module
*/
void Log_terminate()
{
ListFree(log_buffer);
log_buffer = NULL;
free(trace_queue);
trace_queue = NULL;
}
示例12: MQTTProtocol_freeClient
/**
* Free a client structure
* @param client the client data to free
*/
void MQTTProtocol_freeClient(Clients* client)
{
FUNC_ENTRY;
/* free up pending message lists here, and any other allocated data */
MQTTProtocol_freeMessageList(client->outboundMsgs);
MQTTProtocol_freeMessageList(client->inboundMsgs);
ListFree(client->messageQueue);
free(client->clientID);
if (client->will)
{
free(client->will->payload);
free(client->will->topic);
free(client->will);
}
#if defined(OPENSSL)
if (client->sslopts)
{
if (client->sslopts->trustStore)
free((void*)client->sslopts->trustStore);
if (client->sslopts->keyStore)
free((void*)client->sslopts->keyStore);
if (client->sslopts->privateKey)
free((void*)client->sslopts->privateKey);
if (client->sslopts->privateKeyPassword)
free((void*)client->sslopts->privateKeyPassword);
if (client->sslopts->enabledCipherSuites)
free((void*)client->sslopts->enabledCipherSuites);
free(client->sslopts);
}
#endif
/* don't free the client structure itself... this is done elsewhere */
FUNC_EXIT;
}
示例13: Broker_shutdown
/**
* Shutdown the broker.
* @param rc - startup success code
*/
void Broker_shutdown(int rc)
{
FUNC_ENTRY;
if (rc != -99)
{
time_t now = 0;
Log_setPublish(false);
#if !defined(NO_BRIDGE)
Bridge_terminate(&(BrokerState.bridge));
#endif
if (rc != -98)
{
if (rc != -97)
{
if (BrokerState.persistence)
SubscriptionEngines_save(BrokerState.se);
Protocol_terminate();
Socket_terminate();
SubscriptionEngines_terminate(BrokerState.se);
Log(LOG_INFO, 44, NULL, BrokerState.msgs_sent);
Log(LOG_INFO, 43, NULL, BrokerState.msgs_received);
time(&(now));
Log(LOG_INFO, 42, NULL, (int)difftime(now, BrokerState.start_time));
Log(LOG_INFO, 55, NULL, Heap_get_info()->max_size);
}
}
ListFree(BrokerState.clients);
Persistence_free_config(&BrokerState);
}
FUNC_EXIT;
}
示例14: MQTTPacket_freeSuback
/**
* Free allocated storage for a suback packet.
* @param pack pointer to the suback packet structure
*/
void MQTTPacket_freeSuback(Suback* pack)
{
FUNC_ENTRY;
if (pack->qoss != NULL)
ListFree(pack->qoss);
free(pack);
FUNC_EXIT;
}
示例15: Socket_outTerminate
/**
* Terminate the socket module for outbound communications only
*/
void Socket_outTerminate()
{
FUNC_ENTRY;
#if defined(USE_POLL)
TreeFree(s.fds_tree);
#else
ListFree(s.connect_pending);
ListFree(s.write_pending);
ListFree(s.clientsds);
#endif
ListFree(s.newSockets);
SocketBuffer_terminate();
#if defined(WIN32)
WSACleanup();
#endif
FUNC_EXIT;
}