# C Binding non-void callback

**URL:** <https://forum.crystal-lang.org/t/c-binding-non-void-callback/2079>\
**Category:** Help & Support\
**Created:** [May 8, 2020, 6:59am UTC](https://forum.crystal-lang.org/t/c-binding-non-void-callback/2079 "2020-05-08T06:59:27Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![mavu](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/mavu/32/213_2.png) [@mavu](https://forum.crystal-lang.org/u/mavu)\
**Post date:** [May 8, 2020, 2:27pm UTC](https://forum.crystal-lang.org/t/c-binding-non-void-callback/2079/4 "2020-05-08T14:27:09Z")

</div>

I’m not sure I understood all that correctly, but you can check out this thread, where I invent a Rube-Goldberg machine to let an application talk to itself through a Unix-Socket.

(using C-lib that takes a callback but has no data-pointer)

> [@\[Help\] c binding of function that takes callback](https://forum.crystal-lang.org/t/help-c-binding-of-function-that-takes-callback/325):
>
> Hi tldr; how do I “interface” (call functions, etc) with the outside from inside a Proc passed as a callback to a c function? I am trying to use the wiringPi library in crystal on a raspberry pi and I have a problem with a function that requires a callback it has the following signature: extern int wiringPiISR (int pin, int mode, void (\*function)(void)) ; What works so far is this: module Wiringtest @[Link("wiringPi")] lib LibwiringPi fun wiringPiSetupSys : Int32 fun wiringPiISR…

Not sure if you want to go there, but maybe it can offer some ideas?

---

_[View the full topic](https://forum.crystal-lang.org/t/c-binding-non-void-callback/2079)._
