Product Documentation

FairCom ISAM for C

Previous Topic

Next Topic

RegisterCtree

Register (establish) a c-tree instance.

Short Name

REGCTREE()

Type

Low-Level function

Declaration

COUNT RegisterCtree(pTEXT regid)

Description

RegisterCtree() accepts a unique registration reference name, pointed to by regid, and establishes a unique c-tree instance. Each call allocates a new control block for the c-tree global variables. The registration reference name can be up to 31 bytes and a NULL terminator in length.

Return

Value

Symbolic Constant

Explanation

0

NO_ERROR

Instance successfully registered.

82

UALC_ERR

User allocation error (usually out of memory).

518

GEXS_ERR

regid is already registered.

536

AREG_ERR

Only automatic RegisterCtree() is allowed.

See c-tree Error Codes for a complete listing of valid c-tree error values.

Example

TEXT inpbuf[32]; /* input buffer */


ctrt_printf("\nEnter Instance Name\n");

gets(inpbuf);

if (RegisterCtree(inpbuf))

{

ctrt_printf("\nCould not register {%s} data base",inpbuf);

ctlxmg_exit(2);

}

Limitations

File handles are not shared between instances. Virtual logic cannot close files in other instances.

See also

NextCtree(), SwitchCtree(), WhichCtree(), GetCtreePointer(), UnRegisterCtree()

TOCIndex