shtr_param.h (1756B)
1 /* Copyright (C) 2022, 2025, 2026 |Méso|Star> (contact@meso-star.com) 2 * Copyright (C) 2025, 2026 Université de Lorraine 3 * Copyright (C) 2022 Centre National de la Recherche Scientifique 4 * Copyright (C) 2022 Université Paul Sabatier 5 * 6 * This program is free software: you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation, either version 3 of the License, or 9 * (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program. If not, see <http://www.gnu.org/licenses/>. */ 18 19 #ifndef SHTR_PARAM_H 20 #define SHTR_PARAM_H 21 22 #include <rsys/rsys.h> 23 24 struct param_desc { 25 const char* path; /* Path where the param lies */ 26 const char* name; /* Name of the param */ 27 size_t line; /* Line number of the param */ 28 29 /* Domain of the param */ 30 double low, upp; 31 int is_low_incl; /* Define if the lower bound is inclusive */ 32 int is_upp_incl; /* Define if the upper bound is inclusive */ 33 }; 34 #define PARAM_DESC_NULL__ {NULL, NULL, 0, 0, 0, 0, 0} 35 static const struct param_desc PARAM_DESC_NULL = PARAM_DESC_NULL__; 36 37 /* Forware declaration */ 38 struct shtr; 39 40 extern LOCAL_SYM res_T 41 parse_param_int 42 (struct shtr* shtr, 43 const char* str, 44 const struct param_desc* desc, 45 int* param); 46 47 extern LOCAL_SYM res_T 48 parse_param_double 49 (struct shtr* shtr, 50 const char* str, 51 const struct param_desc* desc, 52 double* param); 53 54 #endif /* SHTR_PARAM_H */