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

layer_name.c File Reference

Functions for a DXF layer name object. More...

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

Go to the source code of this file.

Functions

DxfLayerNamedxf_layer_name_new ()
 Allocate memory for a DxfLayerName.
DxfLayerNamedxf_layer_name_init (DxfLayerName *layer_name)
 Allocate memory and initialize data fields in a LAYER_NAME object.
int dxf_layer_name_free (DxfLayerName *layer_name)
 Free the allocated memory for a DXF LAYER_NAME and all it's data fields.
void dxf_layer_name_free_chain (DxfLayerName *layer_names)
 Free the allocated memory for a chain of DXF LAYER_NAME objects and all their data fields.
char * dxf_layer_name_get_name (DxfLayerName *layer_name)
 Get the name from a DXF LAYER_NAME object.
DxfLayerNamedxf_layer_name_set_name (DxfLayerName *layer_name, char *name)
 Set the name for a DXF LAYER_NAME object.
int dxf_layer_name_get_length (DxfLayerName *layer_name)
 Get the length from the name member in a DXF LAYER_NAME object.
DxfLayerNamedxf_layer_name_set_length (DxfLayerName *layer_name, int length)
 Set the length of the name member for a DXF LAYER_NAME object.
DxfLayerNamedxf_layer_name_get_next (DxfLayerName *layer_name)
 Get the pointer to the next LAYER_NAME object from a DXF LAYER_NAME object.
DxfLayerNamedxf_layer_name_set_next (DxfLayerName *layer_name, DxfLayerName *next)
 Set the pointer to the next LAYER_NAME object for a DXF LAYER_NAME object.
DxfLayerNamedxf_layer_name_get_last (DxfLayerName *layer_name)
 Get the pointer to the last LAYER_NAME object from a linked list of DXF LAYER_NAME object.

Detailed Description

Functions for a DXF layer name object.

Author:
Copyright (C) 2017 by Bert Timmerman <bert.timmerman@xs4all.nl>.
Since:
The LAYER_NAME 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 layer_name.c.


Function Documentation

DxfLayerName* dxf_layer_name_new ( )

Allocate memory for a DxfLayerName.

Fill the memory contents with zeros.

Definition at line 52 of file layer_name.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_layer_index_struct::layer_name.

Referenced by dxf_layer_index_init(), and dxf_layer_name_init().

DxfLayerName* dxf_layer_name_init ( DxfLayerName layer_name)

Allocate memory and initialize data fields in a LAYER_NAME object.

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

Definition at line 90 of file layer_name.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_layer_name_new(), dxf_layer_name_struct::length, dxf_layer_name_struct::name, and dxf_layer_name_struct::next.

Referenced by dxf_layer_index_init(), and dxf_layer_index_read().

Here is the call graph for this function:

int dxf_layer_name_free ( DxfLayerName layer_name)

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

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

Definition at line 132 of file layer_name.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_layer_name_struct::name, and dxf_layer_name_struct::next.

Referenced by dxf_layer_name_free_chain().

void dxf_layer_name_free_chain ( DxfLayerName layer_names)

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

Parameters:
layer_namespointer to the chain of DXF LAYER_NAME objects.

Definition at line 172 of file layer_name.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_layer_name_free(), and dxf_layer_name_struct::next.

Referenced by dxf_layer_index_free().

Here is the call graph for this function:

char* dxf_layer_name_get_name ( DxfLayerName layer_name)

Get the name from a DXF LAYER_NAME object.

Returns:
name.
Warning:
No checks are performed on the returned pointer (string).
Parameters:
layer_namea pointer to a DXF LAYER_NAME object.

Definition at line 207 of file layer_name.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_layer_name_struct::name.

DxfLayerName* dxf_layer_name_set_name ( DxfLayerName layer_name,
char *  name 
)

Set the name for a DXF LAYER_NAME object.

Parameters:
layer_namea pointer to a DXF LAYER_NAME object.
namea string containing the name for the entity.

Definition at line 242 of file layer_name.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_layer_name_struct::name.

int dxf_layer_name_get_length ( DxfLayerName layer_name)

Get the length from the name member in a DXF LAYER_NAME object.

Returns:
length.
Parameters:
layer_namea pointer to a DXF LAYER_NAME object.

Definition at line 283 of file layer_name.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_layer_name_struct::length.

DxfLayerName* dxf_layer_name_set_length ( DxfLayerName layer_name,
int  length 
)

Set the length of the name member for a DXF LAYER_NAME object.

Parameters:
layer_namea pointer to a DXF LAYER_NAME object.
lengthlength.

Definition at line 319 of file layer_name.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_layer_name_struct::length.

DxfLayerName* dxf_layer_name_get_next ( DxfLayerName layer_name)

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

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

Definition at line 362 of file layer_name.c.

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

DxfLayerName* dxf_layer_name_set_next ( DxfLayerName layer_name,
DxfLayerName next 
)

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

Parameters:
layer_namea pointer to a DXF LAYER_NAME object.
nexta pointer to the next LAYER_NAME object for the object.

Definition at line 398 of file layer_name.c.

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

DxfLayerName* dxf_layer_name_get_last ( DxfLayerName layer_name)

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

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

Definition at line 442 of file layer_name.c.

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