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

Tcl API Function Categories

The AOLserver Tcl functions are divided into four categories. The tables below list the functions in each category. Detailed descriptions of the functions are provided in alphabetical order in the remainder of this chapter.

Core functions

Core functions are available regardless of which modules are or are not loaded.
Function Description
ns_adminlink Add a link to /NS/Admin page
ns_atshutdown Register a script to be run at shutdown
ns_atsignal Register a script to be run in response to a SIGHUP signal
ns_config Extract information from the configuration file
ns_conn Find information about the HTTP connection
ns_cp Copy one file to another
ns_cpfp Copy a specified number of bytes from one file to another
ns_crypt Encrypt password
ns_eval Evaluate Tcl
ns_formvalueput Set the default value for a key in an HTML form
ns_geturl Fetch a URL
ns_guesstype Lookup MIME type
ns_hrefs Return list of HTML <A> links
ns_htmlselect Build an HTML SELECT form widget using specified data
ns_httpget Open an HTTP connection and fetch a page
ns_httpopen Open an HTTP connection
ns_info Find information about AOLserver
ns_library Return directory for private or shared Tcl library
ns_localtime Return local time
ns_log Write messages to the error log
ns_mkdir Create a directory
ns_mktemp Return a unique file name based on a template
ns_normalizepath Normalize a path
ns_parsetime Return specified time element from a 10-element formatted time
ns_quotehtml Escape <, >, and & characters
ns_register_proc Register a procedure for a URL
ns_register_trace Register a Tcl trace script to a method and matching URL
ns_requestauthorize Check permissions
ns_respond Build a complete response
ns_return Return information to client
ns_rmdir Remove a directory
ns_sendmail Send a mail message
ns_server Get information about a virtual server
ns_set Manipulate sets of key-value pairs
ns_shutdown Shut down the server and optionally restart it
ns_sleep Sleep for a specified number of seconds
ns_state_delete Remove HTML tags from a string
ns_tmpnam Generate a temporary file name
ns_unlink Remove a file
ns_unregister_proc Unregister a procedure for a URL
ns_url2file Return file corresponding to URL
ns_urldecode Decode characters
ns_urlencode Encode characters in a URL
ns_write Write raw content back to the client
ns_writecontent Write content to a file

Scheduled Procedures

These functions allow you to specify a Tcl script to be run daily, weekly, or at specified intervals.
Function Description
ns_schedule_daily Schedule a procedure to run once a day
ns_schedule_proc Schedule a procedure to run at specified intervals
ns_schedule_weekly Schedule a procedure to run once a week
ns_unschedule_proc Stop a scheduled procedure

Sockets interface

The following functions are available for managing sockets:
Function Description
ns_hostbyaddr Resolve an IP address to a hostname
ns_sockaccept Accept a new socket connection
ns_sockcallback Register a socket callback script
ns_sockcheck Check if a socket is connected
ns_socklisten Create a socket listening for connections
ns_sockopen Connect to a remote host on the specified port
ns_sockselect Determine readable file id's

State functions

The following functions are available for maintaining state across connections and server reboots:
Function Description
ns_state_delete Remove state data for specified id
ns_state_restore Return state data for specified id and then remove it
ns_state_save Save state data to disk and return an id
ns_state_view Return state data for specified id

Threads interface

The following functions are available for managing threads and thread synchronozation objects:
Function Description
ns_critsec Manage critical sections
ns_event Manage events
ns_mutex Manage mutexes
ns_sema Manage semaphores
ns_thread Manage threads

Access Log Functions

These functions are available only if the nslog module is loaded.
Function Description
ns_accesslog Roll the access log on demand and get access log information

Permissions functions

Permissions functions are available only when the nsperm module is loaded. See Chapter 4 for information on the access control system. Note that the entire user interface for the access control system is implemented in Tcl. Follow the nsperm link on the Tcl Script Maintenance page to see the scripts..
Function Description
ns_group Add, delete, update, or get information about AOLserver groups
ns_method Add, delete, or get information about method aliases
ns_passwordcheck Verify a user/password combination
ns_perm Add, delete, update, or get information on permissions records
ns_user Add, delete, update, or get information about AOLserver users

Database Services functions

Database services functions are available only when the nsdb module is loaded.
Function Description
ns_buildsqldate Build an SQL date value from specified month, day, and year
ns_buildsqltime Build an SQL time value from specified time and AM/PM designation
ns_buildsqltimestamp Build an SQL timestamp from specified month, day, year, time, and AM/PM designation
ns_column Find information about columns of tables in the database
ns_db Access the AOLserver database
ns_dbconfigpath Get nsdb section name
ns_dberror Return SQL error information
ns_dbformvalue Retrieve the value of a column specified by form data
ns_dbformvalueput Set default values in an HTML form for accessing the database
ns_dbquotename Surround a name by double quotes if it contains a space
ns_dbquotevalue Prepare a value string for inclusion in an SQL statement
ns_deleterow Delete row in specified table corresponding to form data
ns_entryform Return HTML of an entry form for the specified table
ns_entrywidget Return HTML form elements for entering data into specified table and column
ns_entrywidgetbytype Return HTML form elements for entering data into specified column and type
ns_ext Send information to the database proxy daemon
ns_findrowbyid Return row corresponding to specified key/value pairs
ns_ill Return Illustra connection information
ns_insertrow Insert form data into specified table as a new row
ns_localsqltimestamp Return a SQL timestamp containing the local time
ns_odbc Return information on ODBC connection
ns_parsesqldate Return year, month, or day of specified SQL date value
ns_parsesqltime Return clock time or AM/PM designation of specified SQL time value
ns_parsesqltimestamp Return time, AM/PM designation, year, month, or day of specified SQL timestamp
ns_pooldescription Get database pool description
ns_searchform Return HTML of a search form for the specified table
ns_searchopwidget Return HTML form element for searching data by the specified column and type
ns_searchqbf Return HTML table containing search results corresponding to search form data
ns_table Find information about tables in the database
ns_updateform Return HTML of an update form for the specified table and row
ns_updaterow Update row in specified table using form data
ns_updaterowbyid Update row corresponding to specified key/value pairs with specified column values

Full Text functions

Full text functions are available only when the nstext module is loaded.
Function Description
ns_archivetable Get table name for archiving
ns_hiliteurl Return a highlight URL
ns_htmltoquery Get query string from HTML
ns_textarchive Add or delete URLs from archive
ns_textconfigpath Get config section for text module
ns_texthandlepool Get pool used by text module
ns_textindex Add or delete URLs from index
ns_texttable Get table name for indexing

Top of Page

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