unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* #define SOMETHING some_value
@ 2017-06-10  8:31 Catonano
  2017-06-10  9:51 ` Amirouche Boubekki
  2017-06-10 15:55 ` Matt Wette
  0 siblings, 2 replies; 10+ messages in thread
From: Catonano @ 2017-06-10  8:31 UTC (permalink / raw)
  To: guile-user

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-06-16 16:37 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-10  8:31 #define SOMETHING some_value Catonano
2017-06-10  9:51 ` Amirouche Boubekki
2017-06-11 19:42   ` Mark H Weaver
2017-06-11 20:07     ` Matt Wette
2017-06-15 19:21     ` Matt Wette
2017-06-16 16:37       ` Catonano
2017-06-10 15:55 ` Matt Wette
2017-06-11 17:08   ` Catonano
2017-06-11 20:06     ` Mark H Weaver
2017-06-11 20:32       ` Catonano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).