stardis-fbound-prog.h (1858B)
1 /* Copyright (C) 2018-2025 |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 SDIS_FBOUND_PROG_H 17 #define SDIS_FBOUND_PROG_H 18 19 #include <rsys/rsys.h> 20 #include <rsys/str.h> 21 22 #include "stardis-prog-properties.h" 23 24 struct stardis; 25 struct mem_allocator; 26 struct fluid_prog; 27 struct description; 28 struct program; 29 30 /******************************************************************************* 31 * F boundary prog data 32 ******************************************************************************/ 33 struct f_boundary_prog { 34 void* prog_data; /* result of the create() call */ 35 struct str name; 36 struct str prog_name; 37 size_t argc; 38 char** argv; 39 /* lib handle and function ptrs */ 40 struct program* program; 41 void* (*create) 42 (const struct stardis_description_create_context*, void*, size_t, char**); 43 void (*release)(void*); 44 double (*flux)(const struct stardis_interface_fragment*, void*); 45 unsigned mat_id; 46 }; 47 48 res_T 49 init_f_boundary_prog 50 (struct mem_allocator* allocator, 51 struct f_boundary_prog** dst); 52 53 void 54 release_f_boundary_prog 55 (struct f_boundary_prog* bound, 56 struct mem_allocator* allocator); 57 58 res_T 59 str_print_f_boundary_prog 60 (struct str* str, 61 const struct f_boundary_prog* b); 62 63 #endif