Initializing help system before first use

Generating a data file

To generate a data file, a bindrv writer context has to be allocated with a call to bindrv_newwriter. This initialisation routine requires a callback function that is used for outputing data to some stream (e.g. use the C function fwrite to write to a file opened with the function fopen). Then, each data value to be saved to the stream is passed to the function corresponding to its type: this routine builds a token equivalent to the provided object and sends it to the stream. For instance, function bindrv_putint will be used to output an integer etc.. In order to structure the data flow, special markers may be inserted: the function bindrv_putctrl allows to add these control tokens. A control token is characterised by its code (an integer between 0 and 31) such that different types of markers can be used. For instance, control code 1 could indicate the beginning of a list of integers, code 4 the beginning of a list of text strings, code 2 for the end of a list and code 3 could be used to mark the end of the data flow. Using this convention, a file containing a list of integers (e.g. 5,6,7) and a list of strings (e.g. "a","b") could be produced with the following code:

bindrv_putctrl(bctx,1);
bindrv_putint(bctx,5);
bindrv_putint(bctx,6);
bindrv_putint(bctx,7);
bindrv_putctrl(bctx,2);
bindrv_putctrl(bctx,4);
bindrv_putstring(bctx,"a");
bindrv_putstring(bctx,"b");
bindrv_putctrl(bctx,2);
bindrv_putctrl(bctx,3);

© 2001-2019 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.