stardis-tbound-prog.h (1862B)
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_TBOUND_PROG_H 17 #define SDIS_TBOUND_PROG_H 18 19 #include <rsys/rsys.h> 20 #include <rsys/str.h> 21 22 #include "stardis-prog-properties.h" 23 24 struct mem_allocator; 25 struct program; 26 27 /******************************************************************************* 28 * T boundary prog data 29 ******************************************************************************/ 30 struct t_boundary_prog { 31 void* prog_data; /* result of the create() call */ 32 struct str name; 33 struct str prog_name; 34 size_t argc; 35 char** argv; 36 /* lib handle and function ptrs */ 37 struct program* program; 38 void* (*create) 39 (const struct stardis_description_create_context*, void*, size_t, char**); 40 void (*release)(void*); 41 double (*temperature)(const struct stardis_interface_fragment*, void*); 42 double* (*t_range)(void*, double trange[2]); 43 unsigned mat_id; 44 }; 45 46 res_T 47 init_t_boundary_prog 48 (struct mem_allocator* allocator, 49 struct t_boundary_prog** dst); 50 51 void 52 release_t_boundary_prog 53 (struct t_boundary_prog* bound, 54 struct mem_allocator* allocator); 55 56 res_T 57 str_print_t_boundary_prog 58 (struct str* str, 59 const struct t_boundary_prog* bound); 60 61 #endif 62