libDXF 0.0.1
A library with DXF related functions written in C.
|
Functions for a DXF dictionary object (DICTIONARY
).
More...
#include "dictionary.h"
Go to the source code of this file.
Functions | |
DxfDictionary * | dxf_dictionary_new () |
Allocate memory for a DXF DICTIONARY object. | |
DxfDictionary * | dxf_dictionary_init (DxfDictionary *dictionary) |
Allocate memory and initialize data fields in a DICTIONARY object. | |
DxfDictionary * | dxf_dictionary_read (DxfFile *fp, DxfDictionary *dictionary) |
Read data from a DXF file into a DXF DICTIONARY object. | |
int | dxf_dictionary_write (DxfFile *fp, DxfDictionary *dictionary) |
Write DXF output to a file for a DXF DICTIONARY object. | |
int | dxf_dictionary_free (DxfDictionary *dictionary) |
Free the allocated memory for a DXF DICTIONARY and all it's data fields. | |
void | dxf_dictionary_free_chain (DxfDictionary *dictionaries) |
Free the allocated memory for a chain of DXF DICTIONARY objects and all their data fields. | |
int | dxf_dictionary_get_id_code (DxfDictionary *dictionary) |
Get the ID code from a DXF DICTIONARY object. | |
DxfDictionary * | dxf_dictionary_set_id_code (DxfDictionary *dictionary, int id_code) |
Set the ID code for a DXF DICTIONARY object. | |
char * | dxf_dictionary_get_dictionary_owner_soft (DxfDictionary *dictionary) |
Get the soft pointer to the dictionary owner from a DXF DICTIONARY object. | |
DxfDictionary * | dxf_dictionary_set_dictionary_owner_soft (DxfDictionary *dictionary, char *dictionary_owner_soft) |
Set the pointer to the dictionary_owner_soft for a DXF DICTIONARY object. | |
char * | dxf_dictionary_get_dictionary_owner_hard (DxfDictionary *dictionary) |
Get the hard pointer to the dictionary owner from a DXF DICTIONARY object. | |
DxfDictionary * | dxf_dictionary_set_dictionary_owner_hard (DxfDictionary *dictionary, char *dictionary_owner_hard) |
Set the pointer to the dictionary_owner_hard for a DXF DICTIONARY object. | |
char * | dxf_dictionary_get_entry_name (DxfDictionary *dictionary) |
Get the entry name from a DXF DICTIONARY object. | |
DxfDictionary * | dxf_dictionary_set_entry_name (DxfDictionary *dictionary, char *entry_name) |
Set the entry name for a DXF DICTIONARY object. | |
char * | dxf_dictionary_get_entry_object_handle (DxfDictionary *dictionary) |
Get the entry object handle from a DXF DICTIONARY object. | |
DxfDictionary * | dxf_dictionary_set_entry_object_handle (DxfDictionary *dictionary, char *entry_object_handle) |
Set the entry object handle for a DXF DICTIONARY object. | |
DxfDictionary * | dxf_dictionary_get_next (DxfDictionary *dictionary) |
Get the pointer to the next DICTIONARY object from a DXF DICTIONARY object. | |
DxfDictionary * | dxf_dictionary_set_next (DxfDictionary *dictionary, DxfDictionary *next) |
Set the pointer to the next DICTIONARY object for a DXF DICTIONARY object. | |
DxfDictionary * | dxf_dictionary_get_last (DxfDictionary *dictionary) |
Get the pointer to the last DICTIONARY object from a linked list of DXF DICTIONARY objects. |
Functions for a DXF dictionary object (DICTIONARY
).
DICTIONARY
object was introduced in DXF R13.
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 dictionary.c.
DxfDictionary* dxf_dictionary_new | ( | ) |
Allocate memory for a DXF DICTIONARY
object.
Fill the memory contents with zeros.
Definition at line 52 of file dictionary.c.
References _, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
Referenced by dxf_dictionary_init(), and dxf_dictionary_read().
DxfDictionary* dxf_dictionary_init | ( | DxfDictionary * | dictionary | ) |
Allocate memory and initialize data fields in a DICTIONARY
object.
NULL
when no memory was allocated, a pointer to the allocated memory when succesful. dictionary | a pointer to the DXF DICTIONARY object. |
Definition at line 90 of file dictionary.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_dictionary_new(), dxf_dictionary_set_dictionary_owner_hard(), dxf_dictionary_set_dictionary_owner_soft(), dxf_dictionary_set_entry_name(), dxf_dictionary_set_entry_object_handle(), dxf_dictionary_set_id_code(), and dxf_dictionary_set_next().
Referenced by dxf_dictionary_read().
DxfDictionary* dxf_dictionary_read | ( | DxfFile * | fp, |
DxfDictionary * | dictionary | ||
) |
Read data from a DXF file into a DXF DICTIONARY
object.
The last line read from file contained the string "DICTIONARY".
Now follows some data for the DICTIONARY
object, to be terminated with a " 0" string announcing the following object.
While parsing the DXF file store data in dictionary
.
a
pointer to dictionary
. fp | DXF file pointer to an input file (or device). |
dictionary | a pointer to the DXF DICTIONARY object. |
Definition at line 138 of file dictionary.c.
References _, dxf_file_struct::acad_version_number, AutoCAD_13, dxf_dictionary_struct::dictionary_owner_hard, dxf_dictionary_struct::dictionary_owner_soft, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_dictionary_init(), dxf_dictionary_new(), dxf_dictionary_struct::entry_name, dxf_dictionary_struct::entry_object_handle, dxf_file_struct::filename, dxf_file_struct::fp, dxf_dictionary_struct::id_code, and dxf_file_struct::line_number.
int dxf_dictionary_write | ( | DxfFile * | fp, |
DxfDictionary * | dictionary | ||
) |
Write DXF output to a file for a DXF DICTIONARY
object.
EXIT_SUCCESS
when done, or EXIT_FAILURE
when an error occurred. fp | DXF file pointer to an output file (or device). |
dictionary | a pointer to the DXF DICTIONARY object. |
Definition at line 268 of file dictionary.c.
References _, dxf_file_struct::acad_version_number, AutoCAD_13, AutoCAD_14, dxf_dictionary_struct::dictionary_owner_hard, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_dictionary_get_dictionary_owner_hard(), dxf_dictionary_get_dictionary_owner_soft(), dxf_dictionary_get_entry_name(), dxf_dictionary_get_entry_object_handle(), dxf_dictionary_get_id_code(), and dxf_file_struct::fp.
int dxf_dictionary_free | ( | DxfDictionary * | dictionary | ) |
Free the allocated memory for a DXF DICTIONARY
and all it's data fields.
EXIT_SUCCESS
when done, or EXIT_FAILURE
when an error occurred. dictionary | a pointer to the memory occupied by the DXF DICTIONARY object. |
Definition at line 368 of file dictionary.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_dictionary_get_dictionary_owner_hard(), dxf_dictionary_get_dictionary_owner_soft(), dxf_dictionary_get_entry_name(), dxf_dictionary_get_entry_object_handle(), and dxf_dictionary_struct::next.
Referenced by dxf_dictionary_free_chain().
void dxf_dictionary_free_chain | ( | DxfDictionary * | dictionaries | ) |
Free the allocated memory for a chain of DXF DICTIONARY
objects and all their data fields.
dictionaries | a pointer to the chain of DXF DICTIONARY objects. |
Definition at line 411 of file dictionary.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_dictionary_free(), and dxf_dictionary_struct::next.
int dxf_dictionary_get_id_code | ( | DxfDictionary * | dictionary | ) |
Get the ID code from a DXF DICTIONARY
object.
dictionary | a pointer to a DXF DICTIONARY object. |
Definition at line 444 of file dictionary.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_dictionary_struct::id_code.
Referenced by dxf_dictionary_write().
DxfDictionary* dxf_dictionary_set_id_code | ( | DxfDictionary * | dictionary, |
int | id_code | ||
) |
Set the ID code for a DXF DICTIONARY
object.
dictionary | a pointer to a DXF DICTIONARY object. |
id_code | Identification number for the object. This is to be an unique (sequential) number in the DXF file. |
Definition at line 479 of file dictionary.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_dictionary_struct::id_code.
Referenced by dxf_dictionary_init().
char* dxf_dictionary_get_dictionary_owner_soft | ( | DxfDictionary * | dictionary | ) |
Get the soft pointer to the dictionary owner from a DXF DICTIONARY
object.
dictionary | a pointer to a DXF DICTIONARY object. |
Definition at line 524 of file dictionary.c.
References _, dxf_dictionary_struct::dictionary_owner_soft, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
Referenced by dxf_dictionary_free(), and dxf_dictionary_write().
DxfDictionary* dxf_dictionary_set_dictionary_owner_soft | ( | DxfDictionary * | dictionary, |
char * | dictionary_owner_soft | ||
) |
Set the pointer to the dictionary_owner_soft for a DXF DICTIONARY
object.
dictionary | a pointer to a DXF DICTIONARY object. |
dictionary_owner_soft | a string containing the pointer to the dictionary_owner_soft for the object. |
Definition at line 560 of file dictionary.c.
References _, dxf_dictionary_struct::dictionary_owner_soft, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
Referenced by dxf_dictionary_init().
char* dxf_dictionary_get_dictionary_owner_hard | ( | DxfDictionary * | dictionary | ) |
Get the hard pointer to the dictionary owner from a DXF DICTIONARY
object.
dictionary | a pointer to a DXF DICTIONARY object. |
Definition at line 604 of file dictionary.c.
References _, dxf_dictionary_struct::dictionary_owner_hard, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
Referenced by dxf_dictionary_free(), and dxf_dictionary_write().
DxfDictionary* dxf_dictionary_set_dictionary_owner_hard | ( | DxfDictionary * | dictionary, |
char * | dictionary_owner_hard | ||
) |
Set the pointer to the dictionary_owner_hard for a DXF DICTIONARY
object.
dictionary | a pointer to a DXF DICTIONARY object. |
dictionary_owner_hard | a string containing the pointer to the dictionary_owner_hard for the entity. |
Definition at line 640 of file dictionary.c.
References _, dxf_dictionary_struct::dictionary_owner_hard, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
Referenced by dxf_dictionary_init().
char* dxf_dictionary_get_entry_name | ( | DxfDictionary * | dictionary | ) |
Get the entry name from a DXF DICTIONARY
object.
NULL
when an error occurred. dictionary | a pointer to a DXF DICTIONARY object. |
Definition at line 681 of file dictionary.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_dictionary_struct::entry_name.
Referenced by dxf_dictionary_free(), and dxf_dictionary_write().
DxfDictionary* dxf_dictionary_set_entry_name | ( | DxfDictionary * | dictionary, |
char * | entry_name | ||
) |
Set the entry name for a DXF DICTIONARY
object.
dictionary | a pointer to a DXF DICTIONARY object. |
entry_name | a string containing the entry name for the entity. |
Definition at line 716 of file dictionary.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_dictionary_struct::entry_name.
Referenced by dxf_dictionary_init().
char* dxf_dictionary_get_entry_object_handle | ( | DxfDictionary * | dictionary | ) |
Get the entry object handle from a DXF DICTIONARY
object.
NULL
when an error occurred. dictionary | a pointer to a DXF DICTIONARY object. |
Definition at line 756 of file dictionary.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_dictionary_struct::entry_object_handle.
Referenced by dxf_dictionary_free(), and dxf_dictionary_write().
DxfDictionary* dxf_dictionary_set_entry_object_handle | ( | DxfDictionary * | dictionary, |
char * | entry_object_handle | ||
) |
Set the entry object handle for a DXF DICTIONARY
object.
dictionary | a pointer to a DXF DICTIONARY object. |
entry_object_handle | a string containing the entry object handle for the entity. |
Definition at line 791 of file dictionary.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_dictionary_struct::entry_object_handle.
Referenced by dxf_dictionary_init().
DxfDictionary* dxf_dictionary_get_next | ( | DxfDictionary * | dictionary | ) |
Get the pointer to the next DICTIONARY
object from a DXF DICTIONARY
object.
DICTIONARY
object.dictionary | a pointer to a DXF DICTIONARY object. |
Definition at line 835 of file dictionary.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_dictionary_struct::next.
DxfDictionary* dxf_dictionary_set_next | ( | DxfDictionary * | dictionary, |
DxfDictionary * | next | ||
) |
Set the pointer to the next DICTIONARY
object for a DXF DICTIONARY
object.
dictionary | a pointer to a DXF DICTIONARY object. |
next | a pointer to the next DICTIONARY object for the object. |
Definition at line 871 of file dictionary.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_dictionary_struct::next.
Referenced by dxf_dictionary_init().
DxfDictionary* dxf_dictionary_get_last | ( | DxfDictionary * | dictionary | ) |
Get the pointer to the last DICTIONARY
object from a linked list of DXF DICTIONARY
objects.
DICTIONARY
object.dictionary | a pointer to a DXF DICTIONARY object. |
Definition at line 915 of file dictionary.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_dictionary_struct::next.