Index: layer.h =================================================================== --- layer.h (revision 19122) +++ layer.h (revision 19123) @@ -95,6 +95,7 @@ #define PCB_LAYER_IS_ASSY(lyt, purpi) (((lyt) & PCB_LYT_VIRTUAL) && ((purpi) == F_assy)) #define PCB_LAYER_IS_FAB(lyt, purpi) (((lyt) & PCB_LYT_VIRTUAL) && ((purpi) == F_fab)) +#define PCB_LAYER_IS_CSECT(lyt, purpi) (((lyt) & PCB_LYT_VIRTUAL) && ((purpi) == F_csect)) #include "globalconst.h" #include "global_typedefs.h" @@ -248,10 +249,14 @@ - the number of layers copied into res if res is not NULL The plain version require exact match (look for a specific layer), the _any version allows partial match so work with PCB_LYT_ANY*. + The version that ends in 'p' also matches purpose if purpi is not -1 + and/or purpose is not NULL. */ int pcb_layer_list(pcb_board_t *pcb, pcb_layer_type_t mask, pcb_layer_id_t *res, int res_len); int pcb_layer_list_any(pcb_board_t *pcb, pcb_layer_type_t mask, pcb_layer_id_t *res, int res_len); +int pcb_layer_listp(pcb_board_t *pcb, pcb_layer_type_t mask, pcb_layer_id_t *res, int res_len, int purpi, const char *purpose); + /**** layer creation (for load/import code) ****/ /* Reset layers to the bare minimum (double sided board) */