Hi Jeffrey,
I think a lot (maybe all) of this functionality is already in the library under poor/unexpected names. For example, your DL_INSERT_AFTER(old,new) looks equivalent to the existing macro DL_APPEND_ELEM(list,old,new). Admittedly the existing one is poorly named.
Some style nits:
- I'd think _INORDER_ would be a better name than _SORTED_, since there are already _INORDER_ macros in uthash.h.
- Several of the raw assignments in your code (e.g. on line 4) should use _CASTASGN for portability.
- Should there be an LL_INSERT_INORDER, LL_INSERT_AFTER?
- Should there be CDL_ versions? My kneejerk reaction would be "no, it makes no sense to sort a circular list", but I don't know.
Thanks,
Arthur