本文整理汇总了C++中ReleaseList函数的典型用法代码示例。如果您正苦于以下问题:C++ ReleaseList函数的具体用法?C++ ReleaseList怎么用?C++ ReleaseList使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ReleaseList函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CleanupL3Sw
// Clean-up the L3 switch
void CleanupL3Sw(L3SW *s)
{
UINT i;
// Validate arguments
if (s == NULL)
{
return;
}
for (i = 0;i < LIST_NUM(s->IfList);i++)
{
L3IF *f = LIST_DATA(s->IfList, i);
Free(f);
}
ReleaseList(s->IfList);
for (i = 0;i < LIST_NUM(s->TableList);i++)
{
L3TABLE *t = LIST_DATA(s->TableList, i);
Free(t);
}
ReleaseList(s->TableList);
DeleteLock(s->lock);
Free(s);
}
示例2: ElFreeConfig
// Configuration release
void ElFreeConfig(EL *e)
{
UINT i;
LIST *o;
// Validate arguments
if (e == NULL)
{
return;
}
// Write the configuration file
ElSaveConfig(e);
FreeCfgRw(e->CfgRw);
// Stop all capture
o = NewList(NULL);
LockList(e->DeviceList);
{
for (i = 0;i < LIST_NUM(e->DeviceList);i++)
{
EL_DEVICE *d = LIST_DATA(e->DeviceList, i);
Insert(o, CopyStr(d->DeviceName));
}
for (i = 0;i < LIST_NUM(o);i++)
{
char *name = LIST_DATA(o, i);
ElDeleteCaptureDevice(e, name);
Free(name);
}
ReleaseList(o);
}
UnlockList(e->DeviceList);
ReleaseList(e->DeviceList);
}
示例3: main
int main(int argc, const char * argv[])
{
List *cmnds = NULL;
char *string = NULL;
int quit = 0;
ErrorCode errorCode = ERRORCODE_NO_ERROR, endOfFile = ERRORCODE_NO_ERROR;
CATCH_ERROR(InitInput(&string), errHandler); // allocating input string
MEM(string, initialError); // checking if allocation was successful, otherwise quiting
while (endOfFile == ERRORCODE_NO_ERROR && quit != 1) // ends on <quit> command
{
ReleaseList(&cmnds); // releasing list of tokens
endOfFile = ReadStringFromStream(stdin, &string); // reading string of unknown length
CATCH_ERROR(Tokenize(string, &cmnds), errHandler); // creating a list of tokens from input string
CATCH_ERROR(Route(cmnds, &quit), errHandler); // trying to find a matching method
errHandler:
PrintErrorFeedback(errorCode); // on error printing feedback info and continuing main loop
}
ReleaseList(&cmnds); // after escaping while
ReleaseInput(string);
return 0;
initialError:
return 1;
}
示例4: L3FreeInterface
// Release the Layer-3 interface
void L3FreeInterface(L3IF *f)
{
UINT i;
L3PACKET *p;
PKT *pkt;
// Validate arguments
if (f == NULL)
{
return;
}
for (i = 0;i < LIST_NUM(f->ArpTable);i++)
{
L3ARPENTRY *a = LIST_DATA(f->ArpTable, i);
Free(a);
}
ReleaseList(f->ArpTable);
f->ArpTable = NULL;
for (i = 0;i < LIST_NUM(f->ArpWaitTable);i++)
{
L3ARPWAIT *w = LIST_DATA(f->ArpWaitTable, i);
Free(w);
}
ReleaseList(f->ArpWaitTable);
f->ArpWaitTable = NULL;
while (p = GetNext(f->IpPacketQueue))
{
Free(p->Packet->PacketData);
FreePacket(p->Packet);
Free(p);
}
ReleaseQueue(f->IpPacketQueue);
f->IpPacketQueue = NULL;
for (i = 0;i < LIST_NUM(f->IpWaitList);i++)
{
L3PACKET *p = LIST_DATA(f->IpWaitList, i);
Free(p->Packet->PacketData);
FreePacket(p->Packet);
Free(p);
}
ReleaseList(f->IpWaitList);
f->IpWaitList = NULL;
while (pkt = GetNext(f->SendQueue))
{
Free(pkt->PacketData);
FreePacket(pkt);
}
ReleaseQueue(f->SendQueue);
f->SendQueue = NULL;
}
示例5: L3FreeAllSw
// Stop all L3 switches in the Cedar
void L3FreeAllSw(CEDAR *c)
{
LIST *o;
UINT i;
// Validate arguments
if (c == NULL)
{
return;
}
o = NewListFast(NULL);
LockList(c->L3SwList);
{
for (i = 0;i < LIST_NUM(c->L3SwList);i++)
{
L3SW *s = LIST_DATA(c->L3SwList, i);
Insert(o, CopyStr(s->Name));
}
for (i = 0;i < LIST_NUM(o);i++)
{
char *name = LIST_DATA(o, i);
L3DelSw(c, name);
Free(name);
}
ReleaseList(o);
}
UnlockList(c->L3SwList);
}
示例6: FreeTable
// Release the table
void FreeTable()
{
UINT i, num;
TABLE **tables;
if (TableList == NULL)
{
return;
}
TrackingDisable();
num = LIST_NUM(TableList);
tables = ToArray(TableList);
for (i = 0;i < num;i++)
{
TABLE *t = tables[i];
Free(t->name);
Free(t->str);
Free(t->unistr);
Free(t);
}
ReleaseList(TableList);
TableList = NULL;
Free(tables);
Zero(old_table_name, sizeof(old_table_name));
TrackingEnable();
}
示例7: NewListFast
// Get Ethernet device list on Solaris
TOKEN_LIST *GetEthListSolaris()
{
TOKEN_LIST *t;
int i, s;
LIST *o;
o = NewListFast(CompareStr);
s = socket(AF_INET, SOCK_DGRAM, 0);
if (s != INVALID_SOCKET)
{
struct lifnum lifn;
lifn.lifn_family = AF_INET;
lifn.lifn_flags = 0;
if (ioctl(s, SIOCGLIFNUM, (char *)&lifn) >= 0)
{
struct lifconf lifc;
struct lifreq *buf;
UINT numifs;
UINT bufsize;
numifs = lifn.lifn_count;
Debug("NumIFs:%d\n",numifs);
bufsize = numifs * sizeof(struct lifreq);
buf = Malloc(bufsize);
lifc.lifc_family = AF_INET;
lifc.lifc_flags = 0;
lifc.lifc_len = bufsize;
lifc.lifc_buf = (char*) buf;
if (ioctl(s, SIOCGLIFCONF, (char *)&lifc) >= 0)
{
for (i = 0; i<numifs; i++)
{
if(StartWith(buf[i].lifr_name, "lo") == false){
Add(o, CopyStr(buf[i].lifr_name));
}
}
}
Free(buf);
}
closesocket(s);
}
Sort(o);
t = ZeroMalloc(sizeof(TOKEN_LIST));
t->NumTokens = LIST_NUM(o);
t->Token = ZeroMalloc(sizeof(char *) * t->NumTokens);
for (i = 0;i < LIST_NUM(o);i++)
{
char *name = LIST_DATA(o, i);
t->Token[i] = name;
}
ReleaseList(o);
return t;
}
示例8: DeleteOldNoSsl
// Delete old entries in Non-SSL connection list
void DeleteOldNoSsl(CEDAR *c)
{
UINT i;
LIST *o;
// Validate arguments
if (c == NULL)
{
return;
}
o = NewListFast(NULL);
for (i = 0;i < LIST_NUM(c->NonSslList);i++)
{
NON_SSL *n = LIST_DATA(c->NonSslList, i);
if (n->EntryExpires <= Tick64())
{
Add(o, n);
}
}
for (i = 0;i < LIST_NUM(o);i++)
{
NON_SSL *n = LIST_DATA(o, i);
Delete(c->NonSslList, n);
Free(n);
}
ReleaseList(o);
}
示例9: FreeTick64
// Release of the Tick64
void FreeTick64()
{
UINT i;
if (tk64 == NULL)
{
// Uninitialized
return;
}
// Termination process
tk64->Halt = true;
Set(halt_tick_event);
WaitThread(tk64->Thread, INFINITE);
ReleaseThread(tk64->Thread);
// Releasing process
for (i = 0;i < LIST_NUM(tk64->AdjustTime);i++)
{
ADJUST_TIME *t = LIST_DATA(tk64->AdjustTime, i);
Free(t);
}
ReleaseList(tk64->AdjustTime);
DeleteLock(tk64->TickLock);
Free(tk64);
tk64 = NULL;
ReleaseEvent(halt_tick_event);
halt_tick_event = NULL;
}
示例10: main
void main()
{
int nMenu = 0;
LoadList(DATA_FILE_NAME);
// 메인 이벤트 반복문
while ((nMenu = PrintUI()) != 0) {
switch (nMenu) {
case 1: // Add
Add();
break;
case 2: // Search
Search();
break;
case 3: // Print all
PrintAll();
break;
case 4: // Remove
Remove();
break;
}
}
// 종료 전에 파일로 저장하고 메모리를 해제한다.
SaveList(DATA_FILE_NAME);
ReleaseList();
}
示例11: NullToken
// Cut out the token from the string (not ignore the blanks between delimiters)
TOKEN_LIST *ParseTokenWithNullStr(char *str, char *split_chars)
{
LIST *o;
UINT i, len;
BUF *b;
char zero = 0;
TOKEN_LIST *t;
// Validate arguments
if (str == NULL)
{
return NullToken();
}
if (split_chars == NULL)
{
split_chars = DefaultTokenSplitChars();
}
b = NewBuf();
o = NewListFast(NULL);
len = StrLen(str);
for (i = 0;i < (len + 1);i++)
{
char c = str[i];
bool flag = IsCharInStr(split_chars, c);
if (c == '\0')
{
flag = true;
}
if (flag == false)
{
WriteBuf(b, &c, sizeof(char));
}
else
{
WriteBuf(b, &zero, sizeof(char));
Insert(o, CopyStr((char *)b->Buf));
ClearBuf(b);
}
}
t = ZeroMalloc(sizeof(TOKEN_LIST));
t->NumTokens = LIST_NUM(o);
t->Token = ZeroMalloc(sizeof(char *) * t->NumTokens);
for (i = 0;i < t->NumTokens;i++)
{
t->Token[i] = LIST_DATA(o, i);
}
ReleaseList(o);
FreeBuf(b);
return t;
}
示例12: ElStopListener
// Listener stop
void ElStopListener(EL *e)
{
UINT i;
THREAD **threads;
SOCK **socks;
UINT num_threads, num_socks;
// Validate arguments
if (e == NULL)
{
return;
}
StopAllListener(e->Cedar);
LockList(e->AdminThreadList);
{
threads = ToArray(e->AdminThreadList);
num_threads = LIST_NUM(e->AdminThreadList);
DeleteAll(e->AdminThreadList);
socks = ToArray(e->AdminSockList);
num_socks = LIST_NUM(e->AdminSockList);
DeleteAll(e->AdminSockList);
}
UnlockList(e->AdminThreadList);
for (i = 0;i < num_socks;i++)
{
Disconnect(socks[i]);
ReleaseSock(socks[i]);
}
for (i = 0;i < num_threads;i++)
{
WaitThread(threads[i], INFINITE);
ReleaseThread(threads[i]);
}
Free(threads);
Free(socks);
ReleaseList(e->AdminSockList);
ReleaseList(e->AdminThreadList);
ReleaseListener(e->Listener);
}
示例13: CfgDeleteFolder
// Delete the folder
void CfgDeleteFolder(FOLDER *f)
{
FOLDER **ff;
ITEM **tt;
UINT num, i;
// Validate arguments
if (f == NULL)
{
return;
}
// Remove all subfolders
num = LIST_NUM(f->Folders);
ff = Malloc(sizeof(FOLDER *) * num);
Copy(ff, f->Folders->p, sizeof(FOLDER *) * num);
for (i = 0;i < num;i++)
{
CfgDeleteFolder(ff[i]);
}
Free(ff);
// Remove all items
num = LIST_NUM(f->Items);
tt = Malloc(sizeof(ITEM *) * num);
Copy(tt, f->Items->p, sizeof(ITEM *) * num);
for (i = 0;i < num;i++)
{
CfgDeleteItem(tt[i]);
}
Free(tt);
// Memory release
Free(f->Name);
// Remove from the parent list
if (f->Parent != NULL)
{
Delete(f->Parent->Folders, f);
}
// Release the list
ReleaseList(f->Folders);
ReleaseList(f->Items);
// Release of the memory of the body
Free(f);
}
示例14: NullToken
// Get the candidates list of of the real command name whose abbreviation matches to the command specified by the user
TOKEN_LIST *GetRealnameCandidate(char *input_name, TOKEN_LIST *real_name_list)
{
TOKEN_LIST *ret;
LIST *o;
UINT i;
bool ok = false;
// Validate arguments
if (input_name == NULL || real_name_list == NULL)
{
return NullToken();
}
o = NewListFast(NULL);
for (i = 0;i < real_name_list->NumTokens;i++)
{
char *name = real_name_list->Token[i];
// Search for an exact match with the highest priority first
if (StrCmpi(name, input_name) == 0)
{
Insert(o, name);
ok = true;
break;
}
}
if (ok == false)
{
// If there is no command to exact match, check whether it matches to a short form command
for (i = 0;i < real_name_list->NumTokens;i++)
{
char *name = real_name_list->Token[i];
if (IsOmissionName(input_name, name) || IsNameInRealName(input_name, name))
{
// A abbreviation is found
Insert(o, name);
ok = true;
}
}
}
if (ok)
{
// One or more candidate is found
ret = ListToTokenList(o);
}
else
{
ret = NullToken();
}
ReleaseList(o);
return ret;
}
示例15: ReleaseList
void KPlayerTeam::Release()
{
m_nFlag = 0;
m_nFigure = TEAM_CAPTAIN;
m_nApplyCaptainID = -1;
m_nApplyCaptainID = 0;
m_dwApplyTimer = 0;
m_bAutoRefuseInviteFlag = FALSE; // TRUE 自动拒绝 FALSE 手动
ReleaseList();
}