view netdiff/match/pindiff.c @ 152:d41cdd682db5

m4-fp: support for CUI DS04-254-SMT DIP switch series
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 24 Jun 2021 05:13:16 +0000
parents 64d4abf63e1e
children
line wrap: on
line source

#include <stdio.h>
#include <stdlib.h>
#include "struct.h"

char *infnames[2];
struct pin_info *database;

write_diffs_report()
{
	struct pin_info *p;

	for (p = database; p; p = p->next) {
		if (p->netnames[0] && !p->netnames[1])
			printf("Pin %s only in %s: net %s\n", p->pin_name,
				infnames[0], p->netnames[0]);
		if (!p->netnames[0] && p->netnames[1])
			printf("Pin %s only in %s: net %s\n", p->pin_name,
				infnames[1], p->netnames[1]);
	}
}

main(argc, argv)
	char **argv;
{
	int i;

	if (argc != 3) {
		fprintf(stderr, "usage: %s net1 net2\n", argv[0]);
		exit(1);
	}
	infnames[0] = argv[1];
	infnames[1] = argv[2];
	for (i = 0; i < 2; i++)
		read_pass(i);
	write_diffs_report();
	exit(0);
}