[Next] [Up] [Previous] [Contents]
Next: About this document ... Up: manual Previous: Command Reference Manual   Contents

Subsections

Module programming interface

Overview

TODO

The Temple Public Interface (TPI)

The TPI is the lowest-level C interface to the Temple plug-in architecture. It provides a series of functions to manipulate data (such as calcs) and to handle events.

SQL Interface




tpi_sql_register_interface

DCO Interface

A DCO represents an object in Temple's database, such as a user or a calc. Every DCO has a type, such as "user" or "calc", a name, such as "larne", and a series of attribute/value pairs.
The basic type for dealing with DCO objects with TPI is the tpi_dco_ctx, an opaque type representing a handle to a single DCO object. To obtain a handle to a new DCO object, call tpi_dco_new(); when the object is finished with, destroy it with tpi_dco_delete(). Attributes of DCOs may be retrieved with the tpi_dco_get_attr() function.

Example

	/* Retrieve and print the "text" attribute of the "calc" DCO "test". */
	tpi_dco_ctx c;
	char *text;
	
	if (tpi_dco_new(&c, "calc", "test") == 0)
		return 1; /* error */
	
	if (tpi_dco_get_attr(c, "text", &text) == 0) {
		tpi_dco_delete(c);
		return 1; /* error */
	}

	print("text is [%s]\n", text);
	free(text);
	tpi_dco_delete(c);



tpi_dco_new




tpi_dco_delete




tpi_dco_exists




tpi_dco_create




tpi_dco_has_attr




tpi_dco_get_attr




tpi_dco_set_attr




tpi_dco_del_attr




tpi_dco_name




tpi_dco_find_by_key




tpi_dco_find_by_attr




tpi_dco_get_stats




tpi_dco_get_error

Server connection functions




tpi_serv_reply_any




tpi_serv_reply_private




tpi_serv_send_message




tpi_serv_repl_from_nick




tpi_serv_repl_new




tpi_serv_set_from_nick




tpi_serv_set_target




tpi_serv_repl_set_private




tpi_serv_join_channel




tpi_serv_send_raw




tpi_serv_add_user_to_channel




tpi_serv_remove_user_from_channel




tpi_serv_signoff_user

Event functions




tpi_event_install_handler




tpi_event_raise

User functions




tpi_user_has_priv




tpi_user_name




tpi_user_find




tpi_user_find_by_host




tpi_user_delete

Configuration functions




tpi_conf_get_list

Miscellaneous functions




tpi_log_message


[Next] [Up] [Previous] [Contents]
Next: About this document ... Up: manual Previous: Command Reference Manual   Contents
Edward Brocklesby 2005-02-08