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: Re: type friction C <-> scheme Date: Sun, 11 Jun 2017 20:20:24 +0200 Message-ID: References: <8D9D11EA-92C0-4129-80D3-1962A3AC383B@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1497205255 8720 195.159.176.226 (11 Jun 2017 18:20:55 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 11 Jun 2017 18:20:55 +0000 (UTC) Cc: guile-user@gnu.org To: Matt Wette Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sun Jun 11 20:20:51 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 1dK7Tn-00023c-5H for guile-user@m.gmane.org; Sun, 11 Jun 2017 20:20:51 +0200 Original-Received: from localhost ([::1]:34873 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dK7Ts-0005IB-G7 for guile-user@m.gmane.org; Sun, 11 Jun 2017 14:20:56 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54840) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dK7TP-0005I6-Cd for guile-user@gnu.org; Sun, 11 Jun 2017 14:20:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dK7TO-00057Q-4J for guile-user@gnu.org; Sun, 11 Jun 2017 14:20:27 -0400 Original-Received: from mail-wr0-x236.google.com ([2a00:1450:400c:c0c::236]:35367) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dK7TN-00057I-Pz for guile-user@gnu.org; Sun, 11 Jun 2017 14:20:26 -0400 Original-Received: by mail-wr0-x236.google.com with SMTP id q97so75586898wrb.2 for ; Sun, 11 Jun 2017 11:20:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=4hM2zjiVOlCh8a2UMJXh7/lp/Nqj0j9eUU3VyDwhDjY=; b=g0u8bOUTwtnjIphM3tqDKkqFyrmkRrpZFewOYu1iNk+resJ77ES9NWzJ7J/OQZzJiq YpAgJm7mmurjJqdONNcxjr/D4oww42bd4f2QcPEvyntT6Te7BcMRtmQKfumeMm9JdrTw D1kzAKn7AszXis2v3e0Emngh/XIA55kXGFV1PTqoJ20m2mJgeHTV9b7Erxw254pRTfdB 5M1TEljxpkzB6hsqr0q/UA4QdZbmUNEj9by+cQcAZk9TBYmC063T/cvfQIjSVGAQjnbZ kY1YLeA4K1/QufzR2L1Q5waoAXBGLszgBjBECBWCJkYI8CWpJwW8YwycVrt5x4sqHfuQ hghA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=4hM2zjiVOlCh8a2UMJXh7/lp/Nqj0j9eUU3VyDwhDjY=; b=OItw2NE7haFN54kOqlLbERiHWEM8SoajT7HUtMJsig/VAAiRj0HgM3fE1WQjZsN3UM JN9n36FapS5oInT9dOOsuDSKWpXmiEWuKSo1eZ6EJDL4AmhVjeRl2bzBNC0tzpwdoqPf D95GOE7E3yN7iVnSCF5B+8i0j4/atJzXctU1HP5mX63wzSdz36vKZwaQ9BtToI/wLrcT f76SucbFOPqmZuKDbpsOe1ptk3ql6nahAamTCKpYYvTaDj/m/9F3eKmKL3Z9XStGL6Kd IUTp97WvSdou+/G++BtKAQTetWfPn1zskuJTrkUe5QCpB1hDLNZHKeXd/wW7tUri806N RrhA== X-Gm-Message-State: AODbwcCAogn+3iCbj9YayjBWZhXWeSSm2817i333JigVb2bniQijp+9S 07yuhTeIosqEcQhLxJY28Zbkbny9jJV5 X-Received: by 10.80.137.36 with SMTP id e33mr26501265ede.67.1497205224811; Sun, 11 Jun 2017 11:20:24 -0700 (PDT) Original-Received: by 10.80.131.4 with HTTP; Sun, 11 Jun 2017 11:20:24 -0700 (PDT) In-Reply-To: <8D9D11EA-92C0-4129-80D3-1962A3AC383B@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::236 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:13810 Archived-At: Matt, thank you for spending some time on this 2017-06-11 20:01 GMT+02:00 Matt Wette : > > > On Jun 9, 2017, at 1:36 PM, Catonano wrote: > > > > Here we go again > > > > After successfully wrapping freexl_open, I can't do the same with > > freexl_get_info > > Note that my fyi-helper is not working yet, but here is the current output > if I feed it freexl.h > > ;; > ;; auto-generated by ffi-help.scm > ;; > > (define-module (freexl) > #:use-module (ffi-help) > #:use-module ((system foreign) #:prefix ffi:) > #:use-module ((bytestructures guile) #:prefix bs:) > ) > (define bs:struct bs:bs:struct) > > (define lib-link (dynamic-link #f)) > (define (lib-func name) (dynamic-func name lib-link)) > > ;; (struct . "FreeXL_CellValue_str") > ;; ... failed. > > ;; "FreeXL_CellValue" > > ;; typedef struct FreeXL_CellValue_str FreeXL_CellValue; > (define-std-pointer-wrapper FreeXL_CellValue*) > > ;; "freexl_version" > > ;; extern const char *freexl_version(void); > (define freexl_version > (let ((f (ffi:pointer->procedure > '* > (lib-func "freexl_version") > (list)))) > (lambda () (let () (identity (f)))))) > (export freexl_version) > > ;; "freexl_open" > > ;; extern int freexl_open(const char *path, const void **xls_handle); > (define freexl_open > (let ((f (ffi:pointer->procedure > ffi:int > (lib-func "freexl_open") > (list '* '*)))) > (lambda (path xls_handle) > (let ((~path (identity path)) > (~xls_handle (identity xls_handle))) > (f ~path ~xls_handle))))) > (export freexl_open) > Ok, my version of fffreexl_open does work > > ;; "freexl_open_info" > > ;; extern int freexl_open_info(const char *path, const void **xls_handle); > (define freexl_open_info > > ;; "freexl_close" > > ;; extern int freexl_close(const void *xls_handle); > (define freexl_close > I didn't attempt ffrexxl_open_info and frexxl_close yet > > ;; "freexl_get_info" > > ;; extern int freexl_get_info(const void *xls_handle, unsigned short what, > ;; unsigned int *info); > (define freexl_get_info > (let ((f (ffi:pointer->procedure > ffi:int > (lib-func "freexl_get_info") > (list '* ffi:unsigned-short '*)))) > (lambda (xls_handle what info) > (let ((~xls_handle (identity xls_handle)) > (~info (identity info))) > (f ~xls_handle what ~info))))) > (export freexl_get_info) > this doesn't seem so different from what I did I shoul try to call this one iin the REPL and see what happens Thanks, I'll let you know