[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: scheme file name



Well, it isn't exactly what you are looking for, but I created a Scheme
function called gnetlist:get-command-line which returns the command line
string you used when invoking gnetlist.  The source for the fcn lives in
src/g_netlist.c; it just provides the string pointed to by argv to Scheme.
   It is used in gnet-spice-sdb.scm to get the command line which spice-sdb
puts in the first line of the SPICE file.  

You might find some way to parse the string returned by
gnetlist:get-command-line within Scheme to get what you are looking for.

Alternately, you can create a new function in g_netlist.c which you provide
a command line flag, and it returns the string argument value corresponding
to the flag.  I have written some command-line arg stuff in src/g_netlist.c
which you can look at for inspiration.  In particular, look at
g_get_calling_flags, which lives towards the bottom of the file.

Stuart




Quoting Karel Kulhavy <clock@twibright.com>:

> Hello
> 
> Is it please possible to obtain name of the schematic file in guile
> when I call external guile script from gschem (using "ft")?
> 
> If yes, hwo is called the variable the filename resides in?
> 
> I tried
> file-name
> spice-sdb:file-name
> gschem:file-name
> using (display ... ) command but neither of them worked.
> 
> Cl<
> -- 
> Thanks to all free technology (includes free software) developers for
> the
> technology they are making available to general public.
>