Fixed inconsistent socket io.
[tlb/tomd.git] / include / macros.h
CommitLineData
57c82614
TB
1#ifndef _MACROS_H
2#define _MACROS_H
3
1110e851
TB
4#define tomc_p(...) {printf("[tomc] "); printf(__VA_ARGS__); printf("\n");}
5#define tomd_p(...) {printf("[tomd] "); printf(__VA_ARGS__); printf("\n");}
811f95df 6#define SCM_ARR(arr, index) (scm_list_ref(arr, scm_from_int(index)))
3024ed65
TB
7#define SCM_LIST_LEN(list) (scm_to_int(scm_length(list)))
8#define WRAP_SCM_FUNCTION_1(module, scm_name, name) \
9SCM 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
57c82614 18#endif