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
|
#include <stdlib.h> /* SLIRP common {{{ */
#include <unistd.h>
#include <string.h>
#include <stdarg.h>
#include <ctype.h>
#include <slang.h>
#define V SLANG_VOID_TYPE
#define SLEU SL_USAGE_ERROR
#define SLEI SL_INTRINSIC_ERROR
#define SAFE_DEREF_OPAQUE(po) (po == NULL ? NULL : po->instance)
#define SAFE_DEREF_ARRAY(pa) (pa == NULL ? NULL : pa->data)
#define SLang_pop_array(x) SLang_pop_array(x, 1)
#define SLang_pop_string(x) SLang_pop_slstring(x)
#define SLang_push_size_t SLang_push_@size_t_mnemonic@
#define SLang_push_ptrdiff_t SLang_push_@ptrdiff_t_mnemonic@
#define pop_defaultable(argno, kind, type, obj, value) \
(SLang_Num_Function_Args >= argno ? SLang_pop_##kind ( (type*)&obj) : ((obj = value) || ( (void*)&obj > (void*)0) ) )
#ifdef __cplusplus
#define LINKAGE "C"
#else
#define LINKAGE
#endif
#define USAGE(msg) \
{SLang_verror(SL_USAGE_ERROR, (char*)"Usage: %s", msg); return;}
static void Slirp_usage(int i, int j, int flags);
static int slang_abi_mismatch(void)
{
long module_abi = SLANG_VERSION / 10000;
long app_abi = SLang_Version / 10000;
if (module_abi != app_abi) {
SLang_verror(SL_APPLICATION_ERROR, (char*)
"S-Lang library abi mismatch\nmodule: %s, application: %s",
SLANG_VERSION_STRING, SLang_Version_String);
return 1;
}
return 0;
} /* }}} */
|