;; -----------------------------------------------------------------------
;;
-;; Copyright 1994-2006 H. Peter Anvin - All Rights Reserved
+;; Copyright 1994-2007 H. Peter Anvin - All Rights Reserved
;;
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
keywd_table:
keyword menu, pc_comment
keyword text, pc_text
+ keyword include, pc_filecmd, pc_include
keyword append, pc_append
keyword default, pc_default
keyword display, pc_filecmd, get_msg_file
;; -----------------------------------------------------------------------
;;
-;; Copyright 1994-2002 H. Peter Anvin - All Rights Reserved
+;; Copyright 1994-2007 H. Peter Anvin - All Rights Reserved
;;
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; -----------------------------------------------------------------------
;;
-;; Copyright 1994-2006 H. Peter Anvin - All Rights Reserved
+;; Copyright 1994-2007 H. Peter Anvin - All Rights Reserved
;;
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;
; Generic file-processing commands:
-; "display", "font", "kbdmap"
+; "display", "font", "kbdmap", "include"
;
pc_filecmd: push ax ; Function to tailcall
call pc_getline
.ok: ret ; Tailcall if OK, error return
;
+; "include" command (invoked from pc_filecmd)
+;
+pc_include: call openfd
+ jz .err
+ inc word [IncludeLevel]
+.err: ret
+
+;
; "serial" command
;
pc_serial: call getint
xor ax,ax
mov cx,vk_size
rep stosb
+
.again:
- call getcommand
- jnc .again ; If not EOF do it again
+ call getcommand ; Parse one command
+ jnc .again ; If not EOF...
+ call close
+ dec word [IncludeLevel] ; Still parsing?
+ jnz .again
+
;
; The fall through to commit_vk to commit any final
; VKernel being read
NoEscape dw 0 ; No escape
AllowImplicit dw 1 ; Allow implicit kernels
AllowOptions dw 1 ; User-specified options allowed
+IncludeLevel dw 1 ; Nesting level
SerialPort dw 0 ; Serial port base (or 0 for no serial port)
VKernelBytes dw 0 ; Number of bytes used by vkernels
VKernel db 0 ; Have we seen any "label" statements?