summaryrefslogtreecommitdiff
path: root/parseconfig.inc
diff options
context:
space:
mode:
authorhpa <hpa>2002-04-30 03:33:27 +0000
committerhpa <hpa>2002-04-30 03:33:27 +0000
commitb17209b886b2395ed711f3335e7be355d2fefc8d (patch)
tree68821078b0d4b1f2e8975b9b079127d36dedc350 /parseconfig.inc
parent83b3e784e2226dbda6345e54031c0eb4ceca34eb (diff)
downloadsyslinux-b17209b886b2395ed711f3335e7be355d2fefc8d.tar.gz
Further rationalize command-line parsing by allowing functions tosyslinux-1.73-pre9
take an argument.
Diffstat (limited to 'parseconfig.inc')
-rw-r--r--parseconfig.inc89
1 files changed, 23 insertions, 66 deletions
diff --git a/parseconfig.inc b/parseconfig.inc
index a46694a4..cee88df0 100644
--- a/parseconfig.inc
+++ b/parseconfig.inc
@@ -99,28 +99,34 @@ pc_timeout: call getint
.err: ret
;
-; "display" command
+; Generic integer variable setting commands:
+; "prompt", "implicit"
;
-pc_display: call pc_getfile
- jz .err ; File not found?
- call get_msg_file ; Load and display file
-.err: ret
-
-;
-; "prompt" command
-;
-pc_prompt: call getint
+pc_setint16:
+ push ax
+ call getint
+ pop si
jc .err
- mov [ForcePrompt],bx
+ mov [si],bx
.err: ret
;
-; "implicit" command
+; Generic file-processing commands:
+; "display", "font", "kbdmap"
;
-pc_implicit: call getint
- jc .err
- mov [AllowImplicit],bx
-.err: ret
+pc_filecmd: push ax ; Function to tailcall
+ mov di,trackbuf
+ push di
+ call getline
+ pop si
+ mov di,MNameBuf
+ push di
+ call mangle_name
+ pop di
+ call searchdir ; tailcall
+ jnz .ok
+ pop ax ; Drop the successor function
+.ok: ret ; Tailcall if OK, error return
;
; "serial" command
@@ -209,31 +215,12 @@ pc_serial: call getint
;
; "F"-key command
;
-; This relies on the fact that [si] points to the address of the entrypoint
-;
-pc_f1: nop
-pc_f2: nop
-pc_f3: nop
-pc_f4: nop
-pc_f5: nop
-pc_f6: nop
-pc_f7: nop
-pc_f8: nop
-pc_f9: nop
-pc_f10:
- mov cx,[si]
- sub cx,pc_f1
- push cx
- mov ax,1
- shl ax,cl
- or [FKeyMap], ax ; Mark that we have this loaded
+pc_fkey: push ax
mov di,trackbuf
push di
call getline ; Get filename to display
pop si
pop di
- shl di,FILENAME_MAX_LG2 ; Convert to offset
- add di,FKeyName
call mangle_name ; Mangle file name
ret
@@ -264,22 +251,6 @@ pc_label: call commit_vk ; Commit any current vkernel
ret
;
-; "font" command
-;
-pc_font: call pc_getfile ; "font" command
- jz .err ; File not found?
- call loadfont ; Load and install font
-.err: ret
-
-;
-; "kbd" command
-;
-pc_kbd: call pc_getfile ; "kbd" command
- jz .err
- call loadkeys
-.err: ret
-
-;
; "say" command
;
pc_say: mov di,trackbuf ; "say" command
@@ -292,20 +263,6 @@ pc_say: mov di,trackbuf ; "say" command
jmp crlf ; tailcall
;
-; pc_getfile: For command line options that take file argument, this
-; routine decodes the file argument and runs it through searchdir
-;
-pc_getfile: mov di,trackbuf
- push di
- call getline
- pop si
- mov di,MNameBuf
- push di
- call mangle_name
- pop di
- jmp searchdir ; tailcall
-
-;
; Main loop for configuration file parsing
;
parse_config: