Chapter 10. ToolTalk API

This chapter provides reference information for these components of the ToolTalk API:

The enumerated types and functions are listed in alphabetical order in each section.

ToolTalk Enumerated Types

The ToolTalk enumerated types fall into these categories:

Tt_address

Tt_address indicates which message attributes form the address to which the message will be delivered. Possible values and meanings are:

TT_HANDLER  


Addressed to a specific handler that ca perform this operation with these arguments. Fill in handler, op, and arg attributes of the message or pattern.

TT_OBJECT 


Addressed to a specific object that performs this operation with these arguments. Fill in object, op, and arg attributes of the message or pattern.

TT_OTYPE 


Addressed to the type of object that can perform this operation with these arguments. Fill in otype, op, and arg attributes of the message or pattern.

TT_PROCEDURE 


Addressed to any process that can perform this operation with these arguments. Fill in the op and arg attributes of the message or pattern.

Tt_callback

These values are used to specify the action taken by the callback attached to messages or patterns. If no callback returns TT_CALLBACK_PROCESSED, tt_message_receive() will return the message. Possible values and their meanings are:

TT_CALLBACK_CONTINUE 


If the callback returns TT_CALLBACK_CONTINUE, other callbacks will be run.

TT_CALLBACK_PROCESSED 


If the callback returns TT_CALLBACK_PROCESSED, no further callbacks will be invoked for this event, and the message will not be returned by tt_message_receive().

Tt_category

Tt_category values for the category attribute of a pattern indicate the receiver's intent. Possible values and meanings are:

TT_OBSERVE  


Just looking at the message. No feedback will be given to the sender.

TT_HANDLE  


Will process the message, including filling in return values if any.

Tt_class

These values for the class attribute of a message or pattern indicate whether the sender wants an action to take place after the message has been received. Possible values and meanings are:

TT_NOTICE  


Notice of an event. Sender does not want feedback on this message.

TT_REQUEST  


Request for some action to be taken. Sender must be notified of progress, success or failure, and must receive any return values.

Tt_disposition

Tt_disposition values indicate whether the receiving application should be started to receive the message or if the message should be queued until the receiving process is started at a later time. The message can also be discarded if the receiver is not started.

Note that Tt_disposition values can be added together, so that TT_QUEUE+TT_START means both to queue the message and to try to start a process. This can be useful if the start can fail (or be vetoed by the user), to ensure the message is processed as soon as an eligible process does start. Possible values and their meanings are:

TT_DISCARD = 0  


No receiver for this message. Message is returned to sender with the Tt_status field containing TT_FAILED.

TT_QUEUE = 1  


Queue the message until a process of the proper ptype receives the message.

TT_START = 2  


Attempt to start a process of the proper ptype if none is running.

Tt_filter

Tt_filter_action is the return value from a query callback filter procedure. Possible values and meanings are:

TT_FILTER_CONTINUE  


Continue the query, feed more values to the callback.

TT_FILTER_STOP  


Stop the query, don't look for any more values.

Tt_mode

Tt_mode values specify whether the sender, handler, or observers writes a message argument. Possible values are:

TT_IN  


The argument is written by the sender and read by the handler and any observers.

TT_OUT  


The argument is written by the handler and read by the sender and any reply observers.

TT_INOUT  


The argument is written by the sender and the handler and read by all.

Tt_scope

Tt_scope values for the Scope attribute of a message or pattern indicate the set of processes eligible to receive the message. Possible values and meanings are:

TT_SESSION  


All processes joined to the indicated session are eligible.

TT_FILE  


All processes joined to the indicated file are eligible.

TT_BOTH  


All processes joined to either the indicated file or the indicated session are eligible.

TT_FILE_IN_SESSION  


All processes joined to both the indicated session and the indicated file are eligible.

Tt_state

Tt_state values indicate a message's delivery status. Possible values and their meanings are:

TT_CREATED  


Message has been created but not yet sent. Only the sender of a message will see a message in this state.

TT_SENT  


Message has been sent but not yet handled.

TT_HANDLED  


Message has been handled, return values are valid.

TT_FAILED  


Message could not be delivered to a handler.

TT_QUEUED  


Message has been queued for later delivery.

TT_STARTED  


Attempting to start a process to handle the message.

TT_REJECTED  


Message has been rejected by a possible handler. This state is seen only by the rejecting process. The ToolTalk service changes the state back to TT_SENT before delivering the message to another possible handler. If all possible handlers have rejected the message, the ToolTalk service changes the state to TT_FAILED before returning the message to the sender.

Tt_status

A Tt_status code is returned by all functions, sometimes directly and sometimes encoded in an error return value. See Chapter 2, “Participating in ToolTalk Sessions,” for instructions on determining whether the Tt_status code is a warning or an error and for retrieving the catalog string for a Tt_status code.

Appendix D, “ToolTalk Error Messages,” lists the Tt_status codes. The following information is provided for each status code:

  • Message id

  • Catalog string

  • Meaning

  • Remedy

ToolTalk Functions

tt_close

Tt_status  

tt_close(void)

Closes the current default process identifier (procid).


Note: tt_close() should be the last ToolTalk function the process calls.


Returned Value

Tt_status  


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_PROCID

Related Functions

tt_open()

tt_default_file

Returns the current default file. Joining a file makes it the default file.

Returned Value

char *  


Pointer to a character string specifying the current default file. If the pointer is NULL, no default is set. Use tt_ptr_error(), which returns Tt_status, to determine if the pointer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_PROCID

Related Functions

tt_file_join()

tt_default_file_set

Tt_status  

tt_default_file_set(const char *docid)

Sets the default file to the specified file.

Arguments

const char *docid  


Pointer to a character string specifying the file you want as the default file.

Returned Value

Tt_status  


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_PROCID
   TT_ERR_FILE

tt_default_procid

char  

*tt_default_procid(void)

Retrieves the current default process identifier (procid) for your process. The procid is used in the sender field of messages.

Returned Value

char *  


Pointer to character string that uniquely identifies the current default process. Use tt_ptr_error(), which returns Tt_status, to determine if the pointer is valid.

Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_PROCID

tt_default_procid_set

Tt_status  

tt_default_procid_set(const char *procid)

Sets the current default procid. The default procid is set by tt_open(). Only processes that do multiple tt_open() calls and juggle multiple procids ever need to use this function.

Arguments

const char *procid 


Name of process you want to set up as the default process.

Returned Value

Tt_status  


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_PROCID

Related Functions

tt_open()

tt_default_ptype

char  

*tt_default_ptype(void)

Retrieves the current default process type (ptype). Declaring a ptype makes it the default ptype. The default ptype is used in the sender ptype field of your message.

Returned Value

char *  


Pointer to character string that uniquely identifies the current default process type. If the pointer is NULL, no default is set. Use tt_ptr_error(), which returns Tt_status, to determine if the pointer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_PROCID

Related Functions

tt_ptype_declare()

tt_default_ptype_set

Tt_status  

tt_default_ptype_set(const char *ptid)

Sets the default process type (ptype) to the provided string.

Arguments

const char *ptid 


Use the character string that uniquely identifies the process type you wish to set up as the default process type.

Returned Value

Tt_status  


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_PROCID

tt_default_session

char  

*tt_default_session(void)

Retrieves the current default session identifier from the ToolTalk service for the current default procid.

Returned Value

char *  


Pointer to the unique identifier for the current session. If the pointer is NULL, no default is set. Use tt_ptr_error(), which returns Tt_status, to determine if the pointer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_PROCID

Related Functions

tt_default_procid()

tt_default_session_set

Tt_status  

tt_default_session_set(const char *sessid)

Sets the current default session identifier for the current default procid.


Note: The ToolTalk service uses the initial user session as the default session and supports one session per procid. To join other sessions, your program must first set the new session as the default and then initialize and register. The calls required must be in this order: tt_default_session_set, tt_open, tt_fd


Arguments

const char *sessid  


Pointer to the unique identifier for the session in question.

Returned Value

Tt_status  


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_PROCID
   TT_ERR_SESSION

Related Functions

tt_open()
tt_fd()

tt_error_int

int  

tt_error_int(Tt_status ttrc)

Given a Tt_status code, returns an integer error object encoding the code.


Note: The integer error objects are negative integers, so only use this when the valid integer values are non-negative.


Arguments

Tt_status ttrc  


Tt_status code you want to encode.

Returned Value

int  


Encoded Tt_status code.

tt_error_pointer

void  

*tt_error_pointer(Tt_status ttrc)

Given a Tt_status code, returns a pointer to an error object encoding the code.

Arguments

Tt_status ttrc  


Tt_status code you want to encode.

Returned Value

void *  


Pointer to encoded Tt_status code.

tt_fd

int  

tt_fd(void)

Returns a file descriptor (fd) which is used to alert your program that a message has arrived for the default procid in the default session. File descriptors are either active or inactive. When your file descriptor becomes active, you need to call tt_message_receive.


Note: You must have a separate file descriptor for each procid. Each time you call tt_open, use tt_fd to get an associated file descriptor.


Returned Value

int  


File descriptor for your current procid. Use tt_int_error(), which returns Tt_status, to determine if the integer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_PROCID
   TT_ERR_SESSION

Related Functions

tt_open()
tt_message_receive()

tt_file_copy

Tt_status  

tt_file_copy(const char *oldfilepath, const char *newfilepath)

Copies all the objects on the specified file to the new file. Any objects already on the second file are not removed.

Arguments

const char *oldfilepath  


Pointer to the name of the file whose objects are to be copied.

const char *newfilepath  


Pointer to the name of the file on which to create the copied objects.

Returned Value

Tt_status  


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_DBAVAIL
   TT_ERR_DBEXIST
   TT_ERR_FILE
   TT_ERR_NOMP
   TT_ERR_PATH
   TT_ERR_POINTER

Related Functions

tt_file_move()
tt_file_destroy()

tt_file_destroy

Tt_status  

tt_file_destroy(const char *filepath)

Removes all the objects on the files and directories rooted at filepath from the appropriate ToolTalk database. Call this function when you unlink a file or rmdir a directory.

Arguments

const char *filepath  


Pointer to the pathname of the file to be removed.

Returned Value

Tt_status  


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_ACCESS
   TT_ERR_DBAVAIL
   TT_ERR_DBEXIST
   TT_ERR_FILE
   TT_ERR_NOMP
   TT_ERR_PATH
   TT_ERR_POINTER

Related Functions

tt_file_copy()
tt_file_move()
rmdir(2)
unlink(2)

tt_file_join

Tt_status  

tt_file_join(const char *filepath)

Informs the ToolTalk service that your process is interested in messages involving the file named by the provided string. The ToolTalk service adds this file value to any currently registered patterns with scope TT_FILE. The named file becomes the default file.

Arguments

const char *filepath 


Pointer to the pathname of the file to be joined.

Returned Value

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_DBAVAIL
   TT_ERR_DBEXIST
   TT_ERR_NOMP
   TT_ERR_PATH

tt_file_move

Tt_status  

tt_file_move(const char *oldfilepath, const char *newfilepath)

Destroys all the objects on the files and directories rooted at the new filepath, and then moves all the objects on the first file to the second file.

If oldfilepath and newfilepath are in the same filesystem, then tt_file_move() replaces oldfilepath with newfilepath in the path associated with every object in that filesystem. That is, it picks up all the objects in the directory tree rooted at oldfilepath, and overlays them onto newfilepath. In this mode, tt_file_move() is like the system call rename(2).

If oldfilepath and newfilepath are on different file systems, neither may be a directory.

Arguments

const char *oldfilepath  


The name of the file or directory whose objects are to be moved.

const char *newfilepath  


The name of the file or directory to which the objects are to be moved.

Returned Value

Tt_status  


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_ACCESS
   TT_ERR_DBAVAIL
   TT_ERR_DBEXIST
   TT_ERR_FILE
   TT_ERR_NOMP
   TT_ERR_PATH
   TT_ERR_POINTER

Related Functions

tt_file_copy()
tt_file_destroy()
rename(2)

tt_file_objects_query

Tt_status  

tt_file_objects_query(const char *filepath, Tt_filter_function filter, void *context, void *accumulator)

Instructs the ToolTalk service to find all the objects in the named file and pass back the objids to the filter function you created. The context pointer and accumulator pointer you initially specify will also be passed to your filter function.

As the ToolTalk service finds each object, it calls your filter function, passing the objid of the object and the two application-supplied pointers. Your filter function performs its computation, and returns a Tt_filter_action value to tell the query function whether to continue or to stop. Tt_filter action values are:

              TT_FILTER_CONTINUE
              TT_FILTER_STOP

Arguments

const char *filepath  


File name.

Tt_filter_function filter  


Your filter function. Tt_filter_function is a typedef “Tt_filter_action (*) (char *objid, void *context, void *accumulator)”.

void *context  


A pointer to any information your filter needs to execute. The ToolTalk service does not interpret this argument. It passes it straight through to your filter function.

void *accumulator  


A pointer to a place for your filter to store the results of the query and filter operations. The ToolTalk service does not interpret this argument. It passes it straight through to your filter function.

Returned Value

Tt_status  


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_DBAVAIL
   TT_ERR_DBEXIST
   TT_ERR_NOMP
   TT_ERR_PATH
   TT_WRN_STOPPED

tt_file_quit

Tt_status  

tt_file_quit(const char *filepath)

Informs the ToolTalk service that your process is no longer interested in messages involving the file named by the provided string. The ToolTalk service removes this file value from any currently registered patterns with scope TT_FILE. The default file is nulled.

Arguments

const char *filepath 


File name.

Returned Value

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_DBAVAIL
   TT_ERR_DBEXIST
   TT_ERR_PATH

tt_free

void  

tt_free(caddr_t p)

Frees this storage from the ToolTalk API allocation stack.

You may find tt_free more convenient than using tt_mark and tt_release if your application is in a loop obtaining strings from the ToolTalk service and processing each in turn.

Arguments

Related Functions

tt_malloc()

tt_initial_session

char  

*tt_initial_session(void)

Returns the session in which the process was created. This is either a process tree session or the X session associated with the display named in the DISPLAY environment variable.

Returned Value

char *  


Identifier for the current ToolTalk session. Use tt_ptr_error(), which returns Tt_status, to determine if the pointer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP

tt_int_error

Tt_status  

tt_int_error(int return_val)

Given an integer, returns TT_OK if the integer is not an error object or the encoded Tt_status value if the integer is an error object.

Arguments

int return_val  


Integer returned by a ToolTalk function.

Returned Value

Tt_status  


The status of the operation. Possible values are:

   TT_OK
   TT_xxx

tt_is_err

int  

tt_is_err(Tt_status s)

A macro that tells you if the Tt_status enum you provided is a warning or an error. tt_is_err() expands to (TT_WRN_LAST < (p)).

Arguments

Tt_status s  


The Tt_status code you want to check.

Returned Value

int  


If you receive 1, the Tt_status enum is an error. If you receive 0, the Tt_status enum is either a warning or TT_OK.

tt_malloc

caddr_t  

tt_malloc(size_t s)

Allocates storage on the ToolTalk API allocation stack.

This capability is provided so that your application-provided callback routines can take advantage of the allocation stack. For example, a query filter function might allocate storage to hold a result.

Arguments

size_t s 


The amount of storage you want in bytes.

Returned Value

caddr_t 


Storage in the ToolTalk API allocation stack given to your application. If NULL is returned, no storage is available.

Related Functions

tt_free()

tt_mark

int  

tt_mark(void)

Marks a storage position in the ToolTalk API allocation stack. Your application typically does this at the beginning of a procedure.

Returned Value

int  


Integer that marks your application`s storage position in the ToolTalk API allocation stack.

Related Functions

tt_release()

tt_message_address

Tt_address  

tt_message_address(Tt_message m)

Retrieves the address attribute from the specified message.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

Returned Value

Tt_address 


specifies which message attributes form the address of this message. Possible values are:

   TT_PROCEDURE
   TT_OBJECT
   TT_HANDLER
   TT_OTYPE

Use tt_int_error(), which returns Tt_status, to determine if the Tt_address integer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

tt_message_address_set

Tt_status  

tt_message_address_set(Tt_message m,
Tt_address a)

Sets the address attribute for the specified message.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

Tt_address a 


Specifies which message attributes form the address to which the message will be delivered. Possible values are:

   TT_PROCEDURE
   TT_OBJECT
   TT_HANDLER
   TT_OTYPE

Returned Value

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

tt_message_arg_add

Tt_status  

tt_message_arg_add(Tt_message m, Tt_mode n,
const char *vtype, const char *value)

Adds a new argument to a message object. Add all arguments before the message is sent.


Note: Do not add arguments to a reply. Only change existing argument values with modes of TT_OUT or TT_INOUT.


Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

Tt_mode n 


Specifies who (sender, handler, observers) writes and reads a message argument. Possible modes are:

   TT_IN
   TT_OUT
   TT_INOUT

const char *vtype 


Describes the type of argument data being added. The vtype name is used by the message recipient to interpret data.

const char *value 


Contents for the message argument attribute. Use NULL for values of mode TT_OUT, or if the value will be filled in later with tt_message_arg_val_set, tt_message_barg_val_set, or tt_message_iarg_val_set.

Returned Value

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_MODE
   TT_ERR_NOMP
   TT_ERR_POINTER

Related Functions

tt_message_arg_val_set()
tt_message_barg_add()
tt_message_iarg_add()

tt_message_arg_bval

Tt_status  

tt_message_arg_bval(Tt_message m, int n,
unsigned char **value, int *len)

Retrieves the value of the n-th message argument as a byte string.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

int n 


Number of the argument you want to retrieve. The first argument is 0.

unsigned char **value 


Address of a character pointer that the ToolTalk service should aim to a string containing the contents of the argument.

int *len 


Address of an integer that the ToolTalk service should set to the length of the value in bytes.

Returned Values

Tt_status 


The status of the operation. Possible values are:

   TT_ERR_NOMP
   TT_ERR_NUM
   TT_ERR_POINTER

unsigned char **value 


Address of a character pointer that the ToolTalk service aimed at a string containing the contents of the argument.

int *len 


Address of an integer that the ToolTalk service set to the length of the value in bytes.

tt_message_arg_bval_set

Tt_status  

tt_message_arg_bval_set(Tt_message m, int n,
const unsigned char *value, int len)

Sets the value and the type of the n-th message argument as a byte string. You (the sender) can use tt_message_arg_bval_set to fill in opaque data.

Also, changes the value of the n-th message argument to a byte string. Used by the handler before replying to the message.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

int n 


Number of the argument you want to set. The first argument is 0.

const unsigned char *value 


Byte string with the contents for the message argument.

int len 


Length of the value in bytes.

Returned Values

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_NUM
   TT_ERR_POINTER

Related Functions

tt_message_barg_add()
tt_message_arg_val_set()
tt_message_iarg_val_set()

tt_message_arg_ival

Tt_status  

tt_message_arg_ival(Tt_message m, int n,
int *value)

Retrieves the value of the n-th message argument as an integer.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

int n 


Number of the argument you want to retrieve. The first argument is 0.

int *value 


Pointer to an integer where the ToolTalk service should store the contents of the argument.

Returned Value

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_NUM
   TT_ERR_POINTER

int value 


Value of the n-th argument.

tt_message_arg_ival_set

Tt_status  

tt_message_arg_ival_set(Tt_message m, int n,
int value)

Fills in the n-th message argument with an integer value.

Also, changes the value of the n-th message argument to an integer.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

int n 


Number of the argument you want to set. The first argument is 0.

int value 


Contents (in integer form) for the message argument.

Returned Values

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_NUM
   TT_ERR_POINTER

Related Functions

tt_message_arg_ival_add()
tt_message_arg_val_set()
tt_message_barg_val_set()

tt_message_arg_mode

Tt_mode 

tt_message_arg_mode(Tt_message m, int n)

Returns the mode of the n-th message argument.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

int n 


Number of the argument in which you are interested. The first argument is 0.

Returned Value

Tt_mode 


Specifies who (sender, handler, observers) writes and reads a message argument. Possible modes are:

   TT_IN
   TT_OUT
   TT_INOUT

Use tt_int_error(), which returns Tt_status, to determine if the Tt_mode integer is valid.

Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_NUM
   TT_ERR_POINTER

tt_message_arg_type

char  

*tt_message_arg_type(Tt_message m, int n)

Retrieves the type of the n-th message argument.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

int n 


Number of the argument in which you are interested. The first argument is 0.

Returned Value

char * 


Type of the n-th message argument. Use tt_ptr_error(), which returns Tt_status, to determine if the pointer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_NUM
   TT_ERR_POINTER

tt_message_arg_val

char  

*tt_message_arg_val(Tt_message m, int n)

Returns a pointer to the value (assuming it is a character string) of the n-th message argument.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

int n 


Number of the argument in which you are interested. The first argument is 0.

Returned Value

char * 


Contents for the message argument. Use tt_ptr_error(), which returns Tt_status, to determine if the pointer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_NUM
   TT_ERR_POINTER

tt_message_arg_val_set

Tt_status 

tt_message_arg_val_set(Tt_message m, int n,
const char *value)

Changes the value of the n-th message argument. Generally used by the handler before replying to the message.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

int n 


Number of the argument you want to change. The first argument is 0.

const char *value 


Contents for the message argument.

Returned Values

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_NUM
   TT_ERR_POINTER

tt_message_args_count

int  

tt_message_args_count(Tt_message m)

Returns the number of arguments in the message.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

Returned Value

int 


Total number of arguments in the message. Use tt_int_error(), which returns Tt_status, to determine if the integer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

tt_message_barg_add

Tt_status  

tt_message_barg_add(Tt_message m, Tt_mode n,
const char *vtype, const unsigned char
*value, int len)

Adds an argument to a pattern that may have a value containing imbedded nulls.


Note: Do not add arguments to a reply. Only change existing argument values with modes of TT_OUT or TT_INOUT.


Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

Tt_mode n 


Specifies who (sender, handler, observers) writes and reads a message argument. Possible modes are:

   TT_IN
   TT_OUT
   TT_INOUT

const char *vtype 


Describes the type of argument data being added. The vtype name is used by the message recipient to interpret data. The ToolTalk service treats the value as an opaque byte string. To pass structured data, your application and the receiving application must encode and decode these opaque byte strings. The most common way of doing this is to use XDR.

const unsigned char *value 


Value that the ToolTalk service should fill in.

int len 


Length of the value in bytes.

Returned Values

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

Related Functions

tt_message_barg_val_set()
tt_message_arg_add()
tt_message_iarg_add()

tt_message_callback_add

Tt_status  

tt_message_callback_add(Tt_message m,
Tt_message_callback f)

Registers a callback function that will be automatically invoked by tt_message_receive whenever a reply or other state-change to this message is returned.

Tt_callback_action is an enum containing the values TT_CALLBACK_CONTINUE and TT_CALLBACK_PROCESSED. If the callback returns TT_CALLBACK_PROCESSED, no further callbacks will be invoked for this event, and the message will not be returned by tt_message_receive. If the callback returns TT_CALLBACK_CONTINUE, other callbacks will be run, and if no callback returns TT_CALLBACK_PROCESSED, tt_message_receive will return the message.

This behavior can be used to create wrappers for ToolTalk messages. A library routine can construct a request, attach a callback to the message, send the message, and process the reply in the callback. By having the callback return TT_CALLBACK_PROCESSED, the message reply will not be returned to the main program, so the message and reply are completely hidden. Note that these callbacks are invoked from tt_message_receive, so it's still necessary for programs to arrange for tt_message_receive to be called when the file descriptor returned by tt_fd becomes active.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

Tt_message_callback f 


Tt_message_callback is a type definition for a pointer to a function declared like: Tt_callback_action func(Tt_message m, Tt_pattern p). The callback is passed the message in question and the pattern that matched it. The pattern handle will be null if the message didn't match a dynamic pattern (this is usually the case for message callbacks.)

Returned Values

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

tt_message_class

Tt_class  

tt_message_class(Tt_message m)

Retrieves the class attribute from the specified message.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

Returned Value

Tt_class 


Indicates whether or not the sender wanted an action to take place after the message is received. Possible values are:

   TT_NOTICE
   TT_REQUEST

Use tt_int_error(), which returns Tt_status, to determine if the Tt_class integer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

tt_message_class_set

Tt_status  

tt_message_class_set(Tt_message m,
Tt_class c)

Sets the class attribute for the specified message.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

Tt_class c 


Indicates whether or not you want an action to take place after the message is received. Possible values are:

   TT_NOTICE
   TT_REQUEST

Returned Values

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

tt_message_create

Tt_message  

tt_message_create(void)

Creates a new message object. The ToolTalk service returns a message handle that's really an opaque pointer to a ToolTalk structure. You do not manipulate the structure directly.

Returned Value

Tt_message 


The unique opaque handle that identifies your message object. If ToolTalk is unable to create a message when requested, an invalid handle will be returned to you. When you attempt to use this handle, the ToolTalk service will report an error. Use tt_pointer_error to determine why the ToolTalk service was not able to create the message. Use tt_ptr_error(), which returns Tt_status, to determine if the pointer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_NUM
   TT_ERR_POINTER

Related Functions

tt_message_send()
tt_message_destroy()

tt_message_create_super

Tt_message  

tt_message_create_super(Tt_message m)

Re-addresses the specified message to the parent otype of the otype or object listed in the message. Returns the re-addressed message so you can fill in additional message attributes and send the message.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

Returned Value

Tt_message 


Opaque unique handle for the re-addressed message. Use tt_ptr_error(), which returns Tt_status, to determine if the pointer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_ADDRESS
   TT_ERR_NOMP
   TT_ERR_OBJID
   TT_ERR_OTYPE
   TT_ERR_POINTER

Related Functions

tt_message_send()
tt_message_destroy()

tt_message_destroy

Tt_status  

tt_message_destroy(Tt_message m)

Destroys the message. Destroying a message has no effect on the delivery of a message you have already sent.

If you sent a request and are expecting a reply with return values, destroy a message after you have received the reply. If you sent a notice, you can destroy the message after you send it.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

Returned Value

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

Related Functions

tt_message_create()
tt_message_create_super()

tt_message_disposition

Tt_disposition  

tt_message_disposition(Tt_message m)

Retrieves the disposition attribute from the specified message.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

Returned Value

Tt_disposition 


Indicates whether the receiver should be started to receive the message or if the message should be queued until the receiving process is started at a later time. Possible values are:

   TT_QUEUE
   TT_START
   TT_QUEUE+TT_START

Use tt_int_error(), which returns Tt_status, to determine if the Tt_disposition integer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

tt_message_disposition_set

Tt_status  

tt_message_disposition_set(Tt_message m,
Tt_disposition r)

Sets the disposition attribute for the specified message.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

Tt_disposition r 


Indicates whether the receiver should be started to receive the message or if the message should be queued until the receiving process is started at a later time. Possible values are:

   TT_QUEUE
   TT_START
   TT_QUEUE+TT_START

Returned Value

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

tt_message_fail

Tt_status  

tt_message_fail(Tt_message m)

Informs the ToolTalk service that your process can not handle the request you just received and that the message should not be offered to other processes of the same ptype as yours. The ToolTalk service will send the message back to the sender with state TT_FAILED.

To help the requestor distinguish this case from the case where a message failed because no matching handler could be found, place an explanatory message code in the status attribute of the message with tt_message_status_set and tt_message_status_string_set before calling tt_message_fail.


Note: The status value must be greater than 2047 (TT_ERR_LAST) to avoid confusion with the ToolTalk service status values.


Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

Returned Value

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_NOTHANDLER
   TT_ERR_POINTER

Related Functions

tt_message_status_set()
tt_message_status_string_set()

tt_message_file

char  

*tt_message_file(Tt_message m)

Retrieves the file attribute from the specified message.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

Returned Value

char * 


File attribute of the specified message. Use tt_ptr_error(), which returns Tt_status, to determine if the pointer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

tt_message_file_set

Tt_status 

tt_message_file_set(Tt_message m,
const char *file)

Sets the file attribute for the specified message.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

Returned Value

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_FILE
   TT_ERR_NOMP
   TT_ERR_POINTER

tt_message_gid

gid_t  

tt_message_gid(Tt_message m)

Retrieves the group ID attribute from the specified message.

The ToolTalk service automatically sets the group ID of a message with the group ID of the process that created the message.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

Returned Value

gid_t 


The group ID of the message. If the “nobody” group is returned, the message handle is not valid.

Related Functions

tt_message_uid()

tt_message_handler

char  

*tt_message_handler(Tt_message m)

Retrieves the handler attribute from the specified message.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

Returned Value

char * 


Character value that uniquely identifies the process that should handle the message (Tt_state = TT_CREATED or TT_SENT) or the process that did handle the message (Tt_state = TT_SENT or TT_HANDLED).

Use tt_ptr_error(), which returns Tt_status, to determine if the pointer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

tt_message_handler_ptype

char  

*tt_message_handler_ptype(Tt_message m)

Retrieves the handler ptype attribute from the specified message.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

Returned Value

char * 


Type of process that should handle this message.

Use tt_ptr_error(), which returns Tt_status, to determine if the pointer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

tt_message_handler_ptype_set

Tt_status  

tt_message_handler_ptype_set(Tt_message m,
const char *ptid)

Sets the handler process type (ptype) attribute for the specified message.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

const char *ptid 


Type of process that should or did handle this message.

Returned Value

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

tt_message_handler_set

Tt_status  

tt_message_handler_set(Tt_message m,
const char *procid)

Sets the handler attribute for the specified message.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

const char *procid 


Character value that uniquely identifies the process you want to handle the message.

Returned Value

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

tt_message_iarg_add

Tt_status  

tt_message_iarg_add(Tt_messagem, Tt_mode n, const char *vtype, int value)

Adds a new argument to a message object and sets the value to a given integer. Add all arguments before the message is sent.


Note: Do not add arguments to a reply. Only change existing argument values with modes of TT_OUT or TT_INOUT.


Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

Tt_mode n 


Specifies who (sender, handler, observers) writes and reads a message argument. Possible modes are:

   TT_IN
   TT_OUT
   TT_INOUT

const char *vtype 


Describes the type of argument data being added. The vtype name is used by the message recipient to interpret data.

int value 


Value to fill in.

Returned Value

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_MODE
   TT_ERR_NOMP
   TT_ERR_POINTER
   TT_ERR_VTYPE

Related Functions

tt_message_arg_ival_set()
tt_message_arg_add()
tt_message_barg_add()

tt_message_object

char  

*tt_message_object(Tt_message m)

Retrieves the object attribute from the specified message.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

Returned Value

char * 


Object involved in this message. Use tt_ptr_error(), which returns Tt_status, to determine if the pointer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_OBJID
   TT_ERR_POINTER

tt_message_object_set

Tt_status  

tt_message_object_set(Tt_message m,
const char *objid)

Sets the object attribute for the specified message.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

const char *objid 


Object involved in this message.

Returned Value

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

tt_message_op

char  

*tt_message_op(Tt_message m)

Retrieves the operation (op) attribute from the specified message.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

Returned Value

char * 


Operation the receiver should perform. Use tt_ptr_error(), which returns Tt_status, to determine if the pointer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

tt_message_op_set

Tt_status  

tt_message_op_set(Tt_message m,
const char *opname)

Sets the operation (op) attribute for the specified message.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

const char *opname 


Operation the receiver should perform.

Returned Value

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

tt_message_opnum

int  

tt_message_opnum(Tt_message m)

Retrieves the operation number (opnum) attribute from the specified message.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

Returned Value

int 


The number of the operation (opnum) involved in this message. Use tt_int_error(), which returns Tt_status, to determine if the Tt_disposition integer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

tt_message_otype

char  

*tt_message_otype(Tt_message m)

Retrieves the object type (otype) attribute from the specified message.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

Returned Value

char * 


Type of the object involved in this message. Use tt_ptr_error(), which returns Tt_status, to determine if the pointer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

tt_message_otype_set

Tt_status  

tt_message_otype_set(Tt_message m,
const char *otype)

Sets the object type (otype) attribute for the specified message.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

const char *otype 


Type of the object involved in this message.

Returned Value

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_OTYPE
   TT_ERR_POINTER

tt_message_pattern

Tt_pattern  

tt_message_pattern(Tt_message m)

Retrieves the pattern attribute from the specified message.

Arguments

Tt_message m  


Opaque handle for the message involved in this operation.

Returned Value

Tt_pattern  


Opaque handle for a message pattern. Use tt_ptr_error(), which returns Tt_status, to determine if the handle is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

tt_message_receive

Tt_message  

tt_message_receive(void)

Returns a handle for the next message waiting to be delivered to your process. tt_message_receive() also runs any message or pattern callbacks applicable to this message. Check Tt_status with tt_message_status() to see if the return value is TT_WRN_STARTING. If it is, the ToolTalk service started your application to deliver this message. You must reply to this message.


Note: If the returned handle is 0, no message is available. This can occur if a message or pattern callback processes the message. It can also happen if the time between the tt_fd() file descriptor becoming active and the tt_message_receive() call is too long. The ToolTalk service will time out and offer the message to another process.


Returned Value

Tt_message 


Handle for the message object. Use tt_ptr_error(), which returns Tt_status, to determine if the handle is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP

tt_message_reject

Tt_status  

tt_message_reject(Tt_message m)

Informs the ToolTalk service that your process can not handle this message. The ToolTalk service will try other handlers.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

Returned Value

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_NOTHANDLER
   TT_ERR_POINTER

tt_message_reply

Tt_status  

tt_message_reply(Tt_message m)

Informs the ToolTalk service that your process has finished handling the message, and all return values (any arguments with the TT_OUT or TT_INOUT mode) have been filled in. The ToolTalk service will send the message back to the sender and fill the state attribute in with TT_HANDLED.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

Returned Value

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_NOTHANDLER
   TT_ERR_POINTER
   TT_ERR_PROCID

tt_message_scope

Tt_scope  

tt_message_scope(Tt_message m)

Retrieves the scope attribute from the specified message.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

Returned Value

Tt_scope 


Identifies the set of processes eligible to receive the message. Possible values are:

   TT_SESSION
   TT_FILE
   TT_BOTH
   TT_FILE_IN_SESSION

Use tt_int_error(), which returns Tt_status, to determine if the Tt_scope integer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

tt_message_scope_set

Tt_status  

tt_message_scope_set(Tt_message m,
Tt_scope s)

Sets the scope attribute for the specified message.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

Tt_scope s 


Identifies the set of processes eligible to receive the message. Possible values are:

   TT_SESSION
   TT_FILE
   TT_BOTH
   TT_FILE_IN_SESSION

Returned Value

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

tt_message_send

Tt_status  

tt_message_send(Tt_message m)

Sends the specified message.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

Returned Value

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_ADDRESS
   TT_ERR_CLASS
   TT_ERR_FILE
   TT_ERR_NOMP
   TT_ERR_OBJID
   TT_ERR_OTYPE
   TT_ERR_OVERFLOW
   TT_ERR_POINTER
   TT_ERR_PROCID
   TT_ERR_SESSION
   TT_WRN_STALE_OBJID

tt_message_sender

char  

*tt_message_sender(Tt_message m)

Retrieves the sender attribute from the specified message.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

Returned Value

char * 


Character value that uniquely identifies the process that sent the message. Use tt_ptr_error(), which returns Tt_status, to determine if the pointer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

tt_message_sender_ptype

char  

*tt_message_sender_ptype(Tt_message m)

Retrieves the sender ptype attribute from the specified message.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

Returned Value

char * 


Process that sent this message. Use tt_ptr_error(), which returns Tt_status, to determine if the pointer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

tt_message_sender_ptype_set

Tt_status  

tt_message_sender_ptype_set(Tt_message m,
const char *ptid)

Sets the sender ptype attribute for the specified message.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

const char *ptid 


Type of process that is sending this message.

Returned Value

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

tt_message_session

char  

*tt_message_session(Tt_message m)

Retrieves the session attribute from the specified message.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

Returned Value

char * 


Identifier of the session to which this message applies. Use tt_ptr_error(), which returns Tt_status, to determine if the pointer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

tt_message_session_set

Tt_status  

tt_message_session_set(Tt_message m,
const char *sessid)

Sets the session attribute for the specified message.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

const char *sessid 


Identifier of the session in which you are interested.

Returned Value

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

tt_message_state

Tt_state  

tt_message_state(Tt_message m)

Retrieves the state attribute from the specified message.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

Returned Value

Tt_state 


Indicates a message's current delivery state. Possible values are:

   TT_CREATED
   TT_SENT
   TT_HANDLED
   TT_FAILED
   TT_QUEUED
   TT_STARTED
   TT_REJECTED

Use tt_int_error(), which returns Tt_status, to determine if the Tt_state integer is valid.

Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

tt_message_status

int  

tt_message_status(Tt_message m)

Retrieves the status attribute from the specified message.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

Returned Value

int 


An integer that describes the status stored in the status attribute of this message.

Use tt_int_error(), which returns Tt_status, to determine if the integer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

Related Functions

tt_message_status_string()

tt_message_status_set

Tt_status  

tt_message_status_set(Tt_message m,
int status)

Sets the status attribute for the specified message.


Note: The status value must be greater than 2047 (TT_ERR_LAST) to avoid confusion with the ToolTalk service status values.


Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

int status 


Status to be stored in this message.

Returned Value

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

tt_message_status_string

char  

*tt_message_status_string(Tt_message m)

Retrieves the character string stored with the status attribute for the specified message.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

Returned Value

char * 


Status string stored in this message. Use tt_ptr_error(), which returns Tt_status, to determine if the pointer is valid.

Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

Related Functions

tt_message_status()

tt_message_status_string_set

Tt_status  

tt_message_status_string_set(Tt_message m,
const char *status_str)

Sets a character string with the status attribute for the specified message.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

const char *status_str 


Status string stored in this message.

Returned Value

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

Related Functions

tt_message_status_set()

tt_message_uid

uid_t  

tt_message_uid(Tt_message m)

Retrieves the user ID attribute from the specified message.

The ToolTalk service automatically sets the user ID of a message with the user ID of the process that created the message.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

Returned Value

uid_t 


The user ID of the message, or the “nobody” user (65534) if the message handle is not valid.

Related Functions

tt_message_gid()

tt_message_user

void  

*tt_message_user(Tt_message m, int key)

Retrieves the user information stored in data cells associated with the specified message object you created. Since the user data is part of the message object (the storage buffer in your application), not the actual message, you can only retrieve user information that you placed on the message.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

int key 


User data cell in which you are interested. It must be unique over all user data cells for this message.

Returned Value

void * 


A piece of arbitrary user data that is one word in size. Use tt_ptr_error(), which returns Tt_status, to determine if the pointer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

tt_message_user_set

Tt_status  

tt_message_user_set(Tt_message m, int key,
void *v)

Stores user information in data cells associated with the specified message object.

Note that the user data is part of the message object (the storage buffer in your application), not the actual message. Data stored by the sender in user data cells is not seen by any handlers or observers. Use arguments for data that handlers or observers need to see.

Arguments

Tt_message m 


Opaque handle for the message involved in this operation.

int key 


User data cell in which you are interested.

void *v 


A piece of arbitrary user data that is one word in size.

Returned Value

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER
   TT_ERR_PROCID

Related Functions

tt_message_arg_add()

tt_objid_equal

int  

tt_objid_equal(const char *objid1,
const char *objid2)

Tests to see if two objids are equal. tt_objid_equal() is better than strcmp for the purpose since it returns “1” even in the case where one objid is a forwarding pointer for the other.

Arguments

const char *objid1 


Identifier of one of the objects involved in this operation.

const char *objid2  

Identifier of the other object involved in this operation.

Returned Value

int 


Integer indicating whether or not the objids are equal. Possible values are:

   0 – no
   1 – yes

Use tt_int_error(), which returns Tt_status, to determine if the integer is valid.

Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_OBJID

tt_objid_objkey

char  

*tt_objid_objkey(const char *objid)

Returns the “unique key” portion of a objid.

Arguments

const char *objid 


Identifier of the object involved in this operation.

Returned Value

char * 


Unique key of the objid. No two objids have the same unique key.

Use tt_ptr_error(), which returns Tt_status, to determine if the pointer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_OBJID

tt_onotice_create

Tt_message  

tt_onotice_create(const char *objid,
const char *op)

Creates a message with: 


Tt_address = TT_OBJECT

Tt_class = TT_NOTICE

The handle for the created message is returned so you can add arguments, other attributes, and send the message.

Arguments

const char *objid 


Identifier of the desired object.

const char *op 


Operation to be performed by the receiver.

Returned Value

Tt_message 


The unique handle that identifies your message.

Use tt_ptr_error(), which returns Tt_status, to determine if the handle is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_PROCID

tt_open

char  

*tt_open(void)

Returns the process identifier (procid) for the calling process, and sets this procid as the default procid for the process. tt_open() is typically the first the ToolTalk function you call from your process. A process may call tt_open() more than once to obtain more than one procid. Each procid has its own associated tt_fd() file descriptor, and can join another session. To switch to another procid use tt_default_procid_set().

Returned Value

char * 


Character value that uniquely identifies your process.

Use tt_ptr_error(), which returns Tt_status, to determine if the pointer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP

Related Functions

tt_fd()
tt_default_procid_set()

tt_orequest_create

Tt_message  

tt_orequest_create(const char *objid,
const char *op)

Creates a message with: 


Tt_address = TT_OBJECT

Tt_class = TT_REQUEST

The handle for the created message is returned so you can add arguments, other attributes, and send the message.

Arguments

const char *objid 


Identifier of the desired object.

const char *op 


The operation to be performed by the receiver.

Returned Value

Tt_message 


The unique handle that identifies your message. Use tt_ptr_error(), which returns Tt_status, to determine if the handle is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_PROCID

tt_otype_base

char  

*tt_otype_base(const char *otype)

Returns the base otype that the given otype is derived from, or NULL if the given otype is not derived.

Arguments

char *otype 


Object type involved in this operation.

Returned Value

char * 


Name of the base otype, or NULL if the given otype is not derived. Use tt_ptr_error(), which returns Tt_status, to determine if the pointer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_OTYPE

Related Functions

tt_otype_is_derived()
tt_otype_derived()
tt_otype_deriveds_count()
tt_spec_type()
tt_message_otype()

tt_otype_derived

char  

*tt_otype_derived(const char *otype, int i)

Returns the i-th otype derived from the given otype.

Arguments

const char *otype 


Object type involved in this operation.

int i 


Zero-based index into the otypes derived from the given otype.

Returned Value

char * 


Name of the i-th otype derived from the given otype. Use tt_ptr_error(), which returns Tt_status, to determine if the pointer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_OTYPE

Related Functions

tt_otype_is_derived()
tt_otype_base()
tt_otype_deriveds_count()
tt_spec_type()
tt_message_otype()

tt_otype_deriveds_count

int  

tt_otype_deriveds_count(const char *otype)

Returns the number of otypes derived from the given otype.

Arguments

const char *otype 


Object type involved in this operation.

Returned Value

int 


The number of otypes derived from the given otype. Use tt_int_error(), which returns Tt_status, to determine if the integer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_OTYPE

Related Functions

tt_otype_is_derived()
tt_otype_base()
tt_otype_derived()
tt_spec_type()
tt_message_otype()

tt_otype_hsig_arg_mode

Tt_mode  

tt_otype_hsig_arg_mode(const char *otype,
int sig, int arg)

Returns the Tt_mode of the arg'th argument of the sig'th request signature of the given otype.

Arguments

const char *otype 


Object type involved in this operation.

int sig 


Zero-based index into the request signatures of the specified otype.

int arg 


Zero-based index into the arguments of the specified signature.

Returned Value

Tt_mode 


The Tt_mode of the specified argument, which determines who (sender or handler) writes and reads a message argument. Possible modes are:

   TT_IN
   TT_OUT
   TT_INOUT

Use tt_int_error(), which returns Tt_status, to determine if the integer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_NUM
   TT_ERR_OTYPE

Related Functions

tt_otype_hsig_arg_type()
tt_otype_hsig_count()
tt_otype_hsig_args_count()
tt_otype_hsig_op()

tt_otype_hsig_arg_type

char  

*tt_otype_hsig_arg_type(const char *otype,
int sig, int arg)

Returns the data type of the arg'th argument of the sig'th request signature of the given otype.

Arguments

const char *otype 


Object type involved in this operation.

int sig 


Zero-based index into the request signatures of the specified otype.

int arg 


Zero-based index into the arguments of the specified signature.

Returned Value

char * 


Data type of the specified argument. Use tt_ptr_error(), which returns Tt_status, to determine if the pointer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_NUM
   TT_ERR_OTYPE

Related Functions

tt_otype_hsig_arg_mode()
tt_otype_hsig_count()
tt_otype_hsig_args_count()
tt_otype_hsig_op()

tt_otype_hsig_args_count

int  

tt_otype_hsig_args_count(const char *otype,
int sig)

Returns the number of arguments of the sig'th request signature of the given otype.

Arguments

const char *otype 


Object type involved in this operation.

int sig 


Zero-based index into the request signatures of the specified otype.

Returned Value

int 


The number of arguments of the sig'th request signature of the given otype. Use tt_int_error(), which returns Tt_status, to determine if the integer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_NUM
   TT_ERR_OTYPE

Related Functions

tt_otype_hsig_arg_type()
tt_otype_hsig_arg_mode()
tt_otype_hsig_count()
tt_otype_hsig_op()

tt_otype_hsig_count

int  

tt_otype_hsig_count(const char *otype)

Returns the number of request signatures for the given otype.

Arguments

const char *otype 


Object type involved in this operation.

Returned Value

int 


The number of request signatures for the given otype. Use tt_int_error(), which returns Tt_status, to determine if the integer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_OTYPE

Related Functions

tt_otype_hsig_arg_type()
tt_otype_hsig_arg_mode()
tt_otype_hsig_args_count()
tt_otype_hsig_op()

tt_otype_hsig_op

char  

*tt_otype_hsig_op(const char *otype, int sig)

Returns the op name of the sig'th request signature of the give otype.

Arguments

const char *otype 


Object type involved in this operation.

int sig 


Zero-based index into the request signatures of the given otype.

Returned Value

char * 


Operation attribute of the specified request signature. Use tt_ptr_error(), which returns Tt_status, to determine if the pointer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_NUM
   TT_ERR_OTYPE

Related Functions

tt_otype_hsig_arg_type()
tt_otype_hsig_arg_mode()
tt_otype_hsig_args_count()
tt_otype_hsig_count()

tt_otype_is_derived

int  

tt_otype_is_derived(const char *derivedotype,
const char *baseotype)

Returns 1 if and only if derivedotype is derived directly or indirectly from baseotype.

Arguments

const char *derivedotype 


The purportedly derived otype.

const char *baseotype 


Candidate base otype.

Returned Value

int 


Returns 1 if and only if derivedotype is derived directly or indirectly from baseotype. Use tt_int_error(), which returns Tt_status, to determine if the integer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_OTYPE

Related Functions

tt_otype_deriveds_count()
tt_otype_base()
tt_otype_derived()
tt_spec_type()
tt_message_otype()

tt_otype_osig_arg_mode

Tt_mode  

tt_otype_osig_arg_mode(const char *otype, int sig, int arg)

Returns the Tt_mode of the arg'th argument of the sig'th notice signature of the given otype.

Arguments

const char *otype  


Object type involved in this operation.

int sig  


Zero-based index into the notice signatures of the specified otype.

int arg  


Zero-based index into the arguments of the specified signature.

Returned Value

Tt_mode  


The Tt_mode of the specified argument, which determines who (sender or handler) writes and reads a message argument. Possible modes are:

   TT_IN
   TT_OUT
   TT_INOUT

Use tt_int_error(), which returns Tt_status, to determine if the Tt_mode value is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_NUM
   TT_ERR_OTYPE

Related Functions

tt_otype_osig_arg_type()
tt_otype_osig_count()
tt_otype_osig_args_count()
tt_otype_osig_op()

tt_otype_osig_arg_type

char  

*tt_otype_osig_arg_type(const char *otype, int sig, int arg)

Returns the data type of the arg'th argument of the sig'th notice signature of the given otype.

Arguments

const char *otype 


Object type involved in this operation.

int sig 


Zero-based index into the notice signatures of the specified otype.

int arg 


Zero-based index into the arguments of the specified signature.

Returned Value

char * 


Data type of the specified argument. Use tt_ptr_error(), which returns Tt_status, to determine if the pointer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_NUM
   TT_ERR_OTYPE

Related Functions

tt_otype_osig_arg_mode()
tt_otype_osig_count()
tt_otype_osig_args_count()
tt_otype_osig_op()

tt_otype_osig_args_count

int  

tt_otype_osig_args_count(const char *otype,
int sig)

Returns the number of arguments of the sig'th notice signature of the given otype.

Arguments

const char *otype 


Object type involved in this operation.

int sig 


Zero-based index into the notice signatures of the specified otype.

Returned Value

int 


The number of arguments of the sig'th notice signature of the given otype. Use tt_int_error(), which returns Tt_status, to determine if the integer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_NUM
   TT_ERR_OTYPE

Related Functions

tt_otype_osig_arg_type()
tt_otype_osig_arg_mode()
tt_otype_osig_count()
tt_otype_osig_op()

tt_otype_osig_count

int  

tt_otype_osig_count(const char *otype)

Returns the number of notice signatures for the given otype.

Arguments

const char *otype 


Object type involved in this operation.

Returned Value

int  


The number of notice signatures for the given otype. Use tt_int_error(), which returns Tt_status, to determine if the integer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_OTYPE

Related Functions

tt_otype_osig_arg_type()
tt_otype_osig_arg_mode()
tt_otype_osig_args_count()
tt_otype_osig_op()

tt_otype_osig_op

char  

*tt_otype_osig_op(const char *otype, int sig)

Returns the op name of the sig'th notice signature of the give otype.

Arguments

const char *otype 


Object type involved in this operation.

int sig  


Zero-based index into the notice signatures of the given otype.

Returned Value

char *  


Operation attribute of the specified notice signature.

Use tt_ptr_error(), which returns Tt_status, to determine if pointer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_NUM
   TT_ERR_OTYPE

Related Functions

tt_otype_osig_arg_type()
tt_otype_osig_arg_mode()
tt_otype_osig_args_count()
tt_otype_osig_count()

tt_pattern_address_add

Tt_status  

tt_pattern_address_add(Tt_pattern p,
Tt_address d)

Adds a value to the address field for the specified pattern.

Arguments

Tt_pattern p 


A unique handle for a message pattern. You receive this handle after you issue tt_pattern_create().

Tt_address d 


Specifies which pattern attributes form the address that messages will be matched against. Possible values are:

   TT_PROCEDURE
   TT_OBJECT
   TT_HANDLER 
   TT_OTYPE

Returned Value

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

tt_pattern_arg_add

Tt_status  

tt_pattern_arg_add(Tt_pattern p, Tt_mode n,
const char *vtype, const char *value)

Adds an argument to a pattern. Add pattern arguments before registering your pattern with the ToolTalk service.

Arguments

Tt_pattern p 


Opaque handle for the pattern involved in this operation.

Tt_mode n 


Specifies who (sender, handler, observers) writes and reads a message argument. Possible modes are:

   TT_IN
   TT_OUT
   TT_INOUT

const char *vtype 


Describes the type of argument data being added. The vtype name is used by the message recipient to interpret data. Use `ALL' to match without regard to argument value type.

const char *value 


Value to fill in (must be an unsigned character string.) Use NULL to indicate that any value matches.

Returned Value

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

Related Functions

tt_pattern_register()
tt_pattern_barg_add()
tt_pattern_iarg_add()

tt_pattern_barg_add

Tt_status  

tt_pattern_barg_add(Tt_pattern m, Tt_mode n,
const char *vtype, const unsigned
char *value, int len)

Adds an argument with a value containing imbedded nulls to a pattern.

Arguments

Tt_pattern m 


Opaque handle for the pattern involved in this operation.

Tt_mode n 


Specifies who (sender, handler, observers) writes and reads a message argument. Possible modes are:

   TT_IN
   TT_OUT
   TT_INOUT

const char *vtype 


Describes the type of argument data being added. The vtype name is used by the message recipient to interpret data. The ToolTalk service treats the value as an opaque byte string. To pass structured data, your application and the receiving application must encode and decode these unique values. The most common way of doing this is to use XDR.

const unsigned char *value 


Value to be filled in. Use NULL to specify that any value matches.

int len 


Length of the value in bytes.

Returned Value

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

Related Functions

tt_pattern_register()
tt_pattern_arg_add()
tt_pattern_iarg_add()

tt_pattern_callback_add

Tt_status  

tt_pattern_callback_add(Tt_pattern m,
Tt_message_callback f)

Registers a callback function that will be automatically invoked by tt_message_receive() whenever a message matches the pattern.

Tt_callback_action is an enum containing the values TT_CALLBACK_CONTINUE and TT_CALLBACK_PROCESSED. If the callback returns TT_CALLBACK_PROCESSED, no further callbacks will be invoked for this event, and the message will not be returned by tt_message_receive(); if the callback returns TT_CALLBACK_CONTINUE, other callbacks will be run, and if no callback returns TT_CALLBACK_PROCESSED, tt_message_receive() will return the message.

Arguments

Tt_pattern m 


Opaque handle for the pattern involved in this operation.

Tt_message_callback f 


Tt_message_callback is a type definition for a pointer to a function declared like: Tt_callback_action func(Tt_message m,Tt_pattern p). The callback is passed the message in question and the pattern that matched it.

Returned Value

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

Related Functions

tt_pattern_register()

tt_pattern_category

Tt_category  

tt_pattern_category(Tt_pattern p)

Returns the category value of the specified pattern.

Arguments

Tt_pattern p 


Opaque handle for a message pattern.

Returned Value

Tt_category 


Indicates the receiver's intent. Possible values are:

   TT_OBSERVE
   TT_HANDLE

Use tt_int_error(), which returns Tt_status, to determine if the Tt_category integer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

Related Functions

tt_pattern_category_set()

tt_pattern_category_set

Tt_status  

tt_pattern_category_set(Tt_pattern p,
Tt_category c)

Fills in the category field for the specified pattern.

Arguments

Tt_pattern p 


A unique handle for a message pattern. You receive this handle after you issue tt_pattern_create().

Tt_category c 


Indicates the receiver's intent. Possible values are:

   TT_OBSERVE
   TT_HANDLE

Returned Value

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_CATEGORY
   TT_ERR_NOMP
   TT_ERR_POINTER

Related Functions

tt_pattern_category()

tt_pattern_class_add

Tt_status 

t_pattern_class_add(Tt_pattern p,
Tt_class c)

Adds a value to the class information for the specified pattern. If the class is TT_REQUEST, the sender expects a reply to the message. If the class is TT_NOTICE, the sender will not expect a reply.

Arguments

Tt_pattern p 


A unique handle for a message pattern. You receive this handle after you issue tt_pattern_create().

Tt_class c 


Indicates whether or not the sender wants the receiver to take action after the message is received. Possible values are:

   TT_NOTICE
   TT_REQUEST

Tt_pattern p 


A unique handle for a message pattern. You receive this handle after you issue tt_pattern_create().

Tt_class c 


Indicates whether or not the sender wants the receiver to take action after the message is received. Possible values are:

   TT_NOTICE
   TT_REQUEST

Returned Value

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

tt_pattern_create

Tt_pattern  

tt_pattern_create(void)

Requests a new pattern object. After receiving the pattern object, fill in the message pattern fields to indicate what type of messages you want to receive and register it with the ToolTalk service.


Note: You can supply multiple values for each attribute you add to a pattern (some attributes are set and only have one value). The pattern attribute matches a message attribute if any of the values in the pattern match the value in the message. If no value is specified for an attribute, the ToolTalk service assumes that you want any value to match.


Returned Value

Tt_pattern 


Opaque handle for a message pattern. Use this handle in future calls to identify the pattern object. Use tt_ptr_error(), which returns Tt_status, to determine if the pointer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP

Related Functions

tt_pattern_register()

tt_pattern_destroy

Tt_status  

tt_pattern_destroy(Tt_pattern p)

Destroys a pattern object. Destroying a pattern object automatically unregisters the pattern with the ToolTalk service.

Arguments

Tt_pattern p 


A unique handle for a message pattern. You receive this handle after you issue tt_pattern_create().

Returned Value

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

Related Functions

tt_pattern_register()

tt_pattern_disposition_add

Tt_status  

tt_pattern_disposition_add(Tt_pattern p,
tt_disposition r)

Adds a value to the disposition field for the specified pattern.

Arguments

Tt_pattern p 


A unique handle for a message pattern. You receive this handle after you issue tt_pattern_create().

Tt_disposition r 


Indicates whether the receiver should be started to receive the message or if the message should be queued until the receiving process is started at a later time. The message can also be thrown away if the receiver is not started. Possible values are:

   TT_DISCARD
   TT_QUEUE
   TT_START
   TT_QUEUE+TT_START

Returned Value

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

tt_pattern_file_add

Tt_status  

tt_pattern_file_add(Tt_pattern p,
const char *file)

Adds a value to the file field of the specified pattern.


Note: When you join a file, the ToolTalk service updates the file field of your registered patterns.


Arguments

Tt_pattern p 


A unique handle for a message pattern. You receive this handle after you issue tt_pattern_create().

const char *file 


Name of the file in which you are interested.

Returned Value

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

tt_pattern_arg_add

Tt_status  

tt_pattern_iarg_add(Tt_pattern m, Tt_mode n,
const char *vtype, int value)

Adds a new argument to a pattern and sets the value to a given integer. Add all arguments before the pattern is registered.

Arguments

Tt_pattern m 


Opaque handle for the pattern involved in this operation.

Tt_mode n 


Specifies who (sender, handler, observers) writes and reads a message argument. Possible modes are:

   TT_IN
   TT_OUT
   TT_INOUT

const char *vtype 


Describes the type of argument data being added. The vtype name is used by the message recipient to interpret data.

int value 


Value to fill in.

Returned Value

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_MODE
   TT_ERR_NOMP
   TT_ERR_POINTER
   TT_ERR_VTYPE

Related Functions

tt_pattern_register()

tt_pattern_object_add

Tt_status 

tt_pattern_object_add(Tt_pattern p,
const char *objid)

Adds a value to the object field of the specified pattern.

Arguments

Tt_pattern p 


A unique handle for a message pattern. You receive this handle after you issue tt_pattern_create().

const char *objid 


Identifier for the specified object. Objid's are returned from tt_spec_create() or tt_spec_move().

Returned Value

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

tt_pattern_op_add

Tt_status  

tt_pattern_op_add(Tt_pattern p,
const char *opname)

Adds a value to the operation field of the specified pattern.

Arguments

Tt_pattern p 


A unique handle for a message pattern. You receive this handle after you issue tt_pattern_create().

const char *opname 


The name of the operation (op) your process can perform.

Returned Value

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

tt_pattern_otype_add

Tt_status  

tt_pattern_otype_add(Tt_pattern p,
const char *otype)

Adds a value to the object type (otype) field for the specified pattern.

Arguments

Tt_pattern p 


A unique handle for a message pattern. You receive this handle after you issue tt_pattern_create().

const char *otype 


The name of the object type your application manages.

Returned Value

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_OTYPE
   TT_ERR_POINTER

tt_pattern_register

Tt_status  

tt_pattern_register(Tt_pattern p)

Registers your pattern with ToolTalk, so that your process will start receiving messages that match the pattern. Once a pattern is registered, no further changes can be made in the pattern.


Note: When you join a session or file, the ToolTalk service updates the file and session field of your registered patterns.


Arguments

Tt_pattern p 


A unique handle for a message pattern. You receive this handle after you issue tt_pattern_create().

Returned Value

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER
   TT_ERR_PROCID

Related Functions

tt_pattern_unregister()

tt_pattern_scope_add

Tt_status  

tt_pattern_scope_add(Tt_pattern p,
Tt_scope s)

Adds a value to the scope field for the specified pattern.

Arguments

Tt_pattern p 


A unique handle for a message pattern. You receive this handle after you issue tt_pattern_create().

Tt_scope s 


Specifies what process are eligible to receive the message. Possible values are:

   TT_SESSION
   TT_FILE
   TT_BOTH
   TT_FILE_IN_SESSION 

Returned Value

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

tt_pattern_sender_add

Tt_status  

tt_pattern_sender_add(Tt_pattern p,
const char *procid)

Adds a value to the sender field for the specified pattern.

Arguments

Tt_pattern p 


A unique handle for a message pattern. You receive this handle after you issue tt_pattern_create().

const char *procid 


Character value that uniquely identifies the process in which you are interested.

Returned Value

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

tt_pattern_sender_ptype_add

Tt_status  

tt_pattern_sender_ptype_add(Tt_pattern p,
const char *ptid)

Adds a value to the sender's process type (ptype) field for the specified pattern.

Arguments

Tt_pattern p 


A unique handle for a message pattern. You receive this handle after you issue tt_pattern_create().

const char *ptid 


Use the character string that uniquely identifies the type of process in which you are interested.

Returned Value

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

tt_pattern_session_add

Tt_status  

tt_pattern_session_add(Tt_pattern p,
const char *sessid)

Adds a value to the session field for the specified pattern.


Note: When you join a session, the ToolTalk service updates the session field of your registered patterns.


Arguments

Tt_pattern p 


A unique handle for a message pattern. You receive this handle after you issue tt_pattern_create().

const char *sessid 


Session in which you are interested.

Returned Value

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

tt_pattern_state_add

Tt_status  

tt_pattern_state_add(Tt_pattern p, Tt_state s)

Adds a value to the state field for the specified pattern.

Arguments

Tt_pattern p 


A unique handle for a message pattern. You receive this handle after you issue tt_pattern_create()

   TT_CREATED
   TT_SENT
   TT_HANDLED
   TT_FAILED
   TT_QUEUED
   TT_STARTED
   TT_REJECTED

Returned Value

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

tt_pattern_unregister

Tt_status  

tt_pattern_unregister(Tt_pattern p)

Unregisters the specified pattern from the ToolTalk service. Your process will stop receiving messages that match this pattern.

Arguments

Tt_pattern p 


A unique handle for a message pattern. You receive this handle after you issue tt_pattern_create().

Returned Value

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

Related Functions

tt_pattern_register()

tt_pattern_user

void  

*tt_pattern_user(Tt_pattern p, int key)

Returns the value in the indicated user data cell for the specified pattern object.

Every pattern object allows an arbitrary number of user data cells, each one word (a void *) in size. The user data cells are identified by integer keys. Your tool can use these in any way you see fit, to associate arbitrary data with a pattern object. Note that the user data is part of the pattern object (the storage buffer in your application), not the actual pattern. The content of user cells has no effect on pattern matching.

Arguments

Tt_pattern p 


A unique handle for a message pattern. You receive this handle after you issue tt_pattern_create().

int key 


User data cell in which you are interested. Your application assigns the keys to the user data cells which are part of the pattern object with tt_pattern_user_set(). Values must be unique over all data cells for this pattern.

Returned Value

void * 


A piece of arbitrary user data that is one word in size. Use tt_ptr_error(), which returns Tt_status, to determine if the pointer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

Related Functions

tt_pattern_user_set()

tt_pattern_user_set

Tt_status  

tt_pattern_user_set(Tt_pattern p, int key,
void *v)

Stores information in the user data cells associated with the specified pattern object.

Arguments

Tt_pattern p 


A unique handle for a message pattern. You receive this handle after you issue tt_pattern_create().

int key 


User data cell in which you are interested. Values must be unique over all data cells for this pattern.

void *v 


A piece of arbitrary user data that is one word in size.

Returned Value

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

Related Functions

tt_pattern_user()

tt_pnotice_create

Tt_message  

tt_pnotice_create(Tt_scope scope,
const char *op)

Creates a message with: 


Tt_address = TT_PROCEDURE

Tt_class = TT_NOTICE

The handle for the created message is returned so you can add arguments, other attributes, and send the message.

Arguments

Tt_scope scope 


A portion of the message that helps determine which processes are eligible to receive the message. A potential recipient could be joined to:

   TT_SESSION
   TT_FILE
   TT_BOTH
   TT_FILE_IN_SESSION

If the scope is TT_SESSION, the session is set to the current default session. If the scope is TT_FILE, the file is set to the current default file. If the scope is BOTH or FILE_IN_SESSION, both file and session are set to the defaults.

const char *op 


The operation to be performed by the receiver.

Returned Value

Tt_message 


The unique handle that identifies your message. If ToolTalk is unable to create a message when requested, an invalid handle will be returned to you. When you attempt to use this handle, the ToolTalk service will report an error. Use tt_ptr_error(), which returns Tt_status, to determine if the pointer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_PROCID

tt_pointer_error

Tt_status  

tt_pointer_error(void *pointer)

Given an opaque pointer (Tt_message or Tt_pattern), or character pointer (char *), returns TT_OK if the pointer is valid or the encoded Tt_status value if the pointer is an error object.

To avoid the annoyance of having to cast the opaque or character pointer to void * in every call, a macro tt_ptr_error(p) is provided that expands to tt_pointer_error((void *)(p)).

Arguments

void *pointer 


Opaque pointer or character pointer to be checked.

Returned Value

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

tt_prequest_create

Tt_message  

tt_prequest_create(Tt_scope scope,
const char *op)

Creates a message with: 


Tt_address = TT_PROCEDURE

Tt_class = TT_REQUEST

The handle for the created message is returned so you can add arguments, other attributes, and send the message.

Arguments

Tt_scope scope 


A portion of the message that helps determine which processes are eligible to receive the message. A potential recipient could be joined to:

   TT_SESSION
   TT_FILE
   TT_BOTH
   TT_FILE_IN_SESSION

If the scope is TT_SESSION, the session is set to the current default session. If the scope is TT_FILE, the file is set to the current default file. If the scope is BOTH or FILE_IN_SESSION, both file and session are set to the defaults.

const char *op 


The operation to be performed by the receiver.

Returned Value

Tt_message 


The unique handle that identifies your message. If ToolTalk is unable to create a message when requested, an invalid handle will be returned to you. When you attempt to use this handle, the ToolTalk service will report an error. Use tt_ptr_error(), which returns Tt_status, to determine if the pointer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_PROCID

tt_ptr_error

Tt_status  

tt_ptr_error(pointer)

A macro that expands to tt_pointer_error ((void *)(p)). tt_ptr_error() helps you avoid the annoyance of having to cast the opaque or character pointer to void * in every call.

Arguments

pointer 


Opaque pointer or character pointer to be checked.

Returned Value

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_POINTER

tt_ptype_declare

Tt_status  

tt_ptype_declare(const char *ptid)

Registers your process type (ptype) with the ToolTalk service.

Arguments

const char *ptid 


Use the character string specified in your ptype that uniquely identifies your process.

Returned Value

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_PTYPE

tt_release

void  

tt_release(int mark)

Frees all storage allocated on the ToolTalk API allocation stack since your tt_mark() call.

Your application typically calls this at the end of a procedure to release all storage allocated within the procedure.

Arguments

int mark 


Integer that marks your application`s storage position in the ToolTalk API allocation stack.

Related Functions

tt_mark()

tt_session_bprop

Tt_status  

tt_session_bprop(const char *sessid,
const char *propname, int i,
unsigned char **value, int *length)

Obtains the i-th value (first value is number 0) of the named property of the session identified by sessid. If there are i values or fewer, both returned value and returned length are zeroed.

Arguments

const char *sessid 


The session you have joined. Use the sessid value the ToolTalk service returns after you issue tt_default_session().

const char *propname 


The name of the property from which you want to obtain values.

int i 


The number of the item in the property list for which you want to obtain the value. The list numbering begins with 0.

unsigned char **value 


Address of a character pointer that the ToolTalk service should aim to a string containing the contents of the property.

int *len 


Address of an integer that the ToolTalk service should set to the length of the value in bytes.

Returned Values

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_DBAVAIL
   TT_ERR_DBEXIST
   TT_ERR_NOMP
   TT_ERR_NUM
   TT_ERR_PROPNAME
   TT_ERR_SESSION

unsigned char **value 


Address of a character pointer that the ToolTalk service aimed at a string containing the contents of the property.

int *len 


Address of an integer that the ToolTalk service set to the length of the value in bytes.

tt_session_bprop_add

Tt_status  

tt_session_bprop_add(const char *sessid,
const char *propname,
const unsigned char *value, int length)

Adds a new byte-string value to the end of the list of values for the named property of the session identified by sessid.

Arguments

const char *sessid 


Name of the session you have joined. Use the sessid value the ToolTalk service returns after you issue tt_default_session().

const char *propname 


The name of the property to which you want to add values.

const unsigned char *value 


The value to add to the session property.

int length 


The size of the value in bytes.

Returned Values

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_DBAVAIL
   TT_ERR_DBEXIST
   TT_ERR_NOMP
   TT_ERR_PROPLEN
   TT_ERR_PROPNAME
   TT_ERR_SESSION

tt_session_bprop_set

Tt_status  

tt_session_bprop_set(const char *sessid,
const char *propname,
const unsigned char *value, int length)

Replaces any current values stored under the named property of the session identified by sessid with the given byte-string value.

Arguments

const char *sessid 


Name of the session you have joined. Use the sessid value the ToolTalk service returns after you issue tt_default_session().

const char *propname 


The name of the property whose value you want to replace.

const unsigned char *value 


The value to which the session property is set. If value is NULL, the property is removed entirely.

int length 


The size of the value in bytes.

Returned Values

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_DBAVAIL
   TT_ERR_DBEXIST
   TT_ERR_NOMP
   TT_ERR_PROPLEN
   TT_ERR_PROPNAME
   TT_ERR_SESSION

tt_session_join

Tt_status  

tt_session_join(const char *sessid)

Joins the session named by the provided string and makes it the default session for your process.

Arguments

const char *sessid 


Name of the session you wish to join. Use the sessid value the ToolTalk service returns after you issue tt_default_session(), tt_X_session(), or tt_initial_session().

Returned Values

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_DBAVAIL
   TT_ERR_DBEXIST
   TT_ERR_NOMP
   TT_ERR_PATH

Related Functions

tt_default_session()

tt_session_prop

char  

*tt_session_prop(const char *sessid,
const char *propname, int i)

Returns the i-th value (first value is number 0) of the specified session property.


Note: If this value has embedded nulls, you have no way to determine how long it is. Use tt_session_bprop() for values with embedded nulls.


Arguments

const char *sessid 


Name of the session you have joined. Use the sessid value the ToolTalk service returns after you issue tt_default_session().

const char *propname 


The name of the property from which you want to retrieve a value. The name must be less than 64 characters.

int i 


The number of the item in the property name list for which you want to obtain the value. The list numbering begins with 0.

Returned Value

char * 


The value of the requested property. NULL is returned if there are i values or fewer. Use tt_ptr_error(), which returns Tt_status, to determine if the pointer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_DBAVAIL
   TT_ERR_DBEXIST
   TT_ERR_NOMP
   TT_ERR_NUM
   TT_ERR_PROPNAME
   TT_ERR_SESSION

tt_session_prop_add

Tt_status  

tt_session_prop_add(const char *sessid,
const char *propname, const char *value)

Adds a new character-string value to the end of the list of values for the property of the specified session.

Arguments

const char *sessid 


Name of the session you have joined. Use the sessid value the ToolTalk service returns after you issue tt_default_session().

const char *propname 


The name of the property to which you want to add a value. The name must be less than 64 characters.

const char *value 


The character string you want to add to the property name list.

Returned Values

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_DBAVAIL
   TT_ERR_DBEXIST
   TT_ERR_NOMP
   TT_ERR_PROPLEN
   TT_ERR_PROPNAME
   TT_ERR_SESSION

tt_session_prop_count

int  

tt_session_prop_count(const char *sessid,
const char *propname)

Returns the number of values stored under the named property of the session identified by sessid.

Arguments

const char *sessid 


Name of the session you have joined. Use the sessid value the ToolTalk service returns after you issue tt_default_session().

const char *propname 


The name of the property you want to examine.

Returned Value

int 


The number of values in the specified property list. Use tt_int_error(), which returns Tt_status, to determine if the integer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_DBAVAIL
   TT_ERR_DBEXIST
   TT_ERR_NOMP
   TT_ERR_PROPNAME
   TT_ERR_SESSION

tt_session_prop_set

Tt_status  

tt_session_prop_set(const char *sessid,
const char *propname, const char *value)

Replaces all current values stored under the named property of the session identified by sessid with the given character-string value.

Arguments

const char *sessid 


Name of the session you have joined. Use the sessid value the ToolTalk service returns after you issue tt_default_session().

const char *propname 


The name of the property you want to examine.

const char *value 


The new value you want to insert. If you want to remove a value from the property list, specify the value as NULL.

Returned Values

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_DBAVAIL
   TT_ERR_DBEXIST
   TT_ERR_NOMP
   TT_ERR_PROPLEN
   TT_ERR_PROPNAME
   TT_ERR_SESSION

tt_session_propname

char  

*tt_session_propname(const char *sessid,
int n)

Return the n-th element of the list of currently-defined property names for the session identified by sessid.

Arguments

const char *sessid 


Name of the session you have joined. Use the sessid value the ToolTalk service returns after you issue tt_default_session().

int n 


The number of the item in the property name list for which you want to obtain the name. The list numbering begins with 0.

Returned Value

char * 


The name of the desired property from the session property list. NULL is returned if there are n properties or fewer. Use tt_ptr_error(), which returns Tt_status, to determine if the pointer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_DBAVAIL
   TT_ERR_DBEXIST
   TT_ERR_NOMP
   TT_ERR_NUM
   TT_ERR_SESSION

tt_session_propnames_count

int 

tt_session_propnames_count(
const char *sessid)

Return the number of currently-defined property names for the session.

Arguments

const char *sessid 


Name of the session you have joined. Use the sessid value the ToolTalk service returns after you issue tt_default_session().

Returned Value

int 


The number of property names for the session. Use tt_int_error(), which returns Tt_status, to determine if the integer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_DBAVAIL
   TT_ERR_DBEXIST
   TT_ERR_NOMP
   TT_ERR_SESSION

tt_session_quit

Tt_status  

tt_session_quit(const char *sessid)

Informs the ToolTalk service that your application is no longer interested in this ToolTalk session. The ToolTalk service will stop delivering messages scoped to this session.

Arguments

const char *sessid 


Name of the session you want to quit.

Returned Values

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_NOMP
   TT_ERR_SESSION
   TT_WRN_NOTFOUND

tt_spec_bprop

Tt_status  

tt_spec_bprop(const char *objid,
const char *propname, int i,
unsigned char **value, int *length)

Retrieves the i-th value (first value is number 0) of this property.

Arguments

const char *objid 


Identifier of the object involved in this operation.

const char *propname 


Name of the property in which you are interested. The name must be less than 64 characters.

int i 


Item of the list in which you are interested. The list numbering begins with 0.

unsigned char **value 


Address of a character pointer that the ToolTalk service should aim to a string containing the contents of the spec's property. If there are i values or fewer, the pointer will be set to 0.

int *len 


Address of an integer that the ToolTalk service should set to the length of the value in bytes.

Returned Values

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_DBAVAIL
   TT_ERR_DBEXIST
   TT_ERR_NOMP
   TT_ERR_NUM
   TT_ERR_OBJID
   TT_ERR_PROPNAME

unsigned char **value 


Address of a character pointer that the ToolTalk service aimed at a string containing the contents of the property. If there are i values or fewer, the pointer will be set to 0.

int *len 


Address of an integer that the ToolTalk service set to the length of the value in bytes. If there are i values or fewer, the length will be 0.

tt_spec_bprop_add

Tt_status  

tt_spec_bprop_add(const char *objid,
const char *propname,
const unsigned char *value, int length)

Adds a new byte-string to the end of the values list for this spec property.

Arguments

const char *objid 


Identifier of the object involved in this operation.

const char *propname 


Name of the property in which you are interested.

const unsigned char *value 


Byte string you want to add to the property value list.

int length 


Length of the value in bytes.

Returned Values

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_DBAVAIL
   TT_ERR_DBEXIST
   TT_ERR_NOMP
   TT_ERR_OBJID
   TT_ERR_PROPLEN
   TT_ERR_PROPNAME

tt_spec_bprop_set

Tt_status  

tt_spec_bprop_set(const char *objid,
const char *propname,
const unsigned char *value, int length)

Replaces any current values stored under this spec property with a new byte-string.

Arguments

const char *objid 


Identifier of the object involved in this operation.

const char *propname 


Name of the property in which you are interested.

const unsigned char *value 


Byte string you want to add to the property value list.


Note: If the value is NULL, the property is removed entirely.


int length 


Length of the value in bytes.

Returned Values

Tt_statue 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_DBAVAIL
   TT_ERR_DBEXIST
   TT_ERR_NOMP
   TT_ERR_OBJID
   TT_ERR_PROPLEN
   TT_ERR_PROPNAME

tt_spec_create

char  

*tt_spec_create(const char *filepath)

Creates a spec (in memory) for an object. Use the objid that the ToolTalk service returns in future calls to manipulate the object.


Note: The object will not be a permanent ToolTalk item or visible to other processes until the creating process does a tt_spec_write().


Arguments

const char *filepath 


File name.

Returned Value

char * 


Identifier for this object. Use tt_ptr_error(), which returns Tt_status, to determine if the pointer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_DBAVAIL
   TT_ERR_DBEXIST
   TT_ERR_NOMP
   TT_ERR_OTYPE
   TT_ERR_PATH

Related Functions

tt_spec_type_set()
tt_spec_write()

tt_spec_destroy

Tt_status  

tt_spec_destroy(const char *objid)

Immediately destroys an object's spec.

Arguments

const char *objid 


Identififier of the object involved in this operationn.

Returned Values

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_DBAVAIL
   TT_ERR_DBEXIST
   TT_ERR_NOMP
   TT_ERR_OBJID

tt_spec_file

char  

*tt_spec_file(const char *objid)

Retrieves the name of the file containing the object described by the spec.

Arguments

const char *objid 


Identifier of the object involved in this operation.

Returned Value

char * 


The file's absolute pathname. Use tt_ptr_error(), which returns Tt_status, to determine if the pointer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_DBAVAIL
   TT_ERR_DBEXIST
   TT_ERR_NOMP
   TT_ERR_OBJID

tt_spec_move

char  

*tt_spec_move(const char *objid,
const char *newfilepath)

Notifies the ToolTalk service that this object has moved to a different file. The ToolTalk service returns a new objid for the object and a forwarding pointer is left from the old objid to the new one.


Note: If a new objid is not required (because the new and old files are in the same file system), TT_WRN_SAME_OBJID is returned.

For efficiency and reliability, your application should replace any references it has to the old objid with references to the new one.

Arguments

const char *objid 


Identifier of the object involved in this operation.

const char *newfilepath 


New file name.

Returned Value

char * 


New unique identifier of the object involved in this operation. Use tt_ptr_error(), which returns Tt_status, to determine if the pointer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_DBAVAIL
   TT_ERR_DBEXIST
   TT_ERR_NOMP
   TT_ERR_OBJID
   TT_ERR_PATH
   TT_WRN_SAME_OBJID

tt_spec_prop

char  

*tt_spec_prop(const char *objid,
const char *propname, int i)

Retrieves the i-th value (first value is number 0) of the property associated with this object spec.


Note: If this value has embedded nulls, you have no way to determine its length.


Arguments

const char *objid 


Identifier of the object involved in this operation.

const char *propname 


Name of the property in which you are interested.

int i 


Item of the list in which you are interested. The list numbering begins with 0.

Returned Value

char * 


Contents of the property value. A NULL value is returned if there are i values or less. Use tt_ptr_error(), which returns Tt_status, to determine if the pointer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_DBAVAIL
   TT_ERR_DBEXIST
   TT_ERR_NOMP
   TT_ERR_NUM
   TT_ERR_OBJID
   TT_ERR_PROPNAME

tt_spec_prop_add

Tt_status  

tt_spec_prop_add(const char *objid,
const char *propname, const char *value)

Adds a new item to the end of the list of values associated with this spec property.

Arguments

const char *objid 


Identifier of the object involved in this operation.

const char *propname 


Property in which you are interested.

const char *value 


New character-string to be added to the property value list.

Returned Values

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_DBAVAIL
   TT_ERR_DBEXIST
   TT_ERR_NOMP
   TT_ERR_OBJID
   TT_ERR_PROPNAME
   TT_ERR_PROPLEN

Related Functions

tt_spec_prop_set()

tt_spec_prop_count

int  

tt_spec_prop_count(const char *objid,
const char *propname)

Returns the number of values listed in this spec property.

Arguments

const char *objid 


Identifier of the object involved in this operation.

const char *propname 


Name of the property in which you are interested.

Returned Value

int 


Number of values listed in the spec property. Use tt_int_error(), which returns Tt_status, to determine if the integer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_DBAVAIL
   TT_ERR_DBEXIST
   TT_ERR_NOMP
   TT_ERR_OBJID
   TT_ERR_PROPNAME

tt_spec_prop_set

Tt_status  

tt_spec_prop_set(const char *objid,
const char *propname, const char *value)

Replaces any values currently stored under this property of the object spec with a new value.

Arguments

const char *objid 


Identifier of the object involved in this operation.

const char *propname 


Name of the property in which you are interested.

const char *value 


Value you want to put in the property value list. If value is NULL, the property is removed entirely.

Returned Values

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_DBAVAIL
   TT_ERR_DBEXIST
   TT_ERR_NOMP
   TT_ERR_OBJID
   TT_ERR_PROPNAME
   TT_ERR_PROPLEN

Related Functions

tt_spec_prop_add()

tt_spec_propname

char  

*tt_spec_propname(const char *objid, int n)

Returns the n-th element of the property name list for this object spec.

Arguments

const char *objid 


Identifier of the object involved in this operation.

int n 


Item of the list in which you are interested. The list numbering begins with 0.

Returned Value

char * 


Property name. NULL is returned if there are n properties or less.Use tt_ptr_error(), which returns Tt_status, to determine if the pointer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_DBAVAIL
   TT_ERR_DBEXIST
   TT_ERR_NOMP
   TT_ERR_NUM
   TT_ERR_OBJID

tt_spec_propnames_count

int  

tt_spec_propnames_count(const char *objid)

Returns the number of property names for this object.

Arguments

const char *objid 


Identifier of the object involved in this operation.

Returned Value

int 


Number of values listed in the spec property. Use tt_int_error(), which returns Tt_status, to determine if the integer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_DBAVAIL
   TT_ERR_DBEXIST
   TT_ERR_NOMP
   TT_ERR_OBJID

tt_spec_type

char 

*tt_spec_type(const char *objid)

Returns the name (otid) of the object type.

Arguments

const char *objid 


Identifier of the object involved in this operation.

Returned Value

char * 


Type of this object. Use tt_ptr_error(), which returns Tt_status, to determine if the pointer is valid. Possible Tt_status values are:

   TT_OK
   TT_ERR_DBAVAIL
   TT_ERR_DBEXIST
   TT_ERR_NOMP
   TT_ERR_OBJID

tt_spec_type_set

Tt_status  

tt_spec_type_set(const char *objid,
const char *otid)

Assigns an object type (otype) value to the object spec. The type must be set before the spec is written for the first time, and cannot be changed thereafter.

Arguments

const char *objid 


Identifier of the object involved in this operation.

const char *otid 


Otype you want to assign to the spec.

Returned Values

Tt_status  

 

The status of the operation. Possible values are:

   TT_OK
   TT_ERR_DBAVAIL
   TT_ERR_DBEXIST
   TT_ERR_NOMP
   TT_ERR_OBJID
   TT_ERR_READONLY

Related Functions

tt_spec_create()
tt_spec_write()

tt_spec_write

Tt_status 

tt_spec_write(const char *objid)

Writes the spec and any associated properties to the ToolTalk database. It is not necessary to do a write after a destroy.


Note: Several changes can be “batched” between write calls; for example, you might create an object spec, set some properties, and then write all the changes at once with one write call.


Arguments

const char *objid 


Identifier of the object involved in this operation.

Returned Values

Tt_status 


The status of the operation. Possible values are:

   TT_OK
   TT_ERR_DBAVAIL
   TT_ERR_DBEXIST
   TT_ERR_NOMP
   TT_ERR_OBJID

Related Functions

tt_spec_create()
tt_spec_type_set()

tt_status_message

char 

*tt_status_message(Tt_status ttrc)

Returns a pointer to a message describing the problem indicated by this Tt_status code.

Arguments

Tt_status ttrc 


Tt_status code you received during an operation.

Returned Value

char * 


Pointer to character string describing Tt_status code. Use tt_ptr_error(), which returns Tt_status, to determine if the pointer is valid. Possible Tt_status values are:

   TT_OK
   TT_xxx

tt_X_session

char  

tt_X_session(const char *xdisplaystring)

Returns the session associated with the named X Window System display.

Arguments

const char *xdisplaystring 


Name of an X11 display server, e.g. somehost:0, :0, etc.

Returned Value

char * 


Identifier for the current ToolTalk session.

Use tt_ptr_error(), which returns Tt_status, to determine if the pointer is valid. Possible Tt_status values are:

   TT_OK
   TT_NOMP