> 1. what is this mean: (SITAL_DEVICE_HANDLE)(long) ?
It's a double cast.
First you cast something to a long.
Then you cast it to a SITAL_DEVICE_HANDLE
> 2. i have function: int Sital_OpenDevice(SITAL_DEVICE_HANDLE device)
This seems like a broken API to me.
Actually, the first thing you should be calling is something that returns a SITAL_DEVICE_HANDLE.
Eg
1 2
|
SITAL_DEVICE_HANDLE h = Sital_CreateDevice(0); // no idea, just made this up to illustrate
int foo = Sital_OpenDevice(h); // pass the freshly minted handle on.
|
You shouldn't need to care what SITAL_DEVICE_HANDLE actually is. For sure, you shouldn't be creating handles out of thin air just to pass into the API.
It's like good old stdio FILE.
1 2 3 4
|
FILE *fp = fopen("filename.txt","r");
int c = fgetc(fp);
fgets(buff,BUFSIZ,fp);
fclose(fp);
|
You don't care what a FILE actually is. Creating and deleting it is part of the API. You just need to store it and use it.
As far as you're concerned, it's an opaque type.
Is all this documented on some website you can direct us to?
Or are we restricted to peephole glimpses through the wall around your project?