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: type friction C <-> scheme Date: Fri, 9 Jun 2017 22:36:45 +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 1497040633 2180 195.159.176.226 (9 Jun 2017 20:37:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 9 Jun 2017 20:37:13 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Fri Jun 09 22:37:09 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 1dJQeZ-0000Gx-P9 for guile-user@m.gmane.org; Fri, 09 Jun 2017 22:37:07 +0200 Original-Received: from localhost ([::1]:56314 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dJQef-0007x1-3h for guile-user@m.gmane.org; Fri, 09 Jun 2017 16:37:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42976) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dJQeG-0007wh-RD for guile-user@gnu.org; Fri, 09 Jun 2017 16:36:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dJQeF-0005ps-Ag for guile-user@gnu.org; Fri, 09 Jun 2017 16:36:48 -0400 Original-Received: from mail-wr0-x22d.google.com ([2a00:1450:400c:c0c::22d]:35364) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dJQeF-0005p3-15 for guile-user@gnu.org; Fri, 09 Jun 2017 16:36:47 -0400 Original-Received: by mail-wr0-x22d.google.com with SMTP id q97so44253533wrb.2 for ; Fri, 09 Jun 2017 13:36:46 -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=d2Nsia47J3P2709c1YuAyngJ6KkN6+OufbAEs/beC6E=; b=BRSXI6BD9mgeZD1mPjSkWJdwj7JBW4izSndUaa2MozvbtNKhkGzFPqgZEXZWRLKvGa yWKALeTjF8czI/lGgXjwGhTX0SB7Xf7sDHAnQvcpQYYshBxqTCrW50WqvlCABbdqA4uU qZBVVPUTMBixqmh0cap45d/NWW9n4q3wN64wAKwzlbt84sIlI6YINlA3Nmroq533QzDL Hx43w/U5No9KZrqfoyMjd2Rfu4aFEoxbVIGZFaTwHSgxb+9pzBmmzbBASlCQKpHLhw5c kLeus+3RsPGZvFXpvO12j23Q1TGwYfur3ZA3Exhnwjqe7MX32pZRunoO8o3rbLRqZX4s a0xw== 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=d2Nsia47J3P2709c1YuAyngJ6KkN6+OufbAEs/beC6E=; b=PkfU3qXHt4w9jEudX3u6sB8CEWfZ8oNwyqxaxIQB2j5VePxbWFVHmjyKbLRafZCViK 6gpNx6zrx6PFs3RPSdXM9P5gELKdMd07XyP+UzeszGoRznW1ZpytkEsV+CzifMhui0Qk 3zxg/2CjpyNcXfV5DZoi/PLHb0xuCz45JACtJOLVj519hnIP3fKhxac/yKf2+hpryJLL WlHBpSmgG7erkCALm5CSO/mJQInHp77QfM/Yn8+a7rIo1Xdh36anGPcdpSQanXAYnhPC u+BfIvHhYIc5Rb59LFN3OPdULt1PUmoTBrf+tYVHYY2gvr/pRbvOqajvSAv4DoMPcq2j cAIg== X-Gm-Message-State: AODbwcAF/4S8cb9Pfzu1NI5IWA4GsYF62U9LELP/AkBktJSWN4TWOwN4 kBtxYfyj9rl+2WAShq9L3int/UHN6jn9 X-Received: by 10.80.137.36 with SMTP id e33mr20430304ede.67.1497040605712; Fri, 09 Jun 2017 13:36:45 -0700 (PDT) Original-Received: by 10.80.131.4 with HTTP; Fri, 9 Jun 2017 13:36:45 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::22d 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:13789 Archived-At: Here we go again After successfully wrapping freexl_open, I can't do the same with freexl_get_info One of the arguments expected by such function is "unsigned short" When I load the namespace at the REPL I get scheme@(guile-user)> ,m (freexl common) While executing meta-command: ERROR: In procedure pointer->procedure: Wrong type argument in position 3: int I tried with uint8, uint16 and uint32, with the same result Here's the function I'm referring to https://www.gaia-gis.it/gaia-sins/freexl-1.0.1-doxy-doc/html/freexl_8h.html#ad6dbe072c7a4632853d90f4509bf3aee And here's my code (there are some instructions as comments in the code) https://gitlab.com/humanitiesNerd/guile-freexl And here's an excerpt (define freexl-get-info (let* ((ptr (freexl-func "freexl_get_info")) (proc (pointer->procedure int ptr '(* int *))) ;;the int in the arguments list generates ;;a wrong argument type error when ;;loading the namespace at the REPL, like this ;;scheme@(guile-user)> ,m (freexl common) ;;While executing meta-command: ;;ERROR: In procedure pointer->procedure: Wrong type argument ;;in position 3: int ) (lambda (handle-ptr what) (let* ((outcome-ptr (bytevector->pointer (make-bytevector (sizeof '*)))) (result (proc handle-ptr what outcome-ptr))) (if (not (= result 0)) (throw 'get-info-error 'error-code result) outcome-ptr) )))) Thanks in advance