File: import.proc

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 (187 lines) | stat: -rw-r--r-- 4,782 bytes parent folder | download | duplicates (3)
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187

!if ($wims_class notitemof $nei_sup,$nei_part or\
	  $nei notitemof $n_sup,$n_part) and \
    all notitemof $nei_sup,$nei_part
  error=not_neighbor
  job2=first
  !exit
!endif

!read scripts/reccnt.proc me log/classes/$wims_class
!read scripts/reccnt.proc it log/classes/$nei

!if ($wims_class notitemof $nei_sup or $nei notitemof $n_sup) and \
    all notitemof $nei_sup
  newcnt1=0
  !goto user
!endif

newrec=!mexec neighbor/newrec.sh

newcnt1=!linecnt $newrec

!reset doctit,sheettit,examtit,glossarytit
!for i=1 to $me_doccnt
  l=!record $i of wimshome/log/classes/$wims_class/doc/.index
  l=!line 2 of $l
  doctit=!append line $l to $doctit
!next i
!for i=1 to $me_sheetcnt
  l=!record $i of wimshome/log/classes/$wims_class/sheets/.sheets
  l=!line 3 of $l
  sheettit=!append line $l to $sheettit
!next i
!for i=1 to $me_examcnt
  l=!record $i of wimshome/log/classes/$wims_class/exams/.exams
  l=!line 4 of $l
  examtit=!append line $l to $examtit
!next i
!for i=1 to $me_glossarycnt
  l=!record $i of wimshome/log/classes/$wims_class/tool/.glossaryindex
  l=!line 2 of $l
  glossarytit=!append line $l to $glossarytit
!next i
!for i=1 to $newcnt1
  l=!line $i of $newrec
  !distribute words $l into t_,n_,c_
  rtype$i=$t_
  rcode$i=$c_
  rstat$i=1
  rcnt$i=1
  !if $t_=motd
    rName$i=---
    rname$i=---
  !endif
  !if $t_=exo
    N_=!char 1 to -5 of $n_
    rName$i=$N_
    rname$i=!defof title in wimshome/log/classes/$nei/def/$N_.def
  !endif
  !if $t_=doc
    rName$i=c$n_
    rname$i=!defof tit in wimshome/log/classes/$nei/doc/c$n_/.def
    rcnt$i=!recordcnt wimshome/log/classes/$nei/doc/c$n_/.index
    test=!positionof line $(rname$i) in $doctit
    !if $test!=$empty
      test=!item 1 of $test
      rmine$i=$test
      rcode$i=2
    !else
      rcode$i=1
    !endif
  !endif
  !if $t_=sheet
    l=!record $n_ of wimshome/log/classes/$nei/sheets/.sheets
    rName$i=$n_
    rname$i=!line 3 of $l
    rstat$i=!word 1 of $l
    rcnt$i=!recordcnt wimshome/log/classes/$nei/sheets/.sheet$n_
    test=!positionof line $(rname$i) in $sheettit
    !if $test!=$empty
      test=!item 1 of $test
      rmine$i=$test
      rcode$i=2
      l=!record $test of wimshome/log/classes/$wims_class/sheets/.sheets
      test=!word 1 of $l
      !if $test>0
        rcode$i=3
      !endif
    !else
      rcode$i=1
    !endif
  !endif
  !if $t_=glossary
    rName$i=$n_
    l=!record $n_ of wimshome/log/classes/$nei/tool/.glossaryindex
    rname$i=!line 2 of $l
    rstat$i=!word 1 of $l
    rcnt$i=!recordcnt wimshome/log/classes/$nei/tool/.glossary$n_
    test=!positionof line $(rname$i) in $glossarytit
    !if $test!=$empty
      test=!item 1 of $test
      rmine$i=$test
      rcode$i=2
      l=!record $test of wimshome/log/classes/$wims_class/glossary/.glossaryindex
      test=!word 1 of $l
      !if $test>0
        rcode$i=3
      !endif
    !else
      rcode$i=1
    !endif
  !endif
  !if $t_=exam
    rName$i=$n_
    l=!record $n_ of wimshome/log/classes/$nei/exams/.exams
    rname$i=!line 4 of $l
    rstat$i=!word 1 of $l
    rcnt$i=!recordcnt wimshome/log/classes/$nei/exams/.exam$n_
    test=!positionof line $(rname$i) in $examtit
    !if $test!=$empty
      test=!item 1 of $test
      rmine$i=$test
      rcode$i=2
      l=!record $test of wimshome/log/classes/$wims_class/exams/.exams
      test=!word 1 of $l
      !if $test>0
        rcode$i=3
      !endif
    !else
      rcode$i=1
    !endif
  !endif
!next i

!distribute line livret/.comps\
doc/.docindex\
tool/.toolindex into file_livret,file_pdoc,file_tool
!for type in livret,tool,pdoc
  li=!recordcnt wimshome/log/classes/$nei/$(file_$type)
  !if $li>0
    newrec=!append line $type $li 1 to $newrec
    i=!linecnt $newrec
    rtype$i=$type
    rcode$i=1
    rstat$i=1
    rcnt$i=$li
    rName$i=---
    rname$i=---
    rstat$i=---
    rccnt$i=---
    test=!recordcnt wimshome/log/classes/$wims_class/$(file_$type)
    !if $test>0
      rcode$i=2
      rmine$i=$test
    !endif
  !endif
!next type
newcnt1=!linecnt $newrec

:user
nusercnt=!recordcnt wimshome/log/classes/$nei/.userlist
newcnt2=0
!if $nei_sup=all
  !exit
!endif
!for i=1 to $nusercnt
  l=!record $i of wimshome/log/classes/$nei/.userlist
  u=!item 3 of $l
  p1=!defof user_password in wimshome/log/classes/$nei/.users/$u
  p2=!defof user_password in wimshome/log/classes/$wims_class/.users/$u
  !if $p1!=$empty and $p1!=$p2
    !advance newcnt2
    j=$newcnt2
    ulogin$j=$u
    uname1$j=!defof user_lastname in wimshome/log/classes/$nei/.users/$u
    uname2$j=!defof user_firstname in wimshome/log/classes/$nei/.users/$u
    ucode$j=2
    !if $p2=$empty
      t=!record 0 of wimshome/log/classes/$wims_class/.users/.$u
      !if $t=$empty
        ucode$j=1
      !else
        ucode$j=3
      !endif
    !endif
  !endif
!next i