本文整理汇总了C++中ListFree函数的典型用法代码示例。如果您正苦于以下问题:C++ ListFree函数的具体用法?C++ ListFree怎么用?C++ ListFree使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ListFree函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:BenedictHiddleston,项目名称:xmlrpc-c-1.06.30,代码行数:25,代码来源:server.c
示例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);
}
}
开发者ID:jugg,项目名称:litestep-module-lsxcommand,代码行数:29,代码来源:list.c
示例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;
}
开发者ID:pengpengxp,项目名称:supermartket,代码行数:59,代码来源:main.c
示例4: heapDestroy
void heapDestroy (heap_t *h)
{
ListFree(h->empty);
ListFree(h->full);
free(h->base);
free(h);
return;
}
开发者ID:blubecks,项目名称:Laboratorio,代码行数:8,代码来源:myheap.c
示例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));
}
开发者ID:BirminghamConservatoire,项目名称:IntegraLive,代码行数:12,代码来源:http.c
示例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;
}
开发者ID:shotantan,项目名称:mruby-mqtt,代码行数:15,代码来源:Socket.c
示例7: MIMETypeTerm
void
MIMETypeTerm(void) {
if (globalMimeTypeP == NULL)
abort();
ListFree(&globalMimeTypeP->extList);
ListFree(&globalMimeTypeP->typeList);
MIMETypeDestroy(globalMimeTypeP);
globalMimeTypeP = NULL;
}
开发者ID:kmross,项目名称:FreeSWITCH,代码行数:13,代码来源:response.c
示例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 );
}
开发者ID:Ukusbobra,项目名称:open-watcom-v2,代码行数:13,代码来源:owcc.c
示例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 );
}
}
}
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:50,代码来源:wdezordr.c
示例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;
}
开发者ID:bluerover,项目名称:rsmb,代码行数:11,代码来源:MQTTProtocolClient.c
示例11: Log_terminate
/**
* Terminate the log module
*/
void Log_terminate()
{
ListFree(log_buffer);
log_buffer = NULL;
free(trace_queue);
trace_queue = NULL;
}
开发者ID:Frank-KunLi,项目名称:DTLS_RSMB,代码行数:10,代码来源:Log.c
示例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;
}
开发者ID:macchina-io,项目名称:macchina.io,代码行数:37,代码来源:MQTTProtocolClient.c
示例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;
}
开发者ID:Frank-KunLi,项目名称:rsmb,代码行数:37,代码来源:Broker.c
示例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;
}
开发者ID:apache,项目名称:nifi-minifi-cpp,代码行数:12,代码来源:MQTTPacket.c
示例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;
}
开发者ID:charliexp,项目名称:mqttsn_secure,代码行数:20,代码来源:Socket.c
示例16: handleDirectory
static void
handleDirectory(TSession *const sessionP,
const char *const dirName,
time_t const fileModTime,
MIMEType *const mimeTypeP) {
bool text;
bool ascending;
uint16_t sort; /* 1=by name, 2=by date */
const char *error;
determineSortType(sessionP->requestInfo.query,
&ascending, &sort, &text, &error);
if (error) {
ResponseStatus(sessionP, 400);
xmlrpc_strfree(error);
} else if (notRecentlyModified(sessionP, fileModTime)) {
ResponseStatus(sessionP, 304);
ResponseWriteStart(sessionP);
} else {
TPool pool;
bool succeeded;
succeeded = PoolCreate(&pool, 1024);
if (!succeeded)
ResponseStatus(sessionP, 500);
else {
TList list;
uint16_t responseStatus;
const char *error;
generateListing(&list, dirName, sessionP->requestInfo.uri,
&pool, &error, &responseStatus);
if (error) {
ResponseStatus(sessionP, responseStatus);
xmlrpc_strfree(error);
} else {
ResponseStatus(sessionP, 200);
ResponseContentType(sessionP,
text ? "text/plain" : "text/html");
addLastModifiedHeader(sessionP, fileModTime);
ResponseChunked(sessionP);
ResponseWriteStart(sessionP);
if (sessionP->requestInfo.method != m_head)
sendDirectoryDocument(&list, ascending, sort, text,
sessionP->requestInfo.uri, mimeTypeP,
sessionP);
HTTPWriteEndChunk(sessionP);
ListFree(&list);
}
PoolFree(&pool);
}
}
}
开发者ID:arssivka,项目名称:naomech,代码行数:58,代码来源:handler.c
示例17: sendFileAsResponse
static void
sendFileAsResponse(TSession *const sessionP,
TFile *const fileP,
const char *const fileName,
time_t const fileModTime,
MIMEType *const mimeTypeP) {
uint64_t const filesize = FileSize(fileP);
const char *const mediatype = MIMETypeGuessFromFile2(mimeTypeP, fileName);
uint64_t start; /* Defined only if session has one range */
uint64_t end; /* Defined only if session has one range */
switch (sessionP->ranges.size) {
case 0:
ResponseStatus(sessionP, 200);
break;
case 1: {
bool decoded;
decoded = RangeDecode((char *) (sessionP->ranges.item[0]), filesize,
&start, &end);
if (!decoded) {
ListFree(&sessionP->ranges);
ResponseStatus(sessionP, 200);
} else {
const char *contentRange;
xmlrpc_asprintf(&contentRange,
"bytes %" PRIu64 "-%" PRIu64 "/%" PRIu64,
start, end, filesize);
ResponseAddField(sessionP, "Content-range", contentRange);
xmlrpc_strfree(contentRange);
ResponseContentLength(sessionP, end - start + 1);
ResponseStatus(sessionP, 206);
}
}
break;
default:
ResponseContentType(sessionP,
"multipart/ranges; boundary=" BOUNDARY);
ResponseStatus(sessionP, 206);
break;
}
if (sessionP->ranges.size == 0) {
ResponseContentLength(sessionP, filesize);
ResponseContentType(sessionP, mediatype);
}
addLastModifiedHeader(sessionP, fileModTime);
ResponseWriteStart(sessionP);
if (sessionP->requestInfo.method != m_head)
sendBody(sessionP, fileP, filesize, mediatype, start, end);
}
开发者ID:arssivka,项目名称:naomech,代码行数:58,代码来源:handler.c
示例18: HandlerDestroy
void
HandlerDestroy(BIHandler *const handlerP) {
ListFree(&handlerP->defaultFileNames);
xmlrpc_strfree(handlerP->filesPath);
free(handlerP);
}
开发者ID:arssivka,项目名称:naomech,代码行数:9,代码来源:handler.c
示例19: MQTTClient_terminate
void MQTTClient_terminate(void)
{
FUNC_ENTRY;
MQTTClient_stop();
if (initialized)
{
ListFree(bstate->clients);
ListFree(handles);
handles = NULL;
Socket_outTerminate();
#if defined(HEAP_H)
Heap_terminate();
#endif
Log_terminate();
initialized = 0;
}
FUNC_EXIT;
}
开发者ID:FlavioFalcao,项目名称:RSSI-Sniffer,代码行数:18,代码来源:MQTTClient.c
示例20: SocketBuffer_terminate
void SocketBuffer_terminate(void)
{
ListElement* cur = NULL;
ListEmpty(&writes);
FUNC_ENTRY;
while (ListNextElement(queues, &cur)) { free(((socket_queue*)(cur->content))->buf); }
ListFree(queues);
SocketBuffer_freeDefQ();
FUNC_EXIT;
}
开发者ID:wgels,项目名称:apple-sdk,代码行数:11,代码来源:SocketBuffer.c
注:本文中的ListFree函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论