Compaq AA-RH99A-TE Remote Starter User Manual


 
print(buf);
sprintf(buf, "\tConfig 1 - %s\tConfig 2 - %s",
addr_to_proc((long) bus_fields[3].data),
addr_to_proc((long) bus_fields[4].data));
print(buf);
if(!prctlr((long) bus_fields[0].data)) quit(1);
print();
}
3.2.31 Converting a String to a Number
The to_number function converts a string to a number. The function returns
TRUE if successful, or FALSE if conversion was not possible.
This function has the following format:
Boolean to_number(
char* str,
long* val);
Argument Input/Output Description
str
Input Contains the string to be converted
val
Output Contains the numerical equivalent of the string
This function returns TRUE if successful, FALSE if conversion was not
possible.
For example:
check_args(argc, argv, help_string);
if(argc < 5) Usage();
size = 0;
type = argv[1];
if(!to_number(argv[2], &len)) Usage();
addr = strtoul(argv[3], &ptr, 16);
if(*ptr != \0){
if(!read_sym_val(argv[3], NUMBER, &addr, &error)){
fprintf(stderr, "Couldnt read %s:\n", argv[3]);
fprintf(stderr, "%s\n", error);
Usage();
}
}
3.3 Examples of kdbx Extensions
This section contains examples of the three types of extensions provided
by the kdbx debugger:
Extensions that use lists. Example 3–1 provides a C language template
and Example 3–2 is the source code for the /var/kdbx/callout
extension, which shows how to use linked lists in developing an
extension.
3–22 Writing Extensions to the kdbx Debugger