[cc-devel] API changes for liblicense: drop ll_get_name() and friends

Asheesh Laroia asheesh at creativecommons.org
Mon Jan 7 22:14:56 EST 2008


I'm preparing liblicense for a 0.5 release.  There's been a lot of great 
work in liblicense done by people who aren't me over the last few months, 
and it's (way past) time for that work to see a general release.

I'm inventorying it now to see what else should be done before 0.5.  I 
came up with an API switch I wanted to make, so I thought I'd ask the list 
about it.  (NY, this includes you - I haven't asked anyone other than my 
head about this.)  Be warned: No comments on this mean I'm going to get my 
way!

We have some ll_get_* functions, like ll_get_name, ll_get_jurisdiction, 
and ll_get_version, and also a general ll_get_attribute() function.  I 
would like to remove the named ll_get_* functions and require users of the 
license to use the ll_get_attribute(license_uri, LL_ATTRIBUTE_URI_PERMITS) 
syntax.

Advantages:

* Only one way to do it, and that way to do it extends in an obvious way 
to the other

* This is a C library, so people who complain about the syntax can't 
really complain - they're already in C
* The addition of 
* Making people aware of our constants makes it easier to show them that 
they can often re-use these constants in other RDF-exposing libraries.

Impact on speed:

* None: If you use our (e.g.) LL_ATTRIBUTE_URI_PERMITS constant, then we 
can do a pointer equailty check instead of a string check, which is 
practically free, so there should be no speed loss from switching to this.

Impact on library usability:

* Hardly any: If your text editor has known-word completion, then it's 
just as easy to expand arguments to ll_get_attribute as it is to expand 
the function name ll_get_name.

Disadvantages:

* Only one: It makes the calls to ll_get_name(uri) etc. look longer.  I'm 
okay with shortening e.g. LL_ATTRIBUTE_URI_REQUIRES to 
LL_ATTRIBUTE_REQUIRES or LL_ATTR_REQUIRES or even LL_REQUIRES.

Your take:

[This space intentionally left blank.]

-- Asheesh.

-- 
All heiresses are beautiful.
 		-- John Dryden



More information about the cc-devel mailing list