亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? generic.c

?? linux集群服務器軟件代碼包
?? C
字號:
/* $Id: generic.c,v 1.23 2004/10/06 10:55:17 lars Exp $ *//* *  * Generic interface (implementation) manager * * Copyright 2001 Alan Robertson <alanr@unix.sh> * Licensed under the GNU Lesser General Public License * * This manager will manage any number of types of interfaces. * * This means that when any implementations of our client interfaces register * or unregister, it is us that makes their interfaces show up in the outside * world. * * And, of course, we have to do this in a very generic way, since we have * no idea about the client programs or interface types, or anything else. * * We do that by getting a parameter passed to us which tell us the names * of the interface types we want to manage, and the address of a GHashTable * for each type that we put the implementation in when they register * themselves. * * So, each type of interface that we manage gets its own private * GHashTable of the implementations of that type that are currently * registered. * * For example, if we manage communication modules, their exported * interfaces will be registered in a hash table.  If we manage * authentication modules, they'll have their (separate) hash table that * their exported interfaces are registered in. * * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. *  * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU * Lesser General Public License for more details. *  * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA * */#define	PIL_PLUGINTYPE		InterfaceMgr#define PIL_PLUGINTYPE_S	"InterfaceMgr"#define	PIL_PLUGIN		generic#define PIL_PLUGIN_S		"generic"#define PIL_PLUGINLICENSE	LICENSE_LGPL#define PIL_PLUGINLICENSEURL	URL_LGPL/* We are an interface manager... */#define ENABLE_PLUGIN_MANAGER_PRIVATE#define ENABLE_PIL_DEFS_PRIVATE#include <portability.h>#include <pils/generic.h>#include <stdio.h>PIL_PLUGIN_BOILERPLATE("1.0", GenDebugFlag, CloseGeneralPluginManager)/* * Key is interface type, value is a PILGenericIfMgmtRqst. * The key is g_strdup()ed, but the struct is not copied. */static gboolean FreeAKey(gpointer key, gpointer value, gpointer data);/* *	Places to store information gotten during registration. */static const PILPluginImports*	GenPIImports;	/* Imported plugin fcns */static PILPlugin*		GenPlugin;	/* Our plugin info */static PILInterfaceImports*	GenIfImports;	/* Interface imported fcns *//* Our exported generic interface management functions */static PIL_rc RegisterGenIF(PILInterface* ifenv, void**	imports);static PIL_rc UnregisterGenIF(PILInterface*iifinfo);static PIL_rc CloseGenInterfaceManager(PILInterface*, void* info);/* *	Our Interface Manager interfaces - exported to the universe! * *	(or at least to the interface management universe ;-). * *	These are the interfaces which are used to manage our *	client implementations */static PILInterfaceOps		GenIfOps ={	RegisterGenIF,	UnregisterGenIF};PIL_rc PIL_PLUGIN_INIT(PILPlugin*us, PILPluginImports* imports, void*);/* *	Our user_ptr is presumed to point to NULL-terminated array of *	PILGenericIfMgmtRqst structs. * *	These requests have pointers to GHashTables for us *	to put plugins into when they show up, and drop from when *	they disappear. * * 	Issues include: * 	- freeing all memory, * 	- making sure things are all cleaned up correctly * 	- Thread-safety? * * 	IMHO the global system should handle thread-safety. */static PIL_rc AddAnInterfaceType(PILPlugin*us, GHashTable* MasterTable, PILGenericIfMgmtRqst* req);PIL_rcPIL_PLUGIN_INIT(PILPlugin*us, PILPluginImports* imports, void *user_ptr){	PIL_rc			ret;	PILGenericIfMgmtRqst*	user_req;	PILGenericIfMgmtRqst*	curreq;	GHashTable*	MasterTable = NULL;	/*	 * Force the compiler to check our parameters...	 */	PILPluginInitFun	fun = &PIL_PLUGIN_INIT; (void)fun;	GenPIImports = imports;	if (GenDebugFlag) {		PILCallLog(GenPIImports->log, PIL_DEBUG		,	"IF manager %s: initializing.", PIL_PLUGIN_S);	}	if (user_ptr == NULL) {		PILCallLog(GenPIImports->log, PIL_CRIT		,	"%s Interface Manager requires non-NULL "		" PILGenericIfMgmtRqst user pointer at initialization."		,	PIL_PLUGIN_S);		return PIL_INVAL;	}	GenPlugin = us;	if (GenDebugFlag) {		PILCallLog(GenPIImports->log, PIL_DEBUG		,	"IF manager %s: registering as a plugin."		, PIL_PLUGIN_S);	}	user_req = user_ptr;	MasterTable = g_hash_table_new(g_str_hash, g_str_equal);	us->ud_plugin = MasterTable;	/* Override passed value */	/* Register ourselves as a plugin */	if ((ret = imports->register_plugin(us, &OurPIExports)) != PIL_OK) {		PILCallLog(imports->log, PIL_CRIT		,	"IF manager %s unable to register as plugin (%s)"		,	PIL_PLUGIN_S, PIL_strerror(ret));		return ret;	}	/*	 * Register to manage implementations	 * for all the interface types we've been asked to manage.	 */	for(curreq = user_req; curreq->iftype != NULL; ++curreq) {		PIL_rc newret;		newret = AddAnInterfaceType(us, MasterTable, curreq);		if (newret != PIL_OK) {			ret = newret;		}	}	/*	 * Our plugin and all our registered plugin types	 * have ud_plugin pointing at MasterTable.	 */	return ret;}static PIL_rcAddAnInterfaceType(PILPlugin*us, GHashTable* MasterTable, PILGenericIfMgmtRqst* req){	PIL_rc	rc;	PILInterface*		GenIf;		/* Our Generic Interface info*/	g_assert(MasterTable != NULL);	g_hash_table_insert(MasterTable, g_strdup(req->iftype), req);	if (req->ifmap == NULL) {		PILCallLog(GenPIImports->log, PIL_CRIT		,	"IF manager %s: iftype %s has NULL"		" ifmap pointer address."		,	PIL_PLUGIN_S, req->iftype);		return PIL_INVAL;	}	if ((*req->ifmap) != NULL) {		PILCallLog(GenPIImports->log, PIL_CRIT		,	"IF manager %s: iftype %s GHashTable pointer"		" was not initialized to NULL"		,	PIL_PLUGIN_S, req->iftype);		return PIL_INVAL;	}	if (GenDebugFlag) {		PILCallLog(GenPIImports->log, PIL_DEBUG		,	"IF manager %s: registering ourselves"		" to manage interface type %s"		,	PIL_PLUGIN_S, req->iftype);		PILCallLog(GenPIImports->log, PIL_DEBUG		,	"%s IF manager: ifmap: 0x%lx callback: 0x%lx"		" imports: 0x%lx"		,	PIL_PLUGIN_S		,	(unsigned long)req->ifmap		,	(unsigned long)req->callback		,	(unsigned long)req->importfuns);	}	/* Create the hash table to communicate with this client */	*(req->ifmap) = g_hash_table_new(g_str_hash, g_str_equal);	rc = GenPIImports->register_interface(us	,	PIL_PLUGINTYPE_S	,	req->iftype	/* the iftype we're managing here */	,	&GenIfOps	,	CloseGenInterfaceManager	,	&GenIf	,	(void*)&GenIfImports	,	MasterTable);	/* Point ud_interface to MasterTable */	/* We don't ever want to be unloaded... */	GenIfImports->ModRefCount(GenIf, +100);	if (rc != PIL_OK) {		PILCallLog(GenPIImports->log, PIL_CRIT		,	"Generic interface manager %s: unable to register"		" to manage interface type %s: %s"		,	PIL_PLUGIN_S, req->iftype		,	PIL_strerror(rc));	}	return rc;}static voidCloseGeneralPluginManager(PILPlugin* us){		GHashTable*	MasterTable = us->ud_plugin;	int		count;	g_assert(MasterTable != NULL);	/*	 * All our clients have already been shut down automatically	 * This is the final shutdown for us...	 */	/* There *shouldn't* be any keys in there ;-) */	if ((count=g_hash_table_size(MasterTable)) > 0) {		/* But just in case there are... */		g_hash_table_foreach_remove(MasterTable, FreeAKey, NULL);	}	g_hash_table_destroy(MasterTable);	us->ud_plugin = NULL;	return;}/* *	We get called for every time an implementation registers itself as *	implementing one of the kinds of interfaces we manage. * *	It's our job to make the implementation that's *	registering with us available to the system. * *	We do that by adding it to a GHashTable for its interface type *	Our users in the rest of the system takes it from there... * *	The key to the GHashTable is the implementation name, and the data is *	a pointer to the information the implementation exports. * *	It's a piece of cake ;-) */static PIL_rcRegisterGenIF(PILInterface* intf,  void** imports){	PILGenericIfMgmtRqst*	ifinfo;	GHashTable*	MasterTable = intf->ifmanager->ud_interface;	g_assert(MasterTable != NULL);	/* Reference count should now be one */	if (GenDebugFlag) {		PILCallLog(GenPIImports->log, PIL_DEBUG		,	"%s IF manager: interface %s/%s registering."		,	PIL_PLUGIN_S, intf->interfacetype->typename		,	intf->interfacename);	}	g_assert(intf->refcnt == 1);	/*	 * We need to add it to the table that goes with this particular	 * type of interface.	 */	if ((ifinfo = g_hash_table_lookup(MasterTable	,	intf->interfacetype->typename)) !=	NULL)	{		GHashTable*		ifmap = *(ifinfo->ifmap);		g_hash_table_insert(ifmap, intf->interfacename,intf->exports);		if (GenDebugFlag) {			PILCallLog(GenPIImports->log, PIL_DEBUG			, "%s IF manager: Inserted interface [%s] in hash"			" table @ 0x%08lx"			, PIL_PLUGIN_S, intf->interfacename			, (unsigned long)ifmap);			PILCallLog(GenPIImports->log, PIL_DEBUG			, "%s IF manager: Exports are here: 0x%08x"			, PIL_PLUGIN_S			, GPOINTER_TO_UINT(intf->exports));		}		if (ifinfo->callback != NULL) {			PILInterfaceType*	t = intf->interfacetype;			if (GenDebugFlag) {				PILCallLog(GenPIImports->log, PIL_DEBUG				,	"%s IF manager: callback 0x%lx"				,	PIL_PLUGIN_S				,	(unsigned long)ifinfo->callback);			}			ifinfo->callback(PIL_REGISTER			,	t->universe->piuniv, intf->interfacename			,	t->typename, ifinfo->userptr);		}		*imports = ifinfo->importfuns;		return PIL_OK;	}else{		PILCallLog(GenPIImports->log, PIL_WARN		,	"RegisterGenIF: interface type %s not found"		,	intf->interfacename);	}	return PIL_INVAL;}/* Unregister an implementation - * 	We get called from the interface management system when someone * 	has requested that an implementation of a client interface be * 	unregistered. */static PIL_rcUnregisterGenIF(PILInterface*intf){	GHashTable*	MasterTable = intf->ifmanager->ud_interface;	PILGenericIfMgmtRqst*	ifinfo;	g_assert(MasterTable != NULL);	g_assert(intf->refcnt >= 0);	/*	 * Go through the "master table" and find client table, 	 * notify client we're about to remove this entry, then	 * then remove this entry from it.	 */	if (GenDebugFlag) {		PILCallLog(GenPIImports->log, PIL_DEBUG		,	"%s IF manager: unregistering interface %s/%s."		,	PIL_PLUGIN_S, intf->interfacetype->typename		,	intf->interfacename);	}	if ((ifinfo = g_hash_table_lookup(MasterTable	,	intf->interfacetype->typename)) != NULL)	{		GHashTable*		ifmap = *(ifinfo->ifmap);		if (ifinfo->callback != NULL) {			PILInterfaceType*	t = intf->interfacetype;			if (GenDebugFlag) {				PILCallLog(GenPIImports->log, PIL_DEBUG				,	"%s IF manager: callback 0x%lx"				,	PIL_PLUGIN_S				,	(unsigned long)ifinfo->callback);			}			ifinfo->callback(PIL_UNREGISTER			,	t->universe->piuniv, intf->interfacename			,	t->typename, ifinfo->userptr);		}		/* Remove the client entry from master table */		g_hash_table_remove(ifmap, intf->interfacename);	}else{		PILCallLog(GenPIImports->log, PIL_WARN		,	"UnregisterGenIF: interface type %s not found"		,	intf->interfacename);		return PIL_INVAL;	}	return PIL_OK;}/* *	Close down the generic interface manager. */static PIL_rcCloseGenInterfaceManager(PILInterface*intf, void* info){	void*		key;	void*		data;	GHashTable*	MasterTable = intf->ud_interface;	if (GenDebugFlag) {		PILCallLog(GenPIImports->log, PIL_INFO		,	"In CloseGenInterFaceManager on %s/%s (MasterTable: 0x%08lx)"		,	intf->interfacetype->typename, intf->interfacename		,	(unsigned long)MasterTable);	}	g_assert(MasterTable != NULL);	if (g_hash_table_lookup_extended(MasterTable	,	intf->interfacename, &key, &data)) {		PILGenericIfMgmtRqst*	ifinfo = data;		g_hash_table_destroy(*(ifinfo->ifmap));		*(ifinfo->ifmap) = NULL;		g_hash_table_remove(MasterTable, key);		g_free(key);	}else{		g_assert_not_reached();	}	return PIL_OK;}static gbooleanFreeAKey(gpointer key, gpointer value, gpointer data){	g_free(key);	return TRUE;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人污污视频在线观看| 亚洲一区二区在线播放相泽| 色综合久久久久综合99| 风间由美性色一区二区三区| 久久国产剧场电影| 蜜桃av一区二区| 视频一区国产视频| 日韩av一级片| 免费久久精品视频| 七七婷婷婷婷精品国产| 日本不卡免费在线视频| 日本在线不卡视频一二三区| 日韩高清不卡一区二区三区| 日韩二区三区四区| 免费三级欧美电影| 韩国精品主播一区二区在线观看 | 99久久精品免费看| 91猫先生在线| 色婷婷国产精品综合在线观看| 91视频观看视频| 欧美视频精品在线观看| 欧美日韩国产bt| 精品久久一区二区三区| 久久色中文字幕| 欧美极品少妇xxxxⅹ高跟鞋 | 成人18精品视频| 在线欧美日韩精品| 欧美一区二区在线视频| 久久久久久久久99精品| 国产精品久久久久久久蜜臀| 亚洲线精品一区二区三区八戒| 日韩av一区二区三区四区| 精品亚洲成a人在线观看| 成人污视频在线观看| 欧洲人成人精品| 日韩欧美中文字幕制服| 国产精品久久久久毛片软件| 偷拍与自拍一区| 国产成人精品免费| 欧美系列日韩一区| 久久精品人人做人人综合| 成人免费在线播放视频| 日本欧美一区二区三区| 成人一区二区三区视频 | 午夜精品福利久久久| 国产成人精品综合在线观看| 在线看国产日韩| 国产午夜亚洲精品午夜鲁丝片| 一区二区三区四区不卡视频| 激情av综合网| 欧美日韩极品在线观看一区| 国产精品乱码久久久久久| 午夜精品福利视频网站| 99久久久国产精品| 国产亚洲欧美在线| 视频一区二区三区中文字幕| 99久久99久久免费精品蜜臀| 26uuu成人网一区二区三区| 亚洲在线视频网站| 成人激情图片网| 久久综合99re88久久爱| 午夜成人在线视频| 在线中文字幕一区| 国产精品视频你懂的| 国产在线不卡一卡二卡三卡四卡| 欧美色图免费看| 亚洲人成亚洲人成在线观看图片| 国产在线精品一区二区| 欧美一区中文字幕| 亚洲综合在线五月| 99re8在线精品视频免费播放| 久久亚洲欧美国产精品乐播| 日韩电影免费在线| 欧美一级xxx| 午夜精品久久久久久久久久| 在线视频综合导航| 亚洲精品国产第一综合99久久| 成人国产精品免费| 国产调教视频一区| 国产一区二区三区四区五区入口| 日韩欧美中文字幕一区| 琪琪一区二区三区| 精品国产一区二区三区av性色| 免费在线一区观看| 欧美v日韩v国产v| 毛片基地黄久久久久久天堂| 日韩一区二区免费视频| 激情综合亚洲精品| 久久午夜电影网| 国产91精品精华液一区二区三区 | 亚洲国产综合色| 欧美性生活影院| 亚洲国产乱码最新视频| 91精品婷婷国产综合久久性色| 日日夜夜精品免费视频| 日韩一二三区视频| 国产精品一区一区三区| 国产欧美一区二区三区鸳鸯浴| 国产中文字幕一区| 国产精品大尺度| 色88888久久久久久影院按摩| 亚洲一二三区视频在线观看| 欧美日本免费一区二区三区| 蜜臀av一级做a爰片久久| 久久综合色综合88| 91啪在线观看| 免费欧美在线视频| 久久久久久夜精品精品免费| 99re8在线精品视频免费播放| 亚洲国产成人av网| 日韩精品自拍偷拍| 成人精品亚洲人成在线| 亚洲国产美女搞黄色| 精品国产区一区| 色国产综合视频| 男人的天堂久久精品| 国产精品久久久久一区二区三区共| 欧洲精品视频在线观看| 国内精品自线一区二区三区视频| 中文字幕亚洲区| 日韩精品一区二区三区视频在线观看 | 国产精品一区二区男女羞羞无遮挡 | 性做久久久久久免费观看| 精品国产免费人成电影在线观看四季 | 国产高清不卡一区| 亚洲精品乱码久久久久| 97精品久久久久中文字幕| 韩国女主播成人在线| 欧美国产成人在线| 9色porny自拍视频一区二区| 国产精品久久久久永久免费观看| 国产69精品久久久久毛片| 欧美日韩极品在线观看一区| 久久精品72免费观看| 一区二区在线观看免费视频播放| 精品国产99国产精品| 欧美性色黄大片手机版| av欧美精品.com| 精品一区二区三区的国产在线播放| 一区二区国产盗摄色噜噜| 久久精品夜夜夜夜久久| 制服丝袜av成人在线看| 欧美日韩欧美一区二区| 成人91在线观看| 成人中文字幕在线| 国产在线不卡一区| 久久福利视频一区二区| 肉丝袜脚交视频一区二区| 亚洲丝袜另类动漫二区| 国产女人aaa级久久久级| 精品国产乱码久久久久久图片 | 中文字幕av一区 二区| 精品久久久久香蕉网| 91精品国产乱| 欧美日韩色一区| 色久综合一二码| 色综合天天综合色综合av| 99久久国产免费看| 成人国产精品免费观看| 成人免费毛片a| 成人美女在线观看| www.亚洲人| 一本一本大道香蕉久在线精品| www.成人在线| 97久久精品人人爽人人爽蜜臀| 波多野结衣在线aⅴ中文字幕不卡| 国产福利91精品一区| 丰满亚洲少妇av| 99国内精品久久| 欧美亚洲综合网| 91麻豆精品国产91久久久| 欧美一级片在线| 精品国产凹凸成av人网站| 久久久影视传媒| 中文字幕中文字幕一区| 自拍偷自拍亚洲精品播放| 亚洲精品视频在线| 亚洲国产日韩一级| 免费成人在线视频观看| 精品一二线国产| 成人丝袜高跟foot| 欧美影视一区在线| 日韩情涩欧美日韩视频| 国产视频一区二区在线| 亚洲激情在线激情| 日韩高清在线不卡| 国产精品69毛片高清亚洲| 91香蕉视频mp4| 欧美日韩成人一区二区| 久久久久久久免费视频了| 日韩理论片一区二区| 视频一区二区中文字幕| 成人午夜电影网站| 欧美日韩视频第一区| 国产亚洲制服色| 视频一区欧美精品| 成人av网站在线观看| 日韩午夜中文字幕| 亚洲日本护士毛茸茸| 老汉av免费一区二区三区|