cache_describe()

Purpose

Enables caching for a particular table

Syntax

int cache_describe(typenr, keysize)

Parameters

int typenr

Table number

 

int keysize

Size of the key to the record

Description

cache_describe() must be called to enable caching for a particular table. The DP4 cache_xxxx functions utilise a heap for caching. You must initialise a heap with the freex() or heap_init() function, otherwise there will be no room for a cache. Calling the cache_describe() function has no effect on the records already in the cache. The first call to cache_describe() makes a call to cache_start().

Return values

Return values are as follows:

Value

Meaning

-1

There is no cache (insufficient memory)

0

The table cannot be cached with the specified key size because it is already being cached with a different key size

1

The table was successfully added to the list of cache tables

2

The table was already being cached with this key size

See also

freex(), heap_init()

Example

See the example for the cache_find() function