[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: CVS update: globals.c
User: pcjc2
Date: 07/02/11 18:58:27
Modified: . Tag: noscreen globals.c gnetlist.c parsecmd.c
Log:
Sync with trunc
Revision Changes Path
No revision
No revision
1.23.6.1 +0 -1 eda/geda/gaf/gnetlist/src/globals.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: globals.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gnetlist/src/globals.c,v
retrieving revision 1.23
retrieving revision 1.23.6.1
diff -u -b -r1.23 -r1.23.6.1
--- globals.c 22 Apr 2006 20:09:27 -0000 1.23
+++ globals.c 11 Feb 2007 23:58:26 -0000 1.23.6.1
@@ -57,7 +57,6 @@
void (*pin_draw_func)() = o_pin_recalc;
void (*select_func)() = NULL;
void (*x_log_update_func)() = NULL;
-void (*quit_func)() = gnetlist_quit;
/* void (*variable_set_func)() = i_vars_set; */
void (*variable_set_func)() = NULL;
int (*load_newer_backup_func)() = NULL;
1.53.6.1 +64 -0 eda/geda/gaf/gnetlist/src/gnetlist.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: gnetlist.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gnetlist/src/gnetlist.c,v
retrieving revision 1.53
retrieving revision 1.53.6.1
diff -u -b -r1.53 -r1.53.6.1
--- gnetlist.c 7 Sep 2006 02:41:28 -0000 1.53
+++ gnetlist.c 11 Feb 2007 23:58:26 -0000 1.53.6.1
@@ -21,6 +21,13 @@
#include <stdio.h>
#include <sys/param.h>
+#include <sys/types.h>
+#ifdef HAVE_ERRNO_H
+#include <errno.h>
+#endif
+#ifdef HAVE_DIRENT_H
+#include <dirent.h>
+#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
@@ -28,6 +35,7 @@
#include <unistd.h>
#endif
+
#include <libgeda/libgeda.h>
#include "../include/globals.h"
@@ -37,6 +45,8 @@
#include <dmalloc.h>
#endif
+#define BACKEND_LIST_COLS 3
+
void gnetlist_quit(void)
{
s_clib_free();
@@ -48,6 +58,53 @@
g_slist_free (backend_params);
}
+/** @brief Prints a list of all installed gnetlist backends to standard output.
+ *
+ * @param current Pointer to the toplevel struct.
+ */
+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");
+}
+
void main_prog(void *closure, int argc, char *argv[])
{
int i;
@@ -139,6 +196,13 @@
s_rename_init();
+ if(guile_proc!=NULL) {
+ if(!strcmp(guile_proc, "help")) {
+ gnetlist_backends(pr_current);
+ exit(0);
+ }
+ }
+
i = argv_index;
while (argv[i] != NULL) {
gchar *filename;
1.24.6.1 +2 -1 eda/geda/gaf/gnetlist/src/parsecmd.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: parsecmd.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gnetlist/src/parsecmd.c,v
retrieving revision 1.24
retrieving revision 1.24.6.1
diff -u -b -r1.24 -r1.24.6.1
--- parsecmd.c 16 Jul 2006 02:11:31 -0000 1.24
+++ parsecmd.c 11 Feb 2007 23:58:26 -0000 1.24.6.1
@@ -72,7 +72,8 @@
printf(" -l filename Load scheme file before loading backend\n");
printf(" -m filename Load scheme file after loading backend,\n");
printf(" but still before executing procedure\n");
- printf(" -g proc Scheme procedure to execute\n");
+ printf(" -g proc Scheme procedure to execute.\n");
+ printf(" Use '-g help' to list available backends.\n");
printf(" -o filename Output netlist filename\n");
printf(" -c string Execute string as a scheme script\n");
printf(" -O option Pass the given option to the backend\n");
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs