?? circ.h
字號:
/*
* Copyright 2003 by Texas Instruments Incorporated.
* All rights reserved. Property of Texas Instruments Incorporated.
* Restricted rights to use, duplicate or disclose this code are
* granted through contract.
*
*/
/* "@(#) DDK 1.10.00.23 07-02-03 (ddk-b12)" */
/*
* ======== circ.h ========
*/
#ifndef CIRC_
#define CIRC_
#ifdef __cplusplus
extern "C" {
#endif
#define CIRC_BUFSIZE 32 /* must be ^2! */
typedef struct CIRC_Obj {
Uns writeIndex; /* write pointer for the buffer */
Uns readIndex; /* read pointer fro the buffer */
Uns charCount; /* buffer character count */
Uns size;
char buf[CIRC_BUFSIZE]; /* circular buffer */
} CIRC_Obj, *CIRC_Handle;
extern Void CIRC_new(CIRC_Handle circ);
extern Char CIRC_readChar(CIRC_Handle circ);
extern Void CIRC_writeChar(CIRC_Handle circ, Char c);
#define CIRC_fullCount(circ) ((circ)->charCount)
#define CIRC_emptyCount(circ) ((circ)->size - (circ)->charCount)
#define CIRC_nextIndex(circ,index) (((index) + 1) & ((circ)->size - 1))
#define CIRC_prevIndex(circ,index) (((index) - 1) & ((circ)->size - 1))
#define CIRC_reset(circ) {(circ)->charCount = 0; (circ)->readIndex = (circ)->writeIndex; }
#define CIRC_isFull(circ) ((circ)->charCount == CIRC_BUFSIZE)
#ifdef __cplusplus
}
#endif /* extern "C" */
#endif /* CIRC_ */
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -