[Top][All Lists]

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

Re: [libredwg] Refactoring R2000

From: Till Heuschmann
Subject: Re: [libredwg] Refactoring R2000
Date: Mon, 08 Jul 2013 22:25:43 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130620 Thunderbird/17.0.7


Now Introducing a new thing, for every decoding version, there will a
separate decoding file.
We must define "decode_R13_R15 ()" in decode_r2000.c file.

To decode a R2000 version, there is a single function "decode_R13_R15
()" that is doing every thing consisting of 491 lines.
Hence, we should break this function into sub-smaller functions based
on sections like for
1. Unknown section 1
2. Picture (Pre-R13C3)
3. Header variables
4. Classes
5. Object map
6. Second header
7. Section measurement

Please give your views, suggestions on this and correct me where I am wrong.

My thoughts on this:

- Splitting the decode_R13_R15() function is really necessary
- In the decode_r2000.c there should only be functions that are special to R2000 files. All functions that are dealing with common sections should go to separate files. For example the "classes" section can be found in all versions and could be separated to a classes.c
file where all the different decode_classes_rXXXX functions are.
- The decoding of sections like the "second header" is useless at the moment. It should not be thrown away but should only be executed when a command line flag like "fullread" is present.

reply via email to

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