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

object_id.c File Reference

Functions for DXF object ids. More...

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

Go to the source code of this file.

Functions

DxfObjectIddxf_object_id_new ()
 Allocate memory for a DXF object_id.
DxfObjectIddxf_object_id_init (DxfObjectId *object_id)
 Allocate memory and initialize data fields in a DXF object_id.
int dxf_object_id_free (DxfObjectId *object_id)
 Free the allocated memory for a DXF object_id and all it's data fields.
void dxf_object_id_free_chain (DxfObjectId *object_ids)
 Free the allocated memory for a chain of DXF object_ids and all their data fields.
int dxf_object_id_get_group_code (DxfObjectId *object_id)
 Get the group_code from a DXF object_id.
DxfObjectIddxf_object_id_set_group_code (DxfObjectId *object_id, int group_code)
 Set the group_code for a DXF object_id.
char * dxf_object_id_get_data (DxfObjectId *object_id)
 Get the data from a DXF object_id.
DxfObjectIddxf_object_id_set_data (DxfObjectId *object_id, char *data)
 Set the data for a DXF object_id.
int dxf_object_id_get_length (DxfObjectId *object_id)
 Get the length from a DXF object_id.
DxfObjectIddxf_object_id_set_length (DxfObjectId *object_id, int length)
 Set the length for a DXF object_id.
DxfObjectIddxf_object_id_get_next (DxfObjectId *object_id)
 Get the pointer to the next DXF object_id from a DXF object_id.
DxfObjectIddxf_object_id_set_next (DxfObjectId *object_id, DxfObjectId *next)
 Set the pointer to the next DXF object_id for a DXF object_id.
DxfObjectIddxf_object_id_get_last (DxfObjectId *object_id)
 Get the pointer to the last DXF object_id from a linked list of DXF object_id.

Detailed Description

Functions for DXF object ids.

Author:
Copyright (C) 2016, 2017 by Bert Timmerman <bert.timmerman@xs4all.nl>.

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


Function Documentation

DxfObjectId* dxf_object_id_new ( )

Allocate memory for a DXF object_id.

Fill the memory contents with zeros.

Definition at line 44 of file object_id.c.

References _, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

Referenced by dxf_acad_proxy_entity_init(), and dxf_object_id_init().

DxfObjectId* dxf_object_id_init ( DxfObjectId object_id)

Allocate memory and initialize data fields in a DXF object_id.

Returns:
NULL when no memory was allocated, a pointer to the allocated memory when succesful.
Parameters:
object_idDXF object_id.

Definition at line 82 of file object_id.c.

References _, dxf_object_id_struct::data, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_object_id_new(), and dxf_object_id_struct::next.

Referenced by dxf_acad_proxy_entity_read().

Here is the call graph for this function:

int dxf_object_id_free ( DxfObjectId object_id)

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

Returns:
EXIT_SUCCESS when done, or EXIT_FAILURE when an error occurred.
Parameters:
object_idPointer to the memory occupied by the DXF object_id.

Definition at line 123 of file object_id.c.

References _, dxf_object_id_struct::data, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_object_id_struct::next.

Referenced by dxf_object_id_free_chain().

void dxf_object_id_free_chain ( DxfObjectId object_ids)

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

Parameters:
object_idsa pointer to the chain of DXF object_ids.

Definition at line 163 of file object_id.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_object_id_free(), and dxf_object_id_struct::next.

Here is the call graph for this function:

int dxf_object_id_get_group_code ( DxfObjectId object_id)

Get the group_code from a DXF object_id.

Returns:
group_code.
Parameters:
object_ida pointer to a DXF object_id.

Definition at line 196 of file object_id.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_object_id_struct::group_code.

Referenced by dxf_acad_proxy_entity_write().

DxfObjectId* dxf_object_id_set_group_code ( DxfObjectId object_id,
int  group_code 
)

Set the group_code for a DXF object_id.

Returns:
a pointer to object_id when sucessful, NULL when an error occurred.
Parameters:
object_ida pointer to a DXF object_id.
group_codethe group_code to be set for the entity.

Definition at line 237 of file object_id.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_object_id_struct::group_code.

Referenced by dxf_acad_proxy_entity_read().

char* dxf_object_id_get_data ( DxfObjectId object_id)

Get the data from a DXF object_id.

Returns:
data when sucessful, NULL when an error occurred.
Parameters:
object_ida pointer to a DXF object_id.

Definition at line 280 of file object_id.c.

References _, dxf_object_id_struct::data, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

Referenced by dxf_acad_proxy_entity_write().

DxfObjectId* dxf_object_id_set_data ( DxfObjectId object_id,
char *  data 
)

Set the data for a DXF object_id.

Parameters:
object_ida pointer to a DXF object_id.
dataa string containing the data for the entity.

Definition at line 315 of file object_id.c.

References _, dxf_object_id_struct::data, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

Referenced by dxf_acad_proxy_entity_init().

int dxf_object_id_get_length ( DxfObjectId object_id)

Get the length from a DXF object_id.

Returns:
length.
Parameters:
object_ida pointer to a DXF object_id.

Definition at line 355 of file object_id.c.

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

DxfObjectId* dxf_object_id_set_length ( DxfObjectId object_id,
int  length 
)

Set the length for a DXF object_id.

Returns:
a pointer to object_id when sucessful, NULL when an error occurred.
Parameters:
object_ida pointer to a DXF object_id.
lengthLength to be set for the entity.

Definition at line 393 of file object_id.c.

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

DxfObjectId* dxf_object_id_get_next ( DxfObjectId object_id)

Get the pointer to the next DXF object_id from a DXF object_id.

Returns:
pointer to the next object_id.
Warning:
No checks are performed on the returned pointer.
Parameters:
object_ida pointer to a DXF \ object_id.

Definition at line 436 of file object_id.c.

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

Referenced by dxf_acad_proxy_entity_write().

DxfObjectId* dxf_object_id_set_next ( DxfObjectId object_id,
DxfObjectId next 
)

Set the pointer to the next DXF object_id for a DXF object_id.

Parameters:
object_ida pointer to a DXF object_id.
nexta pointer to the next DXF object_id for the entity.

Definition at line 472 of file object_id.c.

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

DxfObjectId* dxf_object_id_get_last ( DxfObjectId object_id)

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

Returns:
pointer to the last object_id.
Warning:
No checks are performed on the returned pointer.
Parameters:
object_ida pointer to a DXF \ object_id.

Definition at line 516 of file object_id.c.

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

Referenced by dxf_acad_proxy_entity_read().