With Basic Prototype Declarations, double-pointered variables etc get messed up and you have to degrade them to dwords. This is because Basic does not support the
typedef constructs found in C. So translating C headers to Basic headers will require considerable interpretation, which is why I aim to read C header files directly.
Now for interfacing APIs at a lower level, all the compiler needs to know is the library handle, and a list comprising pairs of alias names and real case-sensitive names for each call available. No type matching is attempted - so you have to know what you are providing is compatible with the library call - for instance it is ok to provide a dword when a byte is expected. And you must explicitly pass the variable's adress when a pointer is expected.
This is an example of low level API declaration in Oxygen (the semicolons are comment marks)
dim kernel32,user32,GDI32 as long
kernel32=LoadLibrary `kernel32.dll`
user32=LoadLibrary `user32.dll`
GDI32=LoadLibrary `GDI32.dll`
bind kernel32
(
GetCommandLine GetCommandLineA ; @0
GetModuleHandle GetModuleHandleA ; @4
ExitProcess ExitProcess ; @4
)
bind user32
(
LoadIcon LoadIconA ; @8
LoadCursor LoadCursorA ; @8
RegisterClass RegisterClassA ; @4
MessageBox MessageBoxA ; @4
CreateWindowEx CreateWindowExA ; @48
ShowWindow ShowWindow ; @8
UpdateWindow UpdateWindow ; @4
GetMessage GetMessageA ; @16
TranslateMessage TranslateMessage ; @4
DispatchMessage DispatchMessageA ; @4
PostQuitMessage PostQuitMessage ; @4
BeginPaint BeginPaint ; @8
EndPaint EndPaint ; @8
GetClientRect GetClientRect ; @8
DrawText DrawTextA ; @20
PostMessage PostMessageA ; @16
DefWindowProc DefWindowProcA ; @16
)
bind GDI32
(
SetBkColor SetBkColor ; @16
SetTextColor SetTextColor ; @16
GetStockObject GetStockObject ; @4
)