lcrzo_data(3)

NAME
lcrzo_data - lcrzo library : data array manipulation

CONTENTS
/*    Laurent Constantin's network library (lcrzo)
                 lcrzo_data module
  Functions herein allow to work on data arrays.
*/
/*-------------------------------------------------------------*/
/* these typedefs are used for :
   lcrzo_data : an array of data
   lcrzo_constdata : an array of data which can not be modified
   lcrzo_string : a string
   lcrzo_conststring : a string which can not be modified
*/
typedef lcrzo_uint8* lcrzo_data;
typedef const lcrzo_uint8*  lcrzo_constdata;
typedef char* lcrzo_string;
typedef const char* lcrzo_conststring;
/*-------------------------------------------------------------*/
/**********************************************
 * Note about mixed strings :                 *
 * A mixed string permits to represent data   *
 * as a clear form using hexadecimal and      *
 * text.                                      *
 * Hexadecimal is used without "0x" or "0h"   *
 * Text is included between apostrophes "'"   *
 * The character ' is ''                      *
 * For example :                              *
 *   'hello' : data "hello"                   *
 *   'a' 'b' : data "ab"                      *
 *   41 'b'  : data "Ab" (because 'A'==0x41)  *
 *   'man'00 : data "man" ending with 0x00    *
 *   'a''b'  : data "a'b"                     *
 * Real examples :                            *
 *  'hello' 0D 0A 'this is after a newline'   *
 *  'one' 09 'two' 0D 0A                      *
 **********************************************/
typedef char* lcrzo_hexa;
typedef const char* lcrzo_consthexa;
typedef char* lcrzo_mixed;
typedef const char* lcrzo_constmixed;
typedef char* lcrzo_base64;
typedef const char* lcrzo_constbase64;
/*-------------------------------------------------------------*/
/**********************************************
 * Note about sizes :                         *
 *   sizes are always in bytes                *
 **********************************************/
/*-------------------------------------------------------------*/
/* Name : lcrzo_data_alloc
   Description :
     Allocate a memory array.
   Input parameter(s) :
     allocsize : size of this array
   Input/output parameter(s) :
   Output parameter(s) :
     *pptr : pointer which will be malloced (so, the
             memory will have to be freed by the
	     user with 'lcrzo_data_free(*pdataout)' or
             'free(*pdataout)').
   Normal return values :
     LCRZO_ERR_OK : ok
*/
int lcrzo_data_alloc(lcrzo_int32 allocsize, lcrzo_data *pptr);
/*-------------------------------------------------------------*/
/* Name : lcrzo_data_realloc
   Description :
     Reallocate a memory array.
   Input parameter(s) :
     newallocsize : new size of this array
   Input/output parameter(s) :
   Output parameter(s) :
     *pptr : pointer which will be reallocated (so, the
             memory will have to be freed by the
	     user with 'lcrzo_data_free(*pdataout)' or
             'free(*pdataout)').
   Normal return values :
     LCRZO_ERR_OK : ok
*/
int lcrzo_data_realloc(lcrzo_int32 newallocsize, lcrzo_data *pptr);
/*-------------------------------------------------------------*/
/* Name : lcrzo_data_free2
   Description :
     Free a memory array.
   Input parameter(s) :
     *pptr : pointer to the memory to free
   Input/output parameter(s) :
   Output parameter(s) :
   Normal return values :
     LCRZO_ERR_OK : ok
*/
int lcrzo_data_free2(lcrzo_data *pptr);
/*-------------------------------------------------------------*/
/**********************************************
 * Note about indexes :                       *
 * Indexes permit to access range of data.    *
 * For example, if we have a 4 bytes data,    *
 * containing 'ABCD', we can represent it     *
 * like this :                                *
 *       +---+---+---+---+                    *
 *       | A | B | C | D |                    *
 *       +---+---+---+---+                    *
 * The indexes are associated with the        *
 * corners :                                  *
 *       1   2   3   4   5                    *
 *      -5  -4  -3  -2  -1                    *
 * So :                                       *
 *   range [1,5]   is 'ABCD'                  *
 *   range [2,3]   is 'B'                     *
 *   range [3,3]   is ''     (empty array)    *
 *   range [1,-1]  is 'ABCD'                  *
 *   range [2,-3]  is 'B'                     *
 *   range [3,1]   is 'BA'                    *
 *   range [-1,1]  is 'DCBA'                  *
 *   range [-2,-3] is 'C'                     *
 *   etc.                                     *
 * Note : 0 (zero) is an invalid index        *
 **********************************************/
/*-------------------------------------------------------------*/
/* Name : lcrzo_data_init_data
   Description :
     Initialize a data array, with data array
   Input parameter(s) :
     datain : array containing input data
     datainsize : size of this array
     dataoutmaxsize : max size which can be stored in dataout
   Input/output parameter(s) :
   Output parameter(s) :
     dataout : output array.
               This array will be set with datain
     *pdataoutsize : reached size of dataout
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKDATATRUNCATED : dataoutmaxsize reached before
                                 being able to store all the needed
				 data in dataout
*/
int lcrzo_data_init_data(lcrzo_constdata datain,
			 lcrzo_int32 datainsize,
			 lcrzo_int32 dataoutmaxsize,
			 lcrzo_data dataout,
			 lcrzo_int32 *pdataoutsize);
/* Name : lcrzo_data_initm_data
   Description :
     Allocate a memory array, and initialize it with data array
   Input parameter(s) :
     datain : array containing input data
     datainsize : size of this array
   Input/output parameter(s) :
   Output parameter(s) :
     *pdataout : pointer which will be malloced (so, the
                 memory will have to be freed by the
		 user with 'free(*pdataout)').
		 The allocated memory will be set with datain
     *pdataoutsize : reached size of *pdataout
   Normal return values :
     LCRZO_ERR_OK : ok
*/
int lcrzo_data_initm_data(lcrzo_constdata datain,
			  lcrzo_int32 datainsize,
			  lcrzo_data *pdataout,
			  lcrzo_int32 *pdataoutsize);
/* Name : lcrzo_data_append_data
   Description :
     Append at the end of a data array, with data array
   Input parameter(s) :
     datain : array containing input data
     datainsize : size of this array
     dataoutcurrentsize : current size of dataout
     dataoutmaxsize : max size which can be stored in dataout
   Input/output parameter(s) :
   Output parameter(s) :
     dataout : output array.
               datain will be appended to this array.
     *pdataoutsize : reached size of dataout
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKDATATRUNCATED : dataoutmaxsize reached before
                                 being able to store all the needed
				 data in dataout
*/
int lcrzo_data_append_data(lcrzo_constdata datain,
			    lcrzo_int32 datainsize,
			    lcrzo_int32 dataoutcurrentsize,
			    lcrzo_int32 dataoutmaxsize,
			    lcrzo_data dataout,
			    lcrzo_int32 *pdataoutsize);
/* Name : lcrzo_data_appendm_data
   Description :
     Reallocate a memory array, and append at the end, with
     data array
   Input parameter(s) :
     datain : array containing input data
     datainsize : size of this array
     dataoutcurrentsize : current size of *pdataout
   Input/output parameter(s) :
     *pdataout : pointer which will be reallocated (so,
                 the memory will have to be freed by the
                 user with 'free(*pdataout)').
                 datain will be appended to this array.
   Output parameter(s) :
     *pdataoutsize : reached size of *pdataout
   Normal return values :
     LCRZO_ERR_OK : ok
*/
int lcrzo_data_appendm_data(lcrzo_constdata datain,
			    lcrzo_int32 datainsize,
			    lcrzo_int32 dataoutcurrentsize,
			    lcrzo_data *pdataout,
			    lcrzo_int32 *pdataoutsize);
/*-------------------------------------------------------------*/
/* Name : lcrzo_data_init_range
   Description :
     Initialize a data array, with a range of data array
   Input parameter(s) :
     datain : array containing input data
     datainsize : size of this array
     datainstartindex : start index of the range to copy
     datainendindex : end index of the range to copy
     dataoutmaxsize : max size which can be stored in dataout
   Input/output parameter(s) :
   Output parameter(s) :
     dataout : output array.
               This array will be set with a range of datain
     *pdataoutsize : reached size of dataout
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKDATATRUNCATED : dataoutmaxsize reached before
                                 being able to store all the needed
                                 data in dataout
*/
int lcrzo_data_init_range(lcrzo_constdata datain,
			  lcrzo_int32 datainsize,
			  lcrzo_int32 datainstartindex,
			  lcrzo_int32 datainendindex,
			  lcrzo_int32 dataoutmaxsize,
			  lcrzo_data dataout,
			  lcrzo_int32 *pdataoutsize);
/* idem lcrzo_data_init_range, but allocate memory. Read the
   help of lcrzo_data_initm_data for an explanation of the
   parameter used for allocation (pdataout)*/
int lcrzo_data_initm_range(lcrzo_constdata datain,
			   lcrzo_int32 datainsize,
			   lcrzo_int32 datainstartindex,
			   lcrzo_int32 datainendindex,
			   lcrzo_data *pdataout,
			   lcrzo_int32 *pdataoutsize);
/* idem lcrzo_data_init_range, but append. Read the
   help of lcrzo_data_append_data for an explanation of the
   parameter used for appending (dataoutcurrentsize)*/
int lcrzo_data_append_range(lcrzo_constdata datain,
			    lcrzo_int32 datainsize,
			    lcrzo_int32 datainstartindex,
			    lcrzo_int32 datainendindex,
			    lcrzo_int32 dataoutcurrentsize,
			    lcrzo_int32 dataoutmaxsize,
			    lcrzo_data dataout,
			    lcrzo_int32 *pdataoutsize);
/* idem lcrzo_data_initm_range, but append */
int lcrzo_data_appendm_range(lcrzo_constdata datain,
			     lcrzo_int32 datainsize,
			     lcrzo_int32 datainstartindex,
			     lcrzo_int32 datainendindex,
			     lcrzo_int32 dataoutcurrentsize,
			     lcrzo_data *pdataout,
			     lcrzo_int32 *pdataoutsize);
/*-------------------------------------------------------------*/
/* Name : lcrzo_data_init_fill
   Description :
     Initialize a data array, with data filling
   Input parameter(s) :
     datain : array containing input data
     datainsize : size of this array
     fillingsize : size of the filling
     dataoutmaxsize : max size which can be stored in dataout
   Input/output parameter(s) :
   Output parameter(s) :
     dataout : output array.
               This array will be set with a filling from datain
     *pdataoutsize : reached size of dataout
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKDATATRUNCATED : dataoutmaxsize reached before
                                 being able to store all the needed
                                 data in dataout
*/
int lcrzo_data_init_fill(lcrzo_constdata datain,
                         lcrzo_int32 datainsize,
                         lcrzo_int32 fillingsize,
                         lcrzo_int32 dataoutmaxsize,
                         lcrzo_data dataout,
                         lcrzo_int32 *pdataoutsize);
/* idem lcrzo_data_init_fill, but allocate memory. Read the
   help of lcrzo_data_initm_data for an explanation of the
   parameter used for allocation (pdataout)*/
int lcrzo_data_initm_fill(lcrzo_constdata datain,
			  lcrzo_int32 datainsize,
			  lcrzo_int32 fillingsize,
			  lcrzo_data *pdataout,
			  lcrzo_int32 *pdataoutsize);
/* idem lcrzo_data_init_fill, but append. Read the
   help of lcrzo_data_append_data for an explanation of the
   parameter used for appending (dataoutcurrentsize)*/
int lcrzo_data_append_fill(lcrzo_constdata datain,
                           lcrzo_int32 datainsize,
                           lcrzo_int32 fillingsize,
                           lcrzo_int32 dataoutcurrentsize,
                           lcrzo_int32 dataoutmaxsize,
                           lcrzo_data dataout,
                           lcrzo_int32 *pdataoutsize);
/* idem lcrzo_data_initm_fill, but append */
int lcrzo_data_appendm_fill(lcrzo_constdata datain,
			    lcrzo_int32 datainsize,
			    lcrzo_int32 fillingsize,
			    lcrzo_int32 dataoutcurrentsize,
			    lcrzo_data *pdataout,
			    lcrzo_int32 *pdataoutsize);
/*-------------------------------------------------------------*/
/* Name : lcrzo_data_init_char
   Description :
     Initialize a data array, with character filling
   Input parameter(s) :
     c : character to use for the filling
     fillingsize : size of the filling
     dataoutmaxsize : max size which can be stored in dataout
   Input/output parameter(s) :
   Output parameter(s) :
     dataout : output array.
               This array will be set with a filling of c
     *pdataoutsize : reached size of dataout
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKDATATRUNCATED : dataoutmaxsize reached before
                                 being able to store all the needed
                                 data in dataout
*/
int lcrzo_data_init_char(lcrzo_uint8 c,
			 lcrzo_int32 fillingsize,
			 lcrzo_int32 dataoutmaxsize,
			 lcrzo_data dataout,
			 lcrzo_int32 *pdataoutsize);
/* idem lcrzo_data_init_char, but allocate memory. Read the
   help of lcrzo_data_initm_data for an explanation of the
   parameter used for allocation (pdataout)*/
int lcrzo_data_initm_char(lcrzo_uint8 c,
			  lcrzo_int32 fillingsize,
			  lcrzo_data *pdataout,
			  lcrzo_int32 *pdataoutsize);
/* idem lcrzo_data_init_char, but append. Read the
   help of lcrzo_data_append_data for an explanation of the
   parameter used for appending (dataoutcurrentsize)*/
int lcrzo_data_append_char(lcrzo_uint8 c,
			   lcrzo_int32 fillingsize,
			   lcrzo_int32 dataoutcurrentsize,
			   lcrzo_int32 dataoutmaxsize,
			   lcrzo_data dataout,
			   lcrzo_int32 *pdataoutsize);
/* idem lcrzo_data_initm_char, but append */
int lcrzo_data_appendm_char(lcrzo_uint8 c,
			    lcrzo_int32 fillingsize,
			    lcrzo_int32 dataoutcurrentsize,
			    lcrzo_data *pdataout,
			    lcrzo_int32 *pdataoutsize);
/*-------------------------------------------------------------*/
/* Name : lcrzo_data_init_rand
   Description :
     Initialize a data array, with rand filling
   Input parameter(s) :
     minvalue : minimum value of the rand characters
     maxvalue : maximum value of the rand characters
     fillingsize : size of the filling
     dataoutmaxsize : max size which can be stored in dataout
   Input/output parameter(s) :
   Output parameter(s) :
     dataout : output array.
               This array will be set with a filling of rand
	       characters between minvalue and maxvalue
     *pdataoutsize : reached size of dataout
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKDATATRUNCATED : dataoutmaxsize reached before
                                 being able to store all the needed
                                 data in dataout
*/
int lcrzo_data_init_rand(lcrzo_uint8 minvalue,
			 lcrzo_uint8 maxvalue,
			 lcrzo_int32 fillingsize,
			 lcrzo_int32 dataoutmaxsize,
			 lcrzo_data dataout,
			 lcrzo_int32 *pdataoutsize);
/* idem lcrzo_data_init_rand, but allocate memory. Read the
   help of lcrzo_data_initm_data for an explanation of the
   parameter used for allocation (pdataout)*/
int lcrzo_data_initm_rand(lcrzo_uint8 minvalue,
			  lcrzo_uint8 maxvalue,
			  lcrzo_int32 fillingsize,
			  lcrzo_data *pdataout,
			  lcrzo_int32 *pdataoutsize);
/* idem lcrzo_data_init_rand, but append. Read the
   help of lcrzo_data_append_data for an explanation of the
   parameter used for appending (dataoutcurrentsize)*/
int lcrzo_data_append_rand(lcrzo_uint8 minvalue,
			   lcrzo_uint8 maxvalue,
			   lcrzo_int32 fillingsize,
			   lcrzo_int32 dataoutcurrentsize,
			   lcrzo_int32 dataoutmaxsize,
			   lcrzo_data dataout,
			   lcrzo_int32 *pdataoutsize);
/* idem lcrzo_data_initm_rand, but append */
int lcrzo_data_appendm_rand(lcrzo_uint8 minvalue,
			    lcrzo_uint8 maxvalue,
			    lcrzo_int32 fillingsize,
			    lcrzo_int32 dataoutcurrentsize,
			    lcrzo_data *pdataout,
			    lcrzo_int32 *pdataoutsize);
/*-------------------------------------------------------------*/
/* Name : lcrzo_data_init_int
   Description :
     Initialize a data array, with an integer
   Input parameter(s) :
     integer : integer to store
     format : format (printf) of the integer to store.
              This format must be :
                 "%[0+-.]{0,1}[1-9]{0,2}[l]{0,1}[douxX]"
              For example : "%d", "%3x", "%08lX", etc.
     dataoutmaxsize : max size which can be stored in dataout
   Input/output parameter(s) :
   Output parameter(s) :
     dataout : output array.
               This array will be set with the integer
	       printed with the format 'format'
     *pdataoutsize : reached size of dataout
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKDATATRUNCATED : dataoutmaxsize reached before
                                 being able to store all the needed
                                 data in dataout
*/
int lcrzo_data_init_int(lcrzo_int32 integer,
			lcrzo_conststring format,
			lcrzo_int32 dataoutmaxsize,
			lcrzo_data dataout,
			lcrzo_int32 *pdataoutsize);
/* idem lcrzo_data_init_int, but allocate memory. Read the
   help of lcrzo_data_initm_data for an explanation of the
   parameter used for allocation (pdataout)*/
int lcrzo_data_initm_int(lcrzo_int32 integer,
			 lcrzo_conststring format,
			 lcrzo_data *pdataout,
			 lcrzo_int32 *pdataoutsize);
/* idem lcrzo_data_init_int, but append. Read the
   help of lcrzo_data_append_data for an explanation of the
   parameter used for appending (dataoutcurrentsize)*/
int lcrzo_data_append_int(lcrzo_int32 integer,
			  lcrzo_conststring format,
			  lcrzo_int32 dataoutcurrentsize,
			  lcrzo_int32 dataoutmaxsize,
			  lcrzo_data dataout,
			  lcrzo_int32 *pdataoutsize);
/* idem lcrzo_data_initm_int, but append */
int lcrzo_data_appendm_int(lcrzo_int32 integer,
			   lcrzo_conststring format,
			   lcrzo_int32 dataoutcurrentsize,
			   lcrzo_data *pdataout,
			   lcrzo_int32 *pdataoutsize);
/*-------------------------------------------------------------*/
/* Name : lcrzo_data_init_text
   Description :
     Initialize a data array, with an text string
   Input parameter(s) :
     text : text string to use
     dataoutmaxsize : max size which can be stored in dataout
   Input/output parameter(s) :
   Output parameter(s) :
     dataout : output array.
               This array will be set with the text
     *pdataoutsize : reached size of dataout
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKDATATRUNCATED : dataoutmaxsize reached before
                                 being able to store all the needed
                                 data in dataout
*/
int lcrzo_data_init_text(lcrzo_conststring text,
			 lcrzo_int32 dataoutmaxsize,
			 lcrzo_data dataout,
			 lcrzo_int32 *pdataoutsize);
/* idem lcrzo_data_init_text, but allocate memory. Read the
   help of lcrzo_data_initm_data for an explanation of the
   parameter used for allocation (pdataout)*/
int lcrzo_data_initm_text(lcrzo_conststring text,
			  lcrzo_data *pdataout,
			  lcrzo_int32 *pdataoutsize);
/* idem lcrzo_data_init_text, but append. Read the
   help of lcrzo_data_append_data for an explanation of the
   parameter used for appending (dataoutcurrentsize)*/
int lcrzo_data_append_text(lcrzo_conststring text,
			   lcrzo_int32 dataoutcurrentsize,
			   lcrzo_int32 dataoutmaxsize,
			   lcrzo_data dataout,
			   lcrzo_int32 *pdataoutsize);
/* idem lcrzo_data_initm_text, but append */
int lcrzo_data_appendm_text(lcrzo_conststring text,
			    lcrzo_int32 dataoutcurrentsize,
			    lcrzo_data *pdataout,
			    lcrzo_int32 *pdataoutsize);
/*-------------------------------------------------------------*/
/* Name : lcrzo_data_init_coretext
   Description :
     Initialize a data array, with an text string.
     This text string is cleaned before use : the spaces, tabs,
     and newline at the beginning or the end of the text are removed
   Input parameter(s) :
     text : text string to clean, then to use
     dataoutmaxsize : max size which can be stored in dataout
   Input/output parameter(s) :
   Output parameter(s) :
     dataout : output array.
               This array will be set with the cleaned text
     *pdataoutsize : reached size of dataout
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKDATATRUNCATED : dataoutmaxsize reached before
                                 being able to store all the needed
                                 data in dataout
*/
int lcrzo_data_init_coretext(lcrzo_conststring text,
			     lcrzo_int32 dataoutmaxsize,
			     lcrzo_data dataout,
			     lcrzo_int32 *pdataoutsize);
/* idem lcrzo_data_init_coretext, but allocate memory. Read the
   help of lcrzo_data_initm_data for an explanation of the
   parameter used for allocation (pdataout)*/
int lcrzo_data_initm_coretext(lcrzo_conststring text,
			      lcrzo_data *pdataout,
			      lcrzo_int32 *pdataoutsize);
/* idem lcrzo_data_init_coretext, but append. Read the
   help of lcrzo_data_append_data for an explanation of the
   parameter used for appending (dataoutcurrentsize)*/
int lcrzo_data_append_coretext(lcrzo_conststring text,
			       lcrzo_int32 dataoutcurrentsize,
			       lcrzo_int32 dataoutmaxsize,
			       lcrzo_data dataout,
			       lcrzo_int32 *pdataoutsize);
/* idem lcrzo_data_initm_coretext, but append */
int lcrzo_data_appendm_coretext(lcrzo_conststring text,
				lcrzo_int32 dataoutcurrentsize,
				lcrzo_data *pdataout,
				lcrzo_int32 *pdataoutsize);
/*-------------------------------------------------------------*/
/* Name : lcrzo_data_init_hexa
   Description :
     Initialize a data array, with data presented in hexa form
   Input parameter(s) :
     hexa : string in hexa ("45D2" means two bytes 0x45 0xD2)
     dataoutmaxsize : max size which can be stored in dataout
   Input/output parameter(s) :
   Output parameter(s) :
     dataout : output array.
               This array will be set with the equivalent of
	       the hexa string
     *pdataoutsize : reached size of dataout
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKDATATRUNCATED : dataoutmaxsize reached before
                                 being able to store all the needed
                                 data in dataout
*/
int lcrzo_data_init_hexa(lcrzo_consthexa hexa,
			 lcrzo_int32 dataoutmaxsize,
			 lcrzo_data dataout,
			 lcrzo_int32 *pdataoutsize);
/* idem lcrzo_data_init_hexa, but allocate memory. Read the
   help of lcrzo_data_initm_data for an explanation of the
   parameter used for allocation (pdataout)*/
int lcrzo_data_initm_hexa(lcrzo_consthexa hexa,
			  lcrzo_data *pdataout,
			  lcrzo_int32 *pdataoutsize);
/* idem lcrzo_data_init_hexa, but append. Read the
   help of lcrzo_data_append_data for an explanation of the
   parameter used for appending (dataoutcurrentsize)*/
int lcrzo_data_append_hexa(lcrzo_consthexa hexa,
			   lcrzo_int32 dataoutcurrentsize,
			   lcrzo_int32 dataoutmaxsize,
			   lcrzo_data dataout,
			   lcrzo_int32 *pdataoutsize);
/* idem lcrzo_data_initm_hexa, but append */
int lcrzo_data_appendm_hexa(lcrzo_consthexa hexa,
			    lcrzo_int32 dataoutcurrentsize,
			    lcrzo_data *pdataout,
			    lcrzo_int32 *pdataoutsize);
/*-------------------------------------------------------------*/
/* Name : lcrzo_data_init_mixed
   Description :
     Initialize a data array, with data presented in mixed form
   Input parameter(s) :
     mixed : string in mixed (see frame at the top of the help
             for this module describing what's a mixed string)
     dataoutmaxsize : max size which can be stored in dataout
   Input/output parameter(s) :
   Output parameter(s) :
     dataout : output array.
               This array will be set with the equivalent of
	       the mixed string
     *pdataoutsize : reached size of dataout
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKDATATRUNCATED : dataoutmaxsize reached before
                                 being able to store all the needed
                                 data in dataout
*/
int lcrzo_data_init_mixed(lcrzo_constmixed mixed,
			  lcrzo_int32 dataoutmaxsize,
			  lcrzo_data dataout,
			  lcrzo_int32 *pdataoutsize);
/* idem lcrzo_data_init_mixed, but allocate memory. Read the
   help of lcrzo_data_initm_data for an explanation of the
   parameter used for allocation (pdataout)*/
int lcrzo_data_initm_mixed(lcrzo_constmixed mixed,
			   lcrzo_data *pdataout,
			   lcrzo_int32 *pdataoutsize);
/* idem lcrzo_data_init_mixed, but append. Read the
   help of lcrzo_data_append_data for an explanation of the
   parameter used for appending (dataoutcurrentsize)*/
int lcrzo_data_append_mixed(lcrzo_constmixed mixed,
			    lcrzo_int32 dataoutcurrentsize,
			    lcrzo_int32 dataoutmaxsize,
			    lcrzo_data dataout,
			    lcrzo_int32 *pdataoutsize);
/* idem lcrzo_data_initm_mixed, but append */
int lcrzo_data_appendm_mixed(lcrzo_constmixed mixed,
			     lcrzo_int32 dataoutcurrentsize,
			     lcrzo_data *pdataout,
			     lcrzo_int32 *pdataoutsize);
/*-------------------------------------------------------------*/
/* Name : lcrzo_data_init_base64
   Description :
     Initialize a data array, with data presented in base64 form
   Input parameter(s) :
     base64 : string in base64
     dataoutmaxsize : max size which can be stored in dataout
   Input/output parameter(s) :
   Output parameter(s) :
     dataout : output array.
               This array will be set with the equivalent of
	       the base64 string
     *pdataoutsize : reached size of dataout
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKDATATRUNCATED : dataoutmaxsize reached before
                                 being able to store all the needed
                                 data in dataout
*/
int lcrzo_data_init_base64(lcrzo_constbase64 base64,
			   lcrzo_int32 dataoutmaxsize,
			   lcrzo_data dataout,
			   lcrzo_int32 *pdataoutsize);
/* idem lcrzo_data_init_base64, but allocate memory. Read the
   help of lcrzo_data_initm_data for an explanation of the
   parameter used for allocation (pdataout)*/
int lcrzo_data_initm_base64(lcrzo_constbase64 base64,
			    lcrzo_data *pdataout,
			    lcrzo_int32 *pdataoutsize);
/* idem lcrzo_data_init_base64, but append. Read the
   help of lcrzo_data_append_data for an explanation of the
   parameter used for appending (dataoutcurrentsize)*/
int lcrzo_data_append_base64(lcrzo_constbase64 base64,
			     lcrzo_int32 dataoutcurrentsize,
			     lcrzo_int32 dataoutmaxsize,
			     lcrzo_data dataout,
			     lcrzo_int32 *pdataoutsize);
/* idem lcrzo_data_initm_base64, but append */
int lcrzo_data_appendm_base64(lcrzo_constbase64 base64,
			      lcrzo_int32 dataoutcurrentsize,
			      lcrzo_data *pdataout,
			      lcrzo_int32 *pdataoutsize);
/*-------------------------------------------------------------*/
/* Name : lcrzo_data_initm_text_stdin
   Description :
     Initialize a data array, with an text string entered
     by the user
   Input parameter(s) :
     message : message to print before asking user
     defaultext : text string to use if user enters nothing
   Input/output parameter(s) :
   Output parameter(s) :
     dataout : output array.
               This array will be set with the text
     *pdataoutsize : reached size of dataout
   Normal return values :
     LCRZO_ERR_OK : ok
*/
int lcrzo_data_initm_text_stdin(lcrzo_conststring message,
				lcrzo_conststring defaulttext,
				lcrzo_data *pdataout,
				lcrzo_int32 *pdataoutsize);
/* idem lcrzo_data_initm_text_stdin, but append */
int lcrzo_data_appendm_text_stdin(lcrzo_conststring message,
				  lcrzo_conststring defaulttext,
				  lcrzo_int32 dataoutcurrentsize,
				  lcrzo_data *pdataout,
				  lcrzo_int32 *pdataoutsize);
/*-------------------------------------------------------------*/
/* Name : lcrzo_data_initm_coretext_stdin
   Description :
     Initialize a data array, with an text string entered
     by the user. This text string is cleaned before
     use : the spaces, tabs, and newline at the beginning or
     the end of the text are removed
   Input parameter(s) :
     message : message to print before asking user
     defaulcoretext : text string to use if user enters nothing
   Input/output parameter(s) :
   Output parameter(s) :
     dataout : output array.
               This array will be set with the text
     *pdataoutsize : reached size of dataout
   Normal return values :
     LCRZO_ERR_OK : ok
*/
int lcrzo_data_initm_coretext_stdin(lcrzo_conststring message,
				    lcrzo_conststring defaultcoretext,
				    lcrzo_data *pdataout,
				    lcrzo_int32 *pdataoutsize);
/* idem lcrzo_data_initm_coretext_stdin, but append */
int lcrzo_data_appendm_coretext_stdin(lcrzo_conststring message,
				      lcrzo_conststring defaultcoretext,
				      lcrzo_int32 dataoutcurrentsize,
				      lcrzo_data *pdataout,
				      lcrzo_int32 *pdataoutsize);
/*-------------------------------------------------------------*/
/* Name : lcrzo_data_initm_text_passwd
   Description :
     Initialize a data array, with an text string entered
     by the user. This string is not echoed on the screen.
   Input parameter(s) :
     message : message to print before asking user
     defaultext : text string to use if user enters nothing
   Input/output parameter(s) :
   Output parameter(s) :
     dataout : output array.
               This array will be set with the text
     *pdataoutsize : reached size of dataout
   Normal return values :
     LCRZO_ERR_OK : ok
*/
int lcrzo_data_initm_text_passwd(lcrzo_conststring message,
				 lcrzo_conststring defaulttext,
				 lcrzo_data *pdataout,
				 lcrzo_int32 *pdataoutsize);
/* idem lcrzo_data_initm_text_passwd, but append */
int lcrzo_data_appendm_text_passwd(lcrzo_conststring message,
				   lcrzo_conststring defaulttext,
				   lcrzo_int32 dataoutcurrentsize,
				   lcrzo_data *pdataout,
				   lcrzo_int32 *pdataoutsize);
/*-------------------------------------------------------------*/
/* Name : lcrzo_data_initm_coretext_passwd
   Description :
     Initialize a data array, with an text string entered
     by the user. This text string is cleaned before
     use : the spaces, tabs, and newline at the beginning or
     the end of the text are removed. This text is no echoed
     ont the screen.
   Input parameter(s) :
     message : message to print before asking user
     defaulcoretext : text string to use if user enters nothing
   Input/output parameter(s) :
   Output parameter(s) :
     dataout : output array.
               This array will be set with the text
     *pdataoutsize : reached size of dataout
   Normal return values :
     LCRZO_ERR_OK : ok
*/
int lcrzo_data_initm_coretext_passwd(lcrzo_conststring message,
				     lcrzo_conststring defaultcoretext,
				     lcrzo_data *pdataout,
				     lcrzo_int32 *pdataoutsize);
/* idem lcrzo_data_initm_coretext_passwd, but append */
int lcrzo_data_appendm_coretext_passwd(lcrzo_conststring message,
				       lcrzo_conststring defaultcoretext,
				       lcrzo_int32 dataoutcurrentsize,
				       lcrzo_data *pdataout,
				       lcrzo_int32 *pdataoutsize);
/*-------------------------------------------------------------*/
/* Name : lcrzo_data_initm_hexa_stdin
   Description :
     Initialize a data array, with data presented
     in hexa form, and entered by the user
   Input parameter(s) :
     message : message to print before asking user
     defaulhexa : hexa string to use if user enters nothing
   Input/output parameter(s) :
   Output parameter(s) :
     dataout : output array.
               This array will be set with the equivalent of
               the hexa string
     *pdataoutsize : reached size of dataout
   Normal return values :
     LCRZO_ERR_OK : ok
*/
int lcrzo_data_initm_hexa_stdin(lcrzo_conststring message,
				lcrzo_consthexa defaulthexa,
				lcrzo_data *pdataout,
				lcrzo_int32 *pdataoutsize);
/* idem lcrzo_data_initm_hexa_stdin, but append */
int lcrzo_data_appendm_hexa_stdin(lcrzo_conststring message,
				  lcrzo_consthexa defaulthexa,
				  lcrzo_int32 dataoutcurrentsize,
				  lcrzo_data *pdataout,
				  lcrzo_int32 *pdataoutsize);
/*-------------------------------------------------------------*/
/* Name : lcrzo_data_initm_mixed_stdin
   Description :
     Initialize a data array, with data presented
     in mixed form, and entered by the user (see frame at
     the top of the help for this module describing what's
     a mixed string)
   Input parameter(s) :
     message : message to print before asking user
     defaulmixed : mixed string to use if user enters nothing
   Input/output parameter(s) :
   Output parameter(s) :
     dataout : output array.
               This array will be set with the equivalent of
               the mixed string
     *pdataoutsize : reached size of dataout
   Normal return values :
     LCRZO_ERR_OK : ok
*/
int lcrzo_data_initm_mixed_stdin(lcrzo_conststring message,
				 lcrzo_constmixed defaultmixed,
				 lcrzo_data *pdataout,
				 lcrzo_int32 *pdataoutsize);
/* idem lcrzo_data_initm_mixed_stdin, but append */
int lcrzo_data_appendm_mixed_stdin(lcrzo_conststring message,
				   lcrzo_constmixed defaultmixed,
				   lcrzo_int32 dataoutcurrentsize,
				   lcrzo_data *pdataout,
				   lcrzo_int32 *pdataoutsize);
/*-------------------------------------------------------------*/
/* Name : lcrzo_data_initm_base64_stdin
   Description :
     Initialize a data array, with data presented
     in base64 form, and entered by the user
   Input parameter(s) :
     message : message to print before asking user
     defaulbase64 : base64 string to use if user enters nothing
   Input/output parameter(s) :
   Output parameter(s) :
     dataout : output array.
               This array will be set with the equivalent of
               the base64 string
     *pdataoutsize : reached size of dataout
   Normal return values :
     LCRZO_ERR_OK : ok
*/
int lcrzo_data_initm_base64_stdin(lcrzo_conststring message,
				  lcrzo_constbase64 defaultbase64,
				  lcrzo_data *pdataout,
				  lcrzo_int32 *pdataoutsize);
/* idem lcrzo_data_initm_base64_stdin, but append */
int lcrzo_data_appendm_base64_stdin(lcrzo_conststring message,
				    lcrzo_constbase64 defaultbase64,
				    lcrzo_int32 dataoutcurrentsize,
				    lcrzo_data *pdataout,
				    lcrzo_int32 *pdataoutsize);
/*-------------------------------------------------------------*/
/* a lcrzo_regexp is an array of found positions during a
   regular expression search (do a "man regexp" if you don't
   know what is a "regular expression").
   The element at index 0 define the location of the
   global expression.
   The elements at index 1, 2, etc. define the found string
   between '(' and ')'.
   The elements whose values are 0 define the end of the
   found expression.
   For example, if the data is "houses" and the regular expression
   is "o(.(s))", then :
          +---+---+---+---+---+---+
	  | h | o | u | s | e | s |
	  +---+---+---+---+---+---+
	  1   2   3   4   5   6   7
	 -7  -6  -5  -4  -3  -2  -1
     'regexp[0]' indicates "ous", so :
          regexp[0].startindex_negative == -6
	  regexp[0].startindex_positive == 2
	  regexp[0].endindex_negative == -3
	  regexp[0].endindex_positive == 5
     'regexp[1]' indicates "us", so :
          regexp[0].startindex_negative == -5
	  regexp[0].startindex_positive == 3
	  regexp[0].endindex_negative == -3
	  regexp[0].endindex_positive == 5
     'regexp[2]' indicates "s", so :
          regexp[0].startindex_negative == -4
	  regexp[0].startindex_positive == 4
	  regexp[0].endindex_negative == -3
	  regexp[0].endindex_positive == 5
     all the regexp[i] with i>2 indicates the end, so :
          regexp[0].startindex_negative == 0
	  regexp[0].startindex_positive == 0
	  regexp[0].endindex_negative == 0
	  regexp[0].endindex_positive == 0
*/
/* we cannot have more than 30 parenthesis. This should be
   sufficient in all cases, but you may want to increase it*/
#define LCRZO_REGEXP_MAXPAIRS 30
typedef struct lcrzo_regexp_st
{ lcrzo_int32 startindex_negative;
  lcrzo_int32 startindex_positive;
  lcrzo_int32 endindex_negative;
  lcrzo_int32 endindex_positive;
} lcrzo_regexp[LCRZO_REGEXP_MAXPAIRS+1];
/*-------------------------------------------------------------*/
/* Name : lcrzo_data_search_char
   Description :
     Search a character in a data array
   Input parameter(s) :
     datain : array containing input data
     datainsize : size of this array
     searchcomplement : if 0, we search c
                        else we search 'not c'
     datainstartindex : start index of the range to search
			The meaning of indexes is explained
			at the top of the help for this module,
     datainendindex : end index of the range to search
     c : character to search
   Input/output parameter(s) :
     *pfoundindex_negative : index of the found character
                             (negative, because from the end)
     *pfoundindex_positive : index of the found character
                             (positive, because from the start)
   Output parameter(s) :
   Normal return values :
     LCRZO_ERR_OK : the searched element was found
     LCRZO_ERR_OKSEARCHNOTFOUND : the searched element wasn't found
*/
int lcrzo_data_search_char(lcrzo_constdata datain,
			   lcrzo_int32 datainsize,
			   lcrzo_bool searchcomplement,
			   lcrzo_int32 datainstartindex,
			   lcrzo_int32 datainendindex,
			   lcrzo_uint8 c,
			   lcrzo_int32 *pfoundindex_negative,
			   lcrzo_int32 *pfoundindex_positive);
/* Name : lcrzo_data_search_nchar
   Description :
     Search a set of character in a data array
   Input parameter(s) :
     datain : array containing input data
     datainsize : size of this array
     searchcomplement : if 0, we search the set
                        else we search a character not in the set
     datainstartindex : start index of the range to search
			The meaning of indexes is explained
			at the top of the help for this module,
     datainendindex : end index of the range to search
     searchlist : array containing the set of characters to search
                  For example, use "aRt" to search for 'a', 'R' or 't'
     searchlistsize : size of this array
   Input/output parameter(s) :
     *pfoundindex_negative : index of the found character
                             (negative, because from the end)
     *pfoundindex_positive : index of the found character
                             (positive, because from the start)
   Output parameter(s) :
   Normal return values :
     LCRZO_ERR_OK : the searched element was found
     LCRZO_ERR_OKSEARCHNOTFOUND : the searched element wasn't found
*/
int lcrzo_data_search_nchar(lcrzo_constdata datain,
			    lcrzo_int32 datainsize,
			    lcrzo_bool searchcomplement,
			    lcrzo_int32 datainstartindex,
			    lcrzo_int32 datainendindex,
			    lcrzo_constdata searchlist,
			    lcrzo_int32 searchlistsize,
			    lcrzo_int32 *pfoundindex_negative,
			    lcrzo_int32 *pfoundindex_positive);
/* Name : lcrzo_data_search_data
   Description :
     Search data in a data array
   Input parameter(s) :
     datain : array containing input data
     datainsize : size of this array
     searchcomplement : if 0, we search searcheddata
                        else we search a data different from searcheddata
     datainstartindex : start index of the range to search
			The meaning of indexes is explained
			at the top of the help for this module,
     datainendindex : end index of the range to search
     searcheddata : searched data
     searcheddatasize : size of the searched data
   Input/output parameter(s) :
     *pstartfoundindex_negative : index of the start of the found data
                                  (negative, because from the end)
     *pstartfoundindex_positive : index of the start of the found data
                                  (positive, because from the start)
     *pendfoundindex_negative : index of the end of the found data
     *pendfoundindex_positive : index of the end of the found data
   Output parameter(s) :
   Normal return values :
     LCRZO_ERR_OK : the searched element was found
     LCRZO_ERR_OKSEARCHNOTFOUND : the searched element wasn't found
*/
int lcrzo_data_search_data(lcrzo_constdata datain,
			   lcrzo_int32 datainsize,
			   lcrzo_bool searchcomplement,
			   lcrzo_int32 datainstartindex,
			   lcrzo_int32 datainendindex,
			   lcrzo_constdata searcheddata,
			   lcrzo_int32 searcheddatasize,
			   lcrzo_int32 *pstartfoundindex_negative,
			   lcrzo_int32 *pstartfoundindex_positive,
			   lcrzo_int32 *pendfoundindex_negative,
			   lcrzo_int32 *pendfoundindex_positive);
/* Name : lcrzo_data_search_text
   Description :
     Search a string in a data array
   Input parameter(s) :
     datain : array containing input data
     datainsize : size of this array
     searchcomplement : if 0, we search searcheddata
                        else we search a data different from searcheddata
     datainstartindex : start index of the range to search
			The meaning of indexes is explained
			at the top of the help for this module,
     datainendindex : end index of the range to search
     searchedtext : searched string
   Input/output parameter(s) :
     *pstartfoundindex_negative : index of the start of the found data
                                  (negative, because from the end)
     *pstartfoundindex_positive : index of the start of the found data
                                  (positive, because from the start)
     *pendfoundindex_negative : index of the end of the found data
     *pendfoundindex_positive : index of the end of the found data
   Output parameter(s) :
   Normal return values :
     LCRZO_ERR_OK : the searched element was found
     LCRZO_ERR_OKSEARCHNOTFOUND : the searched element wasn't found
*/
int lcrzo_data_search_text(lcrzo_constdata datain,
			   lcrzo_int32 datainsize,
			   lcrzo_bool searchcomplement,
			   lcrzo_int32 datainstartindex,
			   lcrzo_int32 datainendindex,
			   lcrzo_conststring searchedtext,
			   lcrzo_int32 *pstartfoundindex_negative,
			   lcrzo_int32 *pstartfoundindex_positive,
			   lcrzo_int32 *pendfoundindex_negative,
			   lcrzo_int32 *pendfoundindex_positive);
/* Name : lcrzo_data_search_re
   Description :
     Search a regular expression in a data array
     ("man regexp", if you don't know what's a regular expression)
   Input parameter(s) :
     datain : array containing input data
     datainsize : size of this array
     searchcomplement : if 0, we search searcheddata
                        else we search a data different from searcheddata
     datainstartindex : start index of the range to search
			The meaning of indexes is explained
			at the top of the help for this module,
     datainendindex : end index of the range to search
     regularexpression : searched regular expression.
                         For example : "a.", "f[A-Z]", etc.
   Input/output parameter(s) :
     *pstartfoundindex_negative : index of the start of the found data
                                  (negative, because from the end)
     *pstartfoundindex_positive : index of the start of the found data
                                  (positive, because from the start)
     *pendfoundindex_negative : index of the end of the found data
     *pendfoundindex_positive : index of the end of the found data
   Output parameter(s) :
   Normal return values :
     LCRZO_ERR_OK : the searched element was found
     LCRZO_ERR_OKSEARCHNOTFOUND : the searched element wasn't found
*/
int lcrzo_data_search_re(lcrzo_constdata datain,
			 lcrzo_int32 datainsize,
			 lcrzo_bool searchcomplement,
			 lcrzo_int32 datainstartindex,
			 lcrzo_int32 datainendindex,
			 lcrzo_conststring regularexpression,
			 lcrzo_int32 *pstartfoundindex_negative,
			 lcrzo_int32 *pstartfoundindex_positive,
			 lcrzo_int32 *pendfoundindex_negative,
			 lcrzo_int32 *pendfoundindex_positive);
/* Name : lcrzo_data_search_regexp
   Description :
     Search a regular expression in a data array
     ("man regexp", if you don't know what's a regular expression)
     This function is more complex than "lcrzo_data_search_re"
     because we return the complete lcrzo_regexp array.
   Input parameter(s) :
     datain : array containing input data
     datainsize : size of this array
     searchcomplement : if 0, we search searcheddata
                        else we search a data different from searcheddata
     datainstartindex : start index of the range to search
			The meaning of indexes is explained
			at the top of the help for this module,
     datainendindex : end index of the range to search
     regularexpression : searched regular expression.
                         For example : "a(.)", "f([A-Z])", etc.
   Input/output parameter(s) :
     arrayfoundindex : lcrzo_regexp containing the indexes of
                       the found data
   Output parameter(s) :
   Normal return values :
     LCRZO_ERR_OK : the searched element was found
     LCRZO_ERR_OKSEARCHNOTFOUND : the searched element wasn't found
*/
int lcrzo_data_search_regexp(lcrzo_constdata datain,
			     lcrzo_int32 datainsize,
			     lcrzo_bool searchcomplement,
			     lcrzo_int32 datainstartindex,
			     lcrzo_int32 datainendindex,
			     lcrzo_conststring regularexpression,
			     lcrzo_regexp arrayfoundindex);
/*-------------------------------------------------------------*/
/* Name : lcrzo_data_token_char
   Description :
     This function can find data enclosed between delimiters.
     This function is to be used in a loop.
     The delimiters are characters.
   Input parameter(s) :
     datain : array containing input data
     datainsize : size of this array
     searchcomplement : if 0, the delimiter is c c
                        else the delimiter is not c
     datainstartindex : start index of the range to search
                        The meaning of indexes is explained
                        at the top of the help for this module,
     datainendindex : end index of the range to search
     c : character used as a delimiter
   Input/output parameter(s) :
     *pindexindicator : this is internally used.
                        it must be set to zero for the first call
   Output parameter(s) :
     *pstartfoundindex_negative : index of the start of the found data
                                  (negative, because from the end)
     *pstartfoundindex_positive : index of the start of the found data
                                  (positive, because from the start)
     *pendfoundindex_negative : index of the end of the found data
     *pendfoundindex_positive : index of the end of the found data
   Normal return values :
     LCRZO_ERR_OK : we found data in datain
     LCRZO_ERR_OKDATAEND : datainendindex was reached
   Example :
     p=0;
     while (1)
     { ret=lcrzo_data_token_char("badbebcebe", 10, 0, +1, -1,
                                 'b', &p, NULL, &inf, NULL, &sup);
       if (ret==LCRZO_ERR_OKDATAEND) break;
       else if (ret!=LCRZO_ERR_OK)   return(ret);
       /now, we can use inf and sup/
       ...
     }
     In this example, the loop will work on : "", "ad", "e", "ce", "e"
*/
int lcrzo_data_token_char(lcrzo_constdata datain,
			  lcrzo_int32 datainsize,
			  lcrzo_bool searchcomplement,
			  lcrzo_int32 datainstartindex,
			  lcrzo_int32 datainendindex,
			  lcrzo_uint8 c,
			  lcrzo_int32 *pindexindicator,
			  lcrzo_int32 *pstartfoundindex_negative,
			  lcrzo_int32 *pstartfoundindex_positive,
			  lcrzo_int32 *pendfoundindex_negative,
			  lcrzo_int32 *pendfoundindex_positive);
/* Name : lcrzo_data_token_nchar
   Description :
     This function can find data enclosed between delimiters.
     This function is to be used in a loop.
     The delimiter is a set of characters.
   Input parameter(s) :
     datain : array containing input data
     datainsize : size of this array
     searchcomplement : if 0, the delimiter is c c
                        else the delimiter is not c
     datainstartindex : start index of the range to search
                        The meaning of indexes is explained
                        at the top of the help for this module,
     datainendindex : end index of the range to search
     searchlist : array containing the set of characters used
                  as delimiters
     searchlistsize : size of this array
   Input/output parameter(s) :
     *pindexindicator : this is internally used.
                        it must be set to zero for the first call
   Output parameter(s) :
     *pstartfoundindex_negative : index of the start of the found data
                                  (negative, because from the end)
     *pstartfoundindex_positive : index of the start of the found data
                                  (positive, because from the start)
     *pendfoundindex_negative : index of the end of the found data
     *pendfoundindex_positive : index of the end of the found data
   Normal return values :
     LCRZO_ERR_OK : we found data in datain
     LCRZO_ERR_OKDATAEND : datainendindex was reached
   Example :
     see help for lcrzo_data_token_char
*/
int lcrzo_data_token_nchar(lcrzo_constdata datain,
			   lcrzo_int32 datainsize,
			   lcrzo_bool searchcomplement,
			   lcrzo_int32 datainstartindex,
			   lcrzo_int32 datainendindex,
			   lcrzo_constdata searchlist,
			   lcrzo_int32 searchlistsize,
			   lcrzo_int32 *pindexindicator,
			   lcrzo_int32 *pstartfoundindex_negative,
			   lcrzo_int32 *pstartfoundindex_positive,
			   lcrzo_int32 *pendfoundindex_negative,
			   lcrzo_int32 *pendfoundindex_positive);
/* Name : lcrzo_data_token_data
   Description :
     This function can find data enclosed between delimiters.
     This function is to be used in a loop.
     The delimiter is a data array.
   Input parameter(s) :
     datain : array containing input data
     datainsize : size of this array
     searchcomplement : if 0, the delimiter is c c
                        else the delimiter is not c
     datainstartindex : start index of the range to search
                        The meaning of indexes is explained
                        at the top of the help for this module,
     datainendindex : end index of the range to search
     searcheddata : data used as delimiter
     searcheddatasize : size of searcheddata
   Input/output parameter(s) :
     *pindexindicator : this is internally used.
                        it must be set to zero for the first call
   Output parameter(s) :
     *pstartfoundindex_negative : index of the start of the found data
                                  (negative, because from the end)
     *pstartfoundindex_positive : index of the start of the found data
                                  (positive, because from the start)
     *pendfoundindex_negative : index of the end of the found data
     *pendfoundindex_positive : index of the end of the found data
   Normal return values :
     LCRZO_ERR_OK : we found data in datain
     LCRZO_ERR_OKDATAEND : datainendindex was reached
   Example :
     see help for lcrzo_data_token_char
*/
int lcrzo_data_token_data(lcrzo_constdata datain,
			  lcrzo_int32 datainsize,
			  lcrzo_bool searchcomplement,
			  lcrzo_int32 datainstartindex,
			  lcrzo_int32 datainendindex,
			  lcrzo_constdata searcheddata,
			  lcrzo_int32 searcheddatasize,
			  lcrzo_int32 *pindexindicator,
			  lcrzo_int32 *pstartfoundindex_negative,
			  lcrzo_int32 *pstartfoundindex_positive,
			  lcrzo_int32 *pendfoundindex_negative,
			  lcrzo_int32 *pendfoundindex_positive);
/* Name : lcrzo_data_token_text
   Description :
     This function can find data enclosed between delimiters.
     This function is to be used in a loop.
     The delimiter is a string.
   Input parameter(s) :
     datain : array containing input data
     datainsize : size of this array
     searchcomplement : if 0, the delimiter is c c
                        else the delimiter is not c
     datainstartindex : start index of the range to search
                        The meaning of indexes is explained
                        at the top of the help for this module,
     datainendindex : end index of the range to search
     searchedtext : string used as delimiter
   Input/output parameter(s) :
     *pindexindicator : this is internally used.
                        it must be set to zero for the first call
   Output parameter(s) :
     *pstartfoundindex_negative : index of the start of the found data
                                  (negative, because from the end)
     *pstartfoundindex_positive : index of the start of the found data
                                  (positive, because from the start)
     *pendfoundindex_negative : index of the end of the found data
     *pendfoundindex_positive : index of the end of the found data
   Normal return values :
     LCRZO_ERR_OK : we found data in datain
     LCRZO_ERR_OKDATAEND : datainendindex was reached
   Example :
     see help for lcrzo_data_token_char
*/
int lcrzo_data_token_text(lcrzo_constdata datain,
			  lcrzo_int32 datainsize,
			  lcrzo_bool searchcomplement,
			  lcrzo_int32 datainstartindex,
			  lcrzo_int32 datainendindex,
			  lcrzo_conststring searchedtext,
			  lcrzo_int32 *pindexindicator,
			  lcrzo_int32 *pstartfoundindex_negative,
			  lcrzo_int32 *pstartfoundindex_positive,
			  lcrzo_int32 *pendfoundindex_negative,
			  lcrzo_int32 *pendfoundindex_positive);
/* Name : lcrzo_data_token_re
   Description :
     This function can find data enclosed between delimiters.
     This function is to be used in a loop.
     The delimiter is a regular expression.
   Input parameter(s) :
     datain : array containing input data
     datainsize : size of this array
     searchcomplement : if 0, the delimiter is c c
                        else the delimiter is not c
     datainstartindex : start index of the range to search
                        The meaning of indexes is explained
                        at the top of the help for this module,
     datainendindex : end index of the range to search
     regularexpression : regular expression used as delimiter
   Input/output parameter(s) :
     *pindexindicator : this is internally used.
                        it must be set to zero for the first call
   Output parameter(s) :
     *pstartfoundindex_negative : index of the start of the found data
                                  (negative, because from the end)
     *pstartfoundindex_positive : index of the start of the found data
                                  (positive, because from the start)
     *pendfoundindex_negative : index of the end of the found data
     *pendfoundindex_positive : index of the end of the found data
   Normal return values :
     LCRZO_ERR_OK : we found data in datain
     LCRZO_ERR_OKDATAEND : datainendindex was reached
   Example :
     see help for lcrzo_data_token_char
*/
int lcrzo_data_token_re(lcrzo_constdata datain,
			lcrzo_int32 datainsize,
			lcrzo_bool searchcomplement,
			lcrzo_int32 datainstartindex,
			lcrzo_int32 datainendindex,
			lcrzo_conststring regularexpression,
			lcrzo_int32 *pindexindicator,
			lcrzo_int32 *pstartfoundindex_negative,
			lcrzo_int32 *pstartfoundindex_positive,
			lcrzo_int32 *pendfoundindex_negative,
			lcrzo_int32 *pendfoundindex_positive);
/*-------------------------------------------------------------*/
/* Name : lcrzo_data_replacem_char
   Description :
     Replace a character in a data array.
     The outputdata is allocated.
   Input parameter(s) :
     datain : array containing input data
     datainsize : size of this array
     searchcomplement : if 0, we replace c
                        else we replace 'not c'
     datainstartindex : start index of the range to search
                        The meaning of indexes is explained
                        at the top of the help for this module,
     datainendindex : end index of the range to search
     maxnumberofreplacement : maximum replacement to do
                              a value zero means unlimited
     c_toreplace : character to replace
     data_replacing : data to use for replacement
     data_replacingsize : size of data_replacing
     *pdataout : pointer which will be malloced (so, the
                 memory will have to be freed by the
                 user with 'free(*pdataout)').
                 The allocated memory will be set with datain
     *pdataoutsize : reached size of *pdataout
   Normal return values :
     LCRZO_ERR_OK : ok
*/
int lcrzo_data_replacem_char(lcrzo_constdata datain,
			     lcrzo_int32 datainsize,
			     lcrzo_bool searchcomplement,
			     lcrzo_int32 datainstartindex,
			     lcrzo_int32 datainendindex,
			     lcrzo_int32 maxnumberofreplacement,
			     lcrzo_uint8 c_toreplace,
			     lcrzo_constdata data_replacing,
			     lcrzo_int32 data_replacingsize,
			     lcrzo_data *pdataout,
			     lcrzo_int32 *pdataoutsize);
/* idem, but replace a set of characters */
int lcrzo_data_replacem_nchar(lcrzo_constdata datain,
			      lcrzo_int32 datainsize,
			      lcrzo_bool searchcomplement,
			      lcrzo_int32 datainstartindex,
			      lcrzo_int32 datainendindex,
			      lcrzo_int32 maxnumberofreplacement,
			      lcrzo_constdata searchlist,
			      lcrzo_int32 searchlistsize,
			      lcrzo_constdata data_replacing,
			      lcrzo_int32 data_replacingsize,
			      lcrzo_data *pdataout,
			      lcrzo_int32 *pdataoutsize);
/* idem, but replace data */
int lcrzo_data_replacem_data(lcrzo_constdata datain,
			     lcrzo_int32 datainsize,
			     lcrzo_bool searchcomplement,
			     lcrzo_int32 datainstartindex,
			     lcrzo_int32 datainendindex,
			     lcrzo_int32 maxnumberofreplacement,
			     lcrzo_constdata searcheddata,
			     lcrzo_int32 searcheddatasize,
			     lcrzo_constdata data_replacing,
			     lcrzo_int32 data_replacingsize,
			     lcrzo_data *pdataout,
			     lcrzo_int32 *pdataoutsize);
/* idem, but replace a string */
int lcrzo_data_replacem_text(lcrzo_constdata datain,
			     lcrzo_int32 datainsize,
			     lcrzo_bool searchcomplement,
			     lcrzo_int32 datainstartindex,
			     lcrzo_int32 datainendindex,
			     lcrzo_int32 maxnumberofreplacement,
			     lcrzo_conststring searchedtext,
			     lcrzo_constdata data_replacing,
			     lcrzo_int32 data_replacingsize,
			     lcrzo_data *pdataout,
			     lcrzo_int32 *pdataoutsize);
/* idem, but replace data matched by a regular expression */
int lcrzo_data_replacem_re(lcrzo_constdata datain,
			   lcrzo_int32 datainsize,
			   lcrzo_bool searchcomplement,
			   lcrzo_int32 datainstartindex,
			   lcrzo_int32 datainendindex,
			   lcrzo_int32 maxnumberofreplacement,
			   lcrzo_conststring regularexpression,
			   lcrzo_constdata data_replacing,
			   lcrzo_int32 data_replacingsize,
			   lcrzo_data *pdataout,
			   lcrzo_int32 *pdataoutsize);
/*La 'chainederemplacement' peut contenir $1 a $9 pour indiquer
  les parametres matches dans l'expression ("$$" correspond au
  vrai caractere '$').
  Par exemple :
   expression="a(.)b",    chainederemplacement="A$1$1"
   expression="a(.)(b.)", chainederemplacement="A$2$1"
*/
int lcrzo_data_replacem_regexp(lcrzo_constdata datain,
			       lcrzo_int32 datainsize,
			       lcrzo_bool searchcomplement,
			       lcrzo_int32 datainstartindex,
			       lcrzo_int32 datainendindex,
			       lcrzo_int32 maxnumberofreplacement,
			       lcrzo_conststring regularexpression,
			       lcrzo_constdata data_replacing,
			       lcrzo_int32 data_replacingsize,
			       lcrzo_data *pdataout,
			       lcrzo_int32 *pdataoutsize);
/*-------------------------------------------------------------*/
/* Name : lcrzo_hexa_initm_data
   Description :
     Convert data to a string in hexa.
     This string is allocated.
   Input parameter(s) :
     datain : array containing input data
     datainsize : size of this array
   Input/output parameter(s) :
   Output parameter(s) :
     *phexaout : output string.
                 The memory will have to be freed by the
                 user with 'free(*phexaout)'
   Normal return values :
     LCRZO_ERR_OK : ok
*/
int lcrzo_hexa_initm_data(lcrzo_constdata datain,
			  lcrzo_int32 datainsize,
			  lcrzo_hexa *phexaout);
/* Name : lcrzo_mixed_initm_data
   Description :
     Convert data to a string in mixed.
     This string is allocated.
   Input parameter(s) :
     datain : array containing input data
     datainsize : size of this array
   Input/output parameter(s) :
   Output parameter(s) :
     *pmixedout : output string.
                 The memory will have to be freed by the
                 user with 'free(*pmixedout)'
   Normal return values :
     LCRZO_ERR_OK : ok
*/
int lcrzo_mixed_initm_data(lcrzo_constdata datain,
			   lcrzo_int32 datainsize,
			   lcrzo_mixed *pmixedout);
/* Name : lcrzo_base64_initm_data
   Description :
     Convert data to a string in base64.
     This string is allocated.
   Input parameter(s) :
     datain : array containing input data
     datainsize : size of this array
   Input/output parameter(s) :
   Output parameter(s) :
     *pbase64out : output string.
                 The memory will have to be freed by the
                 user with 'free(*pbase64out)'
   Normal return values :
     LCRZO_ERR_OK : ok
*/
int lcrzo_base64_initm_data(lcrzo_constdata datain,
			    lcrzo_int32 datainsize,
			    lcrzo_base64 *pbase64out);
/*-------------------------------------------------------------*/
/* Name : lcrzo_data_checksum
   Description :
     Compute the checksum of a data array
   Input parameter(s) :
     datain : array containing input data
     datainsize : size of this array
   Input/output parameter(s) :
   Output parameter(s) :
     *pchecksum : checksum of datain.
                  Note : this checksum is in host byte order
   Normal return values :
     LCRZO_ERR_OK : ok
*/
int lcrzo_data_checksum(lcrzo_constdata data,
			lcrzo_int32 datasize,
			lcrzo_uint16 *pchecksum);

SEE ALSO
lcrzo(3), lcrzo_types(3), lcrzo_data(3), lcrzo_string(3), lcrzo_time(3), lcrzo_file(3), lcrzo_address(3), lcrzo_device(3), lcrzo_list(3), lcrzo_process(3), lcrzo_ipc(3), lcrzo_header(3), lcrzo_ipopt(3), lcrzo_tcpopt(3), lcrzo_packet(3), lcrzo_icmp(3), lcrzo_print(3), lcrzo_record(3), lcrzo_conf(3), lcrzo_spoof(3), lcrzo_sniff(3), lcrzo_sock(3), lcrzo_wait(3), lcrzo_global(3), lcrzo_error(3) lcrzo_misc(3), lcrzo_obso(3),