Sybernet / Supplied Packages Reference
Release 3.00
August 23, 2003
backwards forwards

HTTP.VALIDATOR

The VALIDATOR package provides subprograms for creating trace files from your active Sybernet session. Although the package can capture all output, there is no facility for capturing user input. It uses the STDIO package to write your output to a standard unix disk file.

Globals

VALIDATOR defines the following global variables:

fildes                   int := -1;           -- File descriptor
errno                    int :=  0;           -- error number

Summary of Subprograms

Subprogram Description
TRACE procedure
 
Turns tracing on and off or writes buffer to the trace file.
TRACING function
 
Determines if tracing is on or off.
UNLINK procedure
 
Removes the trace file.
VALIDATE procedure
 
Validates the trace file.

TRACE procedure

This overloaded procedure turns tracing on and off (Syntax 1) or writes your buffer to the trace file (Syntax 2).

Syntax 1

HTTP.VALIDATOR.TRACE (STATE IN BOOLEAN);

Parameters

Parameter Description
state
 
Turns tracing on (TRUE) and turns tracing off (FALSE).

Syntax 2

HTTP.VALIDATOR.TRACE (BUFFER IN VARCHAR2);

Parameters

Parameter Description
buffer
 
Writes buffer to the trace file.

Example

The following block illustrates how to call HTTP.VALIDATOR.TRACE:

BEGIN
    HTTP.VALIDATOR.TRACE(TRUE);
    HTTP.VALIDATOR.TRACE('<html>');
    HTTP.VALIDATOR.TRACE('</html>');
    HTTP.VALIDATOR.TRACE(FALSE);
END;

VALIDATE procedure

This procedure runs the Sybernet Validator (a C program) against your trace file.

Syntax

HTTP.VALIDATOR.VALIDATE (VERBOSE IN BOOLEAN,DOCTYPE IN VARCHAR2:=NULL)

Parameters

Parameter Description
verbose
 
This option arms verbose (-v) flag when true.
doctype
 
This option arms the document type (-d) flag.

Example

The following block illustrates how to call HTTP.VALIDATOR.VALIDATE:

BEGIN
    HTTP.VALIDATOR.TRACE(TRUE);
    HTTP.VALIDATOR.TRACE('<html>');
    HTTP.VALIDATOR.TRACE('</html>');
    HTTP.VALIDATOR.TRACE(FALSE);
    HTTP.VALIDATOR.VALIDATE(TRUE,'1');
END;

UNLINK procedure

This procedure removes your trace file. Tracing is turned off (if on) before your trace file is discarded.

Syntax

HTTP.VALIDATOR.UNLINK;

Parameters

None.

Example

The following block illustrates how to call HTTP.VALIDATOR.UNLINK:

BEGIN
    HTTP.VALIDATOR.TRACE(TRUE);
    HTTP.VALIDATOR.TRACE('<html>');
    HTTP.VALIDATOR.TRACE('</html>');
    HTTP.VALIDATOR.TRACE(FALSE);
    HTTP.VALIDATOR.UNLINK;
END;

TRACING function

This function determines if tracing is on or off.

Syntax

HTTP.VALIDATOR.TRACING RETURN BOOLEAN;

Parameters

None.

Example

The following block illustrates how to call HTTP.VALIDATOR.TRACING:

BEGIN
    HTTP.SP_HTML_INPUT
    (
        TYPE		=> 'SUBMIT'
    ,   NAME		=> 'SUBMIT'
    ,   VALUE		=> 'Trace On'
    ,   ONCLICK		=> 'TOGGLE(this.form,this);'
    ,   DISABLED	=> HTTP.VALIDATOR.TRACING
    )   ;
END;

See Also

STDIO
SP_HTML_VALIDATOR



Sybernet is a trademark of SRI International.
Copyright © 1996-2008 SRI International. All Rights Reserved.
Denis D. Workman / http://Sybernet.sri.com/