File: mkindex

package info (click to toggle)
wims 2%3A4.29a%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 185,704 kB
  • sloc: xml: 366,687; javascript: 120,570; ansic: 62,341; java: 62,170; sh: 7,744; perl: 3,937; yacc: 3,217; cpp: 1,915; lex: 1,805; makefile: 1,084; lisp: 914; pascal: 601; python: 520; php: 318; asm: 7
file content (128 lines) | stat: -rw-r--r-- 3,479 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# Make index of subclasses for the gateway.
# No calling parameter.
!nocache
!if $wims_superclass=$empty
 !exit
!endif

D_=wimshome/log/classes/$wims_superclass
E_=$wims_home/log/classes/$wims_superclass

levels=!sh cd $E_; find . -maxdepth 1 -mindepth 1 -type d -name '[0-9]*' | sed 's!^\./!!'
classes=!sh cd $E_; find . -maxdepth 2 -mindepth 2 -type d -name '1[0-9][0-9]' | sed 's!^\./!!'
progs=!sh cd $E_; find . -maxdepth 2 -mindepth 2 -type d -name '2[0-9][0-9]' | sed 's!^\./!!'
courses=!sh cd $E_; find . -maxdepth 3 -mindepth 3 -type d -name '2[0-9][0-9]' | sed 's!^\./!!'
icourses=!sh cd $E_; find . -maxdepth 3 -mindepth 3 -type d -name '3[0-9][0-9]' | sed 's!^\./!!'
!for n_ in levels,classes,progs,courses,icourses
 $n_=!words2items $($n_)
!next n_

cp_=!append item $classes to $progs
cp_=!translate internal / to _ in $cp_
idata=
rdata=
!for c in $cp_
  rdata_$c=
  idata_$c=
!next c

!for c in $levels
 cdata_$c=
 pdata_$c=
 idata_$c=
!next c
!for c in $courses
  c_=!translate internal / to , in $c
  cc=!char 1 to 3 of $(c_[3])
  l_=$(c_[1])
  C_=$(c_[1])_$(c_[2])
  p_=$(c_[1])_$cc
  t_=!defof class_Supervisor\
class_supervisor\
class_description\
class_connections\
in $D_/$c/.def
  !distribute lines $t_ into s_,n_,t_,co_
  co_=!items2words $co_
  L_=$c,$s_,$t_,$n_,$co_
  rdata_$l_=!append line $L_ to $(rdata_$l_)
  rdata_$C_=!append line $L_ to $(rdata_$C_)
  rdata_$p_=!append line $L_ to $(rdata_$p_)
  rdata=!append line $L_ to $(rdata)
!next c
!for c in $icourses
  c_=!translate internal / to , in $c
  l_=$(c_[1])
  p_=$(c_[1])_$(c_[2])
  t_=!defof class_Supervisor\
class_supervisor\
class_description\
class_connections\
in $D_/$c/.def
  !distribute lines $t_ into s_,n_,t_
  L_=$c,$s_,$t_,$n_
  idata_$l_=!append line $L_ to $(idata_$l_)
  idata_$p_=!append line $L_ to $(idata_$p_)
  vistest=!defof class_visibility in $D_/$c/.def
  !!ifval $vistest=2
   idata=!append line $L_ to $idata
  !!endif
!next c

cdata=
!for c in $classes
  c_=!translate internal / to , in $c
  c_=!item 1 of $c_
  t_=!defof class_Supervisor\
class_supervisor\
class_description\
class_connections\
in $D_/$c/.def
  !distribute lines $t_ into s_,n_,t_,co_
  co_=!items2words $co_
  cdata=!append line $c,$s_,$t_,$n_,$co_ to $cdata
  cdata_$c_=!append line $c,$s_,$t_,$n_ to $(cdata_$c_)
  c_=!translate internal / to _ in $c
  !writefile $D_/$c/courses $(rdata_$c_)
!next c
!writefile $D_/courses $(rdata_$c_)

pdata=
!for c in $progs
  c_=!translate internal / to , in $c
  c_=!item 1 of $c_
  t_=!defof class_Supervisor\
class_supervisor\
class_description\
class_connections\
in $D_/$c/.def
  !distribute lines $t_ into s_,n_,t_,co_
  co_=!items2words $co_
  pdata=!append line $c,$s_,$t_,$n_,$co_ to $pdata
  pdata_$c_=!append line $c,$s_,$t_,$n_,$co_ to $(pdata_$c_)
  c_=!translate internal / to _ in $c
  !writefile $D_/$c/courses $(rdata_$c_)
  !writefile $D_/$c/icourses $(idata_$c_)
!next c

ldata=
!for c in $levels
  t_=!defof class_Supervisor\
class_supervisor\
class_description\
class_connections\
in $D_/$c/.def
  !distribute lines $t_ into s_,n_,t_,co_
  co_=!items2words $co_
  ldata=!append line $c,$s_,$t_,$n_,$co_ to $ldata
  !writefile $D_/$c/classes $(cdata_$c)
  !writefile $D_/$c/programs $(pdata_$c)
  !writefile $D_/$c/courses $(rdata_$c)
  !writefile $D_/$c/icourses $(idata_$c)
!next c

!writefile $D_/levels $ldata
!writefile $D_/classes $cdata
!writefile $D_/programs $pdata
!writefile $D_/icourses $idata
!writefile $D_/courses $rdata