Index: trunk/scconfig/Rev.h =================================================================== --- trunk/scconfig/Rev.h (revision 8748) +++ trunk/scconfig/Rev.h (revision 8749) @@ -1 +1 @@ -static const int myrev = 8593; +static const int myrev = 8748; Index: trunk/scconfig/Rev.tab =================================================================== --- trunk/scconfig/Rev.tab (revision 8748) +++ trunk/scconfig/Rev.tab (revision 8749) @@ -1,3 +1,4 @@ +8748 configure core: new pcb_bool source file 8593 configure gtk: new layer selector 8331 configure cquote generates C98-safe long strings 8275 configure puplug Index: trunk/src/Makefile.in =================================================================== --- trunk/src/Makefile.in (revision 8748) +++ trunk/src/Makefile.in (revision 8749) @@ -106,6 +106,7 @@ obj_text.o obj_text_list.o paths.o + pcb_bool.o pcb-printf.o plugins.o plug_import.o Index: trunk/src/pcb_bool.c =================================================================== --- trunk/src/pcb_bool.c (nonexistent) +++ trunk/src/pcb_bool.c (revision 8749) @@ -0,0 +1,34 @@ +/* + * COPYRIGHT + * + * pcb-rnd, interactive printed circuit board design + * Copyright (C) 2017 Tibor 'Igor2' Palinkas + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +#include "config.h" +#include "pcb_bool.h" +#include "compat_misc.h" + +pcb_bool_op_t pcb_str2boolop(const char *s) +{ + if (pcb_strcasecmp(s, "set")) return PCB_BOOL_SET; + if (pcb_strcasecmp(s, "clear")) return PCB_BOOL_CLEAR; + if (pcb_strcasecmp(s, "toggle")) return PCB_BOOL_TOGGLE; + if (pcb_strcasecmp(s, "preserve")) return PCB_BOOL_PRESERVE; + return PCB_BOOL_INVALID; +} Index: trunk/src/pcb_bool.h =================================================================== --- trunk/src/pcb_bool.h (revision 8748) +++ trunk/src/pcb_bool.h (revision 8749) @@ -2,8 +2,8 @@ * COPYRIGHT * * pcb-rnd, interactive printed circuit board design - * Copyright (C) 2016 Tibor 'Igor2' Palinkas - * + * Copyright (C) 2016, 2017 Tibor 'Igor2' Palinkas + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -35,7 +35,8 @@ PCB_BOOL_CLEAR = 0, PCB_BOOL_SET = 1, PCB_BOOL_TOGGLE = -1, - PCB_BOOL_PRESERVE = -2 + PCB_BOOL_PRESERVE = -2, + PCB_BOOL_INVALID = -8 } pcb_bool_op_t; /* changes the value of pcb_bool dst as requested by pcb_bool_op_t op @@ -46,6 +47,7 @@ case PCB_BOOL_CLEAR: (dst) = 0; break; \ case PCB_BOOL_SET: (dst) = 1; break; \ case PCB_BOOL_TOGGLE: (dst) = !(dst); break; \ + case PCB_BOOL_INVALID: \ case PCB_BOOL_PRESERVE: break; \ } \ } while(0)