star-geometry-2d

Cleaning and decorating 2D geometries
git clone git://git.meso-star.fr/star-geometry-2d.git
Log | Files | Refs | README | LICENSE

sg2_device.h (1599B)


      1 /* Copyright (C) 2019, 2020, 2023 |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 SG2D_DEVICE_H__
     17 #define SG2D_DEVICE_H__
     18 
     19 #include <rsys/ref_count.h>
     20 
     21  /* Forward declaration of external opaque data types */
     22 struct logger;
     23 struct mem_allocator;
     24 
     25 struct sg2d_device {
     26   struct logger* logger;
     27   struct mem_allocator* allocator;
     28   int verbose;
     29 
     30   ref_T ref;
     31 };
     32 
     33 /* Conditionally log a message on the LOG_ERROR stream of the device logger,
     34  * with respect to the device verbose flag */
     35 extern LOCAL_SYM void
     36 log_err
     37   (struct sg2d_device* dev,
     38    const char* msg,
     39    ...)
     40 #ifdef COMPILER_GCC
     41   __attribute((format(printf, 2, 3)))
     42 #endif
     43   ;
     44 
     45 /* Conditionally log a message on the LOG_WARNING stream of the device logger,
     46  * with respect to the device verbose flag */
     47 extern LOCAL_SYM void
     48 log_warn
     49   (struct sg2d_device* dev,
     50    const char* msg,
     51    ...)
     52 #ifdef COMPILER_GCC
     53   __attribute((format(printf, 2, 3)))
     54 #endif
     55   ;
     56 
     57 #endif /* SG2D_DEVICE_H__ */