File size: 15,194 Bytes
806d4b5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504

//This is a customized version of ::/Demo/ToHtmlToTXTDemo/ToHtml.HC.
//Diff

#help_index "DolDoc/Conversion"
//See ::/Doc/Credits.DD.

#define DOCET_UNDEF_COLOR       0x100000000
#define DOCET_LINK_UNDERLINE    0x200000000
U0 HtmlPutS(CDoc *doc,I64 u32_attr,I64 *_old_u32_attr,Bool underline_update,
        U8 *st,I64 *_col,U8 *style_bitmap=NULL)
{
  U8 *ch,*ptr;

  u32_attr&=0xFFFFFF00;
  if (u32_attr&DOCET_INVERT)
    u32_attr.u8[1]=(u32_attr.u8[1]&15)<<4|u32_attr.u8[1]>>4;

  if (underline_update &&
        !(u32_attr&DOCET_UNDERLINE) && *_old_u32_attr&DOCET_UNDERLINE) {
    if (!(*_old_u32_attr&DOCET_LINK_UNDERLINE))
      DocPrint(doc,"</u>");
    *_old_u32_attr&=~DOCET_LINK_UNDERLINE;
  }
  if (!(u32_attr&DOCET_BLINK) && *_old_u32_attr&DOCET_BLINK)
    DocPrint(doc,"</blink>");

  if (u32_attr&0xFF00!=*_old_u32_attr&0xFF00) {
    if (!(*_old_u32_attr&DOCET_UNDEF_COLOR))
      DocPrint(doc,"</span>");
    DocPrint(doc,"<span class=c%02X>",u32_attr.u8[1]);
    if (style_bitmap)
      LBts(style_bitmap,u32_attr.u8[1]);
  }
  if (u32_attr&DOCET_BLINK && !(*_old_u32_attr&DOCET_BLINK))
    DocPrint(doc,"<blink>");
  if (underline_update) {
    if (u32_attr&DOCET_UNDERLINE && !(*_old_u32_attr&DOCET_UNDERLINE))
      DocPrint(doc,"<u>");
  } else //Keep same underline status.
    u32_attr=u32_attr&~DOCET_UNDERLINE | *_old_u32_attr&DOCET_UNDERLINE;

  *_old_u32_attr=u32_attr | *_old_u32_attr&DOCET_LINK_UNDERLINE;

  while (ch=*st++) {
    switch (ch) {
      case '\t':
        do {
          DocPutKey(doc,CH_SPACE,0);
          *_col=*_col+1;
        } while (*_col&7);
        break;

      start:
        case 'pi':      ptr="pi";       break;
        case 'theta':   ptr="theta";    break;
        case 'phi':     ptr="phi";      break;
        case 'omega':   ptr="omega";    break;
        case 'inf':     ptr="inf";      break;
        case 'u':       ptr="u";        break;
      end:
        DocPrint(doc,ptr);
        *_col=*_col+StrLen(ptr);
        break;

      start:
        case CH_SHIFT_SPACE: ptr=" ";   break;
        case '&':       ptr="&";    break;
        case '<':       ptr="<";     break;
        case '>':       ptr=">";     break;
        case '"':       ptr=""";   break;
      end:
        DocPrint(doc,ptr);
        *_col=*_col+1;
        break;

      default:
        if (CH_SPACE<=ch<0x7F || ch=='\n')
          DocPutKey(doc,ch,0);
        else
          DocPrint(doc,".");
        *_col=*_col+1;
    }
  }
}

U8 *TOSLinkCvt2(U8 *filename,I64 line_num)
{// ::/  --> /Wb/
//Make your own LinkCvt routine
  U8 *res=NULL,*st,*st2;
  if (filename) {
    st2=TOSBlogAbs(filename);
    st=ExtChg(st2,"html");
    Free(st2);
    if (st && StrLen(st)>3 && !StrNCmp(st+1,":/",2))
      res=MStrPrint(PERSONAL_WEB "/%s#l%d",st+3,line_num);
    Free(st);
  }
  return res;
}

U8 *URLBibleGateway(U8 *src)
{
  U8 buf[STR_LEN],*dst=buf;
  if (!MemCmp(src,"BF:",3))
    src+=3;
  while (*src) {
    if (*src==CH_SPACE || *src==',')
      *dst++='+';
    else
      *dst++=*src;
    src++;
  }
  *dst=0;
  if (StrOcc(buf,'-'))
    return MStrPrint(
          "http://www.biblegateway.com/passage/?search=%s&version=NIV",buf);
  else
    return MStrPrint(
          "http://www.biblegateway.com/verse/en/%s",buf);
}

U8 *TOSLinkCvt1(U8 *link_st)
{
  static CDoc *bible=NULL;
  static I64 locks=0;
  U8 *res=NULL,*filename,*needle;
  I64 i,num;
  if (link_st) {
    switch (i=EdLinkCvt(link_st,&filename,&needle,&num)) {
      case LK_FILE_LINE:
      case LK_PLAIN_LINE:
      case LK_FILE:
        res=TOSLinkCvt2(filename,num);
        break;
      case -1:
      case LK_DEF:
      case LK_HELP_INDEX:
      case LK_DOC:
      case LK_DOC_ANCHOR:
      case LK_DOC_FIND:
      case LK_DOC_LINE:
        break;
      case LK_BIBLE_FIND:
        while (LBts(&locks,0))
          Yield;
        if (!bible)
          bible=Adam("DocRead(\"%s\");",filename);
        if (DocFind(bible,num,needle))
          res=URLBibleGateway(link_st);
        LBtr(&locks,0);
        break;
      default:
        if (DocFileEd(i,filename,needle,&num,EDF_UNCOLLAPSE|EDF_BAIL))
          res=TOSLinkCvt2(filename,num);
    }
    Free(filename);
    Free(needle);
  }
  return res;
}


public CDoc *Doc2Html(CDoc *doc_in,U8 *html_header=NULL,U8 *body_header=NULL,
        U8 *body_footer=NULL,U8 *html_footer=NULL,Bool line_anchors=TRUE,
        U8 (*link_cvt)(U8 *link_st)=&TOSLinkCvt1,Bool line_nums=FALSE)
{//Cvt DolDocdoc to HTML file.
  CDocEntry *doc_e,*style,*doc_e2;
  I64 i,y,old_y=I64_MIN,col,old_u32_attr=DOCET_UNDEF_COLOR,old_attr,digits;
  U32 *hl,*src;
  U8 *st,st_2[2],*link_st,*style_bitmap=CAlloc(256/8);
  CBGR48 p[COLORS_NUM];
  GrPaletteGet(p);
  CDoc *doc_out=DocNew;
  Bool unlock_doc_in=DocLock(doc_in),no_bwd;

  old_attr=doc_in->win_task->text_attr;
  doc_in->win_task->text_attr=DOC_ATTR_DFT_TEXT;

  for (i=0xF0;i<=0xFF;i++)
    LBts(style_bitmap,i);

  DocRecalc(doc_in,RECALCt_NORMAL|RECALCF_TO_HTML);
  digits=Log10(doc_in->head.last->y+1)+1;

  st_2[0]=0; st_2[1]=0;
  doc_out->flags|=DOCF_PLAIN_TEXT|DOCF_NO_CURSOR;

  if (!html_header) html_header=
          "<!DOCTYPE HTML>\n"
          "<html>\n"
          "<head>\n"
          "<meta http-equiv=\"Content-Type\" "
          "content=\"text/html;charset=US-ASCII\">\n"
          "<meta name=\"generator\" content=\"TempleOS V5.03\">\n";
  if (!body_header) body_header=
          "<body>\n"
          "<pre style=\"font-family:courier;font-size:10pt\">\n";
  if (!body_footer) body_footer=
          "</pre></body>\n</html>\n";
  if (!html_footer) html_footer=
          "</html>\n";

  DocPrint(doc_out,"%s",html_header);

  DocPrint(doc_out,"<style type=\"text/css\">\n");
  style=doc_out->cur_entry->last;
  DocPrint(doc_out,
        "</style>\n"
        "</head>\n");
  DocPrint(doc_out,"%s",body_header);

  doc_e=doc_in->head.next;
  col=doc_e->x;
  y=doc_e->y;
  while (doc_e!=doc_in) {
    if (!(doc_e->de_flags&DOCEF_SKIP)) {
      if (y!=old_y) {
        if (line_anchors)
          DocPrint(doc_out,"<a name=\"l%d\"></a>",y+1);
        if (line_nums)
          DocPrint(doc_out,"%0*d ",digits,y+1);
        old_y=y;
      }
      while (y<doc_e->y) {
        HtmlPutS(doc_out,doc_e->settings.final_u32_attr,&old_u32_attr,FALSE,
              "\n",&col,style_bitmap);
        if (++y!=old_y) {
          if (line_anchors)
            DocPrint(doc_out,"<a name=\"l%d\"></a>",y+1);
          if (line_nums)
            DocPrint(doc_out,"%0*d ",digits,y+1);
          old_y=y;
        }
        col=0;
      }

      no_bwd=TRUE;
      doc_e2=doc_e->next;
      while (doc_e2!=doc_in && doc_e2->y==doc_e->y) {
        if (doc_e2->x<doc_e->x) {
          no_bwd=FALSE;
          break;
        }
        doc_e2=doc_e2->next;
      }

      if (no_bwd)
        while (col<doc_e->x)
          HtmlPutS(doc_out,doc_e->settings.final_u32_attr&~DOCET_UNDERLINE,
                &old_u32_attr,TRUE," ",&col,style_bitmap);

      link_st=NULL;
      if (doc_e->de_flags&DOCEF_HTML_LINK)
        link_st=StrNew(doc_e->html_link);
      else if (st=DocEntryLink(doc_in,doc_e)) {
        link_st=link_cvt(st);
        Free(st);
      }

      if (link_st) {
        if (old_u32_attr&DOCET_UNDERLINE &&!(old_u32_attr&DOCET_LINK_UNDERLINE))
          DocPrint(doc_out,"</u>");
        if (old_u32_attr&DOCET_BLINK)
          DocPrint(doc_out,"</blink>");
        if (!(old_u32_attr&DOCET_UNDEF_COLOR))
          DocPrint(doc_out,"</span>");
        old_u32_attr=DOCET_UNDEF_COLOR|DOCET_UNDERLINE|DOCET_LINK_UNDERLINE;
        DocPrint(doc_out,"<a href=\"%s\">",link_st);
      }

      switch (doc_e->type_u8) {
        case DOCT_TEXT:
          if (doc_e->de_flags&DOCEF_HIGHLIGHT) {
            if (doc_e->last==doc_in)
              MemCpy(&doc_e->settings,&doc_in->settings_head,
                    sizeof(CDocSettings));
            else
              MemCpy(&doc_e->settings,&doc_e->last->settings,
                    sizeof(CDocSettings));
            src=hl=DocHighlight(doc_e,doc_e->tag,StrLen(doc_e->tag),
                  doc_e->type&0xFF00);
            while (*src) {
              st_2[0]=*src&0xFF;
              HtmlPutS(doc_out,*src++,&old_u32_attr,TRUE,
                    st_2,&col,style_bitmap);
            }
            Free(hl);
          } else {
            if (doc_e->de_flags&DOCEF_CENTER_X && //Nonstandard
                  doc_e->settings.final_u32_attr&0xF00==PURPLE<<8)
              DocPrint(doc_out,"<h1><center>");
            HtmlPutS(doc_out,doc_e->settings.final_u32_attr,
                  &old_u32_attr,TRUE,doc_e->tag,&col,style_bitmap);
            if (doc_e->de_flags&DOCEF_CENTER_X && //Nonstandard
                  doc_e->settings.final_u32_attr&0xF00==PURPLE<<8)
              DocPrint(doc_out,"</center></h1>");
          }
          break;
        case DOCT_TAB:
          HtmlPutS(doc_out,doc_e->settings.final_u32_attr,&old_u32_attr,TRUE,
                "\t",&col,style_bitmap);
          break;
        case DOCT_HTML_CODE:
          if (old_u32_attr&DOCET_UNDERLINE &&
                !(old_u32_attr&DOCET_LINK_UNDERLINE))
            DocPrint(doc_out,"</u>");
          if (old_u32_attr&DOCET_BLINK)
            DocPrint(doc_out,"</blink>");
          if (!(old_u32_attr&DOCET_UNDEF_COLOR))
            DocPrint(doc_out,"</span>");
          old_u32_attr=DOCET_UNDEF_COLOR;
          DocPrint(doc_out,"%s",doc_e->tag);
          break;
        case DOCT_SPRITE:
          HtmlPutS(doc_out,doc_e->settings.final_u32_attr,
                &old_u32_attr,TRUE,doc_e->tag,&col,style_bitmap);
          HtmlPutS(doc_out,doc_e->settings.final_u32_attr,
                &old_u32_attr,TRUE,"/* Graphics Not Rendered in HTML */",
                &col,style_bitmap);
          break;
        default:
          if (doc_e->de_flags&DOCEF_TAG)
            HtmlPutS(doc_out,doc_e->settings.final_u32_attr,
                  &old_u32_attr,TRUE,doc_e->tag,&col,style_bitmap);
      }
      if (link_st) {
        if (old_u32_attr&DOCET_UNDERLINE &&!(old_u32_attr&DOCET_LINK_UNDERLINE))
          DocPrint(doc_out,"</u>");
        if (old_u32_attr&DOCET_BLINK)
          DocPrint(doc_out,"</blink>");
        if (!(old_u32_attr&DOCET_UNDEF_COLOR))
          DocPrint(doc_out,"</span>");
        DocPrint(doc_out,"</a>");
        old_u32_attr=DOCET_UNDEF_COLOR|DOCET_UNDERLINE|DOCET_LINK_UNDERLINE;
        Free(link_st);
      }
    }
    doc_e=doc_e->next;
  }
  while (y++<doc_e->y) {
    HtmlPutS(doc_out,doc_e->settings.final_u32_attr,
          &old_u32_attr,TRUE,"\n",&col,style_bitmap);
    col=0;
  }
  if (old_u32_attr&DOCET_UNDERLINE && !(old_u32_attr&DOCET_LINK_UNDERLINE))
    DocPrint(doc_out,"</u>");
  if (old_u32_attr&DOCET_BLINK)
    DocPrint(doc_out,"</blink>");
  if (!(old_u32_attr&DOCET_UNDEF_COLOR))
    DocPrint(doc_out,"</span>");
  old_u32_attr=DOCET_UNDEF_COLOR;
  DocPrint(doc_out,"%s",body_footer);
  DocPrint(doc_out,"%s",html_footer);

  doc_out->cur_entry=style->next;
  for (i=0;i<256;i++)
    if (Bt(style_bitmap,i))
      DocPrint(doc_out,
            ".c%02X{color:#%02x%02x%02x;background-color:#%02x%02x%02x;}\n",
            i,p[i&15].r>>8,p[i&15].g>>8,p[i&15].b>>8,
            p[i/16].r>>8,p[i/16].g>>8,p[i/16].b>>8);
  doc_out->cur_entry=&doc_out->head;
  DocRecalc(doc_out);

  doc_in->win_task->text_attr=old_attr;

  if (unlock_doc_in)
    DocUnlock(doc_in);
  return doc_out;
}

#help_index "Cmd Line (Typically);DolDoc/Conversion;DolDoc/Cmd Line (Typically)"
public U0 TOSToHtml(U8 *_in_name,U8 *_out_name=NULL,U8 *html_header=NULL,
        U8 *body_header=NULL,U8 *body_footer=NULL,U8 *html_footer=NULL,
        I64 width=80,Bool line_anchors=TRUE,
        U8 (*link_cvt)(U8 *link_st)=&TOSLinkCvt1,Bool line_nums=FALSE)
{//Convert DolDocfile to HTML.
//Supply your own link_cvt routine.
  U8 *in_name,*out_name;
  CDoc *doc_in,*doc_out;

  SettingsPush; //See SettingsPush
  WinHorz(0,width-1); //Sets doc width for word wrap.

  in_name=ExtDft(_in_name,"HC.Z");
  if (_out_name)
    out_name=ExtDft(_out_name,"html");
  else
    out_name=ExtChg(_in_name,"html");

  doc_in=DocRead(in_name);
  DocTop(doc_in);
  DocPrint(doc_in,"$BD,LTCYAN$");       //Nonstandard
  doc_out=Doc2Html(doc_in,html_header,body_header,body_footer,html_footer,
        line_anchors,link_cvt,line_nums);
  StrCpy(&doc_out->filename.name,out_name);

  SettingsPop;

  DocWrite(doc_out);
  DocDel(doc_in);
  DocDel(doc_out);
  Free(in_name);
  Free(out_name);
}

#help_index "Misc/TOS"
U0 TOSWebFile(U8 *name,Bool line_nums=FALSE)
{
  U8 *name2;
  CDirEntry de;
  Bool line_anchors;
  if (FileFind(name,&de)) {
    Free(de.full_name);
    "File:%s\n",name;
    Collapse(name,FALSE);
    Touch(name,"",,de.datetime);
    name2=ExtChg(name,"html");

    if (StrMatch(BLOG_DST,name) || StrMatch(DAILY_DST,name))
      line_anchors=FALSE;
    else
      line_anchors=TRUE;

    TOSToHtml(name,name2,
          "<!DOCTYPE HTML>\n"
          "<html style=\"background-color:#FFFFFF;\">\n"
          "<head>\n"
          "<meta http-equiv=\"Content-Type\" "
          "content=\"text/html;charset=US-ASCII\">\n"
          "<title>The Temple Operating System</title>\n"
          "<meta name=\"keywords\" "
          "content=\"Operating System,64-Bit,64 Bit,"
          "Temple,OS,TempleOS,Free,Open Source,Public Domain,x86_64\">\n"
          "<meta name=\"generator\" content=\"TempleOS V5.03\">\n",

          "<body style=\"background-color:#55FFFF; border-style:solid;
          border-width:8px; border-color:#0000AA;
          margin-left:auto; margin-right:auto; width:800px; \">\n"
          "<pre style=\"font-family:courier;font-size:10pt\">\n"
          "<div style=\"margin-left:auto; margin-right:auto;"
          " width: 640px;\">\n",
          "</div></pre></body>\n",
          "</html>\n",,line_anchors,,line_nums);
    Touch(name2,"",,de.datetime);
    Free(name2);
  }
}

U0 FreshenWebDir(U8 *srcdir,Bool line_nums=FALSE)
{//No recurse
  CDirEntry *tmpde,*tmpde1;
  U8 *dstdir,*src,*dst;
  dstdir=TOSBlogAbs(srcdir);

  src=MStrPrint("D:/Wb%s",dstdir+2);
  DirMk(src);
  Del(src);
  Free(src);

  src=MStrPrint("C:%s/*",srcdir);
  dst=MStrPrint("D:/Wb%s",dstdir+2);
  Copy(src,dst);
  Free(src);
  Free(dst);

  src=MStrPrint("D:/Wb%s/*",dstdir+2);
  tmpde=tmpde1=FilesFind(src,FUF_JUST_FILES|FUF_JUST_TXT|FUF_CLUS_ORDER);
  while (tmpde) {
    TOSWebFile(tmpde->full_name,line_nums);
    tmpde=tmpde->next;
  }
  DirTreeDel(tmpde1);

  Free(dstdir);
}

public U0 FreshenSite()
{//Regen html files in D:/Wb
  CDirEntry *tmpde,*tmpde1;
  DocClear;
  Cd("D:/Wb");
  DelTree("D:/Wb/Home/Books1");
  DelTree("D:/Wb/Home/Books2");
  CopyTree("D:/Wb/Home/" INS_REG_PERSONAL_INITIALS "/TOSBlog",
        "D:/Wb/Home/Web/" INS_REG_PERSONAL_INITIALS);
  DelTree("D:/Wb/Home/ALM");
  DelTree("D:/Wb/Home/TAD");
  Del("D:/Wb/Home/*");
  Touch("D:/Wb/Home/Web/index.DD.Z","");
  Touch("D:/Wb/Home/Web/DownloadOS.DD.Z","");
  Touch("D:/Wb/Home/Web/TempleOS.DD.Z","");
  tmpde=tmpde1=FilesFind("*",
        FUF_RECURSE|FUF_JUST_FILES|FUF_JUST_TXT|FUF_CLUS_ORDER);
  while (tmpde) {
    TOSWebFile(tmpde->full_name);
    tmpde=tmpde->next;
  }
  DirTreeDel(tmpde1);
  FreshenWebDir("/Home/Sup1/Sup1Words",TRUE);
  Drv('C');
}