4 May 2002 gabe   » (Journeyer)

After about two years I finally have access to my advogato account again. (Thanks Raph!) I created it back in 1999 or 2000 when I was living in California. Then I forgot my password at some point and well.. here I am.

I spent some time tracking down folks I know on advogato and certifying them as the lunatics they are.

I started some work on my NetInfo extension for PHP a few weeks ago. It took a while to track down the proper API to use because Mac OS X's documentation SUCKS! Thank goodness for Darwin. I got a pointer to check out the /usr/include/netinfo stuff and I stuck with that API. Someone had previously pointed me to the directory services API in OSX, which is a diseased beast that needs to be incinerated and never seen by anyone again.

So here's the API I've come up with for this NetInfo extension:

  • ni_open(domain [, user, pw [, host [, timeout]]])
  • *ni_close()
  • ni_resync(domain [, tries])
  • ni_statistics(domain)
  • ni_domainname(domain)
  • ni_rparent(domain)

  • ni_dir_create(conn, dir)
  • ni_dir_destroy(conn, dir)
  • *ni_dir_rename(conn, dir, new)
  • ni_dir_list(conn, dir)
  • ni_dir_properties(conn, dir)

  • ni_prop_rename(conn, dir, prop, new)
  • ni_prop_create(conn, dir, prop, value)
  • ni_prop_destroy(conn, dir, prop)
  • ni_prop_append(conn, dir, prop, value)
  • ni_prop_merge(conn, dir, prop, value)
  • ni_prop_values(conn, dir, prop)

  • ni_value_insert(conn, dir, prop, value, index)
  • ni_value_destroy(conn, dir, prop, value)
  • *ni_value_append(conn, dir, prop, value)

  • *ni_find_dirs_with_prop(conn, prop) -- find directories that have a property
  • *ni_find_dirs_with_prop_value(conn, prop, value)

* = non-existant in netinfo C API, something i need to create

functions will not be required to have conn passed to them once a connection has been initiated with ni_open() successfully once. it will be optional.

This seems like it will be a good project for me to do to get back into the habits of writing C code. I found an awesome book at B&N called "Pointers on C". It's the best damn programming book I've ever read, not that I've finished it yet... So, good luck to me on getting this done. Perhaps I can get it done within a month and maybe get it included in PHP 4.3 since that's supposed to be the first official OSX-supported release.

Latest blog entries     Older blog entries

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!