> My god, you only see this type of horrendous API in C don't you.
This is the appropriate place to put a link to this pair of classics on API design:
"How Do I Make This Hard to Misuse?" https://ozlabs.org/~rusty/index.cgi/tech/2008-03-30.html
"What If I Don't Actually Like My Users?" https://ozlabs.org/~rusty/index.cgi/tech/2008-04-01.html
gets belongs in category -10