From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tim Meehan Newsgroups: gmane.lisp.guile.user Subject: Re: guile-user Digest, Vol 216, Issue 19 Date: Wed, 25 Nov 2020 11:15:16 -0600 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7582"; mail-complaints-to="usenet@ciao.gmane.io" Cc: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Wed Nov 25 18:15:46 2020 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1khyOQ-0001sr-FM for guile-user@m.gmane-mx.org; Wed, 25 Nov 2020 18:15:46 +0100 Original-Received: from localhost ([::1]:39508 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1khyOP-00039i-IE for guile-user@m.gmane-mx.org; Wed, 25 Nov 2020 12:15:45 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44278) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1khyOB-00039Z-3h for guile-user@gnu.org; Wed, 25 Nov 2020 12:15:31 -0500 Original-Received: from mail-qv1-xf2a.google.com ([2607:f8b0:4864:20::f2a]:37692) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1khyO9-00089y-Kw for guile-user@gnu.org; Wed, 25 Nov 2020 12:15:30 -0500 Original-Received: by mail-qv1-xf2a.google.com with SMTP id k3so1273498qvz.4 for ; Wed, 25 Nov 2020 09:15:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:cc; bh=T17saAEqATXcPG7iPpmZn8bTWQ7oENoo7vTM6WQrSjs=; b=uYixi2HK0xeWXxbWRk4tmIMHCWL3vXBRAuJ0XFkKXhOubgKt2KlnzepXewF+zLTShK IxknwU/g84K6AZP33IZjocHBBsRapsmder4wDJF7YVgEP7pUPhD4Hkqr7UtiDBU2RWzo jS9VlsIWXUCBx29DUyMYxGdEEIkky7E0HvYWWT2WZLrqKJH58ClL2P2A2ezBvPjdhYrE t2HJvbaw32ErKbEcQPGg3+QZue1xoFc0Q0dDAizYNZFP/QX9Dc8vMjFX0TqGeDDgT27o h4+iHxoOZsL7SCeUEsuq81xKfOGWOzT26RVOurZWyGalZHRkliwp/1QCZHPdjfZodhlx saDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:cc; bh=T17saAEqATXcPG7iPpmZn8bTWQ7oENoo7vTM6WQrSjs=; b=cy8FtKu2h22aeb3SIxR7H8FksPivu4nlCcyAzTP0LeSWLemI8hsU15LjTeToogTiA4 oVvhe8HoQKeFK8D/wPBVoVREAyujpZ4loay7L6m73d/3ORO7U8idbut+2SOEAArQUDWY fl3hPSzZ7CmmEEaI/rUT3hV9iA2cWOI1z1AwOIQHgPXfMmSixRh64OidhebUAqGahI/f bixu+6clJeEJIUv9Bs2gNa98bDWqBy39Iqo+Tsr1hKeIcTPwKWARI8CxvVZYSyld+/3L YXbOXLOUiCc8kLWUjqw083efzUTEXzR7Sd+K46avFenM8RDAJfmjr6zY8kj+taY7VlBj H4/g== X-Gm-Message-State: AOAM530jbx5WcgKvNLqU3jYg5NMDsVOMWs5Wvgh8F+WkyQ8RGpauKCK/ 3vMY+A2l/T6SWffxL6tP+vtvNIpGkVFVlGrl92C16Y14 X-Google-Smtp-Source: ABdhPJxr2md06ipAqb7+y1ddhvJnk+XuWy6v+RcpnDSBzgBrraoHaxq+26oUq662tWVR8PB3iStuPFM0relY3jAt3w8= X-Received: by 2002:a0c:b29b:: with SMTP id r27mr4669822qve.50.1606324527777; Wed, 25 Nov 2020 09:15:27 -0800 (PST) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::f2a; envelope-from=btmeehan@gmail.com; helo=mail-qv1-xf2a.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, MISSING_HEADERS=1.021, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:17057 Archived-At: Hi Adriano, I hope you mean the int pointer example and not the GTK example. I wasn't able to get the GTK example working. The int pointer example worked like this: // C code, compiled with: // gcc stuff.c -o libstuff.so -fPIC -shared void increment_intptr(int *a) { *a += 1; } ;; Guile source (use-modules (system foreign) (rnrs bytevectors)) (define libstuff (dynamic-link "./libstuff.so")) (define increment (pointer->procedure void (dynamic-func "increment_intptr" libstuff) (list '*))) (let ([b (make-bytevector (sizeof int))]) (display b) (newline) (increment (bytevector->pointer b)) (display b) (newline)) On Wed, Nov 25, 2020 at 6:17 AM Adriano Peluso wrote: > Il giorno mar, 24/11/2020 alle 15.26 -0600, Tim Meehan ha scritto: > > Matt - thanks for the help making the FFI pointers work! > > Would you mind publishing the working version of your code ? > > > >