unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Vladimir Zhbanov <vzhbanov@gmail.com>
To: guile-user@gnu.org
Subject: Lepton EDA 1.9.14 announce and misc questions
Date: Tue, 20 Apr 2021 12:29:54 +0300	[thread overview]
Message-ID: <YH6fElCLamHI7o75@lepton> (raw)

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

Lepton supports Guile 2.0, 2.2, and 3.0.  There are lots of C code
involved and one of our current goals is untangling it and moving
our Scheme functionality to FFI as much as possible.  Hence, the
issue I recently stumbled upon.

Having the following code:

(define-public (sys-data-dirs)
  "Returns a list of search directories for system data."
  (let ((pointer (eda_get_system_data_dirs)))
    (let loop ((num 0)
               (ls '()))
      (let ((string-pointer
             (dereference-pointer
              (make-pointer (+ (pointer-address pointer)
                               (* num (alignof '*)))))))
        (if (null-pointer? string-pointer)
            (reverse ls)
            (loop (1+ num)
                  (cons (pointer->string string-pointer)
                        ls)))))))

is it permissible to use 'alignof' (or 'sizeof') this way here, if
at all?  Or some pitfalls may exist?

The function gets the C array of strings and translates them into
a Scheme list.  I just don't want to write an additional C layer
to process the array, but I'm in doubt if it could shoot me in the
foot on some OS/arch combinations.

Thanks in advance,
  Vladimir



             reply	other threads:[~2021-04-20  9:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-20  9:29 Vladimir Zhbanov [this message]
2021-04-20 12:47 ` Lepton EDA 1.9.14 announce and misc questions Matt Wette
2021-04-20 13:46   ` Matt Wette
2021-04-20 23:36     ` Vladimir Zhbanov
2021-04-21  0:34       ` Matt Wette
2021-04-21  7:53         ` Vladimir Zhbanov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YH6fElCLamHI7o75@lepton \
    --to=vzhbanov@gmail.com \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).