File: intro.h.in

package info (click to toggle)
slang-slirp 1.9.5-1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 2,044 kB
  • ctags: 4,817
  • sloc: ansic: 9,669; sh: 3,050; makefile: 697; fortran: 322; cpp: 231; pascal: 6
file content (46 lines) | stat: -rw-r--r-- 1,352 bytes parent folder | download | duplicates (2)
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;
} /* }}} */