discussed in Section 3.3 can help you understand what is involved in writing
an extension and provide good examples of using the kdbx library functions.
3.2 Standard kdbx Library Functions
The kdbx debugger provides a number of library functions that are
used by the resident extensions. You can use these functions, which are
declared in the ./usr/include/kdbx.h header file, to develop customized
extensions for your application. To use the functions, you must include the
./usr/include/kdbx.h header file in your extension.
The sections that follow describe the special data types defined for use in
kdbx extensions and the library routines you use in extensions. The library
routine descriptions show the routine syntax and describe the routine
arguments. Examples included in the descriptions show significant lines
in boldface type.
3.2.1 Special kdbx Extension Data Types
The routines described in this section use the following special data types:
StatusType, Status, FieldRec, and DataStruct. The uses of these data
types are as follows:
• The StatusType data type is used to declare the status type and can
take on any one of the following values:
– OK, which indicates that no error occurred
– Comm, which indicates a communication error
– Local, which indicates other types of errors
The following is the type definition for the StatusType data type:
typedef enum { OK, Comm, Local } StatusType;
• The Status data type is returned by some library routines to inform the
caller of the status of the call. Library routines using this data type fill
in the type field with the call status from StatusType. Upon return,
callers check the type field, and if it is not set to OK, they can pass the
Status structure to the print_status routine to generate a detailed
error message.
The following is the type definition for the Status data type:
typedef struct {
StatusType type;
union {
int comm;
int local;
}u;
} Status;
3–2 Writing Extensions to the kdbx Debugger