theck01/offbrand_lib — pull request #11 by danhd123 (2013-06-18 06:53:09+00:00)
Title: API changes for readability, consistency, less clutter

Hi,

I like the idea of Offbrand, but the API is kinda unusable for inconsistency, namespace pollution, and readability. So I renamed everything, after the fashion of Core Foundation. Made it consistent, readable, and tweaked a couple minor parts of the API. I also gave it an Xcode project, which I'm afraid isn't complete (haven't got the tests set up yet).

I didn't make any drastic changes to the API (other than the wholesale replacement of obj * with OBTypeRef), but I have a few thoughts about things you could do/add:

* retain and release - I really don't grok why release (now OBRelease) returns a OBTypeRef, but OBRetain returns void. If anything, it should be the opposite.
* Unicode support - what string library worth its salt doesn't have this in 2013? If you don't want it, don't have your own string datatype, just have your functions operate on C strings, maybe just wrapping string.h.
* displayObj (OBDisplay) - get rid of it or at the very least add OBDescription so that objects can be put into format strings without having to access their internals.
* Consider wrapping all public versions of the base functions in type-friendly versions; e.g. OBDequeHash(OBDeque *dq); It can just call down to the OBTypeRef version, or do it vice-versa.

Anyway, hope this gives you some good ideas!
danhd123