From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Matt Wette Newsgroups: gmane.lisp.guile.user Subject: Re: Lepton EDA 1.9.14 announce and misc questions Date: Tue, 20 Apr 2021 06:46:27 -0700 Message-ID: <510bfaf9-aa4f-50cd-deb3-7a15247a9bfa@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5088"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Tue Apr 20 15:47:07 2021 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 1lYqiY-00017B-RH for guile-user@m.gmane-mx.org; Tue, 20 Apr 2021 15:47:06 +0200 Original-Received: from localhost ([::1]:51432 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lYqiX-0002PQ-Vk for guile-user@m.gmane-mx.org; Tue, 20 Apr 2021 09:47:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44468) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lYqi2-0002Mm-L6 for guile-user@gnu.org; Tue, 20 Apr 2021 09:46:36 -0400 Original-Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]:34364) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lYqhy-0004UT-PO for guile-user@gnu.org; Tue, 20 Apr 2021 09:46:34 -0400 Original-Received: by mail-pl1-x62b.google.com with SMTP id t22so19377984ply.1 for ; Tue, 20 Apr 2021 06:46:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=cImFnruQlWXttiqAJlmEwsRHkP31fQEov4fEPxipToQ=; b=oZrFIEr2GF9QZwUlUctrMjsZ7jbsPoP7QSAHjIF3sSPaSpwvtWe48Ru/SbrciYPkBl K4/2jk0M/72ApPoU8RwhnsROJj5oQuJu87GoC6sqg6ERIR3NRY76jOFSu4iji/k1PAWT 1fnq53b10wYjmNQOKVox1NO7bDR7GYV9aZAEaN/vor6xYosxXFVlHskKiGiAvyIfAzz0 yPIHGwsHgjzJ3E1VXmLh2Cy0gqTYMDq5JuhL5uczuvkEB2SMLjJZv9bS6of0a5PZ+P/7 Ye2heLbgQn/lJyd02m2iaKQ160Ri7AdvjMhBd+DNMXeSX2wU7ws+mum7zbFnYFigZdRz UVIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=cImFnruQlWXttiqAJlmEwsRHkP31fQEov4fEPxipToQ=; b=e7Uos46J5DJ+vcCCGWA3xh7EDkE4+A+uWf9rR4vjK0vAIMPATH8i8jNmKkbG1lCRDP LhCBs/+SBaIgID3PthYp3qrCzzyeOd2BxsvdjgzFmjzFD+eXY63rXMiPL8KjKYpw7BIF RXyzRX2z+bZA6o40lgnZgPr7bLbC31cr4gt1LOuElUzfBLlBHNF/sH/dzw9gu7nF/qH8 vdwAhVc64JOJ9fqT4jLvpvziJS6nAF4MqGkggF57DwLPf6Lx321EseLAv2YYWYUYhNzX Anm1q7VVlfLiTOcQOEv1MwVEdN+EPvuWTPG+b0j9yjP7uOoWvT7KNl/G7r/jkuVjraj7 HPSw== X-Gm-Message-State: AOAM532FLRUqesmjsiuX29TCbzvt7eEJTqVvv0N6QoGdG42GmuQW2RXb q4aYQJH0/loiyjZpTpsDSEC4OnlBDeM= X-Google-Smtp-Source: ABdhPJzS/PsM38JxiaHAbILhIzJdmC1D7MS04Ug9qHhePAOFz9oVZHb68xLIob2tGoAU6oL44PkDhg== X-Received: by 2002:a17:902:bd4a:b029:ec:7b39:9738 with SMTP id b10-20020a170902bd4ab02900ec7b399738mr22838048plx.59.1618926388660; Tue, 20 Apr 2021 06:46:28 -0700 (PDT) Original-Received: from [192.168.2.126] (64-52-176-132.championbroadband.com. [64.52.176.132]) by smtp.gmail.com with ESMTPSA id d4sm2239912pfd.137.2021.04.20.06.46.27 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 20 Apr 2021 06:46:28 -0700 (PDT) In-Reply-To: Content-Language: en-US Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=matt.wette@gmail.com; helo=mail-pl1-x62b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.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, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:17427 Archived-At: On 4/20/21 5:47 AM, Matt Wette wrote: > > > On 4/20/21 2:29 AM, Vladimir Zhbanov wrote: >> Hi Guile users and devs, >> >> I'm the current maintainer of Lepton EDA suite, an about five year >> old fork of geda-gaf with accent to moving more functionality to >> Scheme code.  I'm not sure if it is acceptable to advertise it >> here, please let me know if not.  I just know several Guix >> packagers are reading this mailing list and would like to announce >> a new version of Lepton, 1.9.14 has been released on April, 7: >> >> https://github.com/lepton-eda/lepton-eda/releases/tag/1.9.14-20210407 >> >> > > Sweet.  Thanks for posting this.   I will take a look at your problem. > It'll require digging into the eda_..._dirs function. > > > The following should work as a complete program on a system w/ glib. You need to first convert the result to a bytevector and then access the elements (pointers) one at a time.  Note that we don't know how big the array returned from the C function is.  I pick an oversized value of 100. (use-modules (system foreign)) (use-modules (rnrs bytevectors)) (define glib (dynamic-link "libglib-2.0")) (define g-get-system-data-dirs   (let ((f (pointer->procedure         '* (dynamic-func "g_get_system_data_dirs" glib) (list)))     (bv-pointer-ref (cond              ((= (sizeof '*) 8) bytevector-u64-native-ref )              ((= (sizeof '*) 4) bytevector-u32-native-ref )              (else (error "hmmm"))))     (BIG 100))     (lambda ()       (let* ((r (f))          (p (pointer->bytevector r (* BIG (sizeof '*)))))         (let loop ((ix 0))           (let* ((ad (bv-pointer-ref p ix))              (sp (make-pointer ad)))         (if (equal? %null-pointer sp)             '()             (cons (pointer->string sp) (loop (+ ix (sizeof '*))))))))))) (simple-format #t "~S" (g-get-system-data-dirs))