senc3d_device_c.h (1923B)
1 /* Copyright (C) 2018-2020, 2023, 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 SENC3D_DEVICE_C_H 17 #define SENC3D_DEVICE_C_H 18 19 #include <rsys/free_list.h> 20 #include <rsys/ref_count.h> 21 22 struct name { FITEM; }; 23 #define FITEM_TYPE name 24 #include <rsys/free_list.h> 25 26 struct senc3d_device { 27 struct logger* logger; 28 struct mem_allocator* allocator; 29 int verbose; 30 int nthreads; 31 32 ref_T ref; 33 }; 34 35 /* Conditionally log a message on the LOG_ERROR stream of the device logger, 36 * with respect to the device verbose flag */ 37 extern LOCAL_SYM void 38 log_err 39 (struct senc3d_device* dev, 40 const char* msg, 41 ...) 42 #ifdef COMPILER_GCC 43 __attribute((format(printf, 2, 3))) 44 #endif 45 ; 46 47 /* Conditionally log a message on the LOG_WARNING stream of the device logger, 48 * with respect to the device verbose flag */ 49 extern LOCAL_SYM void 50 log_warn 51 (struct senc3d_device* dev, 52 const char* msg, 53 ...) 54 #ifdef COMPILER_GCC 55 __attribute((format(printf, 2, 3))) 56 #endif 57 ; 58 59 /* Conditionally log a message on the LOG_OUTPUT stream of the device logger, 60 * with respect to the device verbose flag */ 61 extern LOCAL_SYM void 62 log_info 63 (struct senc3d_device* dev, 64 const char* msg, 65 ...) 66 #ifdef COMPILER_GCC 67 __attribute((format(printf, 2, 3))) 68 #endif 69 ; 70 71 #endif /* SENC3D_DEVICE_C_H */