Older blog entries for dajobe (starting at number 3)

C99

I've been reading Linux kernel changes related to updating for C99 Designated Initializers (also called named struct initialisers). Does anyone know why these are a good idea and why you'd want to change / break your code to support these?

They work like this. A struct with two fields:

struct type_foo bar = {
  val1, 
  val2
};

is now (or can now be) written as

struct type_foo bar = {
  .field1 = val1,
  .field2 = val2
};

and I was just getting used to ignoring K&R C support ;)

3 Aug 2002 (updated 3 Aug 2002 at 20:30 UTC) »

I've mostly been working on the redland iterator changes needed for contexts that edd wanted. The current state is 'make check' works fine, except for memory leak, which I'm still hunting. I tried valgrind, but it gave false info which took yet more time to work that out.

After I get this fixed this, I'll have to consider changing streams to match this new model, however I'm a little worried since it may cause too much user-level change. Iterators are pretty internal and hardly leak out for non-C.

The changes for streams, like iterators are as follows: The two methods on stream are presently: is_end and get_next. is_end will remain the same, but get_next splits into get and next. It may be possible to hide this outside C. The general change is from:

while !stream.is_end { s=stream.get_next;blah blah }

to:

while !stream.is_end { s=stream.get; blah blah; stream.next() }

where the 's' is a shared pointer in C but could be a copy outside. After stream.next() the pointer moves and isn't valid.

(actually this makes things more efficent, there is less copying inside redland and things should work faster)

Last night a bit of success with redland preparing to add contexts. I took the previously static configuration of the hash indexing and made it work dynamically - the code was ready for this - although use the same configuration as the old static one. The next step is to allow users to pass in what indexes they want. I have to work out a good method of passing in appropriate paramters.

Hack hack hack on redland. Isn't libtool such a pain? And on OSX especially. Seems that tool needs a new release, it's been at 1.4.2.hidden versions for along time. At least the Debian version has the patches from CVS to fix some of the worst things.

Now don't get me started on the automake 1.4, 1.5, 1.6 mess

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!