From: Catonano <catonano@gmail.com>
To: guile-user@gnu.org
Subject: #define SOMETHING some_value
Date: Sat, 10 Jun 2017 10:31:20 +0200 [thread overview]
Message-ID: <CAJ98PDxa0zZtzbmuaBJHRiaQKxMkpLBHTkrDnsUppuS4kxzSKg@mail.gmail.com> (raw)
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
next reply other threads:[~2017-06-10 8:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-10 8:31 Catonano [this message]
2017-06-10 9:51 ` #define SOMETHING some_value 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAJ98PDxa0zZtzbmuaBJHRiaQKxMkpLBHTkrDnsUppuS4kxzSKg@mail.gmail.com \
--to=catonano@gmail.com \
--cc=guile-user@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).