in reply to [SOLVED (workaround)]: External C function called through XS not Doing The Right Thing

My C is rusty, but

If i saw

char *strcpy (char *dest, char *src)
I understand that strcopy takes pointers on the stack as its args. a web example shows
char input_str[20]; strcpy(input_str, "Hello");
so the prototype you gave of
extern void lcdCharDef(const int fd, int index, unsigned char data [8] +);
well unsigned char data [8] is not unsigned char *data. Does it mean the call stack has 8 characters in a row on it rather than a pointer to an array of 8 characters? if so your unsigned char * data in
void lcdCharDef(fd, index, data) int fd int index unsigned char * data
is putting a pointer to an array on the stack, isnt it?

i dug up my old C books, one copyright 1990 even, and i cant quite figure out what unsigned char data [8] in a prototype means, everytime char strings are passed the prototype is unsigned char *data

even looking on the web i dont see a prototype like unsigned char data [8], again all the calls seem to want unsigned char *data

edit,I researched and wrote this as other replys were coming in. So your workaround seems to imply that the pointer is what should be on the stack anyway, does that mean a prototype of unsigned char data [8] is converted to a prototype of unsigned char *data because of the [] array reference? what does the 8 do then?

edit2: ok, i should have hit the web harder, in most cases ive found a prototype of unsigned "something" data [8] uses some other type than char, like int. My first searches were for char arrays functions. In this case the 8 doesnt really mean anything and it is the same as unsigned char *data. If it were a 2d array or (N)d array they say all but the leftmost sizes need to be declared, even if you pass the array dims as parms. but void function_c(int m, int n, int arr[m][n]); is fine. this seems to be something introduced in C99, so i may need newer C books, 'cept i dont like to use it if i dont have to.