You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
A (very) simple example will help illustrate:
$ dlcall puts "hello, world"
hello, world
# A more complex example, use libm to calculate sin(PI/2)
$ dlopen libm.so.6
0x172ebf0
$ dlcall -r double sin double:1.57079632679489661923
double:1.000000
ctypes.sh can extend bash scripts to accomplish tasks that were previously
impossible, or would require external helpers to be written.
If you want to use automatic struct support (recommended), you should also make
you have ddebs available.
install
ctypes.sh can be installed from source like this:
$ git clone https://github.com/taviso/ctypes.sh.git
$ cd ctypes.sh
$ ./autogen.sh
$ ./configure
$ make
$ [sudo] make install
By default ctypes.sh is installed into /usr/local/bin and
/usr/local/lib. You can overload the prefix path by defining the
PREFIX environment variable before installing.