libDXF 0.0.1
A library with DXF related functions written in C.
|
Definition of a DXF header section. More...
Go to the source code of this file.
Data Structures | |
struct | dxf_header |
Typedefs | |
typedef struct dxf_header | DxfHeader |
Functions | |
int | dxf_header_acad_version_from_string (const char *version_string) |
Converts a version string into the AutoCAD version number. | |
char * | dxf_header_acad_version_to_string (int version_number) |
Convert the AutoCAD version number into a version string. | |
DxfHeader * | dxf_header_new () |
Allocate memory for a DxfHeader . | |
DxfHeader * | dxf_header_init (DxfHeader *header, int acad_version_number) |
Initialize a dxf header. | |
DxfHeader * | dxf_header_read (DxfFile *fp, DxfHeader *header) |
Reads the header from a DXF file. | |
int | dxf_header_read_parse_int (DxfFile *fp, const char *temp_string, const char *header_var, int *value, int version_expression) |
int | dxf_header_read_parse_n_double (DxfFile *fp, const char *temp_string, const char *header_var, int version_expression, int quant,...) |
int | dxf_header_read_parse_string (DxfFile *fp, const char *temp_string, const char *header_var, char **value_string, int version_expression) |
int | dxf_header_read_parser (DxfFile *fp, DxfHeader *header, char *temp_string, int acad_version_number) |
Parses the header from a DXF file, with no particulary order. | |
int | dxf_header_write (DxfFile *fp, DxfHeader *header) |
Write DXF output to a file for a dxf header. | |
int | dxf_header_write_metric_new (DxfFile *fp) |
Write DXF output to a file for a metric DXF header. | |
DxfHeader * | dxf_header_free (DxfHeader *header) |
Free the allocated memory for a DXF HEADER and all it's data fields. |
Definition of a DXF header section.
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 header.h.
typedef struct dxf_header DxfHeader |
int dxf_header_acad_version_from_string | ( | const char * | version_string | ) |
Converts a version string into the AutoCAD version number.
version_string | Pointer to the version string. |
Definition at line 129 of file header.c.
References _, AC1006, AC1009, AC1012, AC1014, AC1015, AC1016, AC1017, AC1018, AC1019, AC1020, AC1021, AC1022, AC1023, AC1024, AC1025, AC1026, AC1027, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
Referenced by dxf_header_read().
char* dxf_header_acad_version_to_string | ( | int | version_number | ) |
Convert the AutoCAD version number into a version string.
version_number | AutoCAD version number. |
Definition at line 94 of file header.c.
References AC1006, AC1009, AC1012, AC1014, AC1015, AC1016, AC1017, AC1018, AC1021, AC1024, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
Referenced by dxf_header_init().
DxfHeader* dxf_header_new | ( | ) |
Allocate memory for a DxfHeader
.
Fill the memory contents with zeros.
Definition at line 59 of file header.c.
References _, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
Referenced by dxf_header_init(), and dxf_header_read().
Initialize a dxf header.
* Only initialize members which are valid for the given AutoCAD version.
header | DXF header to be initialized. |
acad_version_number | AutoCAD version number. |
Definition at line 192 of file header.c.
References _, AC1009, AC1012, AC1014, AC1015, AC1018, dxf_header::AcadMaintVer, dxf_header::AcadVer, dxf_header::AngBase, dxf_header::AngDir, dxf_header::AttDia, dxf_header::AttMode, dxf_header::AttReq, dxf_header::AUnits, dxf_header::AUPrec, dxf_header::BlipMode, dxf_header::CEColor, dxf_header::CELTScale, dxf_header::CELType, dxf_header::CELWeight, dxf_header::CEPSNType, dxf_header::ChamferA, dxf_header::ChamferB, dxf_header::ChamferC, dxf_header::ChamferD, dxf_header::CLayer, dxf_header::CMLJust, dxf_header::CMLScale, dxf_header::CMLStyle, dxf_header::Coords, dxf_header::DelObj, dxf_header::DimADEC, dxf_header::DimALT, dxf_header::DimALTD, dxf_header::DimALTF, dxf_header::DimALTRND, dxf_header::DimALTTD, dxf_header::DimALTTZ, dxf_header::DimALTU, dxf_header::DimALTZ, dxf_header::DimAPOST, dxf_header::DimASO, dxf_header::DimASSOC, dxf_header::DimASZ, dxf_header::DimATFIT, dxf_header::DimAUNIT, dxf_header::DimAZIN, dxf_header::DimBLK, dxf_header::DimBLK1, dxf_header::DimBLK2, dxf_header::DimCEN, dxf_header::DimCLRD, dxf_header::DimCLRE, dxf_header::DimCLRT, dxf_header::DimDEC, dxf_header::DimDLE, dxf_header::DimDLI, dxf_header::DimDSEP, dxf_header::DimEXE, dxf_header::DimEXO, dxf_header::DimFIT, dxf_header::DimFRAC, dxf_header::DimGAP, dxf_header::DimJUST, dxf_header::DimLDRBLK, dxf_header::DimLFAC, dxf_header::DimLIM, dxf_header::DimLUNIT, dxf_header::DimLWD, dxf_header::DimLWE, dxf_header::DimPOST, dxf_header::DimRND, dxf_header::DimSAH, dxf_header::DimSCALE, dxf_header::DimSD1, dxf_header::DimSD2, dxf_header::DimSE1, dxf_header::DimSE2, dxf_header::DimSHO, dxf_header::DimSOXD, dxf_header::DimTAD, dxf_header::DimTDEC, dxf_header::DimTFAC, dxf_header::DimTIH, dxf_header::DimTIX, dxf_header::DimTM, dxf_header::DimTMOVE, dxf_header::DimTOFL, dxf_header::DimTOH, dxf_header::DimTOL, dxf_header::DimTOLJ, dxf_header::DimTP, dxf_header::DimTSZ, dxf_header::DimTVP, dxf_header::DimTXSTY, dxf_header::DimTXT, dxf_header::DimTZIN, dxf_header::DimUNIT, dxf_header::DimUPT, dxf_header::DimZIN, dxf_header::DispSilH, dxf_header::DragMode, dxf_header::DWGCodePage, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_header_acad_version_to_string(), dxf_header_new(), dxf_header::Elevation, dxf_header::EndCaps, dxf_header::ExtMax, dxf_header::ExtMin, dxf_header::ExtNames, dxf_header::FilletRad, dxf_header::FillMode, dxf_header::FingerPrintGUID, dxf_header::HaloGap, dxf_header::Handling, dxf_header::HandSeed, dxf_header::HideText, dxf_header::HyperLinkBase, dxf_header::IndexCtl, dxf_header::InsBase, dxf_header::InsUnits, dxf_header::InterSectionColor, dxf_header::InterSectionDisplay, dxf_header::JoinStyle, dxf_header::LimCheck, dxf_header::LimMax, dxf_header::LimMin, dxf_header::LTScale, dxf_header::LUnits, dxf_header::LUPrec, dxf_header::LWDisplay, dxf_header::MaxActVP, dxf_header::Measurement, dxf_header::Menu, dxf_header::MirrText, dxf_header::ObsColor, dxf_header::ObsLType, dxf_header::OLEStartUp, dxf_header::OrthoMode, dxf_header::OSMode, dxf_header::PDMode, dxf_header::PDSize, dxf_header::PElevation, dxf_header::PExtMax, dxf_header::PExtMin, dxf_header::PickStyle, dxf_header::PInsBase, dxf_header::PLimCheck, dxf_header::PLimMax, dxf_header::PLimMin, dxf_header::PLineGen, dxf_header::PLineWid, dxf_header::ProjectName, dxf_header::ProxyGraphics, dxf_header::PSLTScale, dxf_header::PStyleMode, dxf_header::PSVPScale, dxf_header::PUCSBase, dxf_header::PUCSName, dxf_header::PUCSOrg, dxf_header::PUCSOrgBack, dxf_header::PUCSOrgBottom, dxf_header::PUCSOrgFront, dxf_header::PUCSOrgLeft, dxf_header::PUCSOrgRight, dxf_header::PUCSOrgTop, dxf_header::PUCSOrthoRef, dxf_header::PUCSOrthoView, dxf_header::PUCSXDir, dxf_header::PUCSYDir, dxf_header::QTextMode, dxf_header::RegenMode, dxf_header::SaveImages, dxf_header::ShadEdge, dxf_header::ShadeDif, dxf_header::Sketchinc, dxf_header::SKPoly, dxf_header::SortEnts, dxf_header::SPLFrame, dxf_header::SPLineSegs, dxf_header::SPLineType, dxf_header::StyleSheet, dxf_header::SurfTab1, dxf_header::SurfTab2, dxf_header::SurfType, dxf_header::SurfU, dxf_header::SurfV, dxf_header::TDCreate, dxf_header::TDInDWG, dxf_header::TDUCreate, dxf_header::TDUpdate, dxf_header::TDUSRTimer, dxf_header::TDUUpdate, dxf_header::TextSize, dxf_header::TextStyle, dxf_header::Thickness, dxf_header::TileMode, dxf_header::TraceWid, dxf_header::TreeDepth, dxf_header::UCSBase, dxf_header::UCSName, dxf_header::UCSOrg, dxf_header::UCSOrgBack, dxf_header::UCSOrgBottom, dxf_header::UCSOrgFront, dxf_header::UCSOrgLeft, dxf_header::UCSOrgRight, dxf_header::UCSOrgTop, dxf_header::UCSOrthoRef, dxf_header::UCSOrthoView, dxf_header::UCSXDir, dxf_header::UCSYDir, dxf_header::UnitMode, dxf_header::UserI1, dxf_header::UserI2, dxf_header::UserI3, dxf_header::UserI4, dxf_header::UserI5, dxf_header::UserR1, dxf_header::UserR2, dxf_header::UserR3, dxf_header::UserR4, dxf_header::UserR5, dxf_header::USRTimer, dxf_header::VersionGUID, dxf_header::VisRetain, dxf_header::WorldView, dxf_point_struct::x0, dxf_header::XClipFrame, dxf_header::XEdit, dxf_point_struct::y0, and dxf_point_struct::z0.
Referenced by dxf_drawing_init().
Reads the header from a DXF file.
fp | DXF file handle of input file (or device). |
header | DXF header to be initialized. |
Definition at line 1868 of file header.c.
References _, dxf_header::_AcadVer, dxf_header::AcadVer, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_header_acad_version_from_string(), dxf_header_new(), dxf_header_read_parse_string(), dxf_header_read_parser(), dxf_read_scanf(), dxf_return_val_if_fail, FALSE, FOUND, dxf_file_struct::fp, and TRUE.
Referenced by dxf_section_read().
int dxf_header_read_parse_int | ( | DxfFile * | fp, |
const char * | temp_string, | ||
const char * | header_var, | ||
int * | value, | ||
int | version_expression | ||
) |
fp | DXF file handle of input file (or device). |
Definition at line 1228 of file header.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_read_is_int(), dxf_read_scanf(), FAIL, FOUND, and SUCCESS.
Referenced by dxf_header_read_parser().
int dxf_header_read_parse_n_double | ( | DxfFile * | fp, |
const char * | temp_string, | ||
const char * | header_var, | ||
int | version_expression, | ||
int | quant, | ||
... | |||
) |
fp | DXF file handle of input file (or device). |
Definition at line 1289 of file header.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_read_is_double(), dxf_read_scanf(), FALSE, FOUND, and SUCCESS.
Referenced by dxf_header_read_parser().
int dxf_header_read_parse_string | ( | DxfFile * | fp, |
const char * | temp_string, | ||
const char * | header_var, | ||
char ** | value_string, | ||
int | version_expression | ||
) |
fp | DXF file handle of input file (or device). |
Definition at line 1192 of file header.c.
References DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_read_is_string(), dxf_read_scanf(), FAIL, FOUND, and SUCCESS.
Referenced by dxf_header_read(), and dxf_header_read_parser().
int dxf_header_read_parser | ( | DxfFile * | fp, |
DxfHeader * | header, | ||
char * | temp_string, | ||
int | acad_version_number | ||
) |
Parses the header from a DXF file, with no particulary order.
fp | DXF file handle of input file (or device). |
header | DXF header to be initialized. |
Definition at line 1367 of file header.c.
References _, AC1009, AC1012, AC1014, AC1015, dxf_header::AcadMaintVer, dxf_header::AttMode, dxf_header::AUnits, dxf_header::AUPrec, dxf_header::CEColor, dxf_header::CELTScale, dxf_header::CELType, dxf_header::CLayer, dxf_header::DelObj, dxf_header::DimADEC, dxf_header::DimASZ, dxf_header::DimAUNIT, dxf_header::DimEXE, dxf_header::DimEXO, dxf_header::DimGAP, dxf_header::DimLUNIT, dxf_header::DimSCALE, dxf_header::DimSTYLE, dxf_header::DimTXT, dxf_header::DispSilH, dxf_header::DWGCodePage, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_header_read_parse_int(), dxf_header_read_parse_n_double(), dxf_header_read_parse_string(), dxf_return, dxf_header::ExtMax, dxf_header::ExtMin, FALSE, dxf_header::FillMode, dxf_header::GridMode, dxf_header::GridUnit, dxf_header::HandSeed, dxf_header::InsBase, dxf_header::InsUnits, dxf_header::LimMax, dxf_header::LimMin, dxf_header::LTScale, dxf_header::LUnits, dxf_header::LUPrec, dxf_header::MirrText, dxf_header::OrthoMode, dxf_header::OSMode, dxf_header::PLimMax, dxf_header::PLimMin, dxf_header::QTextMode, dxf_header::RegenMode, dxf_header::SPLineSegs, dxf_header::TextSize, dxf_header::TextStyle, dxf_header::TraceWid, TRUE, dxf_point_struct::x0, dxf_point_struct::y0, and dxf_point_struct::z0.
Referenced by dxf_header_read().
Write DXF output to a file for a dxf header.
fp | DXF file handle of input file (or device). |
header | DXF header entity. |
Definition at line 922 of file header.c.
References _, AC1012, AC1014, AC1015, AC1018, dxf_file_struct::acad_version_number, dxf_header::AcadMaintVer, dxf_header::AcadVer, dxf_header::AngBase, dxf_header::AngDir, dxf_header::AttDia, dxf_header::AttMode, dxf_header::AttReq, dxf_header::AUnits, dxf_header::AUPrec, dxf_header::BlipMode, dxf_header::CEColor, dxf_header::CELTScale, dxf_header::CELType, dxf_header::CELWeight, dxf_header::CEPSNType, dxf_header::ChamferA, dxf_header::ChamferB, dxf_header::ChamferC, dxf_header::ChamferD, dxf_header::CLayer, dxf_header::CMLJust, dxf_header::CMLScale, dxf_header::CMLStyle, dxf_header::Coords, dxf_header::DelObj, dxf_header::DimADEC, dxf_header::DimALT, dxf_header::DimALTD, dxf_header::DimALTF, dxf_header::DimALTRND, dxf_header::DimALTTD, dxf_header::DimALTTZ, dxf_header::DimALTU, dxf_header::DimALTZ, dxf_header::DimAPOST, dxf_header::DimASO, dxf_header::DimASSOC, dxf_header::DimASZ, dxf_header::DimATFIT, dxf_header::DimAUNIT, dxf_header::DimAZIN, dxf_header::DimBLK, dxf_header::DimBLK1, dxf_header::DimBLK2, dxf_header::DimCEN, dxf_header::DimCLRD, dxf_header::DimCLRE, dxf_header::DimCLRT, dxf_header::DimDEC, dxf_header::DimDLE, dxf_header::DimDLI, dxf_header::DimDSEP, dxf_header::DimEXE, dxf_header::DimEXO, dxf_header::DimFIT, dxf_header::DimFRAC, dxf_header::DimGAP, dxf_header::DimJUST, dxf_header::DimLDRBLK, dxf_header::DimLFAC, dxf_header::DimLIM, dxf_header::DimLUNIT, dxf_header::DimLWD, dxf_header::DimLWE, dxf_header::DimPOST, dxf_header::DimRND, dxf_header::DimSAH, dxf_header::DimSCALE, dxf_header::DimSD1, dxf_header::DimSD2, dxf_header::DimSE1, dxf_header::DimSE2, dxf_header::DimSHO, dxf_header::DimSOXD, dxf_header::DimSTYLE, dxf_header::DimTAD, dxf_header::DimTDEC, dxf_header::DimTFAC, dxf_header::DimTIH, dxf_header::DimTIX, dxf_header::DimTM, dxf_header::DimTMOVE, dxf_header::DimTOFL, dxf_header::DimTOH, dxf_header::DimTOL, dxf_header::DimTOLJ, dxf_header::DimTP, dxf_header::DimTSZ, dxf_header::DimTVP, dxf_header::DimTXSTY, dxf_header::DimTXT, dxf_header::DimTZIN, dxf_header::DimUNIT, dxf_header::DimUPT, dxf_header::DimZIN, dxf_header::DispSilH, dxf_header::DragMode, dxf_header::DWGCodePage, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_endsec_write(), dxf_section_write(), dxf_header::Elevation, dxf_header::EndCaps, dxf_header::ExtMax, dxf_header::ExtMin, dxf_header::ExtNames, dxf_header::FilletRad, dxf_header::FillMode, dxf_header::FingerPrintGUID, dxf_file_struct::fp, dxf_header::HaloGap, dxf_header::Handling, dxf_header::HandSeed, dxf_header::HideText, dxf_header::HyperLinkBase, dxf_header::IndexCtl, dxf_header::InsBase, dxf_header::InsUnits, dxf_header::InterSectionColor, dxf_header::InterSectionDisplay, dxf_header::JoinStyle, dxf_header::LimCheck, dxf_header::LimMax, dxf_header::LimMin, dxf_header::LTScale, dxf_header::LUnits, dxf_header::LUPrec, dxf_header::LWDisplay, dxf_header::MaxActVP, dxf_header::Measurement, dxf_header::Menu, dxf_header::MirrText, dxf_header::ObsColor, dxf_header::ObsLType, dxf_header::OLEStartUp, dxf_header::OrthoMode, dxf_header::OSMode, dxf_header::PDMode, dxf_header::PDSize, dxf_header::PElevation, dxf_header::PExtMax, dxf_header::PExtMin, dxf_header::PickStyle, dxf_header::PInsBase, dxf_header::PLimCheck, dxf_header::PLimMax, dxf_header::PLimMin, dxf_header::PLineGen, dxf_header::PLineWid, dxf_header::ProjectName, dxf_header::ProxyGraphics, dxf_header::PSLTScale, dxf_header::PStyleMode, dxf_header::PSVPScale, dxf_header::PUCSBase, dxf_header::PUCSName, dxf_header::PUCSOrg, dxf_header::PUCSOrgBack, dxf_header::PUCSOrgBottom, dxf_header::PUCSOrgFront, dxf_header::PUCSOrgLeft, dxf_header::PUCSOrgRight, dxf_header::PUCSOrgTop, dxf_header::PUCSOrthoRef, dxf_header::PUCSOrthoView, dxf_header::PUCSXDir, dxf_header::PUCSYDir, dxf_header::QTextMode, dxf_header::RegenMode, dxf_header::SaveImages, dxf_header::ShadEdge, dxf_header::ShadeDif, dxf_header::Sketchinc, dxf_header::SKPoly, dxf_header::SortEnts, dxf_header::SPLFrame, dxf_header::SPLineSegs, dxf_header::SPLineType, dxf_header::StyleSheet, dxf_header::SurfTab1, dxf_header::SurfTab2, dxf_header::SurfType, dxf_header::SurfU, dxf_header::SurfV, dxf_header::TDCreate, dxf_header::TDInDWG, dxf_header::TDUCreate, dxf_header::TDUpdate, dxf_header::TDUSRTimer, dxf_header::TDUUpdate, dxf_header::TextSize, dxf_header::TextStyle, dxf_header::Thickness, dxf_header::TileMode, dxf_header::TraceWid, dxf_header::TreeDepth, dxf_header::UCSBase, dxf_header::UCSName, dxf_header::UCSOrg, dxf_header::UCSOrgBack, dxf_header::UCSOrgBottom, dxf_header::UCSOrgFront, dxf_header::UCSOrgLeft, dxf_header::UCSOrgRight, dxf_header::UCSOrgTop, dxf_header::UCSOrthoRef, dxf_header::UCSOrthoView, dxf_header::UCSXDir, dxf_header::UCSYDir, dxf_header::UnitMode, dxf_header::UserI1, dxf_header::UserI2, dxf_header::UserI3, dxf_header::UserI4, dxf_header::UserI5, dxf_header::UserR1, dxf_header::UserR2, dxf_header::UserR3, dxf_header::UserR4, dxf_header::UserR5, dxf_header::USRTimer, dxf_header::VersionGUID, dxf_header::VisRetain, dxf_header::WorldView, dxf_point_struct::x0, dxf_header::XClipFrame, dxf_header::XEdit, dxf_point_struct::y0, and dxf_point_struct::z0.
int dxf_header_write_metric_new | ( | DxfFile * | fp | ) |
Write DXF output to a file for a metric DXF header.
Fall back for a situation where no default metric header file exists.
Basically this function writes down a DXF header based on metric values.
Included are:
EXIT_SUCCESS
when done, or EXIT_FAILURE
when an error occurred. fp | file pointer to output file (or device) |
Definition at line 711 of file header.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_file_struct::fp.
Free the allocated memory for a DXF HEADER
and all it's data fields.
NULL
when successful.header | Pointer to the memory occupied by the DXF HEADER entity. |
Definition at line 1961 of file header.c.
References _, dxf_header::AcadVer, dxf_header::CELType, dxf_header::CLayer, dxf_header::CMLStyle, dxf_header::DimAPOST, dxf_header::DimBLK, dxf_header::DimBLK1, dxf_header::DimBLK2, dxf_header::DimLDRBLK, dxf_header::DimPOST, dxf_header::DimSTYLE, dxf_header::DimTXSTY, dxf_header::DWGCodePage, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_header::FingerPrintGUID, dxf_header::HandSeed, dxf_header::HyperLinkBase, dxf_header::Menu, dxf_header::ProjectName, dxf_header::PUCSOrthoRef, dxf_header::StyleSheet, dxf_header::TextStyle, dxf_header::UCSBase, dxf_header::UCSName, dxf_header::UCSOrthoRef, and dxf_header::VersionGUID.
Referenced by dxf_drawing_free().