Definition: | c_proc(integer rid, sequence s) |
Description: | Call the C function with routine id rid. rid must be a valid routine id returned by define_c_proc(). s is a sequence of argument values of length n, where n is the number of arguments required by the function. |
Comments: | If the C function does not take any arguments then s should be {}.
If you pass an argument value which contains a fractional part,
where the C function expects a C integer type, the argument is
be rounded towards 0, for example 5.9 is passed as 5, -5.9 is
passed as -5.
The C function could be part of a .dll or .so created via a format DLL/SO directive. |
Example: |
atom user32, hwnd, rect integer GetClientRect -- open user32.dll - it contains the GetClientRect C function user32 = open_dll("user32.dll") -- GetClientRect is a VOID C function that takes a C int -- and a C pointer as its arguments: GetClientRect = define_c_proc(user32, "GetClientRect", {C_INT, C_POINTER}) -- pass hwnd and rect as the arguments c_proc(GetClientRect, {hwnd, rect}) |
See Also: | c_func, define_c_proc, open_dll, Calling C Functions |