CUBRID Engine  latest
dynamic_load.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008 Search Solution Corporation
3  * Copyright 2016 CUBRID Corporation
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 
20 /*
21  * dynamic_load.h - Dynamic loader for run-time inclusion of object code
22  *
23  */
24 
25 #ifndef _DYNAMIC_LOAD_H_
26 #define _DYNAMIC_LOAD_H_
27 
28 #ident "$Id$"
29 
30 #if defined(SOLARIS)
31 #include <dlfcn.h>
32 #include <nlist.h>
33 #endif /* SOLARIS */
34 #if defined(sun)
35 #include <nlist.h>
36 #endif /* sun */
37 #if defined(HPUX)
38 #include <filehdr.h>
39 #include <dl.h>
40 #include <nlist.h>
41 #endif /* UPUX */
42 #if defined(_AIX)
43 #include <dlfcn.h>
44 #include <filehdr.h>
45 #include <aouthdr.h>
46 #include <sys/ldr.h>
47 #include <nlist.h>
48 #endif /* _AIX */
49 #if defined(LINUX)
50 #include <dlfcn.h>
51 #include <nlist.h>
52 #endif /* LINUX */
53 
54 #if defined(SOLARIS) || defined(LINUX) || defined(AIX)
55 /* the nlist types from a.out.h */
56 #if !defined(N_UNDF)
57 #define N_UNDF 0x0 /* undefined */
58 #endif
59 #if !defined(N_EXT)
60 #define N_EXT 01 /* external bit, or'ed in */
61 #endif
62 #if !defined(N_TEXT)
63 #define N_TEXT 0x4 /* text */
64 #endif
65 #endif /* SOLARIS || LINUX || AIX */
66 
67 /* Sun has valloc, HP doesn't. The VALLOC macro hides this.
68  Use free, not free_and_init to free the result of VALLOC. */
69 #if (defined(sun) || defined(sparc)) && !defined(SOLARIS)
70 #define VALLOC valloc
71 #elif defined(HPUX)
72 #define VALLOC malloc
73 #endif /* (sun || sparc) && !SOLARIS */
74 
77 
78 #ifndef HPUX
79 struct nlist;
80 #endif /* HPUX */
81 
82 extern int dl_Errno;
83 
84 #if !defined(LINUX) && !defined(AIX)
85 extern const char *sys_errlist[];
86 #endif /* !LINUX && !AIX */
87 
88 
89 #if !defined(SOLARIS) && !defined(HPUX) && !defined(AIX) && !defined(LINUX)
90 extern int nlist (char *, struct nlist *);
91 #endif /* !SOLARIS && !HPUX && !AIX && !LINUX */
92 
93 #if !defined (SOLARIS) && !defined(LINUX) && !defined(AIX)
94 extern int dl_initiate_module (const char *);
95 #else /* SOLARIS || LINUX || AIX */
96 extern int dl_initiate_module (void);
97 #endif /* SOLARIS || LINUX || AIX */
98 
99 extern int dl_destroy_module (void);
100 
101 #if defined (sun) || defined(SOLARIS) || defined(LINUX) || defined(HPUX) || defined(AIX)
102 extern int dl_resolve_object_symbol (struct nlist *syms);
103 #endif
104 
105 #if defined(HPUX) || defined(SOLARIS) || defined(LINUX) || defined(AIX)
106 #if defined (ENABLE_UNUSED_FUNCTION)
107 extern int dl_load_object_with_estimate (const char **obj_files, const char **msgp);
108 #endif /* ENABLE_UNUSED_FUNCTION */
109 extern int dl_load_object_module (const char **, const char **);
110 #elif (defined(sun) || defined(sparc)) && !defined(SOLARIS)
111 extern int dl_load_object_module (const char **, const char **, const char **);
112 #if defined (ENABLE_UNUSED_FUNCTION)
113 extern int dl_load_object_with_estimate (size_t * actual_size, const char **obj_files, const char **msgp,
114  const char **libs, const size_t estimated_size, enum dl_estimate_mode mode);
115 #endif /* ENABLE_UNUSED_FUNCTION */
116 #endif /* (defined(sun) || defined(sparc)) && !defined(SOLARIS) */
117 
118 #endif /* _DYNAMIC_LOAD_H_ */
const char * sys_errlist[]
int dl_initiate_module(const char *)
static enum scanner_mode mode
dl_estimate_mode
Definition: dynamic_load.h:75
int dl_destroy_module(void)
int nlist(char *, struct nlist *)
int dl_Errno
Definition: dynamic_load.c:189