(root)/
libredwg-0.13/
src/
importer.h
       1  /*****************************************************************************/
       2  /*  LibreDWG - free implementation of the DWG file format                    */
       3  /*                                                                           */
       4  /*  Copyright (C) 2018-2020 Free Software Foundation, Inc.                   */
       5  /*                                                                           */
       6  /*  This library is free software, licensed under the terms of the GNU       */
       7  /*  General Public License as published by the Free Software Foundation,     */
       8  /*  either version 3 of the License, or (at your option) any later version.  */
       9  /*  You should have received a copy of the GNU General Public License        */
      10  /*  along with this program.  If not, see <http://www.gnu.org/licenses/>.    */
      11  /*****************************************************************************/
      12  
      13  /*
      14   * importer.h: overwrite import-specific spec macros,
      15   *   for decode, in_json, in_dxf.
      16   * written by Reini Urban
      17   */
      18  
      19  #ifndef IMPORTER_H
      20  #define IMPORTER_H
      21  
      22  // redeclare versions to be from, not target
      23  #undef VERSION
      24  #undef NOT_VERSION
      25  #undef VERSIONS
      26  #undef PRE
      27  #undef SINCE
      28  #undef UNTIL
      29  #undef RESET_VER
      30  #define VERSION(v)                                                            \
      31    cur_ver = v;                                                                \
      32    if (dat->from_version == v)
      33  #define NOT_VERSION(v)                                                        \
      34    cur_ver = v;                                                                \
      35    if (dat->from_version != v)
      36  #define VERSIONS(v1, v2)                                                      \
      37    cur_ver = v1;                                                               \
      38    if (dat->from_version >= v1 && dat->from_version <= v2)
      39  #define OTHER_VERSIONS else
      40  #define PRE(v)                                                                \
      41    cur_ver = v;                                                                \
      42    if (dat->from_version < v)
      43  #define SINCE(v)                                                              \
      44    cur_ver = v;                                                                \
      45    if (dat->from_version >= v)
      46  #define PRIOR_VERSIONS else
      47  #define UNTIL(v)                                                              \
      48    cur_ver = v;                                                                \
      49    if (dat->from_version <= v)
      50  #define LATER_VERSIONS else
      51  #define RESET_VER cur_ver = dat->from_version;
      52  
      53  #endif