scad_c.h (1227B)
1 /* Copyright (C) 2022-2024 |Méso|Star> (contact@meso-star.com) 2 * 3 * This program is free software: you can redistribute it and/or modify 4 * it under the terms of the GNU General Public License as published by 5 * the Free Software Foundation, either version 3 of the License, or 6 * (at your option) any later version. 7 * 8 * This program is distributed in the hope that it will be useful, 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * GNU General Public License for more details. 12 * 13 * You should have received a copy of the GNU General Public License 14 * along with this program. If not, see <http://www.gnu.org/licenses/>. */ 15 16 #ifndef SCAD_C_H 17 #define SCAD_C_H 18 19 #include <rsys/rsys.h> 20 21 struct scad_geometry; 22 struct darray_int; 23 24 #define ERR(Expr) if((res = (Expr)) != RES_OK) goto error; else (void)0 25 26 static INLINE res_T 27 gmsh_err_to_res_T(const int ierr) 28 { 29 res_T res = RES_OK; 30 31 switch(ierr) { 32 /* TODO identify more precisely the gmsh errors */ 33 case 0: res = RES_OK; break; 34 default: res = RES_UNKNOWN_ERR; break; 35 } 36 return res; 37 } 38 39 res_T 40 get_2d_tags 41 (struct scad_geometry* geometry, 42 struct darray_int* tags); 43 44 #endif