Compaq AA-RH99A-TE Remote Starter User Manual


 
}
3.2.20 Displaying a Message
The print function displays a message on the terminal screen. Because of
the input and output redirection done by kdbx, all output to stdout from a
kdbx extension goes to dbx. As a result, a kdbx extension cannot use normal
C output functions such as printf and fprintf(stdout,...) to display
information on the screen. Although the fprintf(stderr,...) function is
still available, the recommended method is to first use the sprintf function
to print the output into a character buffer and then use the kdbx library
function print to display the contents of the buffer to the screen.
The print function automatically displays a newline character at the end of
the output, it fails if it detects a newline character at the end of the buffer.
This function has the following format:
void print(
char* message);
Argument
Input/Output
Description
message
Input The message to be displayed
For example:
if(do_short){
if(!check_fields("struct mount", short_mount_fields,
NUM_SHORT_MOUNT_FIELDS, NULL)){
field_errors(short_mount_fields, NUM_SHORT_MOUNT_FIELDS);
quit(1);
}
print("SLOT MAJ MIN TYPE DEVICE MOUNT POINT");
}
3.2.21 Displaying Status Messages
The print_status function displays a status message that you supply and
a status message supplied by the system. This function has the following
format:
void print_status(
char* message,
Status* status);
Argument
Input/Output
Description
message
Input Specifies the extension-defined status message
status
Input Specifies the status returned from
another library routine
For example:
3–16 Writing Extensions to the kdbx Debugger