Académique Documents
Professionnel Documents
Culture Documents
Tbtar SDK
1 Concepts................................................................................................................ 3
1 Concepts
The tbtar sdk is designed very closely to the tbtar archiving tool. For each tbtars’s main
function there is an appropriate API which serves for that functionality.
Each API has to be called with the target- or sourcedirectory, a databasename and an ASCII
parameterstring. A callback for standardio and a callback for erroroutput can be supplied.
Optional parameters may be given by an argumentstring.
For each API needing a sParamString parameter specfiying a NULL pointer is equivalent to
specifying an empty string and means no additional parameters given.
Each API returns boolean TRUE in case of success, and FALSE otherwise. In case of no
success an appropriate error code and error message can be retrieved.
The Tbtar SDK comes together with the Transbase Server package. For using your own tbtar
application a Transbase Server license is required.
2 Building an application
For compiling your application you must include tbadmsdk.h within your sourcecode.
Building the application must be done by linking against tbtard32.lib.
Example:
Long nCode;
If(FALSE==API(…)){
TbtarGetLastError(&nCode);
Printf(“Error: %ld\n”, nCode,);
}
Example:
Char *pText;
If(FALSE==API(…)){
TbtarGetLastErrorText(&pText);
Printf(“Error: %s\n”, pText);
}
Example:
Bool TbTarOut(char *sFormat, …)
{
va_list vam;
va_start(vam, f);
vfprintf(stderr,f, vam);
fflush(stderr);
va_end(vam);
return TRUE;
}