gname_def.h

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

H
72
字号
/* *---------------------------------------------------------------------- *    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. * *---------------------------------------------------------------------- *//* *	gname_def.h (gname) * *	Global name management */#ifndef __GName_Def_H__#define __GName_Def_H__ 1#include <basic.h>#include <sys/queue.h>/* It is assumed the entry count of the global name is about 256. *//* A prime is desirable. */#define NumOfHashEntries	257#define HashRate		NumOfHashEntries/* Maximum character count of the global name */#define GlobalNameLengthLimit	256#ifdef DEBUG#  define NumOfPoolEntries	256#endif/* For storing the global name */typedef struct {	W	numOfNames;			/* Valid character count */	TC	name[GlobalNameLengthLimit];	/* Global name */} GlobalName;/* Entry holding the global data */typedef struct {	QUEUE		queue;		/* link for QUEUE */	UW		searchKey;	/* Value of the hashed global name */	ID		pid;		/* Process ID */	GlobalName	gname;		/* Global name */	W		data;		/* Data */	UW		atr;		/* Attribute */} GNameEntry;#define InvalidKey		(-1)#define InvalidPID		(0)#define OffsetOfSearchKey	8#define OffsetOfPID		12/* For entry management  The first one of the queue *//* As a result of the global name being hashed, the collided entry is linked. */typedef QUEUE	ListOfEntry;/* Prototype */#ifdef DEBUGIMPORT ID	getPID(void);#endif#endif /* __GName_Def_H__ */

⌨️ 快捷键说明

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