missing NULL terminator in set_config_x
[geda-gaf.git] / gschem / include / gschem_patch.h
blobe93b43c42192419c7011767c406d201c189e41af
1 /* gEDA - GPL Electronic Design Automation
2 * gschem - gEDA Schematic Capture
3 * Copyright (C) 2015-2020 gEDA Contributors (see ChangeLog for details)
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 /*! \file gschem_patch.h
21 * \brief Back-annotation from pcb-rnd.
24 /* this type of object should be only on a search list */
25 #define OBJ_PATCH 'p'
27 typedef enum {
28 GSCHEM_PATCH_DEL_CONN,
29 GSCHEM_PATCH_ADD_CONN,
30 GSCHEM_PATCH_CHANGE_ATTRIB,
31 GSCHEM_PATCH_NET_INFO,
32 } gschem_patch_op_t;
34 typedef struct gschem_patch_line_s gschem_patch_line_t;
35 struct gschem_patch_line_s {
36 gschem_patch_op_t op;
37 char *id;
38 union {
39 char *net_name;
40 char *attrib_name;
41 GList *ids; /* for net_info */
42 } arg1;
43 union {
44 char *attrib_val;
45 } arg2;
47 gschem_patch_line_t *next;
50 typedef struct {
51 GList *lines; /* an ordered list of patch lines
52 (of gschem_patch_line_t *) */
53 GHashTable *pins; /* refdes-pinnumber -> gschem_patch_pin_t* */
54 GHashTable *comps; /* refdes -> complex object */
55 GHashTable *nets; /* net_name -> GList* of pins as seen by the sender */
56 } gschem_patch_state_t;
58 typedef struct {
59 OBJECT *object;
60 gchar *loc_name;
61 gchar *action;
62 } gschem_patch_hit_t;
64 typedef struct {
65 OBJECT *obj; /* object that creates the pin;
66 for net attributes it is the complex object */
67 gchar *net; /* non-NULL when the pin is auto-connected to a net */
68 } gschem_patch_pin_t;
71 int gschem_patch_state_init (gschem_patch_state_t *st, const char *fn);
72 int gschem_patch_state_build (gschem_patch_state_t *st, OBJECT *o);
73 GSList *gschem_patch_state_execute (gschem_patch_state_t *st);
74 void gschem_patch_state_destroy (gschem_patch_state_t *st);
75 void gschem_patch_free_hit_list (GSList *hits);