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

dictionaryvar.c File Reference

Functions for a DXF dictionaryvar object (DICTIONARYVAR). More...

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

Go to the source code of this file.

Functions

DxfDictionaryVardxf_dictionaryvar_new ()
 Allocate memory for a DXF DICTIONARYVAR object.
DxfDictionaryVardxf_dictionaryvar_init (DxfDictionaryVar *dictionaryvar)
 Allocate memory and initialize data fields in a DICTIONARYVAR object.
DxfDictionaryVardxf_dictionaryvar_read (DxfFile *fp, DxfDictionaryVar *dictionaryvar)
 Read data from a DXF file into a DXF DICTIONARYVAR object.
int dxf_dictionaryvar_write (DxfFile *fp, DxfDictionaryVar *dictionaryvar)
 Write DXF output to a file for a DXF DICTIONARYVAR object.
int dxf_dictionaryvar_free (DxfDictionaryVar *dictionaryvar)
 Free the allocated memory for a DXF DICTIONARYVAR and all it's data fields.
void dxf_dictionaryvar_free_chain (DxfDictionaryVar *dictionaryvars)
 Free the allocated memory for a chain of DXF DICTIONARYVAR objects and all their data fields.
int dxf_dictionaryvar_get_id_code (DxfDictionaryVar *dictionaryvar)
 Get the ID code from a DXF DICTIONARYVAR object.
DxfDictionaryVardxf_dictionaryvar_set_id_code (DxfDictionaryVar *dictionaryvar, int id_code)
 Set the ID code for a DXF DICTIONARYVAR object.
char * dxf_dictionaryvar_get_dictionary_owner_soft (DxfDictionaryVar *dictionaryvar)
 Get the soft pointer to the dictionary owner from a DXF DICTIONARYVAR object.
DxfDictionaryVardxf_dictionaryvar_set_dictionary_owner_soft (DxfDictionaryVar *dictionaryvar, char *dictionary_owner_soft)
 Set the pointer to the dictionary_owner_soft for a DXF DICTIONARYVAR object.
char * dxf_dictionaryvar_get_dictionary_owner_hard (DxfDictionaryVar *dictionaryvar)
 Get the hard pointer to the dictionary owner from a DXF DICTIONARYVAR object.
DxfDictionaryVardxf_dictionaryvar_set_dictionary_owner_hard (DxfDictionaryVar *dictionaryvar, char *dictionary_owner_hard)
 Set the pointer to the dictionary_owner_hard for a DXF DICTIONARYVAR object.
char * dxf_dictionaryvar_get_value (DxfDictionaryVar *dictionaryvar)
 Get the value from a DXF DICTIONARYVAR object.
DxfDictionaryVardxf_dictionaryvar_set_value (DxfDictionaryVar *dictionaryvar, char *value)
 Set the entry name for a DXF DICTIONARYVAR object.
char * dxf_dictionaryvar_get_object_schema_number (DxfDictionaryVar *dictionaryvar)
 Get the object schema number from a DXF DICTIONARYVAR object.
DxfDictionaryVardxf_dictionaryvar_set_object_schema_number (DxfDictionaryVar *dictionaryvar, char *object_schema_number)
 Set the object schema number for a DXF DICTIONARYVAR object.
DxfDictionaryVardxf_dictionaryvar_get_next (DxfDictionaryVar *dictionaryvar)
 Get the pointer to the next DICTIONARYVAR object from a DXF DICTIONARYVAR object.
DxfDictionaryVardxf_dictionaryvar_set_next (DxfDictionaryVar *dictionaryvar, DxfDictionaryVar *next)
 Set the pointer to the next DICTIONARYVAR object for a DXF DICTIONARYVAR object.
DxfDictionaryVardxf_dictionaryvar_get_last (DxfDictionaryVar *dictionaryvar)
 Get the pointer to the last DICTIONARYVAR object from a linked list of DXF DICTIONARYVAR objects.

Detailed Description

Functions for a DXF dictionaryvar object (DICTIONARYVAR).

Author:
Copyright (C) 2015, 2016, 2017 by Bert Timmerman <bert.timmerman@xs4all.nl>.
Since:
The DICTIONARYVAR 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 dictionaryvar.c.


Function Documentation

DxfDictionaryVar* dxf_dictionaryvar_new ( )

Allocate memory for a DXF DICTIONARYVAR object.

Fill the memory contents with zeros.

Definition at line 53 of file dictionaryvar.c.

References _, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

Referenced by dxf_dictionaryvar_init(), and dxf_dictionaryvar_read().

DxfDictionaryVar* dxf_dictionaryvar_init ( DxfDictionaryVar dictionaryvar)

Allocate memory and initialize data fields in a DICTIONARYVAR object.

Returns:
NULL when no memory was allocated, a pointer to the allocated memory when succesful.
Parameters:
dictionaryvarDXF DICTIONARYVAR object.

Definition at line 91 of file dictionaryvar.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_dictionaryvar_new(), dxf_dictionaryvar_set_dictionary_owner_hard(), dxf_dictionaryvar_set_dictionary_owner_soft(), dxf_dictionaryvar_set_id_code(), dxf_dictionaryvar_set_next(), dxf_dictionaryvar_set_object_schema_number(), and dxf_dictionaryvar_set_value().

Referenced by dxf_dictionaryvar_read().

Here is the call graph for this function:

DxfDictionaryVar* dxf_dictionaryvar_read ( DxfFile fp,
DxfDictionaryVar dictionaryvar 
)

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

The last line read from file contained the string "DICTIONARYVAR".
Now follows some data for the DICTIONARYVAR object, to be terminated with a " 0" string announcing the following object.
While parsing the DXF file store data in dictionaryvar.

Returns:
a pointer to dictionaryvar.
Parameters:
fpDXF file pointer to an input file (or device).
dictionaryvarDXF DICTIONARYVAR object.

Definition at line 139 of file dictionaryvar.c.

References _, dxf_file_struct::acad_version_number, AutoCAD_13, AutoCAD_14, dxf_dictionaryvar_struct::dictionary_owner_hard, dxf_dictionaryvar_struct::dictionary_owner_soft, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_dictionaryvar_init(), dxf_dictionaryvar_new(), dxf_file_struct::filename, dxf_file_struct::fp, dxf_dictionaryvar_struct::id_code, dxf_file_struct::line_number, dxf_dictionaryvar_struct::object_schema_number, and dxf_dictionaryvar_struct::value.

Here is the call graph for this function:

int dxf_dictionaryvar_write ( DxfFile fp,
DxfDictionaryVar dictionaryvar 
)

Write DXF output to a file for a DXF DICTIONARYVAR 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).
dictionaryvarDXF DICTIONARYVAR object.

Definition at line 269 of file dictionaryvar.c.

References _, dxf_file_struct::acad_version_number, AutoCAD_13, AutoCAD_14, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_dictionaryvar_get_dictionary_owner_hard(), dxf_dictionaryvar_get_dictionary_owner_soft(), dxf_dictionaryvar_get_id_code(), dxf_dictionaryvar_get_object_schema_number(), dxf_dictionaryvar_get_value(), and dxf_file_struct::fp.

Here is the call graph for this function:

int dxf_dictionaryvar_free ( DxfDictionaryVar dictionaryvar)

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

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

Definition at line 372 of file dictionaryvar.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_dictionaryvar_get_dictionary_owner_hard(), dxf_dictionaryvar_get_dictionary_owner_soft(), dxf_dictionaryvar_get_next(), dxf_dictionaryvar_get_object_schema_number(), and dxf_dictionaryvar_get_value().

Referenced by dxf_dictionaryvar_free_chain().

Here is the call graph for this function:

void dxf_dictionaryvar_free_chain ( DxfDictionaryVar dictionaryvars)

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

Parameters:
dictionaryvarspointer to the chain of DXF DICTIONARYVAR objects.

Definition at line 415 of file dictionaryvar.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_dictionaryvar_free(), and dxf_dictionaryvar_struct::next.

Here is the call graph for this function:

int dxf_dictionaryvar_get_id_code ( DxfDictionaryVar dictionaryvar)

Get the ID code from a DXF DICTIONARYVAR object.

Returns:
ID code.
Parameters:
dictionaryvara pointer to a DXF DICTIONARYVAR object.

Definition at line 448 of file dictionaryvar.c.

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

Referenced by dxf_dictionaryvar_write().

DxfDictionaryVar* dxf_dictionaryvar_set_id_code ( DxfDictionaryVar dictionaryvar,
int  id_code 
)

Set the ID code for a DXF DICTIONARYVAR object.

Parameters:
dictionaryvara pointer to a DXF DICTIONARYVAR object.
id_codeIdentification number for the object.
This is to be an unique (sequential) number in the DXF file.

Definition at line 483 of file dictionaryvar.c.

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

Referenced by dxf_dictionaryvar_init().

char* dxf_dictionaryvar_get_dictionary_owner_soft ( DxfDictionaryVar dictionaryvar)

Get the soft pointer to the dictionary owner from a DXF DICTIONARYVAR object.

Returns:
soft pointer to the dictionary owner.
Warning:
No checks are performed on the returned pointer (string).
Parameters:
dictionaryvara pointer to a DXF DICTIONARYVAR object.

Definition at line 528 of file dictionaryvar.c.

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

Referenced by dxf_dictionaryvar_free(), and dxf_dictionaryvar_write().

DxfDictionaryVar* dxf_dictionaryvar_set_dictionary_owner_soft ( DxfDictionaryVar dictionaryvar,
char *  dictionary_owner_soft 
)

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

Parameters:
dictionaryvara pointer to a DXF DICTIONARYVAR object.
dictionary_owner_softa string containing the pointer to the dictionary_owner_soft for the object.

Definition at line 564 of file dictionaryvar.c.

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

Referenced by dxf_dictionaryvar_init().

char* dxf_dictionaryvar_get_dictionary_owner_hard ( DxfDictionaryVar dictionaryvar)

Get the hard pointer to the dictionary owner from a DXF DICTIONARYVAR object.

Returns:
hard pointer to the dictionary owner.
Warning:
No checks are performed on the returned pointer (string).
Parameters:
dictionaryvara pointer to a DXF DICTIONARYVAR object.

Definition at line 608 of file dictionaryvar.c.

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

Referenced by dxf_dictionaryvar_free(), and dxf_dictionaryvar_write().

DxfDictionaryVar* dxf_dictionaryvar_set_dictionary_owner_hard ( DxfDictionaryVar dictionaryvar,
char *  dictionary_owner_hard 
)

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

Parameters:
dictionaryvara pointer to a DXF DICTIONARYVAR object.
dictionary_owner_harda string containing the pointer to the dictionary_owner_hard for the entity.

Definition at line 644 of file dictionaryvar.c.

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

Referenced by dxf_dictionaryvar_init().

char* dxf_dictionaryvar_get_value ( DxfDictionaryVar dictionaryvar)

Get the value from a DXF DICTIONARYVAR object.

Returns:
value when sucessful, NULL when an error occurred.
Parameters:
dictionaryvara pointer to a DXF DICTIONARYVAR object.

Definition at line 685 of file dictionaryvar.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_dictionaryvar_struct::value.

Referenced by dxf_dictionaryvar_free(), and dxf_dictionaryvar_write().

DxfDictionaryVar* dxf_dictionaryvar_set_value ( DxfDictionaryVar dictionaryvar,
char *  value 
)

Set the entry name for a DXF DICTIONARYVAR object.

Parameters:
dictionaryvara pointer to a DXF DICTIONARYVAR object.
valuea string containing the value for the object.

Definition at line 720 of file dictionaryvar.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_dictionaryvar_struct::value.

Referenced by dxf_dictionaryvar_init().

char* dxf_dictionaryvar_get_object_schema_number ( DxfDictionaryVar dictionaryvar)

Get the object schema number from a DXF DICTIONARYVAR object.

Returns:
object schema number when sucessful, NULL when an error occurred.
Parameters:
dictionaryvara pointer to a DXF DICTIONARYVAR object.

Definition at line 762 of file dictionaryvar.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_dictionaryvar_struct::object_schema_number.

Referenced by dxf_dictionaryvar_free(), and dxf_dictionaryvar_write().

DxfDictionaryVar* dxf_dictionaryvar_set_object_schema_number ( DxfDictionaryVar dictionaryvar,
char *  object_schema_number 
)

Set the object schema number for a DXF DICTIONARYVAR object.

Parameters:
dictionaryvara pointer to a DXF DICTIONARYVAR object.
object_schema_numbera string containing the object schema number for the object.

Definition at line 797 of file dictionaryvar.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_dictionaryvar_struct::object_schema_number.

Referenced by dxf_dictionaryvar_init().

DxfDictionaryVar* dxf_dictionaryvar_get_next ( DxfDictionaryVar dictionaryvar)

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

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

Definition at line 841 of file dictionaryvar.c.

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

Referenced by dxf_dictionaryvar_free().

DxfDictionaryVar* dxf_dictionaryvar_set_next ( DxfDictionaryVar dictionaryvar,
DxfDictionaryVar next 
)

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

Parameters:
dictionaryvara pointer to a DXF DICTIONARYVAR object.
nexta pointer to the next DICTIONARYVAR object for the object.

Definition at line 877 of file dictionaryvar.c.

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

Referenced by dxf_dictionaryvar_init().

DxfDictionaryVar* dxf_dictionaryvar_get_last ( DxfDictionaryVar dictionaryvar)

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

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

Definition at line 921 of file dictionaryvar.c.

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