|
LibreDWG API
0.13.3
LibreDWG API - The DWG Library
|
#include "config.h"#include <stdio.h>#include <stdlib.h>#include <string.h>#include <stdbool.h>#include <assert.h>#include <limits.h>#include "common.h"#include "bits.h"#include "dwg.h"#include "hash.h"#include "decode.h"#include "print.h"#include "free.h"#include "dynapi.h"#include "logging.h"#include "dec_macros.h"#include "template.spec"#include "header.spec"#include "auxheader.spec"#include "summaryinfo.spec"#include "2ndheader.spec"#include "objfreespace.spec"#include "appinfo.spec"#include "filedeplist.spec"#include "security.spec"#include "revhistory.spec"#include "acds.spec"#include "r2004_file_header.spec"#include "common_entity_data.spec"#include "common_object_handle_data.spec"#include "header_variables.spec"#include "common_entity_handle_data.spec"#include "dwg.spec"#include "classes.inc"Data Structures | |
| union | _encrypted_section_header |
Macros | |
| #define | _DEFAULT_SOURCE 1 |
| #define | _BSD_SOURCE 1 |
| #define | _GNU_SOURCE 1 /* for memmem on linux */ |
| #define | _USE_BSD 1 |
| #define | IS_DECODER |
| #define | DWG_LOGLEVEL loglevel |
| #define | MAX_HEADER_SIZE 2048 |
| #define | LOG_POS LOG_RPOS |
| #define | CMP(f, type) |
| #define | DECODE_PRER13_SENTINEL(ID) error |= decode_preR13_sentinel (ID, #ID, dat, dwg) |
Typedefs | |
| typedef union _encrypted_section_header | encrypted_section_header |
Functions | |
| int | dwg_decode (Bit_Chain *restrict dat, Dwg_Data *restrict dwg) |
| Dwg_Object_Ref * | dwg_find_objectref (const Dwg_Data *restrict dwg, const Dwg_Object *restrict obj) |
| void | dwg_resolve_objectrefs_silent (Dwg_Data *restrict dwg) |
| void | bfr_read (void *restrict dst, BITCODE_RC *restrict *restrict src, size_t size) |
| void | bfr_read_32 (void *restrict dst, BITCODE_RC *restrict *restrict src, size_t size) |
| void | bfr_read_64 (void *restrict dst, BITCODE_RC *restrict *restrict src, size_t size) |
| uint32_t | dwg_section_page_checksum (const uint32_t seed, Bit_Chain *restrict dat, int32_t size) |
| unsigned int | section_max_decomp_size (const Dwg_Data *dwg, const Dwg_Section_Type id) |
| void | decrypt_R2004_header (BITCODE_RC *restrict dest, const BITCODE_RC *restrict src, size_t size) |
| int | dwg_decode_eed (Bit_Chain *restrict dat, Dwg_Object_Object *restrict obj) |
| int | obj_handle_stream (Bit_Chain *restrict dat, Dwg_Object *restrict obj, Bit_Chain *restrict hdl_dat) |
| Dwg_Object_Ref * | dwg_new_ref (Dwg_Data *restrict dwg) |
| Dwg_Object_Ref * | dwg_decode_handleref (Bit_Chain *restrict dat, Dwg_Object *restrict obj, Dwg_Data *restrict dwg) |
| Dwg_Object_Ref * | dwg_decode_handleref_with_code (Bit_Chain *restrict dat, Dwg_Object *restrict obj, Dwg_Data *restrict dwg, unsigned int code) |
| int | dwg_decode_header_variables (Bit_Chain *dat, Bit_Chain *hdl_dat, Bit_Chain *str_dat, Dwg_Data *restrict dwg) |
| void | dwg_free_xdata_resbuf (Dwg_Resbuf *rbuf) |
| int | dwg_add_object (Dwg_Data *restrict dwg) |
| int | dwg_decode_add_object (Dwg_Data *restrict dwg, Bit_Chain *dat, Bit_Chain *hdl_dat, size_t address) |
| int | dwg_decode_unknown_bits (Bit_Chain *restrict dat, Dwg_Object *restrict obj) |
| int | dwg_decode_unknown_rest (Bit_Chain *restrict dat, Dwg_Object *restrict obj) |
| char * | dwg_dim_blockname (Dwg_Data *restrict dwg, const Dwg_Object *restrict obj) |
| int | dwg_validate_INSERT (Dwg_Object *restrict obj) |
| int | dwg_validate_POLYLINE (Dwg_Object *restrict obj) |
| int | dwg_fixup_BLOCKS_entities (Dwg_Data *restrict dwg) |
| void | dxf_3dsolid_revisionguid (Dwg_Entity__3DSOLID *_obj) |
| int | decode_preR13_DIMENSION (Bit_Chain *restrict dat, Dwg_Object *restrict obj) |
| int | decode_preR13_sentinel (const Dwg_Sentinel sentinel, const char *restrict sentinel_name, Bit_Chain *restrict dat, Dwg_Data *restrict dwg) |
| int | decode_r11_auxheader (Bit_Chain *restrict dat, Dwg_Data *restrict dwg) |
| int | decode_preR13_entities (BITCODE_RL start, BITCODE_RL end, unsigned num_entities, BITCODE_RL size, Bit_Chain *restrict dat, Dwg_Data *restrict dwg, const EntitySectionIndexR11 entity_section) |
| #define _BSD_SOURCE 1 |
| #define _DEFAULT_SOURCE 1 |
| #define _GNU_SOURCE 1 /* for memmem on linux */ |
| #define _USE_BSD 1 |
| #define CMP | ( | f, | |
| type | |||
| ) |
| #define DECODE_PRER13_SENTINEL | ( | ID | ) | error |= decode_preR13_sentinel (ID, #ID, dat, dwg) |
| #define DWG_LOGLEVEL loglevel |
| #define IS_DECODER |
| #define LOG_POS LOG_RPOS |
| #define MAX_HEADER_SIZE 2048 |
| typedef union _encrypted_section_header encrypted_section_header |
| void bfr_read | ( | void *restrict | dst, |
| BITCODE_RC *restrict *restrict | src, | ||
| size_t | size | ||
| ) |
| void bfr_read_32 | ( | void *restrict | dst, |
| BITCODE_RC *restrict *restrict | src, | ||
| size_t | size | ||
| ) |
| void bfr_read_64 | ( | void *restrict | dst, |
| BITCODE_RC *restrict *restrict | src, | ||
| size_t | size | ||
| ) |
| int decode_preR13_DIMENSION | ( | Bit_Chain *restrict | dat, |
| Dwg_Object *restrict | obj | ||
| ) |
| int decode_preR13_entities | ( | BITCODE_RL | start, |
| BITCODE_RL | end, | ||
| unsigned | num_entities, | ||
| BITCODE_RL | size, | ||
| Bit_Chain *restrict | dat, | ||
| Dwg_Data *restrict | dwg, | ||
| const EntitySectionIndexR11 | entity_section | ||
| ) |
| int decode_preR13_sentinel | ( | const Dwg_Sentinel | sentinel, |
| const char *restrict | sentinel_name, | ||
| Bit_Chain *restrict | dat, | ||
| Dwg_Data *restrict | dwg | ||
| ) |
| void decrypt_R2004_header | ( | BITCODE_RC *restrict | dest, |
| const BITCODE_RC *restrict | src, | ||
| size_t | size | ||
| ) |
| int dwg_add_object | ( | Dwg_Data *restrict | dwg | ) |
Adds a new empty obj to the dwg->object[] array. The new object is at &dwg->object[dwg->num_objects-1].
Returns 0 or some error codes on success. Returns -1 if the dwg->object pool was re-alloced, i.e. pointers within are invalidated. Returns DWG_ERR_OUTOFMEM otherwise.
dwg_decode returns 0 on success.
everything in dwg is cleared and then either read from dat, or set to a default.
| int dwg_decode_add_object | ( | Dwg_Data *restrict | dwg, |
| Bit_Chain * | dat, | ||
| Bit_Chain * | hdl_dat, | ||
| size_t | address | ||
| ) |
Adds an object to the DWG (i.e. dwg->object[dwg->num_objects]) Returns 0 or some error codes on success. Returns -1 if the dwg->object pool was re-alloced. Returns some DWG_ERR_* otherwise.
| int dwg_decode_eed | ( | Bit_Chain *restrict | dat, |
| Dwg_Object_Object *restrict | obj | ||
| ) |
| Dwg_Object_Ref* dwg_decode_handleref | ( | Bit_Chain *restrict | dat, |
| Dwg_Object *restrict | obj, | ||
| Dwg_Data *restrict | dwg | ||
| ) |
| Dwg_Object_Ref* dwg_decode_handleref_with_code | ( | Bit_Chain *restrict | dat, |
| Dwg_Object *restrict | obj, | ||
| Dwg_Data *restrict | dwg, | ||
| unsigned int | code | ||
| ) |
code: TYPEDOBJHANDLE: 2 Soft owner 3 Hard owner 4 Soft pointer 5 Hard pointer OFFSETOBJHANDLE for soft owners or pointers: 6 ref + 1 8 ref - 1 a ref + offset c ref - offset e ??
| int dwg_decode_header_variables | ( | Bit_Chain * | dat, |
| Bit_Chain * | hdl_dat, | ||
| Bit_Chain * | str_dat, | ||
| Dwg_Data *restrict | dwg | ||
| ) |
| int dwg_decode_unknown_bits | ( | Bit_Chain *restrict | dat, |
| Dwg_Object *restrict | obj | ||
| ) |
dwg_decode_unknown Container to hold a unknown class entity, see classes.inc Every DEBUGGING class holds a bits array, a bitsize, and the handle and string stream offsets. It starts after the common_entity|object_data until and goes until the end of final padding, to the CRC. (obj->common_size/8 .. obj->size)
| int dwg_decode_unknown_rest | ( | Bit_Chain *restrict | dat, |
| Dwg_Object *restrict | obj | ||
| ) |
| char* dwg_dim_blockname | ( | Dwg_Data *restrict | dwg, |
| const Dwg_Object *restrict | obj | ||
| ) |
| Dwg_Object_Ref* dwg_find_objectref | ( | const Dwg_Data *restrict | dwg, |
| const Dwg_Object *restrict | obj | ||
| ) |
| int dwg_fixup_BLOCKS_entities | ( | Dwg_Data *restrict | dwg | ) |
| void dwg_free_xdata_resbuf | ( | Dwg_Resbuf * | rbuf | ) |
| Dwg_Object_Ref* dwg_new_ref | ( | Dwg_Data *restrict | dwg | ) |
Add the empty ref to the DWG (freshly malloc'ed), or NULL.
| void dwg_resolve_objectrefs_silent | ( | Dwg_Data *restrict | dwg | ) |
| uint32_t dwg_section_page_checksum | ( | const uint32_t | seed, |
| Bit_Chain *restrict | dat, | ||
| int32_t | size | ||
| ) |
| int dwg_validate_INSERT | ( | Dwg_Object *restrict | obj | ) |
| int dwg_validate_POLYLINE | ( | Dwg_Object *restrict | obj | ) |
| void dxf_3dsolid_revisionguid | ( | Dwg_Entity__3DSOLID * | _obj | ) |
| int obj_handle_stream | ( | Bit_Chain *restrict | dat, |
| Dwg_Object *restrict | obj, | ||
| Bit_Chain *restrict | hdl_dat | ||
| ) |
| unsigned int section_max_decomp_size | ( | const Dwg_Data * | dwg, |
| const Dwg_Section_Type | id | ||
| ) |