<aw->
i recall discussing this issue with you.. or something similar
<Regenaxer>
I don't know the right way
<Regenaxer>
yeah, I asked several people
<Regenaxer>
Vim or Vip work fine however
<Regenaxer>
when pil is in raw mode
<aw->
'passwd works as well
<Regenaxer>
hmm
<aw->
well... passwd doesn't echo the pass anyways haha
<Regenaxer>
what about 'cat' in the script?
<aw->
cat works
<Regenaxer>
stdin -> stoout
<aw->
i've used that in the past
<Regenaxer>
mom, tel
<aw->
ok this is a waste of time, it will be faster for me to just re-write the bash script in picolisp
<Regenaxer>
Sorry, yeah, I'm still on the phone
rob_w has quit [Remote host closed the connection]
mtsd has quit [Quit: Leaving]
sriram_ has joined #picolisp
sriram has quit [Quit: Page closed]
aw- has quit [Quit: Leaving.]
reed has joined #picolisp
<reed>
Hi all, I'm reading the documentation on the C foreign function interface, trying to write some wrapper functions for api in "linux/joystick.h". The joystick event wraps a few varieties of integers. Would a type declaration in an FFI call need to be different for a struct containing a signed 32 bit integer, compared to an unsigned 16 bit integer?
<tankf33der>
reed: start with something simpler
<reed>
tankf33der: Good advice. But even with a toy example, just a function that randomly returns an unsigned 32 bit integer and a different function that randomly returns a signed 16 bit integer, would the interface be different?
<tankf33der>
show function prototype from h file
<tankf33der>
i'm still feel timidly with (native) function
<reed>
for intstance "usigned long f1();" vs "signed int f2();"
<tankf33der>
it will be (native "joy.so" "f1" 'N ...)
<tankf33der>
interface will be different for every function because you need native for "f1" and "f2"
<reed>
So the 'N because its a "long"? and (native "joy.so" "f2" 'I) because it's an int?
<tankf33der>
clone my repo and find all strings with native
<tankf33der>
as start point
<tankf33der>
next
<tankf33der>
take this md5 example and convert to sha256 and sha512 and check with python or something else.
<tankf33der>
good homework.
<Regenaxer>
reed, just to be sure, you use pil64? To be able to use 'native'
<reed>
Regenaxer: Yes, I'm using pil64
<reed>
I'm just trying to figure out how the 'I 'B 'S, in the FFI etc map to the C types. Particularly when there's unsigned and signed stuff happening
<Regenaxer>
I is a signed 32 bit int
<Regenaxer>
N is a 64bit or pointer
<Regenaxer>
If the C function returns only a 32 bit value, negative results need to be converted
<Regenaxer>
Can you show a prototype of the C function here?
<tankf33der>
reed> for intstance "usigned long f1();" vs "signed int f2();"
<reed>
So the same would apply to short ints? I would need to convert them to an int or a long first?
<Regenaxer>
yes, so (native "lib.so" "f1" 'N)
<Regenaxer>
vs (native "lib.so" "f1" 'I)
<tankf33der>
vs (native "lib.so" "f2" 'I)
<Regenaxer>
I signed int is just 'I'
<Regenaxer>
'N' is also signed
<Regenaxer>
Have you tried it?
<Regenaxer>
Just experiment on the REPL
<reed>
I'm in the process. Thank you!
<Regenaxer>
:)
<beneroth>
hi all
<Regenaxer>
Hi beneroth
<beneroth>
brb
beneroth has quit [Quit: Verlassend]
alexshendi has joined #picolisp
alexshendi has quit [Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org]
alexshendi has joined #picolisp
alexshendi has quit [Read error: Connection reset by peer]