[ Previous ] [ Contents ] [ Index ] [ Next ]

Ns_AdpParseFile

Overview

Parse an ADP file by filename

Syntax

    int Ns_AdpParseFile(
        Ns_DString *pds, 
        char       *filename, 
        Ns_Conn    *conn, 
        int         fAllowStreaming,
        int        *fStream,
        int         argc,
        char       **argv,
        int         fGlobal
    );

Description

This function parses an ADP, given its filename. The cached version of the ADP will be returned if it is available, and the file will be added to the cache if possible.

The pds argument is a pointer to a dstring where the output of the ADP will go.

The filename argument is the complete pathname of the file containing the ADP. Any ns_adp_include Tcl commands in the ADP will be processed in the directory where the ADP resides. This ADP's filename is also used as the cache key.

The conn argument is the current connection.

If fAllowStreaming is 0, this function processes the ADP read from fp and writes the result to the passed in dstring (pds). If fAllowStreaming is non-zero, and the ADP contains a script that turns on streaming, the results are written directly out to the conn.

The fStream argument is set to 1 if streaming has been turned on by the ADP and 0 if it has not.

The argc argument is the number of arguments that are to be passed to the ADP.

The argv argument is a list of the argument values to be passed to the ADP.

If fGlobal is set to true, any Tcl commands run in the ADP will be run with Tcl_GlobalEval. If set to false, Tcl commands are run with Tcl_Eval.

If this call is a nested ADP evaluation (where one ADP calls another), an error will be returned if the maximum number of nested ADP evaluations, determined by the MaxCallDepth parameter, has been exceeded.

Top of Page

[ Previous ] [ Contents ] [ Index ] [ Next ]
Copyright © 1996 America Online, Inc.