⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 opendll.c

📁 PNX系列设备驱动 PNX系列设备驱动
💻 C
字号:
/*
 *  +-------------------------------------------------------------------+
 *  | Copyright (c) 1995,1996,1997 by Philips Semiconductors.           |
 *  |                                                                   |
 *  | This software  is furnished under a license  and may only be used |
 *  | and copied in accordance with the terms  and conditions of such a |
 *  | license  and with  the inclusion of this  copyright notice.  This |
 *  | software or any other copies of this software may not be provided |
 *  | or otherwise  made available  to any other person.  The ownership |
 *  | and title of this software is not transferred.                    |
 *  |                                                                   |
 *  | The information  in this software  is subject  to change  without |
 *  | any  prior notice  and should not be construed as a commitment by |
 *  | Philips Semiconductors.                                           |
 *  |                                                                   |
 *  | This  code  and  information  is  provided  "as is"  without  any |
 *  | warranty of any kind,  either expressed or implied, including but |
 *  | not limited  to the implied warranties  of merchantability and/or |
 *  | fitness for any particular purpose.                               |
 *  +-------------------------------------------------------------------+
 *
 *
 *  Module name              : OpenDll.c    1.2
 *
 *  Module type              : IMPLEMENTATION
 *
 *  Title                    : Dll search path handling and opening of DLLs.
 *
 *  Last update              : 16:16:40 - 97/03/20
 */

#include "tmtypes.h"
#include "Lib_Util.h"
#include "RPCServ.h"




static PathList pl;

/*
 * Function         : add a certain directory name for dll searching;
 * Parameters       : pathlist (I) directory
 * Function result  : 
 * Postcondition    : can abort on malloc failure
 */

extern void 
OpenDll_add_dll_path( String path )
{
	if (pl == Null)
		pl = Lib_Util_create_path_list();
	
	Lib_Util_add_path( &pl, path );
}


/*
 * Function         : remove a certain directory name for dll searching;
 * Parameters       : pathlist (I) directory
 * Function result  : 
 */

extern void 
OpenDll_remove_dll_path( String path )
{
	if (pl == Null)
		return;
	
	Lib_Util_remove_path( pl, path );
}


/*
 * Function         : returns an open dll according to previously
 *                    set search paths. First the current directory
 *                    is searched for then the directories (in 
 *                    reverse order of addition) added to
 *                    the search path by RPCServ_add_dll_path. 
 * Parameters       : path (I) filename to be searched for
 * Function result  : open file descriptor on success or -1 on failure.
 */
extern int 
OpenDll_open_dll( String path, RPCServ_OpenFunc My_open, Endian endian)
{
    if (pl == Null || path == Null || My_open == Null)
	return -1;

    return Lib_Util_open_dll_file(pl, path, (OpenFunc) My_open, endian);
}

⌨️ 快捷键说明

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