unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Noah Lavine <noah.b.lavine@gmail.com>
To: guile-devel@gnu.org
Subject: C Struct Interface
Date: Sun, 11 Jul 2010 22:20:33 -0400	[thread overview]
Message-ID: <AANLkTile2rZbZQSuJiFVFLiY_vHcq59hq-y-yWYSEn_F@mail.gmail.com> (raw)

Hello,

I'm trying to use Scheme structures, as defined in struct.c and
struct.h, and I have a question about the interface.

It seems from the code that scm_c_make_structv(vtable, ntail, ninit,
inits) is the main function for creating structs. I'm assuming that
ntail is the number of elements in the tail array of the struct, ninit
is the total number of elements I want to init, and inits is an array
containing the initial values. Is this correct?

Also, if I make a struct in this way, can I then do
SCM_STRUCT_SLOT_REF(struct, n) to get at it, where n=0 is the first
slot?

Thanks,
Noah



             reply	other threads:[~2010-07-12  2:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-12  2:20 Noah Lavine [this message]
2010-07-13 21:18 ` C Struct Interface Andy Wingo

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=AANLkTile2rZbZQSuJiFVFLiY_vHcq59hq-y-yWYSEn_F@mail.gmail.com \
    --to=noah.b.lavine@gmail.com \
    --cc=guile-devel@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).