dbstrcpy

Description

Copy all or a portion of the command buffer.

Syntax

RETCODE dbstrcpy(dbproc, start, numbytes, dest)
 
DBPROCESS    *dbproc;
int                       start;
int                       numbytes;
char                  *dest;

Parameters

dbproc

A pointer to the DBPROCESS structure that provides the connection for a particular front-end/server process. It contains all the information that DB-Library uses to manage communications and data between the front end and server.

start

Character position in the command buffer to start copying from. The first character has position 0. If start is greater than the length of the command buffer, dbstrcpy inserts a null terminator at dest[0].

numbytes

The number of characters to copy. If numbytes is -1, dbstrcpy will copy the entire command buffer, whether or not dest points to adequate space. It is legal to copy 0 bytes, in which case dbstrcpy inserts a null terminator at dest[0]. If there are not numbytes available to copy, dbstrcpy copies the number of bytes available and returns SUCCEED.

dest

A pointer to the destination buffer to copy the source string into. Before calling dbstrcpy, the caller must verify that the destination buffer is large enough to hold the copied characters. The function dbstrlen returns the size of the entire command buffer.

Returns

SUCCEED or FAIL.

dbstrcpy returns FAIL if start is negative.

Usage

See also

dbcmd, dbfcmd, dbfreebuf, dbgetchar, dbstrlen