libera/#commonlisp - IRC Chatlog
Search
4:06:18
cpli
Bike, yes the bytes allocated by `cffi:with-foreign-object` may be scoped, but the allocation on libevdev's behalf is not, the entire issue revolves around passing a double pointer to a struct (wherein we only need to allocate a buffer large enough for libevdev to write the new allocation to) and then successfully dereference that scoped allocation to get our "out argument" to return from `make-uinput`
4:18:15
cpli
since we've been failing to do so, could someone help us and transliterate this from c to cl? https://0x0.st/H-SR.c
4:20:48
ElKowar
aeth same man, it's 5 AM, these guys have been talking about this for two days now, and now theyve been trying to fix this for the entire night, I just wanna sleep TwT
4:23:10
cpli
aeth, what sounds problematic here? (i genuinely don't know what the implication is..) is it the styleguide i'm using?
4:27:55
cpli
aeth: our current progress is: https://git.sr.ht/~cpli/clayboard/tree/dev/item/src/evdev.lisp
4:29:05
cpli
and it's been going alright, i.e. evdev holds a `(:pointer (:struct evdev))` which works, but uinput specifically is giving us issues
4:31:15
buffet
aeth: we are struggling to make the "out pointer" part work. there is no way to "address of", since ref and area and deref all deref; using pointer pointer evdev, passing that, then derefing also doesn't seem to work; we found cl-sqlite which just passed (:pointer sqlite-statement), and it just adds the level of indirection or smth, completely unclear how that works
6:47:53
Josh_2
or the logo :joy: Imagine thinking "hmm yes I run CL subreddit, how about I use uki flag instead of idk lisp alien mascot"
6:53:14
aeth
new.reddit.com for those who use the old reddit and are confused by seeing the default style subreddit
6:57:13
hayley
r/lispmemes trivia: there was a very short-lived HyperSpec CSS theme, which lasted a few hours from memory.
7:08:52
Josh_2
The chances that the mods of the subreddit aren't in here? About 0. Most of the CL community is moderated by the same few people
7:52:15
Shinmera
beach: I've never fully decided on a canonical pronunciation, so whichever way suits you best.
8:25:14
|3b|
ACTION would expect another syllable for the D too (probably 'do', though my intuition for japanese is very rusty)
13:41:19
Bike
cpli: cffi does not have addressof; instead you only deal with addresses. when you with-foreign-object or foreign-alloc an :int, the variable bound is not "an int", it's a pointer to storage for an int. so e.g., { int x; x = 7; return x; } is translated as (with-foreign-object (x int) (setf (mem-ref x :int) 7) (mem-ref x :int))
13:44:08
Bike
cpli: so for your code here, you'd (with-foreign-object (uinput (:pointer libevdev-uinput)) ...), then in that body do (libevdev-uinput-create-from-device ... uinput), and end with (mem-ref uinput '(:pointer libevdev-uinput))