util.h

来自「T-kernel 的extension源代码」· C头文件 代码 · 共 69 行

H
69
字号
/* *---------------------------------------------------------------------- *    T-Kernel / Standard Extension * *    Copyright (C) 2006 by Ken Sakamura. All rights reserved. *    T-Kernel / Standard Extension is distributed  *      under the T-License for T-Kernel / Standard Extension. *---------------------------------------------------------------------- * *    Version:   1.00.00 *    Released by T-Engine Forum(http://www.t-engine.org) at 2006/8/11. * *---------------------------------------------------------------------- *//* *	util.h (extension) * *	Utility for application */#ifndef __EXTENSION_UTIL_H__#define __EXTENSION_UTIL_H__#include <basic.h>#include "typedef.h"#ifdef __cplusplusextern "C" {#endif/* * Shared memory */IMPORT void*	Scalloc( size_t nmemb, size_t size );IMPORT void*	Smalloc( size_t size );IMPORT void*	Srealloc( void *ptr, size_t size );IMPORT void	Sfree( void *ptr );IMPORT void	Smalloctest( int mode );IMPORT BOOL	Smalloccheck( void *ptr );/* * Fast lock *	One BFastLock can be used as up to 16 independent locks. *	Identified by lock number (no); 0 to 15 can be specified as number. */typedef struct {	UH	wai;	UH	flg;	ID	flgid;} BFastLock;IMPORT ER	CreateBLock( BFastLock *lock );IMPORT ER	DeleteBLock( BFastLock *lock );IMPORT ER	BMLock( BFastLock *lock, W no );IMPORT ER	BMLockTmo( BFastLock *lock, W no, TMOUT tmo );IMPORT ER	BMUnlock( BFastLock *lock, W no );#define	BLock(lock)		BMLock(lock, 0)#define	BLockTmo(lock, tmo)	BMLockTmo(lock, 0, tmo)#define	BUnlock(lock)		BMUnlock(lock, 0)#ifdef __cplusplus}#endif#endif /* __EXTENSION_UTIL_H__ */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?