Index: trunk/src/global_typedefs.h =================================================================== --- trunk/src/global_typedefs.h (revision 32884) +++ trunk/src/global_typedefs.h (revision 32885) @@ -49,6 +49,7 @@ typedef struct pcb_poly_s pcb_poly_t; typedef struct pcb_pstk_s pcb_pstk_t; +typedef struct pcb_pstk_proto_s pcb_pstk_proto_t; typedef struct pcb_ratspatch_line_s pcb_ratspatch_line_t; typedef struct pcb_subc_s pcb_subc_t; Index: trunk/src/obj_pstk.h =================================================================== --- trunk/src/obj_pstk.h (revision 32884) +++ trunk/src/obj_pstk.h (revision 32885) @@ -63,7 +63,7 @@ #include "obj_pstk_shape.h" #include "vtpadstack_t.h" -typedef struct pcb_pstk_proto_s { +struct pcb_pstk_proto_s { unsigned in_use:1; /* 1 if the slot is in use */ unsigned hplated:1; /* if > 0, whether the hole is plated */ @@ -78,7 +78,7 @@ pcb_data_t *parent; int mech_idx; /* -1 or index to the first shape[] that is of PCB_LYT_MECH */ unsigned all_copper_connd:1; /* 1 if all copper shapes are connected by the hole/slot (regardless of plating!) */ -} pcb_pstk_proto_t; +}; /* Whether a proto cuts through board layers (has a hole or slot) */ #define PCB_PSTK_PROTO_CUTS(proto) (((proto)->hdia > 0) || ((proto)->mech_idx >= 0)) Index: trunk/src/plug_io.h =================================================================== --- trunk/src/plug_io.h (revision 32884) +++ trunk/src/plug_io.h (revision 32885) @@ -39,7 +39,8 @@ PCB_IOT_PCB = 1, PCB_IOT_FOOTPRINT = 2, PCB_IOT_FONT = 4, - PCB_IOT_BUFFER = 8 + PCB_IOT_BUFFER = 8, + PCB_IOT_PADSTACK = 16 } pcb_plug_iot_t; /* Returned by map_footprint() to tell what type of footprint(s) a file contains */ @@ -97,7 +98,13 @@ /* Attempt to load a complete buffer from a file. Return 0 on success. */ int (*parse_buffer)(pcb_plug_io_t *ctx, pcb_buffer_t *buff, const char *filename); + /* Attempt to load padstack prototype */ + int (*parse_padstack)(pcb_plug_io_t *ctx, pcb_pstk_proto_t *dst, const char *filename); + + /* Write a padstack prototype to a file. Return 0 on success. */ + int (*write_padstack)(pcb_plug_io_t *ctx, FILE *f, pcb_pstk_proto_t *dst); + /* Write the buffer to a file. Return 0 on success. */ int (*write_buffer)(pcb_plug_io_t *ctx, FILE *f, pcb_buffer_t *buff);