~ubuntu-branches/ubuntu/wily/slof/wily

« back to all changes in this revision

Viewing changes to slof/fs/scsi-loader.fs

  • Committer: Package Import Robot
  • Author(s): Aurelien Jarno
  • Date: 2012-09-16 23:05:23 UTC
  • Revision ID: package-import@ubuntu.com-20120916230523-r2ynulqmp2tyu2e5
Tags: upstream-20120217+dfsg
ImportĀ upstreamĀ versionĀ 20120217+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
\ *****************************************************************************
 
2
\ * Copyright (c) 2004, 2008 IBM Corporation
 
3
\ * All rights reserved.
 
4
\ * This program and the accompanying materials
 
5
\ * are made available under the terms of the BSD License
 
6
\ * which accompanies this distribution, and is available at
 
7
\ * http://www.opensource.org/licenses/bsd-license.php
 
8
\ *
 
9
\ * Contributors:
 
10
\ *     IBM Corporation - initial implementation
 
11
\ ****************************************************************************/
 
12
 
 
13
\ **************************************
 
14
\ Last change: MiR 13.11.2007 10:55:57
 
15
\ **************************************
 
16
 
 
17
: .ansi-attr-off 1b emit ." [0m"  ;    \ ESC Sequence: all terminal atributes off
 
18
: .ansi-blue     1b emit ." [34m" ;    \ ESC Sequence: foreground-color = blue
 
19
: .ansi-green    1b emit ." [32m" ;    \ ESC Sequence: foreground-color = green
 
20
: .ansi-red      1b emit ." [31m" ;    \ ESC Sequence: foreground-color = green
 
21
: .ansi-bold     1b emit ." [1m"  ;    \ ESC Sequence: foreground-color bold
 
22
 
 
23
false VALUE scsi-supp-present?
 
24
 
 
25
: scsi-xt-err ." SCSI-ERROR (Intern) " ;
 
26
' scsi-xt-err VALUE scsi-open-xt        \ preset with an invalid token
 
27
 
 
28
\ *************************************
 
29
\ utility to show all active word-lists
 
30
\ *************************************
 
31
: .wordlists      ( -- )
 
32
   .ansi-red
 
33
   get-order      ( -- wid1 .. widn n )
 
34
   dup space 28 emit .d ." word lists : "
 
35
   0 DO
 
36
      . 08 emit 2c emit
 
37
   LOOP
 
38
   08 emit                 \ 'bs'
 
39
   29 emit                 \ ')'
 
40
   cr space 28 emit
 
41
   ." Context: " context dup .
 
42
   @ 5b emit . 8 emit 5d emit
 
43
   space
 
44
   ." / Current: " current .
 
45
   .ansi-attr-off
 
46
   cr
 
47
;
 
48
 
 
49
\ *************************************
 
50
\ utility to show first word-lists
 
51
\ *************************************
 
52
: .context  ( num -- )
 
53
   .ansi-red
 
54
    space
 
55
   5b emit
 
56
   23 emit . 3a emit
 
57
   context @
 
58
   . 8 emit 5d emit space
 
59
   .ansi-attr-off
 
60
;
 
61
 
 
62
\ ****************************************************************************
 
63
\ open scsi-support by adding a new word list on top of search path
 
64
\ first check if scsi-support.fs must be included (first call)
 
65
\ when open use execution pointer to access version in new word list
 
66
\ ****************************************************************************
 
67
: scsi-open  ( -- )
 
68
   scsi-supp-present? NOT
 
69
   IF
 
70
      s" scsi-support.fs" included  ( xt-open )
 
71
      to scsi-open-xt               (  )
 
72
      true to scsi-supp-present?
 
73
   THEN
 
74
   scsi-open-xt execute
 
75
;
 
76
 
 
77