Hi, here's the patch. Please consider that I'm not so familiar with gEDA and didn't find a way to check if the symbol has only one pin(yet).
What I do is basicaly attach the ":1" string to the net=NETNAME attribute so the system works well downstream. The error message is still present but the program doesn't return with error. Best Regards, Felipe. -- Felipe De la Puente Christen Mobile Phone : +56 9 93199807 MSN/GTalk : fdelapue...@gmail.com On Fri, 2010-04-16 at 10:11 +0200, Duncan Drennan wrote: > > Well I just modified s_netattrib.c in gnetlist to do the assumption, > > and seems to work. > > Could you post the patch?
>From 089fd84f147320f9660d7d998300d089002f3e42 Mon Sep 17 00:00:00 2001 From: Felipe De la Puente Christen <fel...@fdelapuente@gmail.com> Date: Fri, 16 Apr 2010 11:39:02 -0400 Subject: [PATCH] Make gnetlist consider net=NETNAME to be an implicit form of net=NETNAME:1 --- gnetlist/src/s_netattrib.c | 23 +++++++++++++++++++---- 1 files changed, 19 insertions(+), 4 deletions(-) diff --git a/gnetlist/src/s_netattrib.c b/gnetlist/src/s_netattrib.c index 6dc2d04..7c770e2 100644 --- a/gnetlist/src/s_netattrib.c +++ b/gnetlist/src/s_netattrib.c @@ -61,9 +61,10 @@ char *s_netattrib_extract_netname(char *value) i++; } + /* It's handy to consider no pinlist as an implicit :1. --fdelapuente */ if (value[i] != ':') { - fprintf(stderr, "Found malformed net attribute\n"); - return (g_strdup ("unknown")); + fprintf(stderr, "Found malformed net attribute(no pinlist, assuming pin 1)\n"); + //return (g_strdup ("unknown")); } return_value[i] = '\0'; @@ -90,9 +91,11 @@ s_netattrib_create_pins(TOPLEVEL * pr_current, OBJECT * o_current, char_ptr = strchr(value, ':'); - + /* It's handy to consider no pinlist as an implicit :1. --fdelapuente */ if (char_ptr == NULL) { - return; + value = g_strconcat(value, ":1", NULL); + char_ptr = strchr(value, ':'); + // return; } @@ -237,6 +240,12 @@ char *s_netattrib_net_search (OBJECT * o_current, char *wanted_pin) counter++; char_ptr = strchr (value, ':'); + /* It's handy to consider no pinlist as an implicit :1. --fdelapuente */ + if (char_ptr == NULL) { + value = g_strconcat(value, ":1", NULL); + char_ptr = strchr(value, ':'); + // return; + } if (char_ptr == NULL) { fprintf (stderr, "Got an invalid net= attrib [net=%s]\n" "Missing : in net= attrib\n", value); @@ -268,6 +277,12 @@ char *s_netattrib_net_search (OBJECT * o_current, char *wanted_pin) counter++; char_ptr = strchr (value, ':'); + /* It's handy to consider no pinlist as an implicit :1. --fdelapuente */ + if (char_ptr == NULL) { + value = g_strconcat(value, ":1", NULL); + char_ptr = strchr(value, ':'); + // return; + } if (char_ptr == NULL) { fprintf (stderr, "Got an invalid net= attrib [net=%s]\n" "Missing : in net= attrib\n", value); -- 1.6.3.3
_______________________________________________ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user