File: dlf.h

package info (click to toggle)
libiodbc2 2.50.3-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 860 kB
  • ctags: 1,245
  • sloc: ansic: 8,060; sh: 6,664; makefile: 81
file content (68 lines) | stat: -rw-r--r-- 2,196 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*
 *  dlf.h
 *
 *  $Id: dlf.h,v 1.5 1999/04/24 09:54:12 source Exp $
 *
 *  Dynamic Library Loader (mapping to SVR4)
 *
 *  The iODBC driver manager.
 *  
 *  Copyright (C) 1995 by Ke Jin <kejin@empress.com> 
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Library General Public
 *  License as published by the Free Software Foundation; either
 *  version 2 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
 *  Library General Public License for more details.
 *
 *  You should have received a copy of the GNU Library General Public
 *  License along with this library; if not, write to the Free
 *  Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
#ifndef	_DLF_H
#define _DLF_H
#include <config.h>

#if defined(HAVE_LIBDL)
#define DLDAPI_SVR4_DLFCN
#elif defined(HAVE_SHL_LOAD)
#define DLDAPI_HP_SHL
#endif

#if defined(DLDAPI_SVR4_DLFCN)
#include <dlfcn.h>
#elif defined(DLDAPI_AIX_LOAD)
#include <dlfcn.h>
#elif defined(DLDAPI_VMS_IODBC)
extern void FAR *iodbc_dlopen (char FAR * path, int mode);
extern void FAR *iodbc_dlsym (void FAR * hdll, char FAR * sym);
extern char FAR *iodbc_dlerror ();
extern int iodbc_dlclose (void FAR * hdll);
#else
extern void FAR *dlopen (char FAR * path, int mode);
extern void FAR *dlsym (void FAR * hdll, char FAR * sym);
extern char FAR *dlerror ();
extern int dlclose (void FAR * hdll);
#endif

#ifndef	RTLD_LAZY
#define	RTLD_LAZY       1
#endif

#if defined(DLDAPI_VMS_IODBC)
#define	DLL_OPEN(dll)		(void*)iodbc_dlopen((char*)(path), RTLD_LAZY)
#define	DLL_PROC(hdll, sym)	(void*)iodbc_dlsym((void*)(hdll), (char*)sym)
#define	DLL_ERROR()		(char*)iodbc_dlerror()
#define	DLL_CLOSE(hdll)		iodbc_dlclose((void*)(hdll))
#else
#define	DLL_OPEN(dll)		(void*)dlopen((char*)(path), RTLD_LAZY)
#define	DLL_PROC(hdll, sym)	(void*)dlsym((void*)(hdll), (char*)sym)
#define	DLL_ERROR()		(char*)dlerror()
#define	DLL_CLOSE(hdll)		dlclose((void*)(hdll))
#endif

#endif