From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Noah Lavine Newsgroups: gmane.lisp.guile.devel Subject: C Struct Interface Date: Sun, 11 Jul 2010 22:20:33 -0400 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: dough.gmane.org 1278901246 30207 80.91.229.12 (12 Jul 2010 02:20:46 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 12 Jul 2010 02:20:46 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Jul 12 04:20:44 2010 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OY8dN-0005MV-DG for guile-devel@m.gmane.org; Mon, 12 Jul 2010 04:20:41 +0200 Original-Received: from localhost ([127.0.0.1]:53238 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OY8dM-0000p4-AI for guile-devel@m.gmane.org; Sun, 11 Jul 2010 22:20:40 -0400 Original-Received: from [140.186.70.92] (port=34611 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OY8dI-0000ol-Ce for guile-devel@gnu.org; Sun, 11 Jul 2010 22:20:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OY8dH-0005Pz-E8 for guile-devel@gnu.org; Sun, 11 Jul 2010 22:20:36 -0400 Original-Received: from mail-iw0-f169.google.com ([209.85.214.169]:63230) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OY8dH-0005Pt-91 for guile-devel@gnu.org; Sun, 11 Jul 2010 22:20:35 -0400 Original-Received: by iwn2 with SMTP id 2so5310153iwn.0 for ; Sun, 11 Jul 2010 19:20:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=PDQ7YKcefZwGqUq4Q2NtwnTwzWgZrt8YbDIyLzuLzTI=; b=rI+SH7GFYB1hAZsL6icPv8yVNRb752Y/OxJNaf/oEi+HjiTNH7H3MdEhm9dIFqXs6f jCHMA/CXr/JtVDztiG0qsnprY1HAGiW5TVngcqKFQ+7VhZwcS9hlutGkjR/fbuq871XZ qKAPN2N3BSEFoqWg63KCfG1flK7UK5q61TBRQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=MVZ63zQM5xbrzUIiYEZiiNvH2Eg/zXPaaicIoKZZIcms3vyCcRW8vw0WPm+TCqmvrd xTYZAF+XqF+bZRihTS33mwhswtPubNk64n4JRRbfxh5UwwEd9PM8SfyDSdmn28kj1zf8 JZaP7itmRYWZ5JFFM5Nm/vfni7I2rmlG/yUZI= Original-Received: by 10.231.36.13 with SMTP id r13mr12823201ibd.75.1278901233485; Sun, 11 Jul 2010 19:20:33 -0700 (PDT) Original-Received: by 10.231.37.133 with HTTP; Sun, 11 Jul 2010 19:20:33 -0700 (PDT) X-Google-Sender-Auth: ubFs0bvfBg3YDlIRP4ZcYYTnHCI X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:10649 Archived-At: 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