Call C function in Bash script
It even possible to use C data structures ;)
This is ctypes.sh, a foreign function interface for bash. ctypes.sh is a bash plugin that provides a foreign function interface directly in your shell. In other words, it allows you to call routines in shared libraries from within bash.
Check out https://github.com/taviso/ctypes.sh ;)
Bash supports loadable builtins. You might be able to make use of this to do what you want. See the files in your /usr/share/doc/bash/examples/loadables
(or similar) directory.
The simplest way to do this is to write a simple program that collects the input, feeds it to the function, then prints the result. Why don't you tell us what you are attempting to accomplish and perhaps we can suggest an easier way to "skin this cat".