[0001] [0002] [0003] [0004] [0005] [0006] [0007] [0008] [0009] [0010] [0011] [0012] [0013] [0014] [0015] [0016] [0017] [0018] [0019] [0020] [0021] [0022] [0023] [0024] [0025] [0026] [0027] [0028] [0029] [0030] [0031] [0032] [0033] [0034] [0035] [0036] [0037] [0038] [0039] [0040] [0041] [0042] [0043] [0044] [0045] [0046] [0047] [0048] [0049] [0050] [0051] [0052] [0053] [0054] [0055] [0056] [0057] [0058] [0059] [0060] [0061] [0062]
$! Simple demonstration that even DCL procedures can be CGIplus scripts $! and use the CGIplus callout mechanism. This non-C-language example $! also demonstrates the essential elements of CGIplus processing. $! 06-SEP-1999 MGD initial $! $ say = "write sys$output" $ UsageCount = 0 $ FirstUsed = f$time() $ open /read CgiPlusIn CGIPLUSIN $! $ RequestLoop: $! $! (block waiting for request, this initial read is always discardable) $ read CgiPlusIn /end=EndRequestLoop Line $ UsageCount = UsageCount + 1 $! $ say "Content-Type: text/plain" $ say "" $ say "Number of times used: ''UsageCount'" $ say "First used: ''FirstUsed'" $ say "Now: ''f$time()'" $ say "" $ say "CGIplus variables:" $ say "" $! $! (read and display the CGIplus variable stream) $ CgiVarLoop: $ read CgiPlusIn /end=EndCgiVarLoop Line $ if Line .eqs. "" then goto EndCgiVarLoop $ say Line $ goto CgiVarLoop $ EndCgiVarLoop: $! $ say "" $ say "CGIplus callout example:" $ say "" $! $! (just a slightly different file name each time it's used) $ PathExample = "/wasd_root/src/httpd/file''UsageCount'.c" $ say "Map '" + PathExample + "' using the following callout request ..." $ say "" $ say " ""MAP-FILE: " + PathExample + """" $ say "" $! $! (this block is the actual callout) $ say f$trnlnm("CGIPLUSESC") $ say "MAP-PATH: " + PathExample $ read CgiPlusIn /end=EndRequestLoop Response $ say f$trnlnm("CGIPLUSEOT") $! $ say "Server response was ..." $ say "" $ say " """ + Response + """" $ say "" $ say "Yielding a file specification of ..." $ say "" $ say " " + f$extract(4,999,Response) $! $ say f$trnlnm("CGIPLUSEOF") $ goto RequestLoop $! $ EndRequestLoop: