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