X-Git-Url: https://git.hcoop.net/tlb/tomd.git/blobdiff_plain/57c826149f1250aa6fd92b47ef8adb958b7a7432..805d0ff4aa57dabe5cec496f6d7de975ac74f759:/include/macros.h diff --git a/include/macros.h b/include/macros.h index 073768d..75a38b8 100644 --- a/include/macros.h +++ b/include/macros.h @@ -1,6 +1,18 @@ #ifndef _MACROS_H #define _MACROS_H +#define tomc_p(...) {printf("[tomc] "); printf(__VA_ARGS__); printf("\n");} #define tomd_p(...) {printf("[tomd] "); printf(__VA_ARGS__); printf("\n");} - +#define SCM_ARR(arr, index) (scm_list_ref(arr, scm_from_int(index))) +#define SCM_LIST_LEN(list) (scm_to_int(scm_length(list))) +#define WRAP_SCM_FUNCTION_1(module, scm_name, name) \ +SCM name(SCM obj) { \ + static SCM func_ref = SCM_UNDEFINED; \ + if(func_ref == SCM_UNDEFINED){ \ + func_ref = scm_c_public_ref(module, scm_name); \ + } \ + return scm_call(func_ref, obj, SCM_UNDEFINED); \ +} + + #endif