1 /*****************************************************************************/
2 /*  LibreDWG - free implementation of the DWG file format                    */
3 /*                                                                           */
4 /*  Copyright (C) 2009-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  * encode.h: encoding function prototypes, write from dwg to dat buffer.
15  * written by Felipe Castro
16  * modified by Felipe Corrêa da Silva Sances
17  * modified by Rodrigo Rodrigues da Silva
18  * modified by Reini Urban
19  */
20 
21 #ifndef ENCODE_H
22 #define ENCODE_H
23 
24 #include "bits.h"
25 #include "dwg.h"
26 
27 /* only when the versions mismatch */
28 #define ENCODE_UNKNOWN_AS_DUMMY
29 
30 #ifdef IN_DXF_H
31 #error in_dxf.h must be included after __FILE__ because of FORMAT_BD
32 #endif
33 
34 EXPORT int dwg_encode (Dwg_Data *restrict dwg, Bit_Chain *restrict dat);
35 
36 /** Returns the class for the object.
37     First searching class by name, not offset
38     because indxf has a different class order. Fixes up the obj->type then.
39     Also searches via dxfname aliases, like DICTIONARYWDFLT => ACDBDICTIONARYWDFLT
40     and fixes up obj->type also then.
41     If obj->dxfname is NULL, the search is done by index, without any fixups.
42  */
43 Dwg_Class *dwg_encode_get_class (Dwg_Data *restrict dwg, Dwg_Object *restrict obj);
44 
45 #endif
46