Loadrunner scripts are run on a ANSI C interpreter and support most standard C functions (libc).
Limitations that are listed in the vugen user guide include structures as arguments and return values and getting the address of a function.
If a function does not exist you may be able to build it into a dll.
You could have trouble with printf as you may have a number of vusers running simultaneously if they are allowed to display text it could be quite jumbled. It may be better to use lr_output_message.