6 #include "libgeda_priv.h"
8 char const *symbol_data
[] = {
10 "L 300 0 200 200 3 0 0 0 -1 -1",
11 "T 300 400 5 10 0 0 0 0 1",
13 "P 900 100 750 100 1 0 0",
15 "T 800 150 5 8 0 1 0 0 1",
18 "P 0 100 152 100 1 0 0",
20 "T 100 150 5 8 0 1 0 0 1",
23 "L 201 200 150 100 3 0 0 0 -1 -1",
24 "T 200 300 8 10 0 1 0 0 1",
26 "T 0 0 8 10 0 1 0 0 1",
37 char *symbol_buf
, *attrib_value
;
41 symbol_buf
= g_strjoinv("\n", symbol_data
);
42 s_clib_add_memory(symbol_buf
, "resistor");
44 toplevel
= s_toplevel_new();
45 page
= s_page_new(toplevel
, "test");
46 s_toplevel_goto_page(toplevel
, page
);
48 clib
= s_clib_get_symbol_by_name("resistor");
50 o
= o_complex_new(toplevel
, 'C', WHITE
, 100, 100, 0, 0, clib
, "foo", 1);
53 attrib_value
= o_attrib_search_object(o
, "pinnumber", 0);
54 if (!attrib_value
|| strcmp(attrib_value
, "2") != 0) {
55 printf("pinnumber[0] = %s\n", attrib_value
? attrib_value
: "NULL");
60 attrib_value
= o_attrib_search_object(o
, "pinnumber", 2);
61 if (!attrib_value
|| strcmp(attrib_value
, "1") != 0) {
62 printf("pinnumber[1] = %s\n", attrib_value
? attrib_value
: "NULL");
67 attrib_value
= o_attrib_search_object(o
, "pinnumber", 4);
69 printf("pinnumber[2] = %s\n", attrib_value
? attrib_value
: "NULL");