Deleted Added
full compact
25c25
< \ $FreeBSD: head/sys/boot/forth/support.4th 87636 2001-12-11 00:49:34Z jhb $
---
> \ $FreeBSD: head/sys/boot/forth/support.4th 97201 2002-05-24 02:28:58Z gordon $
210a211
> string nextboot_conf_file
214a216
> 0 value nextboot?
662a665,672
> : nextboot_flag?
> s" nextboot_enable" assignment_type?
> ;
>
> : nextboot_conf?
> s" nextboot_conf" assignment_type?
> ;
>
715a726,738
> : set_nextboot_conf
> nextboot_conf_file .addr @ ?dup if
> free-memory
> then
> value_buffer .addr @ c@ [char] " = if
> value_buffer .addr @ char+ value_buffer .len @ 2 chars -
> else
> value_buffer .addr @ value_buffer .len @
> then
> strdup
> nextboot_conf_file .len ! nextboot_conf_file .addr !
> ;
>
865a889,892
> : set_nextboot_flag
> yes_value? to nextboot?
> ;
>
892a920,921
> nextboot_flag? if set_nextboot_flag exit then
> nextboot_conf? if set_nextboot_conf exit then
941a971,983
> : peek_file
> 0 to end_of_file?
> reset_line_reading
> O_RDONLY fopen fd !
> fd @ -1 = if open_error throw then
> reset_assignment_buffers
> read_line
> get_assignment
> ['] process_assignment catch
> ['] free_buffers catch
> fd @ fclose
> ;
>
1103a1146,1168
> : get_nextboot_conf_file ( -- addr len )
> nextboot_conf_file .addr @ nextboot_conf_file .len @ strdup
> ;
>
> : rewrite_nextboot_file ( -- )
> get_nextboot_conf_file
> O_WRONLY fopen fd !
> fd @ -1 = if open_error throw then
> fd @ s' nextboot_enable="NO" ' fwrite
> fd @ fclose
> ;
>
> : include_nextboot_file
> get_nextboot_conf_file
> ['] peek_file catch
> nextboot? if
> get_nextboot_conf_file
> ['] load_conf catch
> process_conf_errors
> ['] rewrite_nextboot_file catch
> then
> ;
>