ChanServ changed the topic of #picolisp to: PicoLisp language | Channel Log: https://irclog.whitequark.org/picolisp/ | Check also http://www.picolisp.com for more information
orivej has quit [Ping timeout: 256 seconds]
orivej has quit [Ping timeout: 256 seconds]
mtsd has joined #picolisp
mtsd has joined #picolisp
aw- has quit [Quit: Leaving.]
aw- has quit [Quit: Leaving.]
_whitelogger_ has quit [Remote host closed the connection]
_whitelogger_ has joined #picolisp
_whitelogger_ has joined #picolisp
_whitelogger_ has quit [Remote host closed the connection]
_whitelogger_ has joined #picolisp
_whitelogger_ has joined #picolisp
_whitelogger_ has quit [Remote host closed the connection]
_whitelogger_ has joined #picolisp
_whitelogger_ has joined #picolisp
aw- has joined #picolisp
aw- has joined #picolisp
orivej has joined #picolisp
orivej has joined #picolisp
rob_w has joined #picolisp
rob_w has joined #picolisp
orivej has quit [Ping timeout: 240 seconds]
orivej has quit [Ping timeout: 240 seconds]
<tankf33der> Regenaxer: here ?
<tankf33der> Regenaxer: here ?
<tankf33der> how to receive null terminated string from function with native ?
<tankf33der> how to receive null terminated string from function with native ?
<tankf33der> '(Str (S . 7))
<tankf33der> '(Str (S . 7))
<Regenaxer>
<Regenaxer>
<Regenaxer> No, 'S' specifies a string *pointer*
<Regenaxer> No, 'S' specifies a string *pointer*
<tankf33der> Ah
<tankf33der> Ah
<tankf33der> what should i pass then?
<tankf33der> what should i pass then?
<Regenaxer> It needs a character array (list)
<Regenaxer> It needs a character array (list)
<Regenaxer> (C . 8)
<Regenaxer> (C . 8)
<Regenaxer> hmm, I think we had this discussion here
<Regenaxer> hmm, I think we had this discussion here
<Regenaxer> I don't remember what was the best way
<Regenaxer> I don't remember what was the best way
<tankf33der> Checking
<tankf33der> Checking
<Regenaxer> *return* value is easy with 'S'
<Regenaxer> *return* value is easy with 'S'
<Regenaxer> or a string pointer in a struct
<Regenaxer> or a string pointer in a struct
<tankf33der> gmp crashing
<tankf33der> gmp crashing
<Regenaxer> I think '(Var (8 C . 8)) should do
<Regenaxer> I think '(Var (8 C . 8)) should do
<Regenaxer> then 'pack'
<Regenaxer> then 'pack'
<Regenaxer> or use 'struct'?
<Regenaxer> or use 'struct'?
<Regenaxer> yes, (struct P 'S)
<Regenaxer> yes, (struct P 'S)
<Regenaxer> if 'P' points to the struct
<Regenaxer> if 'P' points to the struct
<tankf33der> damn, (8 C . 8) helped.
<tankf33der> damn, (8 C . 8) helped.
<Regenaxer> ok
<Regenaxer> ok
<Regenaxer> but it gives more than one zero bytes, right?
<Regenaxer> but it gives more than one zero bytes, right?
<Regenaxer> if the string is shorter
<Regenaxer> if the string is shorter
<tankf33der> yeap
<tankf33der> yeap
<Regenaxer> hmm
<Regenaxer> hmm
<Regenaxer> what is the best way?
<Regenaxer> what is the best way?
<Regenaxer> I think 'struct' is most general
<Regenaxer> I think 'struct' is most general
<tankf33der> for me 8 c 8 is ok
<tankf33der> for me 8 c 8 is ok
<Regenaxer> good
<Regenaxer> good
<Regenaxer> lib/net.l
<Regenaxer> lib/net.l
<Regenaxer> line 112
<Regenaxer> line 112
<Regenaxer> it gets 'Host'
<Regenaxer> it gets 'Host'
<Regenaxer> then (struct Host 'S)
<Regenaxer> then (struct Host 'S)
<tankf33der> :)
<tankf33der> :)
<Regenaxer> For 'native' nm[8] is a byte- or char-array
<Regenaxer> For 'native' nm[8] is a byte- or char-array
<tankf33der> this is my variation i used in wireguard client
<tankf33der> this is my variation i used in wireguard client
<Regenaxer> Sometimes it is better anyway to get a list of chars, to process it further
<Regenaxer> Sometimes it is better anyway to get a list of chars, to process it further
<tankf33der> i need somehow add 8 c 8 to pil21-tests
<tankf33der> i need somehow add 8 c 8 to pil21-tests
<Regenaxer> ok
<Regenaxer> ok
<tankf33der> one more question:
<tankf33der> one more question:
<tankf33der> '(Var (8 C . 8))
<tankf33der> '(Var (8 C . 8))
<tankf33der> last 8 is init byte, right?
<tankf33der> last 8 is init byte, right?
<Regenaxer> no, is 8 bytes
<Regenaxer> no, is 8 bytes
<Regenaxer> The first 8 is the size of the total struct
<Regenaxer> The first 8 is the size of the total struct
<Regenaxer> and this has a single entry c[8]
<Regenaxer> and this has a single entry c[8]
<Regenaxer> (Var (8 C . 8) 65 66 67 68 ... is init
<Regenaxer> (Var (8 C . 8) 65 66 67 68 ... is init
<Regenaxer> "A" "B" ...
<Regenaxer> "A" "B" ...
<Regenaxer> you can also '(Var (8 (C . 8)))
<Regenaxer> you can also '(Var (8 (C . 8)))
<Regenaxer> this gives one more list nesting
<Regenaxer> this gives one more list nesting
<Regenaxer> (Var (8 (C . 4) I))
<Regenaxer> (Var (8 (C . 4) I))
<tankf33der> what is exact sentence in documentation describes first 8?
<tankf33der> what is exact sentence in documentation describes first 8?
<Regenaxer> { nm[4]; int; }
<Regenaxer> { nm[4]; int; }
<tankf33der> everytime i fails in something new
<tankf33der> everytime i fails in something new
<Regenaxer> cons pair for the size and result cons pair for the size and result specification in the CADR
<Regenaxer> cons pair for the size and result cons pair for the size and result specification in the CADR
<Regenaxer> oops
<Regenaxer> oops
<Regenaxer> under "structures, passed as lists with"
<Regenaxer> under "structures, passed as lists with"
<Regenaxer> so the second element is (size . result)
<Regenaxer> so the second element is (size . result)
<Regenaxer> size is 8
<Regenaxer> size is 8
<Regenaxer> result is (C . 8)
<Regenaxer> result is (C . 8)
<tankf33der> now i think i remember this
<tankf33der> now i think i remember this
<Regenaxer> :)
<Regenaxer> :)
<tankf33der> now it is clear
<tankf33der> now it is clear
<Regenaxer> I have to check the ref each time too
<Regenaxer> I have to check the ref each time too
<tankf33der> ok.
<tankf33der> ok.
<tankf33der> afk.
<tankf33der> afk.
<tankf33der> thanks a lot.
<tankf33der> thanks a lot.
<Regenaxer> See you! :)
<Regenaxer> See you! :)
orivej has joined #picolisp
orivej has joined #picolisp
mtsd has quit [Quit: Leaving]
mtsd has quit [Quit: Leaving]
rob_w has quit [Quit: Leaving]
rob_w has quit [Quit: Leaving]
orivej has quit [Ping timeout: 276 seconds]
orivej has quit [Ping timeout: 276 seconds]
orivej has joined #picolisp
orivej has joined #picolisp