1 #define DWG_TYPE DWG_TYPE_INSERT
2 #include "common.c"
3 
4 void
api_process(dwg_object * obj)5 api_process (dwg_object *obj)
6 {
7   int error;
8   dwg_point_3d ins_pt, extrusion, scale;
9   double rotation;
10   BITCODE_BB scale_flag;
11   BITCODE_B has_attribs;
12   BITCODE_BL num_owned;
13   BITCODE_H block_header, first_attrib, last_attrib, seqend, *attribs;
14 
15   Dwg_Version_Type version = obj->parent->header.version;
16   dwg_ent_insert *insert = dwg_object_to_INSERT (obj);
17 
18   CHK_ENTITY_3RD_W_OLD (insert, INSERT, ins_pt);
19   CHK_ENTITY_3RD_W_OLD (insert, INSERT, scale);
20   CHK_ENTITY_TYPE_W_OLD (insert, INSERT, rotation, BD);
21   CHK_ENTITY_MAX (insert, INSERT, rotation, BD, MAX_ANGLE);
22   CHK_ENTITY_3RD_W_OLD (insert, INSERT, extrusion);
23   CHK_ENTITY_TYPE (insert, INSERT, scale_flag, BB);
24   CHK_ENTITY_TYPE (insert, INSERT, has_attribs, B);
25   if (version >= R_2004)
26     {
27       CHK_ENTITY_TYPE_W_OLD (insert, INSERT, num_owned, BL);
28     }
29 
30   CHK_ENTITY_H (insert, INSERT, block_header);
31   if (insert->has_attribs)
32     {
33       if (version <= R_2000)
34         {
35           CHK_ENTITY_H (insert, INSERT, first_attrib);
36           CHK_ENTITY_H (insert, INSERT, last_attrib);
37         }
38       if (version >= R_2004)
39         {
40           CHK_ENTITY_HV (insert, INSERT, attribs, num_owned);
41         }
42       CHK_ENTITY_H (insert, INSERT, seqend);
43     }
44 }
45