Fixed inconsistent socket io.
[tlb/tomd.git] / include / macros.h
1 #ifndef _MACROS_H
2 #define _MACROS_H
3
4 #define tomc_p(...) {printf("[tomc] "); printf(__VA_ARGS__); printf("\n");}
5 #define tomd_p(...) {printf("[tomd] "); printf(__VA_ARGS__); printf("\n");}
6 #define SCM_ARR(arr, index) (scm_list_ref(arr, scm_from_int(index)))
7 #define SCM_LIST_LEN(list) (scm_to_int(scm_length(list)))
8 #define WRAP_SCM_FUNCTION_1(module, scm_name, name) \
9 SCM name(SCM obj) { \
10 static SCM func_ref = SCM_UNDEFINED; \
11 if(func_ref == SCM_UNDEFINED){ \
12 func_ref = scm_c_public_ref(module, scm_name); \
13 } \
14 return scm_call(func_ref, obj, SCM_UNDEFINED); \
15 }
16
17
18 #endif