[Top][All Lists]

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

Re: [libredwg] Sample functions

From: Rodrigo Rodrigues da Silva
Subject: Re: [libredwg] Sample functions
Date: Tue, 2 Jul 2013 01:37:59 -0300
User-agent: Mutt/1.5.21 (2010-09-15)

Sorry for the delay.

My Comments:

The first two functions are OK. Some attributes (specially 'global'
attributes) are useful but hard to access, or accessed in different
ways for different file versions. The API should abstract that.

And maybe we should think of a better way of error handling. Something
like making the function return an error code instead of a pointer, so
that the error could be treated properly. The pointer would be passed
as an argument. This is common in GTK and possibly other
object-oriented-like libraries written in C.

I am not sure about the effectiveness of the count_entity
function. Basically, when used with extract_[circle,lines] the program
will iterate 3 times over the whole object list, which has proved to
be very inefficient with big files. I have thought of storing the
objects in a binary tree or something more efficient than a list... of
course that is over the boundaries of your project, but keep that
possibility in mind. You could do some profiling with a relatively big
file (500MiB or so).

I would also suggest the latter functions (extract_lines and
extract_circles) be implemented in a more generic way. Think about
having to write one of these for each object. If you copy and paste
some code more than twice you're doing something wrong. I understand
the purpose of them, but as I menitoned before I am not sure if the
library should take care of it. This is data management, not data

Let's have a chat on IRC this week. Better Wednesday or Thursday. If I
am not on the channel, pvt me.

happy hacking,

On Sat, 22 Jun 2013, gagan wrote:

> I have created a total of 5 functions till now. Please review these [
> 0 ]. Tell me if these need any changes.
> Like the way functions are created for extracting lines and circles,
> we can have these for all entities since these avoid the low level
> struct access.
> [ 0 ]
> -- 
> Thanks
> Gaganjyot
> "Jai Sai Naath"

Rodrigo Rodrigues da Silva

reply via email to

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