Lines Matching +full:read +full:- +full:1

1 \ Copyright (c) 2006-2015 Devin Teske <dteske@FreeBSD.org>
8 \ 1. Redistributions of source code must retain the above copyright
26 marker task-check-password.4th
30 vocabulary password-processing
31 only forth also password-processing definitions
35 21 constant ctrl_u \ The decimal ASCII value for Ctrl-U sequence
38 variable read-tick \ Twiddle position (used by read)
39 variable read-start \ Starting X offset (column)(used by read)
49 \ called by the read function. You need not call it directly. NOTE: arrow keys
52 : sgetkey ( -- )
56 drop \ Remove stack-cruft
62 read-tick @ dup 1+ 4 mod read-tick !
64 dup 0 = if ( 1 ) ." /" else
65 dup 1 = if ( 2 ) ." -" else
68 1 spaces
70 read-start @ sr at-xy
74 \ Always allow Backspace, Enter, and Ctrl-U
83 : cfill ( c c-addr/u -- )
85 -rot 2dup c! 1+ rot 1-
89 : read-reset ( -- )
94 : read ( c-addr/u -- ) \ Expects string prompt as stack input
96 at-bl \ Move the cursor to the bottom-left
97 dup 1+ read-start ! \ Store X offset after the prompt
98 0 readlen ! \ Initialize the read length
115 3 spaces read-start @ sr at-xy \ Erase the twiddle
118 readlen @ 1 - dup readlen ! \ Decrement input length
120 0= if 3 spaces read-start @ sr at-xy then \ Twiddle
124 readlen @ 1+ dup readlen ! 1- readval + c!
131 only forth definitions also password-processing
133 : check-password ( -- )
135 \ Do not allow the user to proceed beyond this point if a boot-lock
137 s" bootlock_password" getenv dup -1 <> if
140 s" Boot Password: " read ( prompt -- )
145 2drop read-reset
149 s" geom_eli_passphrase_prompt" getenv dup -1 <> if
150 s" YES" compare-insensitive 0= if
151 s" GELI Passphrase: " read ( prompt -- )
153 read-reset
158 s" password" getenv -1 = if exit else drop then
170 s" Password: " read ( prompt -- )
172 2drop read-reset exit