00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044 #ifndef iapi_INCLUDED
00045 # define iapi_INCLUDED
00046
00047 #ifdef __cplusplus
00048 extern "C" {
00049 #endif
00050
00051 #if defined(_WINDOWS_) || defined(__WINDOWS__)
00052 # ifndef _Windows
00053 # define _Windows
00054 # endif
00055 #endif
00056
00057 #ifdef _Windows
00058 # ifndef GSDLLEXPORT
00059 # define GSDLLEXPORT __declspec(dllexport)
00060 # endif
00061 # ifndef GSDLLAPI
00062 # define GSDLLAPI __stdcall
00063 # endif
00064 # ifndef GSDLLCALL
00065 # define GSDLLCALL __stdcall
00066 # endif
00067 #endif
00068
00069 #if defined(OS2) && defined(__IBMC__)
00070 # ifndef GSDLLAPI
00071 # define GSDLLAPI _System
00072 # endif
00073 # ifndef GSDLLCALL
00074 # define GSDLLCALL _System
00075 # endif
00076 #endif
00077
00078 #ifdef __MACOS__
00079 # pragma export on
00080 #endif
00081
00082 #ifndef GSDLLEXPORT
00083 # define GSDLLEXPORT
00084 #endif
00085 #ifndef GSDLLAPI
00086 # define GSDLLAPI
00087 #endif
00088 #ifndef GSDLLCALL
00089 # define GSDLLCALL
00090 #endif
00091
00092 #if defined(__IBMC__)
00093 # define GSDLLAPIPTR * GSDLLAPI
00094 # define GSDLLCALLPTR * GSDLLCALL
00095 #else
00096 # define GSDLLAPIPTR GSDLLAPI *
00097 # define GSDLLCALLPTR GSDLLCALL *
00098 #endif
00099
00100 #ifndef display_callback_DEFINED
00101 # define display_callback_DEFINED
00102 typedef struct display_callback_s display_callback;
00103 #endif
00104
00105 typedef struct gsapi_revision_s {
00106 const char *product;
00107 const char *copyright;
00108 long revision;
00109 long revisiondate;
00110 } gsapi_revision_t;
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123 GSDLLEXPORT int GSDLLAPI
00124 gsapi_revision(gsapi_revision_t *pr, int len);
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140 GSDLLEXPORT int GSDLLAPI
00141 gsapi_new_instance(void **pinstance, void *caller_handle);
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155 GSDLLEXPORT void GSDLLAPI
00156 gsapi_delete_instance(void *instance);
00157
00158
00159
00160
00161
00162
00163
00164
00165 GSDLLEXPORT int GSDLLAPI
00166 gsapi_set_stdio(void *instance,
00167 int (GSDLLCALLPTR stdin_fn)(void *caller_handle, char *buf, int len),
00168 int (GSDLLCALLPTR stdout_fn)(void *caller_handle, const char *str, int len),
00169 int (GSDLLCALLPTR stderr_fn)(void *caller_handle, const char *str, int len));
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180 GSDLLEXPORT int GSDLLAPI gsapi_set_poll(void *instance,
00181 int (GSDLLCALLPTR poll_fn)(void *caller_handle));
00182
00183
00184
00185
00186
00187
00188 GSDLLEXPORT int GSDLLAPI gsapi_set_display_callback(
00189 void *instance, display_callback *callback);
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204 GSDLLEXPORT int GSDLLAPI gsapi_init_with_args(void *instance,
00205 int argc, char **argv);
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216 GSDLLEXPORT int GSDLLAPI
00217 gsapi_run_string_begin(void *instance,
00218 int user_errors, int *pexit_code);
00219
00220 GSDLLEXPORT int GSDLLAPI
00221 gsapi_run_string_continue(void *instance,
00222 const char *str, unsigned int length, int user_errors, int *pexit_code);
00223
00224 GSDLLEXPORT int GSDLLAPI
00225 gsapi_run_string_end(void *instance,
00226 int user_errors, int *pexit_code);
00227
00228 GSDLLEXPORT int GSDLLAPI
00229 gsapi_run_string_with_length(void *instance,
00230 const char *str, unsigned int length, int user_errors, int *pexit_code);
00231
00232 GSDLLEXPORT int GSDLLAPI
00233 gsapi_run_string(void *instance,
00234 const char *str, int user_errors, int *pexit_code);
00235
00236 GSDLLEXPORT int GSDLLAPI
00237 gsapi_run_file(void *instance,
00238 const char *file_name, int user_errors, int *pexit_code);
00239
00240
00241
00242
00243
00244
00245 GSDLLEXPORT int GSDLLAPI
00246 gsapi_exit(void *instance);
00247
00248
00249
00250 struct vd_trace_interface_s;
00251 GSDLLEXPORT void GSDLLAPI
00252 gsapi_set_visual_tracer(struct vd_trace_interface_s *I);
00253
00254
00255
00256 typedef int (GSDLLAPIPTR PFN_gsapi_revision)(
00257 gsapi_revision_t *pr, int len);
00258 typedef int (GSDLLAPIPTR PFN_gsapi_new_instance)(
00259 void **pinstance, void *caller_handle);
00260 typedef void (GSDLLAPIPTR PFN_gsapi_delete_instance)(
00261 void *instance);
00262 typedef int (GSDLLAPIPTR PFN_gsapi_set_stdio)(void *instance,
00263 int (GSDLLCALLPTR stdin_fn)(void *caller_handle, char *buf, int len),
00264 int (GSDLLCALLPTR stdout_fn)(void *caller_handle, const char *str, int len),
00265 int (GSDLLCALLPTR stderr_fn)(void *caller_handle, const char *str, int len));
00266 typedef int (GSDLLAPIPTR PFN_gsapi_set_poll)(void *instance,
00267 int(GSDLLCALLPTR poll_fn)(void *caller_handle));
00268 typedef int (GSDLLAPIPTR PFN_gsapi_set_display_callback)(
00269 void *instance, display_callback *callback);
00270 typedef int (GSDLLAPIPTR PFN_gsapi_init_with_args)(
00271 void *instance, int argc, char **argv);
00272 typedef int (GSDLLAPIPTR PFN_gsapi_run_string_begin)(
00273 void *instance, int user_errors, int *pexit_code);
00274 typedef int (GSDLLAPIPTR PFN_gsapi_run_string_continue)(
00275 void *instance, const char *str, unsigned int length,
00276 int user_errors, int *pexit_code);
00277 typedef int (GSDLLAPIPTR PFN_gsapi_run_string_end)(
00278 void *instance, int user_errors, int *pexit_code);
00279 typedef int (GSDLLAPIPTR PFN_gsapi_run_string_with_length)(
00280 void *instance, const char *str, unsigned int length,
00281 int user_errors, int *pexit_code);
00282 typedef int (GSDLLAPIPTR PFN_gsapi_run_string)(
00283 void *instance, const char *str,
00284 int user_errors, int *pexit_code);
00285 typedef int (GSDLLAPIPTR PFN_gsapi_run_file)(void *instance,
00286 const char *file_name, int user_errors, int *pexit_code);
00287 typedef int (GSDLLAPIPTR PFN_gsapi_exit)(void *instance);
00288 typedef void (GSDLLAPIPTR PFN_gsapi_set_visual_tracer)
00289 (struct vd_trace_interface_s *I);
00290
00291
00292 #ifdef __MACOS__
00293 #pragma export off
00294 #endif
00295
00296 #ifdef __cplusplus
00297 }
00298 #endif
00299
00300 #endif