guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

#define SOMETHING some_value


From: Catonano
Subject: #define SOMETHING some_value
Date: Sat, 10 Jun 2017 10:31:20 +0200

The Freexl documentation states that I should call freexl_get_info like this

freexl_get_info(&handler, FREEXL_BIFF_SHEET_COUNT, &outcome);

Now, FREEXL_BIFF_SHEET_COUNT is defined in the header file like this

/** Information query for BIFF sheet count */
#define FREEXL_BIFF_SHEET_COUNT        32010

But at the REPL, when I call my procedure like this

scheme@(freexl common)> (freexl-open "resources/Lavoro_P.xls")
$1 = #<pointer 0x1227f50>
scheme@(freexl common)> (freexl-get-info $1 32010)

I get

ERROR: Throw to key `get-info-error' with args `(error-code -3)'.

That is, an exception is being raised, as you can see in this excerpt of my
code

(define freexl-get-info
  (let* ((ptr     (freexl-func "freexl_get_info"))
         (proc    (pointer->procedure int ptr (list '* unsigned-int '*))))
    (lambda (handle-ptr what)
      (let* ((outcome-ptr (bytevector->pointer (make-bytevector (sizeof
unsigned-int))))
         (result (proc handle-ptr what outcome-ptr)))
    (if (not (= result 0))
        (throw 'get-info-error 'error-code result) <-- THIS IS THE
EXCEPTION BEING RAISED
        outcome-ptr)
    ))))

How do I deal with these #define'd things ?

I tried with both unsigned-int and uint16

Thanks in advance


reply via email to

[Prev in Thread] Current Thread [Next in Thread]