libDXF 0.0.1
A library with DXF related functions written in C.
|
Functions for libDXF coding utilities. More...
Go to the source code of this file.
Functions | |
DxfChar * | dxf_char_new () |
Allocate memory for a DxfChar . | |
DxfChar * | dxf_char_init (DxfChar *c) |
Allocate memory and initialize data fields in a DxfChar object. | |
int | dxf_char_free (DxfChar *c) |
Free the allocated memory for a DxfChar object and all it's data fields. | |
int | dxf_char_free_chain (DxfChar *chars) |
Free the allocated memory for a single linked list of DxfChar objects and all their data fields. | |
DxfDouble * | dxf_double_new () |
Allocate memory for a DxfDouble . | |
DxfDouble * | dxf_double_init (DxfDouble *d) |
Allocate memory and initialize data fields in a DxfDouble object. | |
int | dxf_double_free (DxfDouble *d) |
Free the allocated memory for a DxfDouble object and all it's data fields. | |
int | dxf_double_free_chain (DxfDouble *doubles) |
Free the allocated memory for a single linked list of DxfDouble objects and all their data fields. | |
DxfInt * | dxf_int_new () |
Allocate memory for a DxfInt . | |
DxfInt * | dxf_int_init (DxfInt *i) |
Allocate memory and initialize data fields in a DxfInt object. | |
int | dxf_int_free (DxfInt *i) |
Free the allocated memory for a DxfInt object and all it's data fields. | |
int | dxf_int_free_chain (DxfInt *ints) |
Free the allocated memory for a single linked list of DxfInt objects and all their data fields. | |
int | dxf_read_is_double (int type) |
int | dxf_read_is_int (int type) |
int | dxf_read_is_string (int type) |
DxfFile * | dxf_read_init (const char *filename) |
Opens a DxfFile, does error checking and resets the line number counter. | |
void | dxf_read_close (DxfFile *file) |
int | dxf_read_line (char *temp_string, DxfFile *fp) |
Reads a line from a file. | |
int | dxf_read_scanf (DxfFile *fp, const char *template,...) |
Uses of fscanf with other features. |
Functions for libDXF coding utilities.
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 util.c.
DxfChar* dxf_char_new | ( | ) |
Allocate memory for a DxfChar
.
Fill the memory contents with zeros.
Definition at line 48 of file util.c.
References _, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
Referenced by dxf_char_init(), dxf_ole2frame_init(), dxf_oleframe_init(), and dxf_region_init().
Allocate memory and initialize data fields in a DxfChar
object.
NULL
when no memory was allocated, a pointer to the allocated memory when succesful. c | a pointer to the DxfChar object. |
Definition at line 86 of file util.c.
References _, dxf_char_new(), DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_char_struct::length, dxf_char_struct::next, and dxf_char_struct::value.
Referenced by dxf_ole2frame_init(), dxf_ole2frame_read(), dxf_oleframe_init(), dxf_oleframe_read(), dxf_region_init(), dxf_region_read(), dxf_sortentstable_init(), and dxf_sortentstable_read().
int dxf_char_free | ( | DxfChar * | c | ) |
Free the allocated memory for a DxfChar object and all it's data fields.
EXIT_SUCCESS
when done, or EXIT_FAILURE
when an error occurred. c | a pointer to the memory occupied by the DxfChar object. |
Definition at line 128 of file util.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_char_struct::next, and dxf_char_struct::value.
Referenced by dxf_char_free_chain().
int dxf_char_free_chain | ( | DxfChar * | chars | ) |
Free the allocated memory for a single linked list of DxfChar objects and all their data fields.
chars | a pointer to the single linked list of DxfChar objects. |
Definition at line 168 of file util.c.
References _, dxf_char_free(), DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_char_struct::next.
Referenced by dxf_oleframe_free(), dxf_region_free(), and dxf_sortentstable_free().
DxfDouble* dxf_double_new | ( | ) |
Allocate memory for a DxfDouble
.
Fill the memory contents with zeros.
Definition at line 203 of file util.c.
References _, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
Referenced by dxf_double_init(), and dxf_spline_init().
Allocate memory and initialize data fields in a DxfDouble
object.
NULL
when no memory was allocated, a pointer to the allocated memory when succesful. d | a pointer to the DxfDouble object. |
Definition at line 241 of file util.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_double_new(), dxf_double_struct::next, and dxf_double_struct::value.
Referenced by dxf_spline_init(), and dxf_spline_read().
int dxf_double_free | ( | DxfDouble * | d | ) |
Free the allocated memory for a DxfDouble object and all it's data fields.
EXIT_SUCCESS
when done, or EXIT_FAILURE
when an error occurred. d | a pointer to the memory occupied by the DxfDouble object. |
Definition at line 282 of file util.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_double_struct::next.
Referenced by dxf_double_free_chain().
int dxf_double_free_chain | ( | DxfDouble * | doubles | ) |
Free the allocated memory for a single linked list of DxfDouble objects and all their data fields.
doubles | a pointer to the single linked list of DxfDouble objects. |
Definition at line 321 of file util.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_double_free(), and dxf_double_struct::next.
Referenced by dxf_spline_free().
DxfInt* dxf_int_new | ( | ) |
Allocate memory for a DxfInt
.
Fill the memory contents with zeros.
Definition at line 356 of file util.c.
References _, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
Referenced by dxf_int_init().
Allocate memory and initialize data fields in a DxfInt
object.
NULL
when no memory was allocated, a pointer to the allocated memory when succesful. i | a pointer to the DxfInt object. |
Definition at line 394 of file util.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_int_new(), dxf_int_struct::next, and dxf_int_struct::value.
Referenced by dxf_sortentstable_read().
int dxf_int_free | ( | DxfInt * | i | ) |
Free the allocated memory for a DxfInt object and all it's data fields.
EXIT_SUCCESS
when done, or EXIT_FAILURE
when an error occurred. i | a pointer to the memory occupied by the DxfInt object. |
Definition at line 435 of file util.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_int_struct::next.
Referenced by dxf_int_free_chain().
int dxf_int_free_chain | ( | DxfInt * | ints | ) |
Free the allocated memory for a single linked list of DxfInt objects and all their data fields.
ints | a pointer to the single linked list of DxfInt objects. |
Definition at line 474 of file util.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_int_free(), and dxf_int_struct::next.
int dxf_read_is_double | ( | int | type | ) |
Definition at line 504 of file util.c.
References DXF_DEBUG_BEGIN, DXF_DEBUG_END, FALSE, and TRUE.
Referenced by dxf_header_read_parse_n_double().
int dxf_read_is_int | ( | int | type | ) |
Definition at line 527 of file util.c.
References DXF_DEBUG_BEGIN, DXF_DEBUG_END, FALSE, and TRUE.
Referenced by dxf_header_read_parse_int().
int dxf_read_is_string | ( | int | type | ) |
Definition at line 550 of file util.c.
References DXF_DEBUG_BEGIN, DXF_DEBUG_END, FALSE, and TRUE.
Referenced by dxf_header_read_parse_string().
DxfFile* dxf_read_init | ( | const char * | filename | ) |
Opens a DxfFile, does error checking and resets the line number counter.
Reset the line counting to 0.
Definition at line 579 of file util.c.
References _, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
Referenced by dxf_file_read().
void dxf_read_close | ( | DxfFile * | file | ) |
Definition at line 622 of file util.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_file_struct::filename, and dxf_file_struct::fp.
Referenced by dxf_file_read().
int dxf_read_line | ( | char * | temp_string, |
DxfFile * | fp | ||
) |
Reads a line from a file.
Reads the next line from fp
file and stores it into the temp_string.
Definition at line 653 of file util.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_file_struct::filename, dxf_file_struct::fp, and dxf_file_struct::line_number.
Referenced by dxf_file_read(), and dxf_section_read().
int dxf_read_scanf | ( | DxfFile * | fp, |
const char * | template, | ||
... | |||
) |
Uses of fscanf with other features.
Uses fscanf for file parsing, but also tracks the lines it reads;
Definition at line 685 of file util.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_file_struct::filename, dxf_file_struct::fp, dxf_file_struct::line_number, and TRUE.
Referenced by dxf_header_read(), dxf_header_read_parse_int(), dxf_header_read_parse_n_double(), and dxf_header_read_parse_string().