Re:Efficient string copying and concatenation in C
by saagarjha on Friday September 13, 2019 @12:27AM
(#20959170)
> macOS used to provide them in /usr/include (now they're only in the kernel headers - but they're header-only and self-contained so they're easy to add to any project)
They've been moved to the Xcode Command Line Tools with the rest of the standard headers.
sys/queue.h provides four different linked list implementations: standard singly-linked lists, standard doubly-linked lists, a singly-linked list with a tail pointer (for fast tail insertion) and a doubly-linked list without a head pointer. All come complete with
sys/tree.h provides two types of balanced search trees: splay trees and red-black trees. Both provide ordered dictionaries
Both libraries make quite extensive use of macros, but they are quite reasonably implemented and documented via man-page. I've successfully used them a few times. Shame that, like other nice BSD innovations (e.g. strlcpy/strlcat) they haven't made it into other libcs.