<Regenaxer>
From the curses man page: The integer variables LINES and COLS are defined in <curses.h> and will be filled in by initscr with the size of the screen
<beneroth>
ah, alright. I suspected this. Thanks Regenaxer !
<beneroth>
so the native call is: get me a pointer to this globale :)
<Regenaxer>
yes
<Regenaxer>
There are two reasons:
<Regenaxer>
1. preload the library and pointer into memory for faster later access
<Regenaxer>
2. it can't be called because it is not a function
<Regenaxer>
brb
<Regenaxer>
LINES and COLS are also a bit confusing because there are the env variables LINES and COLUMNS. They are a different thing and cannot be used in Vip because they don't update when the terminal is resized
<beneroth>
yeah I figured so
<beneroth>
gotta go. have a nice day :)
<Regenaxer>
cu :)
<yunfan>
so i remember someone ask if there're library for oauth support, how's finally answer?
<Regenaxer>
It says "document.txt_backup empty string, because _ is not a letter or number"
<Regenaxer>
Strange rule, isn't it? ;)
<Regenaxer>
Why only letters and numbers?
<tankf33der>
i think ext is any after last dot
<tankf33der>
assume file names in task is valid
<Regenaxer>
Yes, but the task demands explicitly "letters or digits (A-Z, a-z, 0-9)"
<tankf33der>
aaa, i see
<Regenaxer>
What is the shortest check for such a rule?
<Regenaxer>
Perhaps this: (find '>= '("Z" "z" "9") (circ C) '("A" "a" "0")))
<Regenaxer>
no quote needed: (find >= '("Z" "z" "9") (circ C) '("A" "a" "0")))
reed has joined #picolisp
<reed>
Hi All. I was on here yesterday and I asked about the following code in "vip.l": (native "@" "LINES" T). I have been lookin through the documentation on the native call quite a bit, but I still don't understand what is happening here. What C library is the function "LINES" in?
<Regenaxer>
Yes
<Regenaxer>
See the chat log, I gave answers this morning
<reed>
Will do
<Regenaxer>
So the issue is here special, as "LINES" is not a callable function
<reed>
so is the a general pattern to access global C variables?
<Regenaxer>
The typical way is with 'struct' as in Vip I would say
<Regenaxer>
"LINES" contains the pointer after the above native call
<Regenaxer>
It just does not call this location as a C function, this would crash
<reed>
So in the line (setq *Lines (car (struct "LINES" '(I)))) they are taking the value that "LINES" points to
<Regenaxer>
yes, resulting in the number of lines
<Regenaxer>
in the ncurses lib
<reed>
Thanks, that makes sense
<Regenaxer>
I used (sys "LINES") first
<Regenaxer>
but this does not change if the terminal is resized
<reed>
I see. I was having a hard time understanding all the ncurses variable definitions because they use a bunch of macros defined in a different file. Thank you!
<Regenaxer>
Curses is a horror indeed, a true mess
<reed>
Just to make sure I understand: If I wanted to get the pointer to 'stdscr', I would call (curses "stdscr" T) then something like (setq *StdScr (car (struct "stdscr" '(N))))?
<Regenaxer>
Yes, should work
<Regenaxer>
Though stdscr is also returned by initscr iirc
<Regenaxer>
Would be a good test
<reed>
Just tested it out. Both point to the same place. Thanks!