ABI array format

Kenny B funisher at gmail.com
Wed Dec 19 03:32:21 PST 2007


Commonly in C API's you will see something of the following:

size_t byte_chr(void* haystack, size_t len, char needle);

or

uint mc_hash(memcache *mc, char *key, size_t len);

I have never seen the pointer and length in reverse order. Why then, is
the ABI for the arrays in reverse order...

(length, pointer)

I know this is a real long shot, but it'd be super awesome (and also
break every %.*s in printf, if those were reversed). I could rewrite
those API's to be

size_t byte_chr(void* haystack, string needle);

uint mc_hash(memcache *mc, string key);

and it'd be about 500 times more awesome.

Thanks for listening,
Kenny



More information about the Digitalmars-d mailing list