ChanServ changed the topic of #crystal-lang to: The Crystal programming language | https://crystal-lang.org | Fund Crystal's development: https://crystal-lang.org/sponsors | GH: https://github.com/crystal-lang/crystal | Docs: https://crystal-lang.org/docs | Gitter: https://gitter.im/crystal-lang/crystal
ur5us has quit [Ping timeout: 240 seconds]
ur5us has joined #crystal-lang
f1refly has quit [Ping timeout: 248 seconds]
f1refly has joined #crystal-lang
ur5us has quit [Ping timeout: 260 seconds]
f1refly has quit [Quit: see ya in hell]
fifr_ has quit [*.net *.split]
Elouin has quit [*.net *.split]
spuun has quit [*.net *.split]
oz has quit [*.net *.split]
dannyAAM has quit [*.net *.split]
dostoyevsky2 has quit [*.net *.split]
dostoyevsky2 has joined #crystal-lang
fifr_ has joined #crystal-lang
Elouin has joined #crystal-lang
ox has joined #crystal-lang
dannyAAM has joined #crystal-lang
spuun has joined #crystal-lang
SamantazFox has quit [Killed (NickServ (GHOST command used by SamantazFox_))]
SamantazFox_ has joined #crystal-lang
r0bby has quit [*.net *.split]
raz has quit [*.net *.split]
markmarkmark has quit [*.net *.split]
r0bby has joined #crystal-lang
markmarkmark has joined #crystal-lang
analogsalad has joined #crystal-lang
analog_salad has joined #crystal-lang
analogsalad has quit [Ping timeout: 272 seconds]
ur5us has joined #crystal-lang
ur5us has quit [Remote host closed the connection]
ur5us has joined #crystal-lang
ur5us has quit [Ping timeout: 248 seconds]
ur5us has joined #crystal-lang
ur5us has quit [Ping timeout: 240 seconds]
Sankalp has quit [Ping timeout: 240 seconds]
Sankalp has joined #crystal-lang
ox is now known as oz
<FromGitter> <eliasjpr> Hello, sharing this small library about http session management https://shards.info/github/azutoolkit/session/
analog_salad has quit [Quit: bye]
Sankalp has quit [Ping timeout: 240 seconds]
Sankalp has joined #crystal-lang
notzmv has quit [Ping timeout: 248 seconds]
<FromGitter> <anhedonia:sakura.ci> I have a question about C bindings, is there an easy way to pass an `IO` instance (`STDOUT` for example, preferably instance of `IO::Memory`) to a C function that takes `FILE*` as an argument? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=6282a03a61f5ca3fee04dd98]
<FromGitter> <remiliascarlet:nanako.mooo.com> If I'm not mistaken, if the IO is actually a File, then you can use `that_io.fd` to get the raw file descriptor. ⏎ https://crystal-lang.org/api/1.4.1/IO/FileDescriptor.html#fd%3AInt-instance-method
<FromGitter> <remiliascarlet:nanako.mooo.com> Not sure about other subclasses of IO, though.
<FromGitter> <remiliascarlet:nanako.mooo.com> It could be that I'm missing something in the standard library that already does this for you, but a few quick searches isn't pulling up much ^_^; So unless it exists, you could wrap `fdopen`, then use your wrapped function long with `#fd` to get a `FILE*` pointer.
<FromGitter> <anhedonia:sakura.ci> yeah this works, just gonna hack my way through ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=6282a72646495f47cfe3c966]
<FromGitter> <Blacksmoke16> out of curiosity, does: ⏎ ⏎ ```file = pointerof(STDOUT.fd) ⏎ ⏎ C.fprint(file, "Hello from C\n")``` [https://gitter.im/crystal-lang/crystal?at=6282a76746495f47cfe3c9fc]
<FromGitter> <anhedonia:sakura.ci> nope
<FromGitter> <Blacksmoke16> rip
<FromGitter> <remiliascarlet:nanako.mooo.com> Yeah, fd is an integer representing the handle, FILE* is some sort of structure, iirc :(
<FromGitter> <remiliascarlet:nanako.mooo.com> Been a while since I've done anything with C
<FromGitter> <Blacksmoke16> makes sense
notzmv has joined #crystal-lang
ur5us has joined #crystal-lang