libDXF 0.0.1
A library with DXF related functions written in C.
Functions

rastervariables.c File Reference

Functions for a DXF rastervariables object (RASTERVARIABLES). More...

#include "rastervariables.h"
Include dependency graph for rastervariables.c:

Go to the source code of this file.

Functions

DxfRasterVariablesdxf_rastervariables_new ()
 Allocate memory for a DxfRasterVariables.
DxfRasterVariablesdxf_rastervariables_init (DxfRasterVariables *rastervariables)
 Allocate memory and initialize data fields in a RASTERVARIABLES object.
DxfRasterVariablesdxf_rastervariables_read (DxfFile *fp, DxfRasterVariables *rastervariables)
 Read data from a DXF file into a DXF RASTERVARIABLES object.
int dxf_rastervariables_write (DxfFile *fp, DxfRasterVariables *rastervariables)
 Write DXF output to a file for a DXF RASTERVARIABLES object.
int dxf_rastervariables_free (DxfRasterVariables *rastervariables)
 Free the allocated memory for a DXF RASTERVARIABLES and all it's data fields.
void dxf_rastervariables_free_chain (DxfRasterVariables *rastervariables)
 Free the allocated memory for a chain of DXF RASTERVARIABLES objects and all their data fields.
int dxf_rastervariables_get_id_code (DxfRasterVariables *rastervariables)
 Get the id_code from a DXF RASTERVARIABLES object.
DxfRasterVariablesdxf_rastervariables_set_id_code (DxfRasterVariables *rastervariables, int id_code)
 Set the id_code for a DXF RASTERVARIABLES object.
char * dxf_rastervariables_get_dictionary_owner_soft (DxfRasterVariables *rastervariables)
 Get the pointer to the dictionary_owner_soft from a DXF RASTERVARIABLES object.
DxfRasterVariablesdxf_rastervariables_set_dictionary_owner_soft (DxfRasterVariables *rastervariables, char *dictionary_owner_soft)
 Set the pointer to the dictionary_owner_soft for a DXF RASTERVARIABLES object.
char * dxf_rastervariables_get_dictionary_owner_hard (DxfRasterVariables *rastervariables)
 Get the pointer to the dictionary_owner_hard from a DXF RASTERVARIABLES object.
DxfRasterVariablesdxf_rastervariables_set_dictionary_owner_hard (DxfRasterVariables *rastervariables, char *dictionary_owner_hard)
 Set the pointer to the dictionary_owner_hard for a DXF RASTERVARIABLES object.
int dxf_rastervariables_get_display_image_frame (DxfRasterVariables *rastervariables)
 Get the display_image_frame from a DXF RASTERVARIABLES object.
DxfRasterVariablesdxf_rastervariables_set_display_image_frame (DxfRasterVariables *rastervariables, int display_image_frame)
 Set the display_image_frame for a DXF RASTERVARIABLES object.
int dxf_rastervariables_get_display_quality (DxfRasterVariables *rastervariables)
 Get the display_quality from a DXF RASTERVARIABLES object.
DxfRasterVariablesdxf_rastervariables_set_display_quality (DxfRasterVariables *rastervariables, int display_quality)
 Set the display_quality for a DXF RASTERVARIABLES object.
int dxf_rastervariables_get_units (DxfRasterVariables *rastervariables)
 Get the units from a DXF RASTERVARIABLES object.
DxfRasterVariablesdxf_rastervariables_set_units (DxfRasterVariables *rastervariables, int units)
 Set the units for a DXF RASTERVARIABLES object.
int32_t dxf_rastervariables_get_class_version (DxfRasterVariables *rastervariables)
 Get the class_version from a DXF RASTERVARIABLES object.
DxfRasterVariablesdxf_rastervariables_set_class_version (DxfRasterVariables *rastervariables, int32_t class_version)
 Set the class_version for a DXF RASTERVARIABLES object.
DxfRasterVariablesdxf_rastervariables_get_next (DxfRasterVariables *rastervariables)
 Get the pointer to the next RASTERVARIABLES object from a DXF RASTERVARIABLES object.
DxfRasterVariablesdxf_rastervariables_set_next (DxfRasterVariables *rastervariables, DxfRasterVariables *next)
 Set the pointer to the next RASTERVARIABLES object for a DXF RASTERVARIABLES object.
DxfRasterVariablesdxf_rastervariables_get_last (DxfRasterVariables *rastervariables)
 Get the pointer to the last RASTERVARIABLES object from a linked list of DXF RASTERVARIABLES objects.

Detailed Description

Functions for a DXF rastervariables object (RASTERVARIABLES).

Author:
Copyright (C) 2015, 2017 by Bert Timmerman <bert.timmerman@xs4all.nl>.
Since:
The RASTERVARIABLES object was introduced in DXF R14.
Version:
According to DXF R10 (backward compatibility).
According to DXF R11 (backward compatibility).
According to DXF R12 (backward compatibility).
According to DXF R13 (backward compatibility).
According to DXF R14.

Copyright Notices.


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 rastervariables.c.


Function Documentation

DxfRasterVariables* dxf_rastervariables_new ( )

Allocate memory for a DxfRasterVariables.

Fill the memory contents with zeros.

Definition at line 52 of file rastervariables.c.

References _, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

Referenced by dxf_rastervariables_init(), and dxf_rastervariables_read().

DxfRasterVariables* dxf_rastervariables_init ( DxfRasterVariables rastervariables)

Allocate memory and initialize data fields in a RASTERVARIABLES object.

Returns:
NULL when no memory was allocated, a pointer to the allocated memory when succesful.
Parameters:
rastervariablesa pointer to the DXF RASTERVARIABLES object.

Definition at line 90 of file rastervariables.c.

References _, dxf_rastervariables_struct::class_version, dxf_rastervariables_struct::dictionary_owner_hard, dxf_rastervariables_struct::dictionary_owner_soft, dxf_rastervariables_struct::display_image_frame, dxf_rastervariables_struct::display_quality, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_rastervariables_new(), dxf_rastervariables_struct::id_code, dxf_rastervariables_struct::next, and dxf_rastervariables_struct::units.

Referenced by dxf_rastervariables_read().

Here is the call graph for this function:

DxfRasterVariables* dxf_rastervariables_read ( DxfFile fp,
DxfRasterVariables rastervariables 
)

Read data from a DXF file into a DXF RASTERVARIABLES object.

The last line read from file contained the string "RASTERVARIABLES".
Now follows some data for the RASTERVARIABLES, to be terminated with a " 0" string announcing the following entity, or the end of the OBJECTS section marker ENDSEC.
While parsing the DXF file store data in rastervariables.

Returns:
a pointer to rastervariables.
Parameters:
fpDXF file pointer to an input file (or device).
rastervariablesa pointer to the DXF RASTERVARIABLES object.

Definition at line 141 of file rastervariables.c.

References _, dxf_file_struct::acad_version_number, AutoCAD_13, AutoCAD_14, dxf_rastervariables_struct::class_version, dxf_rastervariables_struct::dictionary_owner_hard, dxf_rastervariables_struct::dictionary_owner_soft, dxf_rastervariables_struct::display_image_frame, dxf_rastervariables_struct::display_quality, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_rastervariables_init(), dxf_rastervariables_new(), dxf_file_struct::filename, dxf_file_struct::fp, dxf_rastervariables_struct::id_code, dxf_file_struct::line_number, and dxf_rastervariables_struct::units.

Here is the call graph for this function:

int dxf_rastervariables_write ( DxfFile fp,
DxfRasterVariables rastervariables 
)

Write DXF output to a file for a DXF RASTERVARIABLES object.

Returns:
EXIT_SUCCESS when done, or EXIT_FAILURE when an error occurred.

Todo:
for version R14.
Implementing the start of application-defined group "{application_name", with Group code 102.
For example: "{ACAD_REACTORS" indicates the start of the AutoCAD persistent reactors group.

application-defined codes: Group codes and values within the 102 groups are application defined (optional).

End of group, "}" (optional), with Group code 102.

Parameters:
fpDXF file pointer to an output file (or device).
rastervariablesa pointer to the DXF RASTERVARIABLES object.

Definition at line 288 of file rastervariables.c.

References _, dxf_file_struct::acad_version_number, AutoCAD_13, AutoCAD_14, dxf_rastervariables_struct::class_version, dxf_rastervariables_struct::dictionary_owner_hard, dxf_rastervariables_struct::dictionary_owner_soft, dxf_rastervariables_struct::display_image_frame, dxf_rastervariables_struct::display_quality, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_file_struct::fp, dxf_rastervariables_struct::id_code, and dxf_rastervariables_struct::units.

int dxf_rastervariables_free ( DxfRasterVariables rastervariables)

Free the allocated memory for a DXF RASTERVARIABLES and all it's data fields.

Returns:
EXIT_SUCCESS when done, or EXIT_FAILURE when an error occurred.
Parameters:
rastervariablesa pointer to the memory occupied by the DXF RASTERVARIABLES object.

Definition at line 381 of file rastervariables.c.

References _, dxf_rastervariables_struct::dictionary_owner_hard, dxf_rastervariables_struct::dictionary_owner_soft, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_rastervariables_struct::next.

Referenced by dxf_rastervariables_free_chain().

void dxf_rastervariables_free_chain ( DxfRasterVariables rastervariables)

Free the allocated memory for a chain of DXF RASTERVARIABLES objects and all their data fields.

Parameters:
rastervariablesa pointer to the chain of DXF RASTERVARIABLES objects.

Definition at line 422 of file rastervariables.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_rastervariables_free(), and dxf_rastervariables_struct::next.

Here is the call graph for this function:

int dxf_rastervariables_get_id_code ( DxfRasterVariables rastervariables)

Get the id_code from a DXF RASTERVARIABLES object.

Returns:
id_code.
Parameters:
rastervariablesa pointer to a DXF RASTERVARIABLES object.

Definition at line 456 of file rastervariables.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_rastervariables_struct::id_code.

DxfRasterVariables* dxf_rastervariables_set_id_code ( DxfRasterVariables rastervariables,
int  id_code 
)

Set the id_code for a DXF RASTERVARIABLES object.

Parameters:
rastervariablesa pointer to a DXF RASTERVARIABLES object.
id_codethe id_code to be set for the entity.
This is to be an unique (sequential) number in the DXF file.

Definition at line 490 of file rastervariables.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_rastervariables_struct::id_code.

char* dxf_rastervariables_get_dictionary_owner_soft ( DxfRasterVariables rastervariables)

Get the pointer to the dictionary_owner_soft from a DXF RASTERVARIABLES object.

Returns:
pointer to the dictionary_owner_soft.
Warning:
No checks are performed on the returned pointer (string).
Parameters:
rastervariablesa pointer to a DXF RASTERVARIABLES object.

Definition at line 534 of file rastervariables.c.

References _, dxf_rastervariables_struct::dictionary_owner_soft, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

DxfRasterVariables* dxf_rastervariables_set_dictionary_owner_soft ( DxfRasterVariables rastervariables,
char *  dictionary_owner_soft 
)

Set the pointer to the dictionary_owner_soft for a DXF RASTERVARIABLES object.

Parameters:
rastervariablesa pointer to a DXF RASTERVARIABLES object.
dictionary_owner_softa string containing the pointer to the dictionary_owner_soft for the entity.

Definition at line 570 of file rastervariables.c.

References _, dxf_rastervariables_struct::dictionary_owner_soft, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

char* dxf_rastervariables_get_dictionary_owner_hard ( DxfRasterVariables rastervariables)

Get the pointer to the dictionary_owner_hard from a DXF RASTERVARIABLES object.

Returns:
pointer to the dictionary_owner_hard.
Warning:
No checks are performed on the returned pointer (string).
Parameters:
rastervariablesa pointer to a DXF RASTERVARIABLES object.

Definition at line 614 of file rastervariables.c.

References _, dxf_rastervariables_struct::dictionary_owner_hard, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

DxfRasterVariables* dxf_rastervariables_set_dictionary_owner_hard ( DxfRasterVariables rastervariables,
char *  dictionary_owner_hard 
)

Set the pointer to the dictionary_owner_hard for a DXF RASTERVARIABLES object.

Parameters:
rastervariablesa pointer to a DXF RASTERVARIABLES object.
dictionary_owner_harda string containing the pointer to the dictionary_owner_hard for the object.

Definition at line 650 of file rastervariables.c.

References _, dxf_rastervariables_struct::dictionary_owner_hard, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

int dxf_rastervariables_get_display_image_frame ( DxfRasterVariables rastervariables)

Get the display_image_frame from a DXF RASTERVARIABLES object.

Returns:
display_image_frame.
Parameters:
rastervariablesa pointer to a DXF RASTERVARIABLES object.

Definition at line 691 of file rastervariables.c.

References _, dxf_rastervariables_struct::display_image_frame, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

DxfRasterVariables* dxf_rastervariables_set_display_image_frame ( DxfRasterVariables rastervariables,
int  display_image_frame 
)

Set the display_image_frame for a DXF RASTERVARIABLES object.

Parameters:
rastervariablesa pointer to a DXF RASTERVARIABLES object.
display_image_framethe display_image_frame to be set for the object.

Definition at line 732 of file rastervariables.c.

References _, dxf_rastervariables_struct::display_image_frame, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

int dxf_rastervariables_get_display_quality ( DxfRasterVariables rastervariables)

Get the display_quality from a DXF RASTERVARIABLES object.

Returns:
display_quality.
Parameters:
rastervariablesa pointer to a DXF RASTERVARIABLES object.

Definition at line 778 of file rastervariables.c.

References _, dxf_rastervariables_struct::display_quality, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

DxfRasterVariables* dxf_rastervariables_set_display_quality ( DxfRasterVariables rastervariables,
int  display_quality 
)

Set the display_quality for a DXF RASTERVARIABLES object.

Parameters:
rastervariablesa pointer to a DXF RASTERVARIABLES object.
display_qualitythe display_quality to be set for the object.

Definition at line 819 of file rastervariables.c.

References _, dxf_rastervariables_struct::display_quality, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

int dxf_rastervariables_get_units ( DxfRasterVariables rastervariables)

Get the units from a DXF RASTERVARIABLES object.

Returns:
units.
Parameters:
rastervariablesa pointer to a DXF RASTERVARIABLES object.

Definition at line 864 of file rastervariables.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_rastervariables_struct::units.

DxfRasterVariables* dxf_rastervariables_set_units ( DxfRasterVariables rastervariables,
int  units 
)

Set the units for a DXF RASTERVARIABLES object.

Parameters:
rastervariablesa pointer to a DXF RASTERVARIABLES object.
unitsthe units to be set for the object.

Definition at line 904 of file rastervariables.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_rastervariables_struct::units.

int32_t dxf_rastervariables_get_class_version ( DxfRasterVariables rastervariables)

Get the class_version from a DXF RASTERVARIABLES object.

Returns:
class_version.
Parameters:
rastervariablesa pointer to a DXF RASTERVARIABLES object.

Definition at line 949 of file rastervariables.c.

References _, dxf_rastervariables_struct::class_version, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

DxfRasterVariables* dxf_rastervariables_set_class_version ( DxfRasterVariables rastervariables,
int32_t  class_version 
)

Set the class_version for a DXF RASTERVARIABLES object.

Parameters:
rastervariablesa pointer to a DXF RASTERVARIABLES object.
class_versionthe class_version to be set for the object.

Definition at line 989 of file rastervariables.c.

References _, dxf_rastervariables_struct::class_version, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

DxfRasterVariables* dxf_rastervariables_get_next ( DxfRasterVariables rastervariables)

Get the pointer to the next RASTERVARIABLES object from a DXF RASTERVARIABLES object.

Returns:
pointer to the next RASTERVARIABLES object.
Warning:
No checks are performed on the returned pointer.
Parameters:
rastervariablesa pointer to a DXF RASTERVARIABLES object.

Definition at line 1037 of file rastervariables.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_rastervariables_struct::next.

DxfRasterVariables* dxf_rastervariables_set_next ( DxfRasterVariables rastervariables,
DxfRasterVariables next 
)

Set the pointer to the next RASTERVARIABLES object for a DXF RASTERVARIABLES object.

Parameters:
rastervariablesa pointer to a DXF RASTERVARIABLES object.
nexta pointer to the next RASTERVARIABLES object for the list of objects.

Definition at line 1073 of file rastervariables.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_rastervariables_struct::next.

DxfRasterVariables* dxf_rastervariables_get_last ( DxfRasterVariables rastervariables)

Get the pointer to the last RASTERVARIABLES object from a linked list of DXF RASTERVARIABLES objects.

Returns:
pointer to the last RASTERVARIABLES object.
Warning:
No checks are performed on the returned pointer.
Parameters:
rastervariablesa pointer to a DXF RASTERVARIABLES object.

Definition at line 1117 of file rastervariables.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_rastervariables_struct::next.