Compaq AA-RH99A-TE Remote Starter User Manual


 
Example 3–1: Template Extension Using Lists (cont.)
quit(0);
}
1 The help string is output by the check_args function if the user enters
the help extension_name command at the kdbx prompt. The first
line of the help string should be a one-line description of the extension.
The rest should be a complete description of the arguments. Also, each
line should end with the string \\\n\.
2 Every structure field to be extracted needs an entry. The first field is
the name of the next extracted field; the second field is the type. The
last two fields are for output and initialize to NULL.
3 Specifies the type of the list that is being traversed.
4 Specifies the variable that holds the head of the list.
5 Specifies the table header string.
6 Specifies the type of the list that is being traversed.
7 Specifies the structure type.
8 Extracts, formats, and prints the field information.
Example 3–2: Extension That Uses Linked Lists: callout.c
#include <stdio.h>
#include <errno.h>
#include <kdbx.h>
#define KERNEL
#include <sys/callout.h>
static char *help_string =
"callout - print the callout table \\\n\
Usage : callout [cpu] \\\n\
";
FieldRec processor_fields[] = {
{ ".calltodo.c_u.c_ticks", NUMBER, NULL, NULL },
{ ".calltodo.c_arg", NUMBER, NULL, NULL },
{ ".calltodo.c_func", NUMBER, NULL, NULL },
{ ".calltodo.c_next", NUMBER, NULL, NULL },
{ ".lbolt", NUMBER, NULL, NULL },
{ ".state", NUMBER, NULL, NULL },
};
FieldRec callout_fields[] = {
{ ".c_u.c_ticks", NUMBER, NULL, NULL },
{ ".c_arg", NUMBER, NULL, NULL },
{ ".c_func", NUMBER, NULL, NULL },
{ ".c_next", NUMBER, NULL, NULL },
};
3–24 Writing Extensions to the kdbx Debugger