lua-users home
lua-l archive

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


On Thu, Mar 11, 2010 at 1:23 PM, Ben Kelly <ranavin@gmail.com> wrote:
> Sam Roberts wrote:
>> ## vstruct:
>>
>> Lots of code, include a lexer/parser, compiled patterns, etc. Definitely not
>> trivial to read.
>>
> I've tried to keep things fairly organized, and 1.1 is in general more
> readable than 1.0 - but it could definitely use more commenting, and
> probably a bit of a refactor.

I didn't mean to imply the code is less readable than it could be, not at all.

It does a lot more than struct.c/lpack.c, which are both about 200
lines of simple C code, so they
are comparatively easier to read and patch, and also comparatively feature-poor.

We do a lot of packing/unpacking, so I like that struct.c/lpack.c are
so small I can rewrite them
from scratch, which I'm on the verge of doing. But your lib looks
interesting, I might give it a try.

>> Patch vstruct with the changes from the mailing list.
>>
> What changes? Please point me at the right thread - if someone's posted
> a patch, I'd like to incorporate it into master.

>> Add _ to vstruct to mean "underlying endianness"
>>
> vstruct already has = for "native endianness", as well as < and >. Or am
> I misunderstanding what you mean by "underlying endianness"?

My apologies, it's struct.c that has the patch:

  From: Flemming Madsen <lua@themadsens.dk>
  Date: Thu, Oct 15, 2009 at 12:50 AM
  Subject: Struct library patch WAS: Roberto's struct library missing
"size" function?

and lacks a way to reset to native endianness.

Cheers,
Sam