[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: branch: master updated (1.3.0-20071229-47-gaafa53b)
The branch, master has been updated
via aafa53bb3e4b248e178a654883db2ba1177c5750 (commit)
via 82dd20fe6d7a5022cebcc40c2a6ad73af230901c (commit)
from c29a844384a176d2880ee47aac8999ef017e50a2 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
gnetlist/scheme/Makefile.am | 3 +-
gnetlist/scheme/gnetlist-post.scm | 171 +++++++++++++++++++++++++++++
gnetlist/scheme/gnetlist.scm | 152 --------------------------
gnetlist/src/gnetlist.c | 214 +++++++++++++++++++------------------
4 files changed, 283 insertions(+), 257 deletions(-)
create mode 100644 gnetlist/scheme/gnetlist-post.scm
=================
Commit Messages
=================
commit aafa53bb3e4b248e178a654883db2ba1177c5750
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date: Thu Jan 10 00:25:20 2008 +0000
gnetlist: Load gnetlist.scm and backend before schematic traversal.
Allows gnetlist.scm and backends to define scheme procedures and
variables which may be used to control the schematic traversal process.
Since some portions of of gnetlist.scm are evaluated immediately upon
load, yet require execution _after_ schematic traversal, these portions
have been split out from gnetlist.scm into a new file, gnetlist-post.scm
which is loaded after traversal.
The moved definitions are those of "packages", "all-unique-nets",
"all-nets", "all-pins", and the refdes aliasing functionality.
:100644 100644 43f2b96... 43d69bf... M gnetlist/scheme/Makefile.am
:000000 100644 0000000... bfb4ae3... A gnetlist/scheme/gnetlist-post.scm
:100644 100644 bddf66a... 19ba899... M gnetlist/scheme/gnetlist.scm
:100644 100644 c1ec95e... 09ddd88... M gnetlist/src/gnetlist.c
commit 82dd20fe6d7a5022cebcc40c2a6ad73af230901c
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date: Wed Jan 9 23:00:55 2008 +0000
Change some tabs in gnetlist.c to spaces. Alter some other whitespace.
:100644 100644 9a0cafa... c1ec95e... M gnetlist/src/gnetlist.c
=========
Changes
=========
commit aafa53bb3e4b248e178a654883db2ba1177c5750
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date: Thu Jan 10 00:25:20 2008 +0000
gnetlist: Load gnetlist.scm and backend before schematic traversal.
Allows gnetlist.scm and backends to define scheme procedures and
variables which may be used to control the schematic traversal process.
Since some portions of of gnetlist.scm are evaluated immediately upon
load, yet require execution _after_ schematic traversal, these portions
have been split out from gnetlist.scm into a new file, gnetlist-post.scm
which is loaded after traversal.
The moved definitions are those of "packages", "all-unique-nets",
"all-nets", "all-pins", and the refdes aliasing functionality.
diff --git a/gnetlist/scheme/Makefile.am b/gnetlist/scheme/Makefile.am
index 43f2b96..43d69bf 100644
--- a/gnetlist/scheme/Makefile.am
+++ b/gnetlist/scheme/Makefile.am
@@ -11,7 +11,8 @@ scmdata_DATA = $(DIST_SCM) $(BUILT_SCM)
DIST_SCM = gnet-PCB.scm gnet-allegro.scm gnet-bom.scm gnet-geda.scm \
gnet-spice.scm gnet-tango.scm gnet-verilog.scm \
gnet-vhdl.scm gnet-vipec.scm \
- gnet-pads.scm gnetlist.scm gnet-bae.scm gnet-protelII.scm \
+ gnet-pads.scm gnetlist.scm gnetlist-post.scm \
+ gnet-bae.scm gnet-protelII.scm \
gnet-bom2.scm gnet-gossip.scm gnet-drc.scm gnet-vams.scm \
gnet-partslist-common.scm gnet-partslist1.scm \
gnet-partslist2.scm gnet-partslist3.scm gnet-maxascii.scm \
diff --git a/gnetlist/scheme/gnetlist-post.scm b/gnetlist/scheme/gnetlist-post.scm
new file mode 100644
index 0000000..bfb4ae3
--- /dev/null
+++ b/gnetlist/scheme/gnetlist-post.scm
@@ -0,0 +1,171 @@
+;;; gEDA - GPL Electronic Design Automation
+;;; gnetlist - gEDA Netlist
+;;; Copyright (C) 1998-2007 Ales Hvezda
+;;; Copyright (C) 1998-2007 gEDA Contributors (see ChangeLog for details)
+;;;
+;;; This program is free software; you can redistribute it and/or modify
+;;; it under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 2 of the License, or
+;;; (at your option) any later version.
+;;;
+;;; This program is distributed in the hope that it will be useful,
+;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with this program; if not, write to the Free Software
+;;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+
+;; get all packages for a particular schematic page
+;; eventually placeholder will be either the hierarchical level or something
+;; of the sort
+(define packages
+ (gnetlist:get-packages "placeholder"))
+
+;; return a list of all unique the nets in the design
+(define all-unique-nets
+ (gnetlist:get-all-unique-nets "placeholder"))
+
+;; return a list of all the nets in the design
+;; Might return duplicates
+(define all-nets
+ (gnetlist:get-all-nets "placeholder"))
+
+
+;; not very useful, but amusing
+(define all-pins
+ (map gnetlist:get-pins packages))
+
+
+;;
+;; Functions for dealing with naming requirements for different
+;; output netlist formats which may be more restrictive than
+;; gEDA's internals.
+;;
+
+;; These will become hash tables which provide the mapping
+;; from gEDA net name to netlist net name and from netlist
+;; net name to gEDA net name.
+(define gnetlist:net-hash-forward (make-hash-table (length all-nets)))
+(define gnetlist:net-hash-reverse (make-hash-table (length all-nets)))
+
+;; These will become hash tables which provide the mapping
+;; from gEDA refdes to netlist refdes and from netlist
+;; refdes to gEDA refdes.
+(define gnetlist:refdes-hash-forward (make-hash-table (length packages)))
+(define gnetlist:refdes-hash-reverse (make-hash-table (length packages)))
+
+;; build the hash tables with the net name mappings and
+;; while doing so, check for any shorts which are created
+;; by modifying the netnames. If a short occurs, error out
+;; with a descriptive message.
+;;
+;; This function should be called as one of the first steps
+;; in a netlister which needs to alias nets.
+(define gnetlist:build-net-aliases
+ (lambda (mapfn nets)
+ (if (not (null? nets))
+ (begin
+ (let ( (net (car nets))
+ (alias (mapfn (car nets)))
+ )
+
+ (if (hash-ref gnetlist:net-hash-reverse alias)
+ (begin
+ (display "***** ERROR *****\n")
+ (display "There is a net name collision!\n")
+ (display "The net called \"")
+ (display net)
+ (display "\" will be remapped\nto \"")
+ (display alias)
+ (display "\" which is already used\n")
+ (display "by the net called \"")
+ (display (hash-ref gnetlist:net-hash-reverse alias))
+ (display "\".\n")
+ (display "This may be caused by netname attributes colliding with other netnames\n")
+ (display "due to truncation of the name, case insensitivity, or\n")
+ (display "other limitations imposed by this netlist format.\n")
+ (error)
+ )
+ )
+ (hash-create-handle! gnetlist:net-hash-forward net alias)
+ (hash-create-handle! gnetlist:net-hash-reverse alias net )
+ (gnetlist:build-net-aliases mapfn (cdr nets))
+ )
+ )
+ )
+ )
+ )
+
+;; build the hash tables with the refdes mappings and
+;; while doing so, check for any name clashes which are created
+;; by modifying the refdes's. If a name clash occurs, error out
+;; with a descriptive message.
+;;
+;; This function should be called as one of the first steps
+;; in a netlister which needs to alias refdes's.
+(define gnetlist:build-refdes-aliases
+ (lambda (mapfn refdeses)
+ (if (not (null? refdeses))
+ (begin
+ (let ( (refdes (car refdeses))
+ (alias (mapfn (car refdeses)))
+ )
+
+ (if (hash-ref gnetlist:refdes-hash-reverse alias)
+ (begin
+ (display "***** ERROR *****\n")
+ (display "There is a refdes name collision!\n")
+ (display "The refdes \"")
+ (display refdes)
+ (display "\" will be mapped\nto \"")
+ (display alias)
+ (display "\" which is already used\n")
+ (display "by \"")
+ (display (hash-ref gnetlist:refdes-hash-reverse alias))
+ (display "\".\n")
+ (display "This may be caused by refdes attributes colliding with others\n")
+ (display "due to truncation of the refdes, case insensitivity, or\n")
+ (display "other limitations imposed by this netlist format.\n")
+ (error)
+ )
+ )
+ (hash-create-handle! gnetlist:refdes-hash-forward refdes alias)
+ (hash-create-handle! gnetlist:refdes-hash-reverse alias refdes )
+ (gnetlist:build-refdes-aliases mapfn (cdr refdeses))
+ )
+ )
+ )
+ )
+ )
+
+;; convert a gEDA netname into an output netlist net name
+(define gnetlist:alias-net
+ (lambda (net)
+ (hash-ref gnetlist:net-hash-forward net)
+ )
+ )
+
+;; convert a gEDA refdes into an output netlist refdes
+(define gnetlist:alias-refdes
+ (lambda (refdes)
+ (hash-ref gnetlist:refdes-hash-forward refdes)
+ )
+ )
+
+;; convert an output netlist net name into a gEDA netname
+(define gnetlist:unalias-net
+ (lambda (net)
+ (hash-ref gnetlist:net-hash-reverse net)
+ )
+ )
+
+;; convert an output netlist refdes into a gEDA refdes
+(define gnetlist:unalias-refdes
+ (lambda (refdes)
+ (hash-ref gnetlist:refdes-hash-reverse refdes)
+ )
+ )
+
diff --git a/gnetlist/scheme/gnetlist.scm b/gnetlist/scheme/gnetlist.scm
index bddf66a..19ba899 100644
--- a/gnetlist/scheme/gnetlist.scm
+++ b/gnetlist/scheme/gnetlist.scm
@@ -94,23 +94,6 @@
)
)
-
-;; get all packages for a particular schematic page
-;; eventually placeholder will be either the hierarchical level or something
-;; of the sort
-(define packages
- (gnetlist:get-packages "placeholder"))
-
-;; return a list of all unique the nets in the design
-(define all-unique-nets
- (gnetlist:get-all-unique-nets "placeholder"))
-
-
-;; return a list of all the nets in the design
-;; Might return duplicates
-(define all-nets
- (gnetlist:get-all-nets "placeholder"))
-
;;
;; Given a uref, returns the device attribute value (unknown if not defined)
;;
@@ -140,10 +123,6 @@
(lambda (package)
(gnetlist:get-pins package)))
-;; not very useful, but amusing
-(define all-pins
- (map gnetlist:get-pins packages))
-
;; this is really crude, but I'm tired... :)
(define display-nl
(lambda (list)
@@ -270,134 +249,3 @@
; (run-test "one two three four five six seven eight nine ten" 5)
; (run-test "one two three four five six seven eight nine ten" 10)
; (run-test "one two three four five six seven eight nine ten" 20)
-
-
-;;
-;; Functions for dealing with naming requirements for different
-;; output netlist formats which may be more restrictive than
-;; gEDA's internals.
-;;
-
-;; These will become hash tables which provide the mapping
-;; from gEDA net name to netlist net name and from netlist
-;; net name to gEDA net name.
-(define gnetlist:net-hash-forward (make-hash-table (length all-nets)))
-(define gnetlist:net-hash-reverse (make-hash-table (length all-nets)))
-
-;; These will become hash tables which provide the mapping
-;; from gEDA refdes to netlist refdes and from netlist
-;; refdes to gEDA refdes.
-(define gnetlist:refdes-hash-forward (make-hash-table (length packages)))
-(define gnetlist:refdes-hash-reverse (make-hash-table (length packages)))
-
-;; build the hash tables with the net name mappings and
-;; while doing so, check for any shorts which are created
-;; by modifying the netnames. If a short occurs, error out
-;; with a descriptive message.
-;;
-;; This function should be called as one of the first steps
-;; in a netlister which needs to alias nets.
-(define gnetlist:build-net-aliases
- (lambda (mapfn nets)
- (if (not (null? nets))
- (begin
- (let ( (net (car nets))
- (alias (mapfn (car nets)))
- )
-
- (if (hash-ref gnetlist:net-hash-reverse alias)
- (begin
- (display "***** ERROR *****\n")
- (display "There is a net name collision!\n")
- (display "The net called \"")
- (display net)
- (display "\" will be remapped\nto \"")
- (display alias)
- (display "\" which is already used\n")
- (display "by the net called \"")
- (display (hash-ref gnetlist:net-hash-reverse alias))
- (display "\".\n")
- (display "This may be caused by netname attributes colliding with other netnames\n")
- (display "due to truncation of the name, case insensitivity, or\n")
- (display "other limitations imposed by this netlist format.\n")
- (error)
- )
- )
- (hash-create-handle! gnetlist:net-hash-forward net alias)
- (hash-create-handle! gnetlist:net-hash-reverse alias net )
- (gnetlist:build-net-aliases mapfn (cdr nets))
- )
- )
- )
- )
- )
-
-;; build the hash tables with the refdes mappings and
-;; while doing so, check for any name clashes which are created
-;; by modifying the refdes's. If a name clash occurs, error out
-;; with a descriptive message.
-;;
-;; This function should be called as one of the first steps
-;; in a netlister which needs to alias refdes's.
-(define gnetlist:build-refdes-aliases
- (lambda (mapfn refdeses)
- (if (not (null? refdeses))
- (begin
- (let ( (refdes (car refdeses))
- (alias (mapfn (car refdeses)))
- )
-
- (if (hash-ref gnetlist:refdes-hash-reverse alias)
- (begin
- (display "***** ERROR *****\n")
- (display "There is a refdes name collision!\n")
- (display "The refdes \"")
- (display refdes)
- (display "\" will be mapped\nto \"")
- (display alias)
- (display "\" which is already used\n")
- (display "by \"")
- (display (hash-ref gnetlist:refdes-hash-reverse alias))
- (display "\".\n")
- (display "This may be caused by refdes attributes colliding with others\n")
- (display "due to truncation of the refdes, case insensitivity, or\n")
- (display "other limitations imposed by this netlist format.\n")
- (error)
- )
- )
- (hash-create-handle! gnetlist:refdes-hash-forward refdes alias)
- (hash-create-handle! gnetlist:refdes-hash-reverse alias refdes )
- (gnetlist:build-refdes-aliases mapfn (cdr refdeses))
- )
- )
- )
- )
- )
-
-;; convert a gEDA netname into an output netlist net name
-(define gnetlist:alias-net
- (lambda (net)
- (hash-ref gnetlist:net-hash-forward net)
- )
- )
-
-;; convert a gEDA refdes into an output netlist refdes
-(define gnetlist:alias-refdes
- (lambda (refdes)
- (hash-ref gnetlist:refdes-hash-forward refdes)
- )
- )
-
-;; convert an output netlist net name into a gEDA netname
-(define gnetlist:unalias-net
- (lambda (net)
- (hash-ref gnetlist:net-hash-reverse net)
- )
- )
-
-;; convert an output netlist refdes into a gEDA refdes
-(define gnetlist:unalias-refdes
- (lambda (refdes)
- (hash-ref gnetlist:refdes-hash-reverse refdes)
- )
- )
diff --git a/gnetlist/src/gnetlist.c b/gnetlist/src/gnetlist.c
index c1ec95e..09ddd88 100644
--- a/gnetlist/src/gnetlist.c
+++ b/gnetlist/src/gnetlist.c
@@ -268,18 +268,10 @@ void main_prog(void *closure, int argc, char *argv[])
s_page_print_all(pr_current);
#endif
- s_traverse_init();
- s_traverse_start(pr_current);
-
/* temporarly reuse input_str */
sprintf(input_str, "%s%cgnetlist.scm", pr_current->scheme_directory,
G_DIR_SEPARATOR);
- /* Change back to the directory where we started AGAIN. This is done */
- /* because the s_traverse functions can change the Current Working Directory. */
- chdir(cwd);
- free(cwd); /* allocated by getcwd, so this should stay as free() */
-
if (g_read_file(input_str) != -1) {
s_log_message("Read init scm file [%s]\n", input_str);
} else {
@@ -318,7 +310,28 @@ void main_prog(void *closure, int argc, char *argv[])
}
/* Free now the list of configuration files */
g_slist_free(post_backend_list);
+ }
+
+ s_traverse_init();
+ s_traverse_start(pr_current);
+ /* Change back to the directory where we started AGAIN. This is done */
+ /* because the s_traverse functions can change the Current Working Directory. */
+ chdir(cwd);
+ free(cwd); /* allocated by getcwd, so this should stay as free() */
+
+ /* temporarly reuse input_str */
+ sprintf(input_str, "%s%cgnetlist-post.scm", pr_current->scheme_directory,
+ G_DIR_SEPARATOR);
+
+ if (g_read_file(input_str) != -1) {
+ s_log_message("Read post traversal scm file [%s]\n", input_str);
+ } else {
+ s_log_message("Failed to read post traversal scm file [%s]\n", input_str);
+ fprintf(stderr, "Failed to read post traversal scm file [%s]\n", input_str);
+ }
+
+ if (guile_proc) {
/* check size here hack */
sprintf(input_str, "(%s \"%s\")", guile_proc, output_filename);
scm_c_eval_string (input_str);
commit 82dd20fe6d7a5022cebcc40c2a6ad73af230901c
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date: Wed Jan 9 23:00:55 2008 +0000
Change some tabs in gnetlist.c to spaces. Alter some other whitespace.
diff --git a/gnetlist/src/gnetlist.c b/gnetlist/src/gnetlist.c
index 9a0cafa..c1ec95e 100644
--- a/gnetlist/src/gnetlist.c
+++ b/gnetlist/src/gnetlist.c
@@ -46,7 +46,7 @@
#include <dmalloc.h>
#endif
-#define BACKEND_LIST_COLS 3
+#define BACKEND_LIST_COLS 3
void gnetlist_quit(void)
{
@@ -65,45 +65,45 @@ void gnetlist_quit(void)
*/
void gnetlist_backends(TOPLEVEL *current)
{
- DIR *schemedir;
- struct dirent *entry;
- char *filename;
- int n;
-
- schemedir=opendir(current->scheme_directory);
- if(schemedir==NULL) {
- fprintf(stderr, "\nERROR! Can't open directory %s: %s\n",
- current->scheme_directory,
- strerror(errno));
- return;
- }
-
- printf("List of available backends:\n\n");
-
- n=1;
- while(1) {
- entry=readdir(schemedir);
- if(entry==NULL) break;
-
- filename=strdup(entry->d_name);
-
- if(g_str_has_prefix(filename, "gnet-")&&
- g_str_has_suffix(filename, ".scm")) {
-
- /* strip the suffix */
- filename[strlen(filename)-4]='\0';
- /* and skip the prefix */
- printf("%-25s", &filename[5]);
- if(n>=BACKEND_LIST_COLS) {
- printf("\n");
- n=0;
- }
- n++;
- }
-
- free(filename);
- }
- printf("\n");
+ DIR *schemedir;
+ struct dirent *entry;
+ char *filename;
+ int n;
+
+ schemedir=opendir(current->scheme_directory);
+ if(schemedir==NULL) {
+ fprintf(stderr, "\nERROR! Can't open directory %s: %s\n",
+ current->scheme_directory,
+ strerror(errno));
+ return;
+ }
+
+ printf("List of available backends:\n\n");
+
+ n=1;
+ while(1) {
+ entry=readdir(schemedir);
+ if(entry==NULL) break;
+
+ filename=strdup(entry->d_name);
+
+ if(g_str_has_prefix(filename, "gnet-")&&
+ g_str_has_suffix(filename, ".scm")) {
+
+ /* strip the suffix */
+ filename[strlen(filename)-4]='\0';
+ /* and skip the prefix */
+ printf("%-25s", &filename[5]);
+ if(n>=BACKEND_LIST_COLS) {
+ printf("\n");
+ n=0;
+ }
+ n++;
+ }
+
+ free(filename);
+ }
+ printf("\n");
}
void main_prog(void *closure, int argc, char *argv[])
@@ -119,10 +119,9 @@ void main_prog(void *closure, int argc, char *argv[])
/* set default output filename */
output_filename =
- (char *) g_malloc(sizeof(char) * (strlen("output.net") + 1));
+ (char *) g_malloc(sizeof(char) * (strlen("output.net") + 1));
strcpy(output_filename, "output.net");
-
argv_index = parse_commandline(argc, argv);
cwd = getcwd(NULL, MAXPATHLEN);
#ifdef __MINGW32__
@@ -131,17 +130,17 @@ void main_prog(void *closure, int argc, char *argv[])
/* this is a kludge to make sure that spice mode gets set */
/* Hacked by SDB to allow spice netlisters of arbitrary name
- * as long as they begin with "spice". For example, this spice
+ * as long as they begin with "spice". For example, this spice
* netlister is valid: "spice-sdb".
*/
if (guile_proc) {
- if (strncmp(guile_proc, "spice", 5) == 0) {
- netlist_mode = SPICE;
- command_line = create_command_line(argc, argv);
+ if (strncmp(guile_proc, "spice", 5) == 0) {
+ netlist_mode = SPICE;
+ command_line = create_command_line(argc, argv);
- printf("Command line passed = %s \n", command_line);
+ printf("Command line passed = %s \n", command_line);
- }
+ }
}
libgeda_init();
@@ -158,21 +157,21 @@ void main_prog(void *closure, int argc, char *argv[])
s_log_message("gEDA/gnetlist version %s%s.%s\n", PREPEND_VERSION_STRING,
DOTTED_VERSION, DATE_VERSION);
s_log_message
- ("gEDA/gnetlist comes with ABSOLUTELY NO WARRANTY; see COPYING for more details.\n");
+ ("gEDA/gnetlist comes with ABSOLUTELY NO WARRANTY; see COPYING for more details.\n");
s_log_message
- ("This is free software, and you are welcome to redistribute it under certain\n");
+ ("This is free software, and you are welcome to redistribute it under certain\n");
s_log_message
- ("conditions; please see the COPYING file for more details.\n\n");
+ ("conditions; please see the COPYING file for more details.\n\n");
if (!quiet_mode) {
- fprintf(stderr, "gEDA/gnetlist version %s%s.%s\n",
+ fprintf(stderr, "gEDA/gnetlist version %s%s.%s\n",
PREPEND_VERSION_STRING, DOTTED_VERSION, DATE_VERSION);
- fprintf(stderr,
- "gEDA/gnetlist comes with ABSOLUTELY NO WARRANTY; see COPYING for more details.\n");
- fprintf(stderr,
- "This is free software, and you are welcome to redistribute it under certain\n");
- fprintf(stderr,
- "conditions; please see the COPYING file for more details.\n\n");
+ fprintf(stderr,
+ "gEDA/gnetlist comes with ABSOLUTELY NO WARRANTY; see COPYING for more details.\n");
+ fprintf(stderr,
+ "This is free software, and you are welcome to redistribute it under certain\n");
+ fprintf(stderr,
+ "conditions; please see the COPYING file for more details.\n\n");
}
#ifdef __MINGW32__
@@ -187,7 +186,6 @@ void main_prog(void *closure, int argc, char *argv[])
fprintf (stderr, "Remember to check that your schematic has no errors using the drc2 backend.\n");
fprintf (stderr, "You can do it running 'gnetlist -g drc2 your_schematic.sch -o drc_output.txt'\n");
fprintf (stderr, "and seeing the contents of the file drc_output.txt.\n\n");
-
}
/* register guile (scheme) functions */
g_register_funcs();
@@ -200,10 +198,10 @@ void main_prog(void *closure, int argc, char *argv[])
s_rename_init();
if(guile_proc!=NULL) {
- if(!strcmp(guile_proc, "help")) {
- gnetlist_backends(pr_current);
- exit(0);
- }
+ if(!strcmp(guile_proc, "help")) {
+ gnetlist_backends(pr_current);
+ exit(0);
+ }
}
/* Load the first set of scm files before we load any schematic files */
@@ -228,8 +226,7 @@ void main_prog(void *closure, int argc, char *argv[])
gchar *filename;
GError *err = NULL;
- if (g_path_is_absolute(argv[i]))
- {
+ if (g_path_is_absolute(argv[i])) {
/* Path is already absolute so no need to do any concat of cwd */
filename = g_strdup (argv[i]);
} else {
@@ -261,9 +258,9 @@ void main_prog(void *closure, int argc, char *argv[])
/* free(cwd); - Defered; see below */
if (argv[argv_index] == NULL) {
- fprintf(stderr,
- "\nERROR! You must specify at least one filename\n\n");
- usage(argv[0]);
+ fprintf(stderr,
+ "\nERROR! You must specify at least one filename\n\n");
+ usage(argv[0]);
}
g_set_project_current(pr_current);
@@ -284,29 +281,26 @@ void main_prog(void *closure, int argc, char *argv[])
free(cwd); /* allocated by getcwd, so this should stay as free() */
if (g_read_file(input_str) != -1) {
- s_log_message("Read init scm file [%s]\n", input_str);
+ s_log_message("Read init scm file [%s]\n", input_str);
} else {
- s_log_message("Failed to read init scm file [%s]\n", input_str);
- fprintf(stderr, "Failed to read init scm file [%s]\n", input_str);
+ s_log_message("Failed to read init scm file [%s]\n", input_str);
+ fprintf(stderr, "Failed to read init scm file [%s]\n", input_str);
}
if (guile_proc) {
-
- /* load the appropriate scm file */
- sprintf(input_str, "%s%cgnet-%s.scm", pr_current->scheme_directory,
- G_DIR_SEPARATOR, guile_proc);
-
- if (g_read_file(input_str) != -1) {
- s_log_message("Read %s scm file [%s]\n", guile_proc,
- input_str);
- } else {
- s_log_message("Failed to read %s scm file [%s]\n",
- guile_proc, input_str);
-
- fprintf(stderr, "Failed to read %s scm file [%s]\n",
- guile_proc, input_str);
- }
-
+ /* load the appropriate scm file */
+ sprintf(input_str, "%s%cgnet-%s.scm", pr_current->scheme_directory,
+ G_DIR_SEPARATOR, guile_proc);
+
+ if (g_read_file(input_str) != -1) {
+ s_log_message("Read %s scm file [%s]\n", guile_proc,
+ input_str);
+ } else {
+ s_log_message("Failed to read %s scm file [%s]\n",
+ guile_proc, input_str);
+ fprintf(stderr, "Failed to read %s scm file [%s]\n",
+ guile_proc, input_str);
+ }
/* Load second set of scm files */
list_pnt = post_backend_list;
@@ -325,17 +319,16 @@ void main_prog(void *closure, int argc, char *argv[])
/* Free now the list of configuration files */
g_slist_free(post_backend_list);
- /* check size here hack */
- sprintf(input_str, "(%s \"%s\")", guile_proc, output_filename);
- scm_c_eval_string (input_str);
- /* gh_eval_str_with_stack_saving_handler (input_str); */
+ /* check size here hack */
+ sprintf(input_str, "(%s \"%s\")", guile_proc, output_filename);
+ scm_c_eval_string (input_str);
+ /* gh_eval_str_with_stack_saving_handler (input_str); */
} else if (interactive_mode) {
- scm_c_eval_string ("(set-repl-prompt! \"gnetlist> \")");
- scm_shell (0, NULL);
+ scm_c_eval_string ("(set-repl-prompt! \"gnetlist> \")");
+ scm_shell (0, NULL);
} else {
- fprintf(stderr,
- "You gave neither backend to execute nor interactive mode!\n");
-
+ fprintf(stderr,
+ "You gave neither backend to execute nor interactive mode!\n");
}
gnetlist_quit();
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs