<
yunfan>
Regenaxer: any libraries to explore a .so file?
<
tankf33der>
yunfan: try google
<
yunfan>
tankf33der: i mean in picolisp
<
tankf33der>
yunfan: of course no
inara has quit [Quit: Leaving]
inara has joined #picolisp
<
Regenaxer>
yeah, so sense in writing such libs I think. Just call the OS-resident tools
<
Regenaxer>
Via call or better a pipe
<
tankf33der>
no sense, os utils is ok
<
Regenaxer>
Good morning tankf33der, yunfan BTW :)
<
yunfan>
Regenaxer: afternoon :D
<
yunfan>
Regenaxer: i just curious how cant picolisp had that? since you could easilly invoke native method in the .so files
<
yunfan>
insnt that you need first indexing methods and then invoke?
<
Regenaxer>
yes, would be possible
<
Regenaxer>
or read the binary files directly if the format is known
<
Regenaxer>
What do you mean with indexing and invoke here?
<
Regenaxer>
As tankf33der said, start with 'nm'
<
yunfan>
lets say you want to invoke funcA from xx.so
<
Regenaxer>
This is just 'native'
<
yunfan>
when picolisp do it, wont it indexing that funcA's location from xx.so and then invoke it??
<
yunfan>
or you just have another magic mechanic?
<
Regenaxer>
No, it calls dlopen() and dlsym()
<
yunfan>
ah, got it
<
Regenaxer>
dlopen() and dlsym() are called only the first time
<
Regenaxer>
after that they are remembered in the symbol values
<
Regenaxer>
That's why the args to 'native' should better be transient symbols
<
yunfan>
if so, then how can we provide the corresponding parameters?
<
yunfan>
especially for those require special data structure
<
Regenaxer>
The parameters to the C function can be anything
<
Regenaxer>
I meant the lib and func names
<
Regenaxer>
(native "myLib" "myFunc" ...
<
yunfan>
but how can we build that ? for eg, if i have a funcA that require a parameter require to be a structure of my own defined
<
Regenaxer>
did you look at doc/native.html ?
<
yunfan>
int funcA(*some_diy_structure)
<
yunfan>
not yet, still reading the ref.html as the tutorial required
<
Regenaxer>
The above doc explains it in more detail
<
Regenaxer>
The second function used here is 'struct'
<
Regenaxer>
'native' and 'struct' work together
orivej_ has quit [Ping timeout: 268 seconds]
mtsd has joined #picolisp
beneroth has joined #picolisp
orivej has joined #picolisp
orivej has quit [Ping timeout: 248 seconds]
libertas has quit [Read error: Connection reset by peer]
libertas has joined #picolisp
<
Regenaxer>
Wow, just found out something cool!
<
Regenaxer>
Pil scripts can be started as:
<
Regenaxer>
#!bin/picolisp -load "lib.l" "ext.l"
<
Regenaxer>
(Normally, you can pass only a single file name to a hashbang)
<
Regenaxer>
But Unix passes the whole rest of the command line as a single arg!! :)
<
Regenaxer>
Beautiful!
orivej has joined #picolisp
orivej has quit [Ping timeout: 268 seconds]
mtsd has quit [Remote host closed the connection]
orivej has joined #picolisp
orivej has quit [Ping timeout: 276 seconds]
orivej has joined #picolisp
orivej has quit [Ping timeout: 268 seconds]
orivej has joined #picolisp
<
tankf33der>
insane
<
Regenaxer>
Uh, looks like a task for Pilog or 'gen' (genetic algorithm)?
<
Regenaxer>
Probably Pilog for a full search?
<
tankf33der>
i will skip, too much
grp has joined #picolisp
alexshendi has joined #picolisp
orivej has quit [Ping timeout: 265 seconds]
grp has quit [Quit: box shutting down...]
orivej has joined #picolisp