From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Catonano Newsgroups: gmane.lisp.guile.user Subject: a foreign struct: a shameless request Date: Fri, 16 Jun 2017 18:04:55 +0200 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1497629143 4917 195.159.176.226 (16 Jun 2017 16:05:43 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 16 Jun 2017 16:05:43 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Fri Jun 16 18:05:39 2017 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dLtkg-00010o-7M for guile-user@m.gmane.org; Fri, 16 Jun 2017 18:05:38 +0200 Original-Received: from localhost ([::1]:59672 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dLtkl-00081l-GQ for guile-user@m.gmane.org; Fri, 16 Jun 2017 12:05:43 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51124) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dLtk6-0007sj-1r for guile-user@gnu.org; Fri, 16 Jun 2017 12:05:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dLtk3-0008KC-Or for guile-user@gnu.org; Fri, 16 Jun 2017 12:05:00 -0400 Original-Received: from mail-wm0-x233.google.com ([2a00:1450:400c:c09::233]:35279) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dLtk3-0008J1-Eq for guile-user@gnu.org; Fri, 16 Jun 2017 12:04:59 -0400 Original-Received: by mail-wm0-x233.google.com with SMTP id x70so29973794wme.0 for ; Fri, 16 Jun 2017 09:04:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=vQ+C8g522MLtgrYslKIMS5MEMn6voBNHLZSNx9ogzrU=; b=cp9aGA1GxUzA3Au34U3xV3vQXeRljsEDwPcT99/3Ws2+CeOW3IFVqIEb9hML6NWliR hVbZ17sDXCJU9/8B6ZzTVv28fQ4JLvGQUC3NM3zQfzEhmJWeFjPnz67Xt0oVTglsmVwQ GfOr+x7g22STvOyMf0X01DL7uzL9R+zPY5xQTnRV/KCS26qZRNj1zK+74lUt/mBQV1Al Vt/+8gJSkZUOp6VV+NP86+v1YEyZaBolR26+6eRa+M8lTztH9PfZrdiD7RhqHly/7bKh El5jWZc5Qoir2mtdoK+cmI0EV/g8VuDpyMntm8VtvnW48Ao6UTUl7MEzOGYX8sJOEaiC HDLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=vQ+C8g522MLtgrYslKIMS5MEMn6voBNHLZSNx9ogzrU=; b=jn36VrGcq3d8i6vifAm4QZiqcQ7ey7LU1C8MIWOO5O4omT1f+DmUgqrfekWhkQboM7 m2NQKgE1TJi00wD6V//Mvkc2ld7fTo5urpok5K/01hDFPSJQJmI4IoC72veO/r6bsYdl 0hP9UK4uhRGySxsDcacPZeKhyUDM09fb9pDSchHJahFswEMnXRxYY38XcfEfzj4P98/6 UznxSJCF93SWsGKXjaU5+B4ptAOobdaNDizbDt0oeNVtBMOE4Yu+2RlC5qIsCPrAXIj9 lFQaAoKj2U1efj+rdXd+D5r0kkH4E1ip9In7t5RaWwPFhr4MRzkPbXF5YED41iKzriGd ZZGA== X-Gm-Message-State: AKS2vOzm8CSBU7tcR0ejuWuTbu1WKrjv5be8R8v5i9rvU11blQSBLMd9 oIj5oXxPlSqQULJQ3PIjQMU5USp7+tO5 X-Received: by 10.80.149.132 with SMTP id w4mr7941922eda.82.1497629096320; Fri, 16 Jun 2017 09:04:56 -0700 (PDT) Original-Received: by 10.80.131.4 with HTTP; Fri, 16 Jun 2017 09:04:55 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::233 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:13840 Archived-At: I'd love to see a template of usage of a complex structure from scheme That is, I'm asking for someone to write that template for me :-/ This is the foreign struct I have to deal with https://www.gaia-gis.it/gaia-sins/freexl-1.0.1-doxy-doc/html/structFreeXL__CellValue__str.html Particulary, I don't know how to treat the "union" thing A different union field gets populated on the basis of the type of the content of the spreadsheet cell If the cell contains an integer number, then cell.int_value field gets populated If the cell contains a double float number, then the cell.double_value field gets populated And so on This is an excerpt from the example usage: switch (cell.type ) { case FREEXL_CELL_INT : printf (", %d", cell.value .int_value ); break; ... How do I use "make-c-struct" and "parse-c-struct" with a structure like this ? Thanks in advance