star-2d

Contour structuring for efficient 2D geometric queries
git clone git://git.meso-star.fr/star-2d.git
Log | Files | Refs | README | LICENSE

s2d_device_c.h (1721B)


      1 /* Copyright (C) 2016-2021, 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 S2D_DEVICE_C_H
     17 #define S2D_DEVICE_C_H
     18 
     19 #include "s2d_backend.h"
     20 
     21 #include <rsys/ref_count.h>
     22 #include <rsys/free_list.h>
     23 
     24 struct name { FITEM; };
     25 #define FITEM_TYPE name
     26 #include <rsys/free_list.h>
     27 
     28 struct s2d_device {
     29   int verbose;
     30   struct logger* logger;
     31   struct mem_allocator* allocator;
     32 
     33   RTCDevice rtc; /* Embree device */
     34 
     35   struct flist_name names; /* List of shape id */
     36 
     37   ref_T ref;
     38 };
     39 
     40 /* Conditionally log a message on the LOG_ERROR stream of the device logger,
     41  * with respect to the device verbose flag */
     42 extern LOCAL_SYM void
     43 log_error
     44   (struct s2d_device* dev,
     45    const char* msg,
     46    ...)
     47 #ifdef COMPILER_GCC
     48   __attribute((format(printf, 2, 3)))
     49 #endif
     50 ;
     51 
     52 /* Conditionally log a message on the LOG_WARNING stream of the device logger,
     53  * with respect to the device verbose flag */
     54 extern LOCAL_SYM void
     55 log_warning
     56   (struct s2d_device* dev,
     57    const char* msg,
     58    ...)
     59 #ifdef COMPILER_GCC
     60     __attribute((format(printf, 2, 3)))
     61 #endif
     62 ;
     63 
     64 #endif /* S2D_DEVICE_C_H */
     65