The C function looks like so:
Code: Select all
#define BCON_NEW(...) \
bcon_new (NULL, __VA_ARGS__, NULL)
Code: Select all
(set 'bson-lib "/usr/local/lib/libbson-1.0.so")
;; @Import bson_t * bcon_new (void *unused,...) BSON_GNUC_NULL_TERMINATED;
(import bson-lib "bcon_new" "void*" "void*" "char*" "char*")
;; @syntax (mongo:bcon-new arg1 arg2)
;; @return the point of bson_t
(define (bcon-new arg1 arg2)
(println arg1 "|" arg2)
(bcon_new nil arg1 arg2)
)
(set 'query-ptr (mongo:bcon-new "stats" "test"))
Code: Select all
stats|test
ERR: missing argument
called from user defined function mongo:bcon-new