?? createmailbox.cpp
字號:
#ifndef CREATE_MAILBOX#define CREATE_MAILBOXbool ttCreateMailbox(char *nameOfMailbox, int maxSize) { MailboxNode* mn; Mailbox* m; if (strcmp(nameOfMailbox,"") == 0) { MEX_ERROR("ttCreateMailbox: Name should be a non-empty string!"); return false; } if (rtsys->prioFcn == NULL) { MEX_ERROR("ttCreateMailbox: Kernel must be initialized before creation of mailboxes!"); return false; } mn = (MailboxNode*) rtsys->mailboxList->getFirst(); while (mn!=NULL) { if (mn->getMailbox()->name != NULL) { if (strcmp(mn->getMailbox()->name, nameOfMailbox) == 0) break; } mn = (MailboxNode*) mn->getNext(); } if (mn != NULL) { MEX_ERROR("ttCreateMailbox: Name of mailbox not unique!"); return false; } if (maxSize < 1) { MEX_ERROR("ttCreateMailbox: Size of mailbox must be greater than zero!"); return false; } m = new Mailbox; m->name = new char[strlen(nameOfMailbox)+1]; strcpy(m->name, nameOfMailbox); m->maxSize = maxSize; m->buffer = new void*[maxSize]; m->inP = 0; m->outP = 0; m->count = 0; rtsys->mailboxList->appendNode(new MailboxNode(m)); return true;}#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -