Previous Topic

Next Topic

StopUser

Log application off the c-tree Server.

Short Name

STPUSR()

Type

Server function only

Declaration

COUNT StopUser() 

Description

StopUser() logs an application off a c-tree Server. It causes all the files not yet closed by the application to be closed and frees a slot on the Server for another user. StopUser() is automatically invoked by CloseISAM(). Therefore, StopUser() is only required in low-level applications, or in ISAM applications when a program can exit without calling CloseISAM().

Note: A c-tree Plus application is automatically logged on to a c-tree Server whenever InitCTree(), InitISAM(), OpenISAM(), or CreateISAM() is called. There is no separate call for logging-on to the c-tree Server.

Return

StopUser() returns an error if it could not communicate with the c-tree Server. This might happen if the c-tree Server has been shut down or if the communications link has been disturbed.

Value

Symbolic Constant

Explanation

0

NO_ERROR

Successful disconnect.

133

ASKY_ERR

User cannot be found (has it been shut down?).

162

SGON_ERR

Server communication link has been disturbed.

410

USTP_ERR

User is not logged on when StopUser() was called.

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

Example

pTEXT     pfname;

if (OpenISAM(pfname)) {
    printf("\nCould not OpenISAM. Error %d. File %d.", isam_err,isam_fil);
    StopUser();
    exit(2);
}

See also

CloseISAM(), InitCTree(), InitISAM(), OpenISAM(), CreateISAM()