/*****************************************************************************/
/* LibreDWG - free implementation of the DWG file format */
/* */
/* Copyright (C) 2013,2018-2020 Free Software Foundation, Inc. */
/* */
/* This library is free software, licensed under the terms of the GNU */
/* General Public License as published by the Free Software Foundation, */
/* either version 3 of the License, or (at your option) any later version. */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/*****************************************************************************/
/*
* dwg_api.h: external C API
* This is the only file an user of the API needs to include.
*
* written by Gaganjyot Singh
* modified by Reini Urban
*/
#ifndef _DWG_API_H_
#define _DWG_API_H_
#include <stdio.h>
#include <stdbool.h>
#include "dwg.h"
#ifndef __attribute_deprecated__
/* Since version 3.2, gcc allows marking deprecated functions. */
# if (defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 302)
# define __attribute_deprecated__ __attribute__ ((__deprecated__))
# else
# define __attribute_deprecated__
# endif
#endif
#if defined(__clang__) && defined(__has_extension)
# define _clang_has_extension(ext) __has_extension (ext)
#else
# define _clang_has_extension(ext) 0
#endif
/* Since version 4.5, gcc also allows one to specify the message printed
when a deprecated function is used.
clang claims to be gcc 4.2, but may also support this feature.
icc (at least 12) not.
glibc 2.28 /usr/include/sys/cdefs.h is wrong about icc compat. */
#if (defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 405 \
&& !defined(__ICC)) \
|| _clang_has_extension(attribute_deprecated_with_message)
# undef __attribute_deprecated_msg
# define __attribute_deprecated_msg__(msg) \
__attribute__ ((__deprecated__ (msg)))
#else
# define __attribute_deprecated_msg__(msg) __attribute_deprecated__
#endif
/* The __nonnull function attribute marks pointer arguments which
must not be NULL. */
#if (defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 303) \
&& !defined(__cplusplus)
# undef __nonnull
# define __nonnull(params) __attribute__ ((__nonnull__ params))
// cygwin/newlib has this
# ifndef __nonnull_all
# define __nonnull_all __attribute__ ((__nonnull__))
# endif
# define HAVE_NONNULL
#else
# undef __nonnull
# undef HAVE_NONNULL
# define __nonnull(params)
# define __nonnull_all
#endif
#ifdef __cplusplus
extern "C"
{
#endif
#ifndef LOG_ERROR
# define LOG_ERROR(msg, name, type) fprintf (stderr, msg, name, (type))
#endif
// static bool g_add_to_mspace = true;
/** dynapi */
typedef struct dwg_field_name_type_offset
{
const char *const name; /* field name */
const char *const type; /* e.g "RS" for BITCODE_RS */
const unsigned short size; /* e.g. 2 for RS, 4 for BL */
const unsigned short offset;
const unsigned short
is_indirect : 1; // for pointers, references, like 3BD, CMC, H, TV
const unsigned short is_malloc : 1; // for strings and dynamic arrays only,
// H*, TV, unknown size
const unsigned short is_string : 1; // for null-terminated strings, use
// strcpy/wcscpy. not memcpy
const short dxf;
} Dwg_DYNAPI_field;
/** Check if the name is a valid ENTITY name, not an OBJECT.
*/
EXPORT bool is_dwg_entity (const char *name) __nonnull ((1));
/** Check if the name is a valid OBJECT name, not an ENTITY.
*/
EXPORT bool is_dwg_object (const char *name) __nonnull ((1));
/** Returns the HEADER.fieldname value in out.
The optional Dwg_DYNAPI_field *fp is filled with the field types from
dynapi.c
*/
EXPORT bool dwg_dynapi_header_value (const Dwg_Data *restrict dwg,
const char *restrict fieldname,
void *restrict out,
Dwg_DYNAPI_field *restrict fp)
__nonnull ((1, 2, 3));
/** Returns the ENTITY|OBJECT.fieldname value in out.
entity is the Dwg_Entity_ENTITY or Dwg_Object_OBJECT struct with the
specific fields. The optional Dwg_DYNAPI_field *fp is filled with the
field types from dynapi.c.
*/
EXPORT bool
dwg_dynapi_entity_value (void *restrict entity, const char *restrict dxfname,
const char *restrict fieldname, void *restrict out,
Dwg_DYNAPI_field *restrict fp)
__nonnull ((1, 2, 3, 4));
/** Returns the common ENTITY|OBJECT.fieldname value in out.
_obj is the Dwg_Entity_ENTITY or Dwg_Object_OBJECT struct with the
specific fields. The optional Dwg_DYNAPI_field *fp is filled with the
field types from dynapi.c
*/
EXPORT bool
dwg_dynapi_common_value (void *restrict _obj, const char *restrict fieldname,
void *restrict out, Dwg_DYNAPI_field *restrict fp)
__nonnull ((1, 2, 3));
/** Returns the common OBJECT.subclass.fieldname value in out.
ptr points to the subclass field. The optional Dwg_DYNAPI_field *fp is
filled with the field types from dynapi.c
*/
EXPORT bool dwg_dynapi_subclass_value (const void *restrict ptr,
const char *restrict subclass,
const char *restrict fieldname,
void *restrict out,
Dwg_DYNAPI_field *restrict fp)
__nonnull ((1, 2, 3, 4));
// Converts T or TU wide-strings to utf-8. Only for text values
// isnew is set to 1 if textp is freshly malloced (r2007+), otherwise 0
EXPORT bool dwg_dynapi_header_utf8text (const Dwg_Data *restrict dwg,
const char *restrict fieldname,
char **restrict textp, int *isnewp,
Dwg_DYNAPI_field *restrict fp)
__nonnull ((1, 2, 3));
/** Returns the ENTITY|OBJECT.fieldname text value in textp as utf-8.
entity is the Dwg_Entity_ENTITY or Dwg_Object_OBJECT struct with the
specific fields. The optional Dwg_DYNAPI_field *fp is filled with the
field types from dynapi.c With DWG's since r2007+ creates a fresh UTF-8
conversion from the UTF-16 wchar value (which needs to be free'd), with
older DWG's or with TV, TF or TFF returns the unconverted text value. Only
valid for text fields. isnew is set to 1 if textp is freshly malloced
(r2007+), otherwise 0
*/
EXPORT bool dwg_dynapi_entity_utf8text (void *restrict entity,
const char *restrict name,
const char *restrict fieldname,
char **restrict textp, int *isnewp,
Dwg_DYNAPI_field *restrict fp)
__nonnull ((1, 2, 3, 4));
EXPORT bool dwg_dynapi_common_utf8text (void *restrict _obj,
const char *restrict fieldname,
char **restrict textp, int *isnewp,
Dwg_DYNAPI_field *restrict fp)
__nonnull ((1, 2, 3));
/** Sets the HEADER.fieldname to a value.
A malloc'ed struct or string is passed by ptr, not by the content.
A non-malloc'ed struct is set by content.
If is_utf8 is set, the given value is a UTF-8 string, and will be
converted to TV or TU.
没有合适的资源?快使用搜索试试~ 我知道了~
libredwg qt creator交叉编译,安卓平台,共享库 armeabi-v7a
共3个文件
h:2个
so:1个
需积分: 5 0 下载量 128 浏览量
2024-05-16
11:01:20
上传
评论
收藏 6.21MB ZIP 举报
温馨提示
libredwg qt creator交叉编译,安卓平台,共享库 armeabi-v7a
资源推荐
资源详情
资源评论
收起资源包目录
armeabi-v7a.zip (3个子文件)
armeabi-v7a
libredwg.so 15.32MB
dwg.h 321KB
dwg_api.h 350KB
共 3 条
- 1
资源评论
cmrcmr_04
- 粉丝: 0
- 资源: 6
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功