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 =>
40 ACDBDICTIONARYWDFLT and fixes up obj->type also then. If obj->dxfname is
41 NULL, the search is done by index, without any fixups.
42 */
43 Dwg_Class *dwg_encode_get_class (Dwg_Data *restrict dwg,
44 Dwg_Object *restrict obj);
45
46 Dwg_Object *find_prev_entity (Dwg_Object *obj);
47 void in_postprocess_handles (Dwg_Object *restrict obj);
48 void in_postprocess_SEQEND (Dwg_Object *restrict obj, BITCODE_BL num_owned,
49 BITCODE_H *owned);
50 void dwg_set_dataflags (Dwg_Object *obj);
51 int dwg_encode_unknown_rest (Bit_Chain *restrict dat,
52 Dwg_Object *restrict obj);
53 bool dwg_encode_unknown_bits (Bit_Chain *restrict dat,
54 Dwg_Object *restrict obj);
55 void downconvert_TABLESTYLE (Dwg_Object *restrict obj);
56
57 #endif