[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [libredwg] Refactoring R2000
From: |
Avneet Kaur |
Subject: |
Re: [libredwg] Refactoring R2000 |
Date: |
Wed, 10 Jul 2013 22:17:55 +0530 |
On Tue, Jul 9, 2013 at 1:55 AM, Till Heuschmann <address@hidden> wrote:
> All functions that are dealing with common sections should go to separate
> files.
Yes. Handle section (Object map in case of R13-R15), Section (map in
R2004 and locator
records in R13 - R15) and Header variables are common part.
So I will make .h (handle.h, section_record.h and header.h) and .c
files for these.
In decode.c file, there are six private functions
/************************************************************************/
static void
dwg_decode_add_object(Dwg_Data * dwg, Bit_Chain * dat,
long unsigned int address);
static Dwg_Object *
dwg_resolve_handle(Dwg_Data* dwg, unsigned long int handle);
static void
dwg_decode_header_variables(Bit_Chain* dat, Dwg_Data * dwg);
static void
resolve_objectref_vector(Dwg_Data * dwg);
/********************************************************************/
Above these functions are used in every version.
So will put in new common_ref.h file or declare in decode.h file.
So guide me on this.
/*********************************************************************/
int decode_R13_R15(Bit_Chain* dat, Dwg_Data * dwg);
int read_r2007_meta_data(Bit_Chain *dat, Dwg_Data *dwg);
/********************************************************************/
According to my review, there are two paths either
- Declare decoding function of every version in decode.h file and define in
separate file depending upon its version.
OR
- Make .h file to decode every version like declaration of decode_R13_R15()
will be in decode_r2000.h file and definition in decode_r2000.c file and
calling from decode.c file by dwg_decode_data().
Please tell me on which path I should go.
--
Er. Avneet Kaur
Blog: www.avneetkhasla.wordpress.com
"Coming together is a beginning; keeping together is progress; working
together is success."