ad_register_proc

one of the documented procedures in this installation of the ACS
Usage:
ad_register_proc { -debug f -noinherit f -description "" } method path proc args
What it does:
Registers a procedure (see ns_register_proc for syntax). Use a method of "*" to register GET, POST, and HEAD filters. If debug is set to "t", all invocations of the procedure will be ns_logged.
Defined in: /web/philip/packages/acs-core/request-processor-procs.tcl

Source code:

arg_parser_for_ad_register_proc $args

    if { [string equal $method "*"] } {
	# Shortcut to allow registering filter for all methods. Just call ad_register_proc
	# again, with each of the three methods.
	foreach method { GET POST HEAD } {
	    eval ad_register_proc [list -debug $debug -noinherit $noinherit $method $path $proc] $args
	}
	return
    }

    if { [lsearch -exact { GET POST HEAD } $method] == -1 } {
	error "Method passed to ad_register_proc must be one of GET, POST, or HEAD"
    }

    # Obtain a lock on the list of registered procedures.
    set mutex [nsv_get rp_registered_procs mutex]
    ns_mutex lock $mutex

    set procs [nsv_get rp_registered_procs $method]
    set proc_info [list $method $path $proc $args $debug $noinherit $description [info script]]

    # Don't allow the same thing to be registered twice.
    if { [lsearch -exact $procs $proc_info] != -1 } {
	ns_log "Warning" "Procedure $proc already registered for $method $path"
	ns_mutex unlock $mutex
    }

    # Append and sort the list of procedures.
    lappend procs $proc_info
    set procs [lsort -command rp_registered_proc_info_compare $procs]

    ns_log "Notice" "Registering proc $proc for $method $path"

    # Reset the array entry, and free the lock.
    nsv_set rp_registered_procs $method $procs
    ns_mutex unlock $mutex


philg@mit.edu