libDXF 0.0.1
A library with DXF related functions written in C.
Data Structures | Typedefs | Functions

tables.h File Reference

Header file for of a DXF tables section (TABLES). More...

#include "global.h"
Include dependency graph for tables.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  dxf_tables
 DXF definition of a tables section. More...

Typedefs

typedef struct dxf_tables DxfTables
 DXF definition of a tables section.

Functions

DxfTablesdxf_tables_new ()
 Allocate memory for a DXF TABLES section.
DxfTablesdxf_tables_init (DxfTables *tables)
 Allocate memory and initialize data fields in a DXF TABLES section.
int dxf_tables_write (DxfFile *fp, DxfTables *tables)
 Write DXF output to a file for a table section.
int dxf_tables_free (DxfTables *tables)
 Free the allocated memory for a DXF TABLE and all it's data fields.

Detailed Description

Header file for of a DXF tables section (TABLES).

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

The TABLES section contains several tables, each of which contain a variable number of table entries.

The order of the tables may change, but the LTYPE table will always precede the LAYER table. Each table is introduced with a 0 group with the label TABLE.
This is followed by a 2 group identifying the particular table (VPORT, LTYPE, LAYER, STYLE, VIEW, DIMSTYLE, UCS or APPID) and a 70 group that specifies the maximum number of table entries that may follow.
Table names are always output in uppercase characters.

The tables in a drawing can contain deleted items, but these are not written to the DXF file.
Thus, fewer table entries may follow the table header than are indicated by the 70 group, so don't use the count in the 70 group as an index to read in the table.
This group is provided so that a program which reads DXF files can allocate an array large enough to hold all the table entries that follow.


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 tables.h.


Typedef Documentation

typedef struct dxf_tables DxfTables

DXF definition of a tables section.


Function Documentation

DxfTables* dxf_tables_new ( )

Allocate memory for a DXF TABLES section.

Fill the memory contents with zeros.

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

Definition at line 48 of file tables.c.

References _, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

Referenced by dxf_tables_init().

DxfTables* dxf_tables_init ( DxfTables tables)

Allocate memory and initialize data fields in a DXF TABLES section.

Returns:
NULL when no memory was allocated, a pointer to the allocated memory when succesful.
Parameters:
tablesDXF tables section.

Definition at line 86 of file tables.c.

References _, dxf_tables::appids, dxf_tables::block_records, dxf_tables::dimstyles, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_tables_new(), dxf_tables::layers, dxf_tables::ltypes, dxf_tables::max_table_entries, dxf_tables::styles, dxf_tables::ucss, dxf_tables::views, and dxf_tables::vports.

Here is the call graph for this function:

int dxf_tables_write ( DxfFile fp,
DxfTables tables 
)

Write DXF output to a file for a table section.

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

Todo:
Add code here

Parameters:
fpDXF file pointer to an output file (or device).
tablesDXF table section.

Definition at line 134 of file tables.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_endsec_write(), and dxf_section_write().

Here is the call graph for this function:

int dxf_tables_free ( DxfTables tables)

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

Returns:
EXIT_SUCCESS when done, or EXIT_FAILURE when an error occurred.
Parameters:
tablesDXF table section.

Definition at line 175 of file tables.c.

References _, dxf_tables::appids, dxf_tables::block_records, dxf_tables::dimstyles, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_tables::layers, dxf_tables::ltypes, dxf_tables::styles, dxf_tables::ucss, dxf_tables::views, and dxf_tables::vports.