Skip to content

Commit

Permalink
sch2pcb: Factor out a function for PcbElement instance creation.
Browse files Browse the repository at this point in the history
  • Loading branch information
vzh committed Oct 2, 2023
1 parent 8ebd342 commit b108b49
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion liblepton/src/sch2pcb.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@

#define SEP_STRING "--------\n"

PcbElement*
pcb_element_new ()
{
return g_new0 (PcbElement, 1);
}

gchar*
pcb_element_get_refdes (PcbElement *element)
Expand Down Expand Up @@ -683,7 +688,7 @@ pcb_element_pkg_to_element (gchar *pkg_line)
fix_spaces (args[1]);
fix_spaces (args[2]);

el = g_new0 (PcbElement, 1);
el = pcb_element_new ();
el->description = g_strdup (args[0]);
el->refdes = g_strdup (args[1]);
el->value = g_strdup (args[2]);
Expand Down

0 comments on commit b108b49

Please sign in to comment.