port.h
来自「这是状态机的一个框架结构的例子,可以作为状态机的基本架构」· C头文件 代码 · 共 48 行
H
48 行
/********************************************************************
* Quantum Framework Win32 port declarations (C version)
* Copyright (c) 2002 Miro Samek, Palo Alto, CA.
* All Rights Reserved.
*******************************************************************/
#ifndef port_h
#define port_h
#include "qf_win32.h"
#include "qfpkg.h"
/* Win32-specific critical section operations */
extern CRITICAL_SECTION pkgWin32CritSect;
#define QF_PROTECT() EnterCriticalSection(&pkgWin32CritSect)
#define QF_UNPROTECT() LeaveCriticalSection(&pkgWin32CritSect)
#define QF_ISR_PROTECT() QF_PROTECT()
#define QF_ISR_UNPROTECT() QF_UNPROTECT()
/* Win32-specific event queue operations */
#define QF_EQUEUE_INIT(q_) \
((q_)->osEvent__ = CreateEvent(NULL, FALSE, FALSE, NULL))
#define QF_EQUEUE_CLEANUP(q_) CloseHandle((q_)->osEvent__)
#define QF_EQUEUE_WAIT(q_) \
QF_UNPROTECT(); \
do { \
WaitForSingleObject((q_)->osEvent__, INFINITE); \
} while ((q_)->frontEvt__ == 0); \
QF_PROTECT()
#define QF_EQUEUE_SIGNAL(q_) \
QF_UNPROTECT(); \
SetEvent((q_)->osEvent__)
#define QF_EQUEUE_ONEMPTY(q_)
/* Win32-specific event pool operations */
#define QF_EPOOL QEPool
#define QF_EPOOL_INIT(p_, poolSto_, nEvts_, evtSize_) \
QEPoolCtor(p_, poolSto_, nEvts_, evtSize_);
#define QF_EPOOL_GET(p_, e_) ((e_) = QEPoolGet(p_))
#define QF_EPOOL_PUT(p_, e_) (QEPoolPut(p_, e_))
/* the following constant may be bumped up to 15 (inclusive)
* before redesign of algorithms is necessary
*/
enum { QF_MAX_ACTIVE = 15 };
#endif /* port_h */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?