delorie.com/archives/browse.cgi   search  
Mail Archives: geda-user/2016/01/21/08:23:51

X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f
X-Recipient: geda-user AT delorie DOT com
X-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20120113;
h=mime-version:in-reply-to:references:date:message-id:subject:from:to
:content-type;
bh=eHZ2QQQYusUK6xKXM5zDGO6s3fvncYFxlSf741Wx/eQ=;
b=gyemMBkBv31aj2TrBs7sy7++FF4oUdVAHg1zRzed4lYkjcqq4ImTBhze/dtoan7Fsh
YzU/nbFLXJXAsI7X+8aAch+hiw/lNuiATrvku18g41rRFD3ALDAqA0grwEM1OscSxFoM
jAVwfZYo3DO3fq4PRoenNRWSPQsqj7aUCvdpreUuPZbgIAA3FpYV/HedHbb21vEzkmn6
64vsH7gKSwECMi/31Ze9Nrr4slLGwNDSGniMk8NXvIt8bNa6BO5lFwOrwuoC5zHofhe/
/9jrM6NzSXjsCS7i32UxDRxC7Y/+uLgbBfDJYU35KXJce1RPdgYYMzg6fzTbYekY1wcJ
m/vw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20130820;
h=x-gm-message-state:mime-version:in-reply-to:references:date
:message-id:subject:from:to:content-type;
bh=eHZ2QQQYusUK6xKXM5zDGO6s3fvncYFxlSf741Wx/eQ=;
b=VWlr/5/Q8fitEi2kL3YXQUr9tZXdeQx5Oet4wuYeWkmMl4l7NMcZY58luxYAP14Jr7
XlHIgTjxe5Ps+mUigorgl6Z02Yt0d/Goxh9g1p5Vofe9rpm7sxYBCKLGIP7rLxC5y8H8
eeqJmdNxMdgNBcNmJbW2oA4yXccGh6CQsiWlT9BynVultHNdiVR4fufnZWtwF9vPNdbz
kJnDHHdxuQnphVYejrtB1DLNdolYAvOPUG28Sx7S/aNTKqAAVRZre96m0lxBY1qMSs7h
c3H0gK8NAWMSy7Ny866xBY88yMpndjCUrOe4plPpeGyetqbQzKOzE+vu935QKx1x/Sb0
C3GQ==
X-Gm-Message-State: ALoCoQntpAJU04TswSGU5AQ+2gCU8tpHSjCcI3ztYJ5DpmLL2phHIkye56fiHToolO9ZEzqZN0iMLiOtpWD516sOptWnFmnmKw==
MIME-Version: 1.0
X-Received: by 10.194.243.6 with SMTP id wu6mr41009032wjc.14.1453382507350;
Thu, 21 Jan 2016 05:21:47 -0800 (PST)
In-Reply-To: <20160102131252.F383A809D79A@turkos.aspodata.se>
References: <20160102091556 DOT BBC6D809D79B AT turkos DOT aspodata DOT se>
<CAJXU7q_Zwyfpcb4g00QCFNTjQ9Le2Tm8WjKz3CKMnNXb7gMceg AT mail DOT gmail DOT com>
<20160102131252 DOT F383A809D79A AT turkos DOT aspodata DOT se>
Date: Thu, 21 Jan 2016 16:21:47 +0300
Message-ID: <CAMvDHVCi5wR78jybhOEG0EmKyqWVpeaoYFuyWkWSrtkxF7kXQw@mail.gmail.com>
Subject: Re: [geda-user] should we broaden scope of libgeda
From: "Vladimir Zhbanov (vzhbanov AT gmail DOT com) [via geda-user AT delorie DOT com]" <geda-user AT delorie DOT com>
To: geda-user AT delorie DOT com
Reply-To: geda-user AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: geda-user AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

--089e0149414612d14e0529d7fc8e
Content-Type: text/plain; charset=UTF-8

Karl,

On 1/2/16, karl AT aspodata DOT se <karl AT aspodata DOT se> wrote:
...
> So currently, if I want to write an "get all syms that this sch file
> referencs"-program I have to do it in c or don't use libgeda at all.
>
> I thought that kind of program could be a nice way to learn a
> little scheme, but the infrastructure wasn't there.

You were wrong ;)

The attached script will do just what you want.

You can extend it, if you want, say, by adding menu entry for it, or
probably add a hook to run it automatically at exit, or make the cache
dir name configurable and so on.

Installation:
  - place the file into your ~/.gEDA;
  - add somewhere in your ~/.gEDA/gschemrc the line:
    (load "cache-symbols.scm")

Usage:
  - make the "sym" directory in the current directory
  - open gschem
  - hit ":" to open command line
  - type (cache-symbols)
  - hit Enter

That's all.

I believe the script will work as well using 'gaf shell' if anybody
want to run it from Makefile. Didn't check though.

Obviously, the script mistakenly assumes that the cache dir already
exist. Fixing this would be a little exercise for the user. Hint: you
may probably want to look through the section "File System" of the
chapter "POSIX" in the guile manual.

If anybody want to do the same things in C, please do, it is doable,
and we'll compare results ;)

Cheers,
  Vladimir

--089e0149414612d14e0529d7fc8e
Content-Type: application/octet-stream; name="cache-symbols.scm"
Content-Disposition: attachment; filename="cache-symbols.scm"
Content-Transfer-Encoding: base64
X-Attachment-Id: file0

Ozs7IERvIHlvdSBuZWVkIGFueSBjb3B5cmlnaHQgaGVyZT8gT3IgcHJvYmFibHkgY29weWxlZnQ/
IEkgZG9uJ3QuCgo7OzsgV2FybmluZzogdGhlIGZ1bmN0aW9ucyBiZWxvdyB3aWxsIHNpbGVudGx5
IG92ZXJ3cml0ZSB5b3VyIHN5bWJvbHMKOzs7IGluIHRoZSBkaXJlY3Rvcnkgc3BlY2lmaWVkIGlu
IHRoZSAnY2FjaGUtZGlyLW5hbWUnIHZhcmlhYmxlCgoodXNlLW1vZHVsZXMgKGdlZGEgcGFnZSkg
KGdlZGEgb2JqZWN0KSAoc3JmaSBzcmZpLTEpKQoKOzs7IFByZWRlZmluZWQgY2FjaGUgZGlyIG5h
bWUKKGRlZmluZSBjYWNoZS1kaXItbmFtZSAic3ltIikKCjs7OyBTdG9sZW4gZnJvbSB0aGUgJ2Zv
bGQnIGZ1bmN0aW9uIGRlc2NyaXB0aW9uIGluIHRoZSBndWlsZSBpbmZvIG1hbnVhbAooZGVmaW5l
IChkZWxldGUtYWRqYWNlbnQtZHVwbGljYXRlcyBscykKICAoZm9sZC1yaWdodCAobGFtYmRhIChl
bGVtIHJldCkKICAgICAgICAgICAgICAgIChpZiAoc3RyaW5nPT8gZWxlbSAoZmlyc3QgcmV0KSkK
ICAgICAgICAgICAgICAgICAgICByZXQKICAgICAgICAgICAgICAgICAgICAoY29ucyBlb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G9m
IFBBR0UKKGRlZmluZSAoZ2V0LXVuaXF1ZS1jb21wb25lbnQtbmFtZXMgcGFnZSkKICAobGV0KiAo
KGNvbXBvbmVudHMgKGZpbHRlciBjb21wb25lbnQ/IChwYWdlLWNvbnRlbnRzIHBhZ2UpKSkKICAg
ICAgICAgKGJhc2VuYW1lcyAobWFwIGNvbXBvbmVudC1iYXNlbmFtZSBjb21wb25lbnRzKSkgICAg
ICAgICApCiAgICAoZGVsZXRlLWFkamFjZW50LWR1cGxpY2F0ZXMgKHNvcnQgYmFzZW5hbWVzIHN0
cmluZzw/KSkpKQoKOzs7IFNhdmUgYWxsIHN5bWJvbHMgb2YgUEFHRSB0byBjYWNoZSBkaXJlY3Rv
cnkKKGRlZmluZSAoY2FjaGUtcGFnZS1zeW1ib2xzIHBhZ2UpCiAgKGZvci1lYWNoCiAgIGNhY2hl
LXN5bWJvbAogICAoZ2V0LXVuaXF1ZS1jb21wb25lbnQtbmFtZXMgcGFnZSkpKQoKOzs7IFNhdmUg
YWxsIHN5bWJvbHMgb2YgYWxsIG9wZW4gcGFnZXMgdG8gY2FjaGUgZGlyZWN0b3J5CihkZWZpbmUg
KGNhY2hlLXN5bWJvbHMpCiAgKGZvci1lYWNoIGNhY2hlLXBhZ2Utc3ltYm9scyAoYWN0aXZlLXBh
Z2VzKSkpCg==
--089e0149414612d14e0529d7fc8e--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019