Compaq AA-RH99A-TE Remote Starter User Manual


 
For example:
if(!cast(addr, "struct file", &fil, &error)){
fprintf(stderr, "Couldnt cast address to a file:\n");
fprintf(stderr, "%s\n", error);
quit(1);
}
3.2.7 Checking Arguments Passed to an Extension
The check_args function checks the arguments passed to an extension or
displays a help message. The function displays a help message when the
user specifies the help flag on the command line.
This function has the following syntax:
void check_args(
int argc,
char** argv,
char* help_string);
Argument
Input/Output
Description
argc
Input Passes in the first argument to the command
argv
Input Passes in the second argument to the command
help_string
Input Specifies the help message to be displayed
to the user
You should include the check_args function early in your extension to
be sure that arguments are correct.
For example:
check_args(argc, argv, help_string);
if(!check_fields("struct sz_softc", fields, NUM_FIELDS, NULL)){
field_errors(fields, NUM_FIELDS);
quit(1);
}
3.2.8 Checking the Fields in a Structure
The check_fields function verifies that the specified function consists of
the expected number of fields and that those fields have the correct data
type. If the function is successful, TRUE is returned; otherwise, the error
parts of the affected fields are filled in with errors, and FALSE is returned.
This function has the following syntax:
Boolean check_fields(
char* symbol,
FieldRec* fields,
int nfields,
Writing Extensions to the kdbx Debugger 3–7