JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
ToolTalk User's Guide
search filter icon
search icon

Document Information

Preface

1.  Introducing the ToolTalk Service

2.  An Overview of the ToolTalk Service

3.  Message Patterns

4.  Setting Up and Maintaining the ToolTalk Processes

5.  Maintaining Application Information

6.  Maintaining Files and Objects Referenced in ToolTalk Messages

7.  Participating in ToolTalk Sessions

8.  Sending Messages

9.  Dynamic Message Patterns

10.  Static Message Patterns

11.  Receiving Messages

12.  Objects

13.  Managing Information Storage

Information Provided to the ToolTalk Service

Information Provided by the ToolTalk Service

Calls Provided to Manage the Storage of Information

Marking and Releasing Information

Marking Information for Storage

Releasing Information No Longer Needed

Example of Marking and Releasing Information

Allocating and Freeing Storage Space

Allocating Storage Space

Freeing Allocated Storage Space

Special Case: Callback and Filter Routines

Callback Routines

Filter Routines

14.  Handling Errors

A.  Migrating from the Classing Engine to the ToolTalk Types Database

B.  A Simple Demonstration of How the ToolTalk Service Works

C.  The ToolTalk Standard Message Sets

D.  Frequently Asked Questions

Glossary

Index

Special Case: Callback and Filter Routines

The way that the ToolTalk service behaves toward information passed into filter functions and callbacks is a special case. Callback and filter routines called by the ToolTalk service are called with two kinds of arguments:

The context arguments are passed from the ToolTalk service to your application. The API objects referenced by pointers are freed by the ToolTalk service as soon as your callback or filter function returns. If you want to keep any of these objects, you must copy the objects before your function returns.


Note - The way that the ToolTalk service behaves toward information passed into filter functions and callbacks is a special case. In all other instances, the ToolTalk service stores the information in the API allocation stack until you free it.


Callback Routines

One of the features of the ToolTalk service is callback support for messages, patterns, and filters. Callbacks are routines in your program that ToolTalk calls when a particular message arrives (message callback) or when a message matches a particular pattern you registered (pattern callback).

To tell the ToolTalk service about these callbacks, add the callback to a message or pattern before you send the message or register the pattern.

Filter Routines

When you call file query functions such as tt_file_objects_query(), you point to a filter routine that the ToolTalk service calls as it returns items from the query. For example, you could use filter routine used by the ToolTalk file query function to find a specific object. The tt_file_objects_query() function returns all the objects in a file and runs the objects through a filter routine that you provide. Once your filter routine finds the specified object, you can use tt_malloc() to create a storage location and copy the object into the location. When your filter function returns, the ToolTalk service will free all storage used by the objects in the file but the object you stored with the tt_malloc() call will be available for further use.