Common C interfaces and implementations