diff ueda/uschem-netlist/pintonet.c @ 0:cd92449fdb51

initial import of ueda and ifctf-part-lib from ifctfvax CVS
author Space Falcon <falcon@ivan.Harhan.ORG>
date Mon, 20 Jul 2015 00:24:37 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ueda/uschem-netlist/pintonet.c	Mon Jul 20 00:24:37 2015 +0000
@@ -0,0 +1,56 @@
+#include <sys/types.h>
+#include <stdio.h>
+#include "netlist.h"
+#include "../libuschem/schemstruct.h"
+
+extern struct net *get_nethead_for_netname();
+
+check_compinst_pintonet(obj)
+	register struct schemobj *obj;
+{
+	register struct decoration *decor;
+
+	for (decor = obj->obj_decorations; decor; decor = decor->decor_next)
+		switch (decor->decor_type) {
+		case DECOR_TYPE_PINTONET:
+			handle_pintonet(obj, decor);
+			continue;
+		case DECOR_TYPE_NOCONNECT:
+			handle_noconnect_decor(obj, decor);
+			continue;
+		}
+}
+
+handle_pintonet(comp, decor)
+	struct schemobj *comp;
+	register struct decoration *decor;
+{
+	register char *soughtpin;
+	int bynum;
+	register struct net *n;
+
+	soughtpin = decor->decorpincon_pin;
+	if (soughtpin[0] == '#') {
+		soughtpin++;
+		bynum = 1;
+	} else
+		bynum = 0;
+	n = get_nethead_for_netname(decor->decorpincon_netname);
+	do_connect(n, comp, soughtpin, bynum, decor->decor_lineno);
+}
+
+handle_noconnect_decor(comp, decor)
+	struct schemobj *comp;
+	register struct decoration *decor;
+{
+	register char *soughtpin;
+	int bynum;
+
+	soughtpin = decor->decorpincon_pin;
+	if (soughtpin[0] == '#') {
+		soughtpin++;
+		bynum = 1;
+	} else
+		bynum = 0;
+	do_noconnect(comp, soughtpin, bynum, decor->decor_lineno);
+}