[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libredwg] GSOC Progress - LibreDWG Decode Refactoring

From: Avneet Kaur
Subject: [libredwg] GSOC Progress - LibreDWG Decode Refactoring
Date: Mon, 29 Jul 2013 14:39:05 +0530

As per milestones, upto mid-term evaluation I have to complete these:

1. Support R2004
2. Refactor decode.c file
3. Source code Documentation

I. Start with R2004 version:
   * Successfully implemented 32-bit CRC.
   * R2004 Header CRC check
   * R2004 Handle CRC check
   * R2004 Classes CRC check
   * R2004 Section map CRC check
   * Change R2004 file header according to specs 5.3 (page no 22)
   * Implemented section page checksum - but there is something wrong
when we compare the checksum with CRC. According to specs, it is
always different from CRC. Gives no error during compilation but throw
SegFault on parsing DWG R2004 file.
   * Resizing of variables under encrypted data (4 to 8 bytes) throws
segFault on parsing R2004 DWG file.
I have tested these changes one at a time. So first five points are
right implemented.

II. Come with Refactoring:
I followed Till's approach for refactoring. Split the DWG versions
according to common and uncommon sections.
   * Since header, handle, classes and section map are common sections
so I made separate .c files for these; decode_r13_r15 and
decode_r2004.c for decoding the DWG version respectively; decode.c
file containing macros and main function for decoding the DWG file;
object.c for decoding objects call by header section function and
resolve_pointers.c file for resolving handle references.
   * Modified makefile.
   * Include stdint.h library and made changes.
   * Refactored each and every file - move function declarations to
header file, obey GNU coding standards like in some places no space
before and after operator, characters exceeding 80's, no proper
comment style and so others.

Refactoring almost is complete, but currently playing with the following error:

In file included from object.c:27:0:
dwg.spec: In function 'dwg_decode_INSERT':
dwg.spec:341:7: error: 'DECODER' undeclared (first use in this function)
dwg.spec:341:7: note: each undeclared identifier is reported only once
for each function it appears in
dwg.spec:342:9: error: expected ';' before '{' token
dwg.spec: In function 'dwg_decode_MINSERT':
dwg.spec:458:7: error: 'DECODER' undeclared (first use in this function)
dwg.spec:459:9: error: expected ';' before '{' token

"DECODER" is declared in dwg.spec file under IS_DECODER macro and this
macro is used in decode.h file.
I am including decode.h file in object.c file. I will get out from
this error soon.

III. Documentation
As I used Doxygen for source code documentation.
   * Modified README file for Documentation main page.
   * Add doxygen comments to every file for struct, enum and functions
and header (like)

 *     \file           decode_r2004.c
 *     \brief          R2004 decode functions
 *     \author       written by Felipe Castro
 *     \author       modified by Felipe CorrĂȘa da Silva Sances
 *     \author       modified by Rodrigo Rodrigues da Silva
 *     \author       modified by Till Heuschmann
 *     \version
 *     \copyright   GNU General Public License (version 3 or later)

Currently version filed is empty, developer can decide release version.

GSoC Daily Diary :
Documentation    :
Code                  :

After mid-term evaluation, I will focus on R2007 version (decoding and

Er. Avneet Kaur

"Coming together is a beginning; keeping together is progress; working
together is success."

reply via email to

[Prev in Thread] Current Thread [Next in Thread]