libDXF 0.0.1
A library with DXF related functions written in C.
|
Functions for a DXF idbuffer object (IDBUFFER
).
More...
#include "idbuffer.h"
Go to the source code of this file.
Functions | |
DxfIdbuffer * | dxf_idbuffer_new () |
Allocate memory for a DxfIdbuffer . | |
DxfIdbuffer * | dxf_idbuffer_init (DxfIdbuffer *idbuffer) |
Allocate memory and initialize data fields in a IDBUFFER object. | |
DxfIdbuffer * | dxf_idbuffer_read (DxfFile *fp, DxfIdbuffer *idbuffer) |
Read data from a DXF file into a DXF IDBUFFER object. | |
int | dxf_idbuffer_write (DxfFile *fp, DxfIdbuffer *idbuffer) |
Write DXF output to a file for a DXF IDBUFFER object. | |
int | dxf_idbuffer_free (DxfIdbuffer *idbuffer) |
Free the allocated memory for a DXF IDBUFFER object and all it's data fields. | |
void | dxf_idbuffer_free_chain (DxfIdbuffer *id_buffers) |
Free the allocated memory for a chain of DXF IDBUFFER objects and all their data fields. | |
int | dxf_idbuffer_get_id_code (DxfIdbuffer *idbuffer) |
Get the id_code from a DXF IDBUFFER object. | |
DxfIdbuffer * | dxf_idbuffer_set_id_code (DxfIdbuffer *idbuffer, int id_code) |
Set the id_code for a DXF IDBUFFER object. | |
char * | dxf_idbuffer_get_dictionary_owner_soft (DxfIdbuffer *idbuffer) |
Get the pointer to the dictionary_owner_soft from a DXF IDBUFFER object. | |
DxfIdbuffer * | dxf_idbuffer_set_dictionary_owner_soft (DxfIdbuffer *idbuffer, char *dictionary_owner_soft) |
Set the pointer to the dictionary_owner_soft for a DXF IDBUFFER object. | |
char * | dxf_idbuffer_get_dictionary_owner_hard (DxfIdbuffer *idbuffer) |
Get the pointer to the dictionary_owner_hard from a DXF IDBUFFER object. | |
DxfIdbuffer * | dxf_idbuffer_set_dictionary_owner_hard (DxfIdbuffer *idbuffer, char *dictionary_owner_hard) |
Set the pointer to the dictionary_owner_hard for a DXF IDBUFFER object. | |
DxfIdbufferEntityPointer * | dxf_idbuffer_get_entity_pointer (DxfIdbuffer *idbuffer) |
Get the pointer to the first entity_pointer of a linked list of entity_pointer from a DXF IDBUFFER object. | |
DxfIdbuffer * | dxf_idbuffer_set_entity_pointer (DxfIdbuffer *idbuffer, DxfIdbufferEntityPointer *entity_pointer) |
Set the pointer to the first entity_pointer of a linked list for a DXF IDBUFFER object. | |
DxfIdbuffer * | dxf_idbuffer_get_next (DxfIdbuffer *idbuffer) |
Get the pointer to the next HELIX entity from a DXF IDBUFFER object. | |
DxfIdbuffer * | dxf_idbuffer_set_next (DxfIdbuffer *idbuffer, DxfIdbuffer *next) |
Set the pointer to the next IDBUFFER for a DXF IDBUFFER object. | |
DxfIdbuffer * | dxf_idbuffer_get_last (DxfIdbuffer *idbuffer) |
Get the pointer to the last IDBUFFER object from a linked list of DXF IDBUFFER objects. | |
DxfIdbufferEntityPointer * | dxf_idbuffer_entity_pointer_new () |
Allocate memory for a DxfIdbufferEntityPointer . | |
DxfIdbufferEntityPointer * | dxf_idbuffer_entity_pointer_init (DxfIdbufferEntityPointer *entity_pointer) |
Allocate memory and initialize data fields in a DxfIdbufferEntityPointer struct. | |
int | dxf_idbuffer_entity_pointer_free (DxfIdbufferEntityPointer *entity_pointer) |
Free the allocated memory for a DXF DxfIdbufferEntityPointer struct and all it's data fields. | |
void | dxf_idbuffer_entity_pointer_free_chain (DxfIdbufferEntityPointer *entity_pointers) |
Free the allocated memory for a chain of DXF DxfIdbufferEntityPointer structs and all their data fields. | |
char * | dxf_idbuffer_entity_pointer_get_soft_pointer (DxfIdbufferEntityPointer *entity_pointer) |
Get the pointer to the soft_pointer from a DXF DxfIdbufferEntityPointer object. | |
DxfIdbufferEntityPointer * | dxf_idbuffer_entity_pointer_set_soft_pointer (DxfIdbufferEntityPointer *entity_pointer, char *soft_pointer) |
Set the pointer to the soft_pointer for a DXF DxfIdbufferEntityPointer object. | |
DxfIdbufferEntityPointer * | dxf_idbuffer_entity_pointer_get_next (DxfIdbufferEntityPointer *entity_pointer) |
Get the pointer to the next DxfIdbufferEntityPointer object from a DXF DxfIdbufferEntityPointer object. | |
DxfIdbufferEntityPointer * | dxf_idbuffer_entity_pointer_set_next (DxfIdbufferEntityPointer *entity_pointer, DxfIdbufferEntityPointer *next) |
Set the pointer to the next DxfIdbufferEntityPointer object for a DXF DxfIdbufferEntityPointer object. | |
DxfIdbufferEntityPointer * | dxf_idbuffer_entity_pointer_get_last (DxfIdbufferEntityPointer *entity_pointer) |
Get the pointer to the last DxfIdbufferEntityPointer object from a linked list of DXF DxfIdbufferEntityPointer objects. |
Functions for a DXF idbuffer object (IDBUFFER
).
IDBUFFER
object was introduced in DXF R14.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to:
Free Software Foundation, Inc.,
59 Temple Place,
Suite 330,
Boston,
MA 02111 USA.
Drawing eXchange Format (DXF) is a defacto industry standard for the exchange of drawing files between various Computer Aided Drafting programs.
DXF is an industry standard designed by Autodesk(TM).
For more details see http://www.autodesk.com.
Definition in file idbuffer.c.
DxfIdbuffer* dxf_idbuffer_new | ( | ) |
Allocate memory for a DxfIdbuffer
.
Fill the memory contents with zeros.
Definition at line 52 of file idbuffer.c.
References _, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
Referenced by dxf_idbuffer_init(), and dxf_idbuffer_read().
DxfIdbuffer* dxf_idbuffer_init | ( | DxfIdbuffer * | idbuffer | ) |
Allocate memory and initialize data fields in a IDBUFFER
object.
NULL
when no memory was allocated, a pointer to the allocated memory when succesful. idbuffer | DXF IDBUFFER object. |
Definition at line 90 of file idbuffer.c.
References _, dxf_idbuffer::dictionary_owner_hard, dxf_idbuffer::dictionary_owner_soft, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_idbuffer_entity_pointer_init(), dxf_idbuffer_new(), dxf_idbuffer::entity_pointer, dxf_idbuffer::id_code, and dxf_idbuffer::next.
Referenced by dxf_idbuffer_read().
DxfIdbuffer* dxf_idbuffer_read | ( | DxfFile * | fp, |
DxfIdbuffer * | idbuffer | ||
) |
Read data from a DXF file into a DXF IDBUFFER
object.
The last line read from file contained the string "IDBUFFER".
Now follows some data for the IDBUFFER
, to be terminated with a " 0" string announcing the following object, or the end of the OBJECTS
section marker ENDSEC
.
While parsing the DXF file store data in idbuffer
.
idbuffer
. fp | DXF file pointer to an input file (or device). |
idbuffer | DXF IDBUFFER object. |
Definition at line 138 of file idbuffer.c.
References _, dxf_file_struct::acad_version_number, AutoCAD_14, dxf_idbuffer::dictionary_owner_hard, dxf_idbuffer::dictionary_owner_soft, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_idbuffer_entity_pointer_init(), dxf_idbuffer_init(), dxf_idbuffer_new(), dxf_file_struct::filename, dxf_file_struct::fp, dxf_idbuffer::id_code, dxf_file_struct::line_number, dxf_idbuffer_entity_pointer_struct::next, and dxf_idbuffer_entity_pointer_struct::soft_pointer.
int dxf_idbuffer_write | ( | DxfFile * | fp, |
DxfIdbuffer * | idbuffer | ||
) |
Write DXF output to a file for a DXF IDBUFFER
object.
EXIT_SUCCESS
when done, or EXIT_FAILURE
when an error occurred. fp | DXF file pointer to an output file (or device). |
idbuffer | DXF IDBUFFER object. |
Definition at line 269 of file idbuffer.c.
References _, dxf_file_struct::acad_version_number, AutoCAD_13, AutoCAD_14, dxf_idbuffer::dictionary_owner_hard, dxf_idbuffer::dictionary_owner_soft, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_idbuffer_entity_pointer_get_next(), dxf_idbuffer_entity_pointer_get_soft_pointer(), dxf_idbuffer_get_dictionary_owner_hard(), dxf_idbuffer_get_dictionary_owner_soft(), dxf_idbuffer_get_entity_pointer(), dxf_idbuffer_get_id_code(), dxf_idbuffer::entity_pointer, and dxf_file_struct::fp.
int dxf_idbuffer_free | ( | DxfIdbuffer * | idbuffer | ) |
Free the allocated memory for a DXF IDBUFFER
object and all it's data fields.
EXIT_SUCCESS
when done, or EXIT_FAILURE
when an error occurred. idbuffer | Pointer to the memory occupied by the DXF IDBUFFER object. |
Definition at line 365 of file idbuffer.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_idbuffer_entity_pointer_free_chain(), dxf_idbuffer_get_dictionary_owner_hard(), dxf_idbuffer_get_dictionary_owner_soft(), dxf_idbuffer_get_entity_pointer(), and dxf_idbuffer::next.
Referenced by dxf_idbuffer_free_chain().
void dxf_idbuffer_free_chain | ( | DxfIdbuffer * | id_buffers | ) |
Free the allocated memory for a chain of DXF IDBUFFER
objects and all their data fields.
id_buffers | pointer to the chain of DXF IDBUFFER objects. |
Definition at line 407 of file idbuffer.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_idbuffer_free(), and dxf_idbuffer_get_next().
int dxf_idbuffer_get_id_code | ( | DxfIdbuffer * | idbuffer | ) |
Get the id_code
from a DXF IDBUFFER
object.
id_code
when successful, or EXIT_FAILURE
when an error occurred. idbuffer | a pointer to a DXF IDBUFFER . |
Definition at line 441 of file idbuffer.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_idbuffer::id_code.
Referenced by dxf_idbuffer_write().
DxfIdbuffer* dxf_idbuffer_set_id_code | ( | DxfIdbuffer * | idbuffer, |
int | id_code | ||
) |
Set the id_code
for a DXF IDBUFFER
object.
idbuffer
when successful, or NULL
when an error occurred. idbuffer | a pointer to a DXF IDBUFFER . |
id_code | Identification number for the entity. This is to be an unique (sequential) number in the DXF file. |
Definition at line 479 of file idbuffer.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_helix_struct::id_code, and dxf_idbuffer::id_code.
char* dxf_idbuffer_get_dictionary_owner_soft | ( | DxfIdbuffer * | idbuffer | ) |
Get the pointer to the dictionary_owner_soft
from a DXF IDBUFFER
object.
dictionary_owner_soft
when successful, or NULL
when an error occurred.idbuffer | a pointer to a DXF IDBUFFER object. |
Definition at line 525 of file idbuffer.c.
References _, dxf_idbuffer::dictionary_owner_soft, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
Referenced by dxf_idbuffer_free(), and dxf_idbuffer_write().
DxfIdbuffer* dxf_idbuffer_set_dictionary_owner_soft | ( | DxfIdbuffer * | idbuffer, |
char * | dictionary_owner_soft | ||
) |
Set the pointer to the dictionary_owner_soft
for a DXF IDBUFFER
object.
idbuffer
when successful, or NULL
when an error occurred. idbuffer | a pointer to a DXF IDBUFFER object. |
dictionary_owner_soft | a string containing the pointer to the dictionary_owner_soft for the entity. |
Definition at line 564 of file idbuffer.c.
References _, dxf_idbuffer::dictionary_owner_soft, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
char* dxf_idbuffer_get_dictionary_owner_hard | ( | DxfIdbuffer * | idbuffer | ) |
Get the pointer to the dictionary_owner_hard
from a DXF IDBUFFER
object.
dictionary_owner_hard
when successful, or NULL
when an error occurred.idbuffer | a pointer to a DXF IDBUFFER object. |
Definition at line 609 of file idbuffer.c.
References _, dxf_idbuffer::dictionary_owner_hard, dxf_idbuffer::dictionary_owner_soft, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
Referenced by dxf_idbuffer_free(), and dxf_idbuffer_write().
DxfIdbuffer* dxf_idbuffer_set_dictionary_owner_hard | ( | DxfIdbuffer * | idbuffer, |
char * | dictionary_owner_hard | ||
) |
Set the pointer to the dictionary_owner_hard
for a DXF IDBUFFER
object.
idbuffer
when successful, or NULL
when an error occurred. idbuffer | a pointer to a DXF IDBUFFER object. |
dictionary_owner_hard | a string containing the pointer to the dictionary_owner_hard for the entity. |
Definition at line 648 of file idbuffer.c.
References _, dxf_idbuffer::dictionary_owner_hard, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
DxfIdbufferEntityPointer* dxf_idbuffer_get_entity_pointer | ( | DxfIdbuffer * | idbuffer | ) |
Get the pointer to the first entity_pointer of a linked list of entity_pointer
from a DXF IDBUFFER
object.
entity_pointer
of a linked list.idbuffer | a pointer to a DXF IDBUFFER object. |
Definition at line 692 of file idbuffer.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_idbuffer::entity_pointer.
Referenced by dxf_idbuffer_free(), and dxf_idbuffer_write().
DxfIdbuffer* dxf_idbuffer_set_entity_pointer | ( | DxfIdbuffer * | idbuffer, |
DxfIdbufferEntityPointer * | entity_pointer | ||
) |
Set the pointer to the first entity_pointer
of a linked list for a DXF IDBUFFER
object.
idbuffer
when successful, or NULL
when an error occurred. idbuffer | a pointer to a DXF IDBUFFER object. |
entity_pointer | a pointer to the first entity_pointer of a linked list for the object. |
Definition at line 731 of file idbuffer.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_idbuffer::entity_pointer.
DxfIdbuffer* dxf_idbuffer_get_next | ( | DxfIdbuffer * | idbuffer | ) |
Get the pointer to the next HELIX
entity from a DXF IDBUFFER
object.
IDBUFFER
object.idbuffer | a pointer to a DXF IDBUFFER object. |
Definition at line 775 of file idbuffer.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_idbuffer::next.
Referenced by dxf_idbuffer_free_chain().
DxfIdbuffer* dxf_idbuffer_set_next | ( | DxfIdbuffer * | idbuffer, |
DxfIdbuffer * | next | ||
) |
Set the pointer to the next IDBUFFER
for a DXF IDBUFFER
object.
idbuffer
when successful, or NULL
when an error occurred. idbuffer | a pointer to a DXF IDBUFFER object. |
next | a pointer to the next IDBUFFER for the object. |
Definition at line 814 of file idbuffer.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_idbuffer::next.
DxfIdbuffer* dxf_idbuffer_get_last | ( | DxfIdbuffer * | idbuffer | ) |
Get the pointer to the last IDBUFFER
object from a linked list of DXF IDBUFFER
objects.
IDBUFFER
object.idbuffer | a pointer to a DXF IDBUFFER object. |
Definition at line 857 of file idbuffer.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_idbuffer::next.
DxfIdbufferEntityPointer* dxf_idbuffer_entity_pointer_new | ( | ) |
Allocate memory for a DxfIdbufferEntityPointer
.
Fill the memory contents with zeros.
Definition at line 898 of file idbuffer.c.
References _, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
Referenced by dxf_idbuffer_entity_pointer_init().
DxfIdbufferEntityPointer* dxf_idbuffer_entity_pointer_init | ( | DxfIdbufferEntityPointer * | entity_pointer | ) |
Allocate memory and initialize data fields in a DxfIdbufferEntityPointer
struct.
NULL
when no memory was allocated, a pointer to the allocated memory when succesful. entity_pointer | DXF DxfIdbufferEntityPointer struct. |
Definition at line 936 of file idbuffer.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_idbuffer_entity_pointer_new(), dxf_idbuffer_entity_pointer_struct::next, and dxf_idbuffer_entity_pointer_struct::soft_pointer.
Referenced by dxf_idbuffer_init(), and dxf_idbuffer_read().
int dxf_idbuffer_entity_pointer_free | ( | DxfIdbufferEntityPointer * | entity_pointer | ) |
Free the allocated memory for a DXF DxfIdbufferEntityPointer
struct and all it's data fields.
EXIT_SUCCESS
when done, or EXIT_FAILURE
when an error occurred. entity_pointer | Pointer to the memory occupied by the DXF DxfIdbufferEntityPointer struct. |
Definition at line 977 of file idbuffer.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_idbuffer_entity_pointer_struct::next, and dxf_idbuffer_entity_pointer_struct::soft_pointer.
Referenced by dxf_idbuffer_entity_pointer_free_chain().
void dxf_idbuffer_entity_pointer_free_chain | ( | DxfIdbufferEntityPointer * | entity_pointers | ) |
Free the allocated memory for a chain of DXF DxfIdbufferEntityPointer
structs and all their data fields.
entity_pointers | pointer to the chain of DXF DxfIdbufferEntityPointer structs. |
Definition at line 1017 of file idbuffer.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_idbuffer_entity_pointer_free(), and dxf_idbuffer_entity_pointer_struct::next.
Referenced by dxf_idbuffer_free().
char* dxf_idbuffer_entity_pointer_get_soft_pointer | ( | DxfIdbufferEntityPointer * | entity_pointer | ) |
Get the pointer to the soft_pointer
from a DXF DxfIdbufferEntityPointer
object.
soft_pointer
when successful, or NULL
when an error occurred.entity_pointer | a pointer to a DXF IDBUFFER object. |
Definition at line 1055 of file idbuffer.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_idbuffer_entity_pointer_struct::soft_pointer.
Referenced by dxf_idbuffer_write().
DxfIdbufferEntityPointer* dxf_idbuffer_entity_pointer_set_soft_pointer | ( | DxfIdbufferEntityPointer * | entity_pointer, |
char * | soft_pointer | ||
) |
Set the pointer to the soft_pointer
for a DXF DxfIdbufferEntityPointer
object.
entity_pointer
when successful, or NULL
when an error occurred. entity_pointer | a pointer to a DXF DxfIdbufferEntityPointer object. |
soft_pointer | a string containing the pointer to the soft_pointer for the entity. |
Definition at line 1094 of file idbuffer.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_idbuffer_entity_pointer_struct::soft_pointer.
DxfIdbufferEntityPointer* dxf_idbuffer_entity_pointer_get_next | ( | DxfIdbufferEntityPointer * | entity_pointer | ) |
Get the pointer to the next DxfIdbufferEntityPointer
object from a DXF DxfIdbufferEntityPointer
object.
DxfIdbufferEntityPointer
object.entity_pointer | a pointer to a DXF DxfIdbufferEntityPointer object. |
Definition at line 1138 of file idbuffer.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_idbuffer_entity_pointer_struct::next.
Referenced by dxf_idbuffer_write().
DxfIdbufferEntityPointer* dxf_idbuffer_entity_pointer_set_next | ( | DxfIdbufferEntityPointer * | entity_pointer, |
DxfIdbufferEntityPointer * | next | ||
) |
Set the pointer to the next DxfIdbufferEntityPointer
object for a DXF DxfIdbufferEntityPointer
object.
entity_pointer
when successful, or NULL
when an error occurred. entity_pointer | a pointer to a DXF DxfIdbufferEntityPointer object. |
next | a pointer to the next DxfIdbufferEntityPointer object for the DxfIdbufferEntityPointer object. |
Definition at line 1177 of file idbuffer.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_idbuffer_entity_pointer_struct::next.
DxfIdbufferEntityPointer* dxf_idbuffer_entity_pointer_get_last | ( | DxfIdbufferEntityPointer * | entity_pointer | ) |
Get the pointer to the last DxfIdbufferEntityPointer
object from a linked list of DXF DxfIdbufferEntityPointer
objects.
DxfIdbufferEntityPointer
object.entity_pointer | a pointer to a DXF DxfIdbufferEntityPointer object. |
Definition at line 1222 of file idbuffer.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_idbuffer_entity_pointer_struct::next.