YAP
7.1.0
Foreign.h
Go to the documentation of this file.
1
/*************************************************************************
2
* *
3
* YAP Prolog *
4
* *
5
* Yap Prolog was developed at NCCUP - Universidade do Porto *
6
* *
7
* Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-97 *
8
* *
9
**************************************************************************
10
* *
11
* File: Foreign.h *
12
* comments: header file for dynamic loading routines *
13
*************************************************************************/
14
15
#define NO_DYN 1
16
17
#ifndef FOREIGN_H
18
#define FOREIGN_H
19
49
#include "
Yap.h
"
50
#include "YapHeap.h"
51
52
#ifdef _AIX
53
#undef NO_DYN
54
#endif
/* __AIX */
55
56
#ifdef HAVE_DLOPEN
57
#define LOAD_DL 1
58
#ifdef NO_DYN
59
#undef NO_DYN
60
#endif
61
#endif
/* LOAD_DL */
62
63
#if defined(sparc) || defined(__sparc)
64
#undef NO_DYN
65
#if (!defined(__svr4__) && !defined(__SVR4))
66
#define A_OUT 1
67
#else
68
#ifdef SIMICS
69
#define NO_DYN 1
70
#else
71
#define LOAD_DL 1
72
#endif
73
#endif
74
#endif
75
76
#if defined(_WIN32)
77
#ifdef NO_DYN
78
#undef NO_DYN
79
#define LOAD_DLL 1
80
#endif
81
#if LOAD_DL
82
#undef LOAD_DL
83
#endif
84
#endif
85
86
#ifdef __hpux
87
#ifdef NO_DYN
88
#undef NO_DYN
89
#endif
90
#define LOAD_SHL 1
91
#endif
92
93
#ifdef HAVE_NSLINKMODULE
94
#ifdef NO_DYN
95
#undef NO_DYN
96
#endif
97
#if !HAVE_DLOPEN
98
#define LOAD_DYLD 1
99
#endif
100
#endif
/* LOAD_DYLD */
101
102
#define LOAD_SUCCEEDED 0
103
#define LOAD_FAILLED -1
104
105
typedef
struct
StringListItem
{
106
Atom
name;
107
void
*handle;
108
struct
StringListItem
*next;
109
}
StringListItem
, *
StringList
;
110
111
typedef
struct
ForeignLoadItem
{
112
StringList
objs;
113
StringList
libs;
114
Atom
f;
115
Term module;
116
struct
ForeignLoadItem
*next;
117
}
ForeignObj
;
118
119
typedef
void (*YapInitProc)(void);
120
121
void
*Yap_LoadForeignFile(
char
*,
int
);
122
int
Yap_CallForeignFile(
void
*,
char
*);
123
int
Yap_CloseForeignFile(
void
*);
124
Int Yap_LoadForeign(
StringList
,
StringList
,
char
*, YapInitProc *);
125
Int Yap_ReLoadForeign(
StringList
,
StringList
,
char
*, YapInitProc *);
126
void
Yap_ReOpenLoadForeign(
void
);
127
void
Yap_ShutdownLoadForeign(
void
);
128
129
#define EAGER_LOADING 1
130
#define GLOBAL_LOADING 2
131
132
#endif
Yap.h
Main definitions.
AtomEntryStruct
Definition:
Atoms.h:52
ForeignLoadItem
Definition:
Foreign.h:111
StringListItem
Definition:
Foreign.h:105
H
Foreign.h
Generated by
1.9.3