7 .local string file, res, slides
11 slides = _read_file(conn, file)
12 unless slides goto err
15 res = _find_slides(conn, slides, p)
24 $P0 = getclass 'ParrotIO'
25 $S0 = $P0.'slurp'(file)
34 .local int n, p, pos1, pos2
37 pos1 = index slides, '<body', 0
38 if pos1 == -1 goto nobody
44 (pos1, p, $S0) = _next_tag(slides, pos1)
45 if p == -1 goto serve_eof # at eof
47 (pos2, p, tag) = _next_tag(slides, p)
48 if p == -1 goto serve_eof # at eof
49 if part == n goto serve_it
50 if tag == 'ul' goto loop2
51 if tag == 'ol' goto loop2
52 if tag == 'dl' goto loop2
53 if tag == 'blockquote' goto loop2
55 if tag == 'p' goto loop2
56 if tag == 'pre' goto loop2
57 if tag == 'h2' goto loop2
58 if tag == 'h3' goto loop2
59 if tag == 'li' goto loop2
60 if tag == 'dt' goto loop2
61 if tag == 'dd' goto loop2
66 $S0 = '<h1>ENOMORESLIDES - <sub>'
73 $S0 = substr slides, pos1, $I0
76 if null conn goto no_conn
78 srv.'debug'("CGI: pos1 ", pos1, " pos2 ", p, " -: ", $S0)
89 p = index slides, '<', pos1
93 if $S0 == '/' goto ignore
94 # got open tag - ignore <b>, <i>, <tt>, <sup>, <sub> ...
95 if $S0 == 'b' goto ignore
96 if $S0 == 'i' goto ignore
97 if $S0 == 's' goto ignore
98 if $S0 == 't' goto ignore
100 p = index slides, '>', p1
103 tag = substr slides, p1, $I0
105 .return (pos1, p, tag)
111 p = index slides, '</body>', pos1
112 .return (pos1, p, '')
124 $S0 = cgi_main($P0, '', $P1)
132 # vim: expandtab shiftwidth=4 ft=pir: