Thursday, June 30, 2005

Writing C with XML and XSLT

I've been playing with writing C code with XML and XSLT. I have been using this to look at a state machine where each state is a separate C function. eg the BSD Installer C backend.

The basic gist is:

<installer>
 <window name="foo">
  <button name="b1"/>
  <button name="b2"/>
 </window>
 <window name="bar">
  <button name="baz">
 </window>
</installer>

The XSL file then converts each <window> to a separate function with each <button> becoming the correct definition for a button in dfui API.

Monday, June 27, 2005

Summer of Code

I received an email from goggle in the weekend saying I was selected for the Google Summer of Code to work with the FreeBSD Project on integrating the BSD Installer to FreeBSD.

I have added a page to the FreeBSD test wiki on my project. It is currently the proposal I sent in but will soon include more detail.

Friday, June 17, 2005

OpenSolaris

I've been looking at the OpenSolaris source code.

I found this little gem. It will print a number n in base b to stdout. That's fine but this one works recursively. Also note the use of register long.

The thing with the code is they only use it to print an octal, decimal or hexadecimal number. These are easily replaced with printf using %o %u and %x respectively.