• Main Page
  • Modules
  • Data Structures
  • Files
  • File List

D:/Perso/dev/ocilib/ocilib/src/oci_loader.h

00001 /*
00002     +-----------------------------------------------------------------------------------------+
00003     |                                                                                         |
00004     |                               OCILIB - C Driver for Oracle                              |
00005     |                                                                                         |
00006     |                                (C Wrapper for Oracle OCI)                               |
00007     |                                                                                         |
00008     |                              Website : http://www.ocilib.net                            |
00009     |                                                                                         |
00010     |             Copyright (c) 2007-2010 Vincent ROGIER <vince.rogier@ocilib.net>            |
00011     |                                                                                         |
00012     +-----------------------------------------------------------------------------------------+
00013     |                                                                                         |
00014     |             This library is free software; you can redistribute it and/or               |
00015     |             modify it under the terms of the GNU Lesser General Public                  |
00016     |             License as published by the Free Software Foundation; either                |
00017     |             version 2 of the License, or (at your option) any later version.            |
00018     |                                                                                         |
00019     |             This library is distributed in the hope that it will be useful,             |
00020     |             but WITHOUT ANY WARRANTY; without even the implied warranty of              |
00021     |             MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU           |
00022     |             Lesser General Public License for more details.                             |
00023     |                                                                                         |
00024     |             You should have received a copy of the GNU Lesser General Public            |
00025     |             License along with this library; if not, write to the Free                  |
00026     |             Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.          |
00027     |                                                                                         |
00028     +-----------------------------------------------------------------------------------------+
00029 */
00030 
00031 /* --------------------------------------------------------------------------------------------- *
00032  * $Id: oci_loader.h, v 3.8.1 2010-12-13 00:00 Vincent Rogier $
00033  * --------------------------------------------------------------------------------------------- */
00034 
00035 #ifndef OCILIB_OCI_LOADER_H_INCLUDED
00036 #define OCILIB_OCI_LOADER_H_INCLUDED
00037 
00038 #if defined(_AIX)
00039   #define  LIB_OPEN_FLAGS        RTLD_NOW | RTLD_GLOBAL | RTLD_MEMBER
00040 #elif defined(__hpux)
00041   #define  LIB_OPEN_FLAGS        BIND_DEFERRED |BIND_VERBOSE| DYNAMIC_PATH
00042 #else
00043   #define  LIB_OPEN_FLAGS        RTLD_NOW | RTLD_GLOBAL
00044 #endif
00045 
00046 #if defined(_WINDOWS)
00047 
00048   #include <windows.h>
00049 
00050   #define LIB_HANDLE               HMODULE
00051   #define LIB_OPEN(l)              LoadLibraryA(l)
00052   #define LIB_CLOSE                FreeLibrary
00053   #define LIB_SYMBOL(h, s, p, t)   p = (t) GetProcAddress(h, s)
00054 
00055 #elif defined(__hpux)
00056 
00057   #include <dl.h>
00058 
00059   #define LIB_HANDLE               shl_t
00060   #define LIB_OPEN(l)              shl_load(l, LIB_OPEN_FLAGS, 0L)
00061   #define LIB_CLOSE                shl_unload
00062   #define LIB_SYMBOL(h, s, p, t)   shl_findsym(&h, s, (short) TYPE_PROCEDURE, (void *) &p)
00063 
00064 #else
00065 
00066   #ifdef HAVE_DLFCN_H
00067     #include <dlfcn.h>
00068   #endif
00069 
00070   #define LIB_HANDLE               void *
00071   #define LIB_OPEN(l)              dlopen(l, LIB_OPEN_FLAGS)
00072   #define LIB_CLOSE                dlclose
00073   #define LIB_SYMBOL(h, s, p, t)   p = (t) dlsym(h, s)
00074 
00075 #endif
00076 
00077 #endif    /* OCILIB_OCI_LOADER_H_INCLUDED */
00078 

Generated on Mon Dec 13 2010 22:32:02 for OCILIB (C Driver for Oracle) by  doxygen 1.7.2