#include<string.h>
#include"ses_layout.h"
+char* component_types[SCF_EDA_Components_NB] =
+{
+ "None",
+ "Battery",
+ "Resistor",
+ "Capacitor",
+ "Inductor",
+ "Diode",
+ "Transistor",
+};
+
int main(int argc, char* argv[])
{
if (argc < 2) {
ScfEboard* b = scf_eboard__unpack(NULL, len, pb);
ses_layout_board(b, 0, 0, 500, 500);
-#if 0
+#if 1
size_t i;
size_t j;
size_t k;
- size_t l;
+ size_t m;
for (i = 0; i < b->n_functions; i++) {
f = b->functions[i];
for (j = 0; j < f->n_components; j++) {
c = f->components[j];
- printf("c: %ld\n", c->id);
+ printf("c: %ld, type: %s\n", c->id, component_types[c->type]);
for (k = 0; k < c->n_pins; k++) {
p = c->pins[k];
printf("cid: %ld, pid: %ld\n", p->cid, p->id);
+
+ for (m = 0; m + 1 < p->n_tos; m += 2)
+ printf("to cid: %ld, pid: %ld\n", p->tos[m], p->tos[m + 1]);
}
+ printf("\n");
}
- printf("\n\n");
}
#endif