cg_catalog_parsing.h (1819B)
1 /* Copyright (C) 2022 Université de Pau et des Pays de l'Adour UPPA 2 * Copyright (C) 2022 CNRS 3 * Copyright (C) 2022 Sorbonne Université 4 * Copyright (C) 2022 Université Paul Sabatier 5 * Copyright (C) 2022 |Meso|Star> (contact@meso-star.com) 6 * 7 * This program is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with this program. If not, see <http://www.gnu.org/licenses/>. */ 19 20 #ifndef PARSING_H 21 #define PARSING_H 22 23 #include "cg_construction_modes_parsing_schemas.h" 24 25 #include <rsys/rsys.h> 26 #include <rsys/dynamic_array.h> 27 28 struct logger; 29 struct mem_allocator; 30 struct cyaml_config; 31 struct darray_names; 32 33 struct parsed_catalog_items { 34 enum parsed_cmode_type construction_mode; 35 const char* filename; 36 void* parsed_data; 37 }; 38 39 #define DARRAY_NAME parsed_catalog_items 40 #define DARRAY_DATA struct parsed_catalog_items 41 #include <rsys/dynamic_array.h> 42 43 struct parsed_catalog { 44 struct mem_allocator* allocator; 45 struct logger* logger; 46 struct darray_parsed_catalog_items catalog; 47 }; 48 49 res_T 50 parse_catalog 51 (const struct darray_names* files, 52 struct mem_allocator* allocator, 53 struct logger* logger, 54 const struct cyaml_config* config, 55 struct parsed_catalog** catalog); 56 57 void 58 release_parsed_catalog 59 (const struct cyaml_config* config, 60 struct parsed_catalog* parsed); 61 62 #endif /*PARSING_H*/