1N/A/***********************************************************************
1N/A* *
1N/A* This software is part of the ast package *
1N/A* Copyright (c) 1997-2011 AT&T Intellectual Property *
1N/A* and is licensed under the *
1N/A* Common Public License, Version 1.0 *
1N/A* by AT&T Intellectual Property *
1N/A* *
1N/A* A copy of the License is available at *
1N/A* http://www.opensource.org/licenses/cpl1.0.txt *
1N/A* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
1N/A* *
1N/A* Information and Software Systems Research *
1N/A* AT&T Research *
1N/A* Florham Park NJ *
1N/A* *
1N/A* Glenn Fowler <gsf@research.att.com> *
1N/A* *
1N/A***********************************************************************/
1N/A#pragma prototyped
1N/A/*
1N/A * Glenn Fowler
1N/A * AT&T Research
1N/A */
1N/A
1N/A#include <ast.h>
1N/A#include <dlldefs.h>
1N/A#include <error.h>
1N/A
1N/A/*
1N/A * find and load library name with optional version ver and dlopen() flags
1N/A * at least one dlopen() is called to initialize dlerror()
1N/A * if path!=0 then library path up to size chars copied to path with trailing 0
1N/A * if name contains a directory prefix then library search is limited to the dir and siblings
1N/A */
1N/A
1N/Aextern void*
1N/Adllfind(const char* lib, const char* ver, int flags, char* path, size_t size)
1N/A{
1N/A char* id;
1N/A void* dll;
1N/A
1N/A if ((id = error_info.id) && (dll = dllplug(id, lib, ver, flags, path, size)))
1N/A return dll;
1N/A return dllplug(NiL, lib, ver, flags, path, size);
1N/A}