The prime function is the barcode() function, called with parameters that specify the options available for the barcode.
Declaration
Int barcode (char * szIn, int nlen, char * szOut, int type, int mode, int level, int flag)
szIn – is a pointer to a string containing the bytes used as data to create the barcode. While passed as a text string, the string can contain non-text bytes (including ASCII 0) provided that the length parameter (n) is used to specify the length of the data. If n is 0, then the string is assumed to be a null-terminated ASCII string.
n – a pointer to an integer which is either 0 or specified the length of the data in szIn.
szOut – is a pointer to a string buffer that will receive the characters that form the barcode when displayed or printed in the barcode font. The value may be NULL in which case no characters are copied. If the parameter is not NULL the buffer must exist and be at least 4096 bytes in length. For Maxicode this parameter is ignored and should be NULL.
type - is an integer specifying the type of barcode to be generated. For libraries that support only one barcode type this parameter is ignored.
mode – is an integer specifying the mode of the barcode (see specific barcode types for more information). The names of allowed modes may be obtained using the getModeNames() function – see below.
level – is an integer specifying the security level of the barcode generated. Allowed values for for some barcode types depend on the mode, and the allowed values may be interrogated using the getLevels() function – see below. For Maxicode symbols this parameter is the number of pixels per inch of the target image – see Maxicode section.
flags – is an integer which contains additional formatting data. Common to all barcode font kits, a 1 in bit 0 of this integer causes the lines of the barcodes to be separated by carriage return and line feed characters <13><10>. A 0 in bit 0 sets the line separator as a single carriage return <13>.
The funtion returns 0 if successful, or an error code to indicate what went wrong!