Back to home page

Enduro/X

 
 

    


0001 BTYPCVT(3)
0002 ==========
0003 :doctype: manpage
0004 
0005 
0006 NAME
0007 ----
0008 Btypcvt - Convert user data betwen UBF types
0009 
0010 
0011 SYNOPSIS
0012 --------
0013 
0014 #include <ubf.h>
0015 
0016 char * Btypcvt (BFLDLEN *'to_len', int 'to_type', char *'from_buf', int 'from_type', BFLDLEN 'from_len');
0017 
0018 
0019 Link with '-lubf -lnstd -lm -lpthread'
0020 
0021 DESCRIPTION
0022 -----------
0023 Convert the data from 'from_buf'/'from_type'/'from_len' triplet to type in 'to_type'. 
0024 The length is returned in 'to_len'. Length is mandatory for *BFLD_CARRAY* types, 
0025 for others they can be NULL. Function returns the pointer to data block, 
0026 which is malloced by this function.
0027 
0028 The memory allocated by this function user shall free with standard *free()* system call.
0029 
0030 Function operations on field types *BFLD_UBF* and *BFLD_VIEW* 
0031 are not supported. This includes type of 'bfldid' or 'usrtype' having any 
0032 unsupported field types for this function.
0033 
0034 RETURN VALUE
0035 ------------
0036 On success, *Btypcvt()* return pointer to allocated memory with 
0037 converted data; on error, NULL is returned, with *Berror* set to indicate the error.
0038 
0039 ERRORS
0040 ------
0041 Note that *Bstrerror()* returns generic error message plus custom 
0042 message with debug info from last function call.
0043 
0044 *BTYPERR* Invalid from/to type specified.
0045 
0046 *BEINVAL* 'from_buf' is NULL.
0047 
0048 *BMALLOC* Failed to allocate type conversion buffer.
0049 
0050 *BEBADOP* Operation not supported (e.g. work with *BFLD_UBF* 
0051 or *BFLD_VIEW* type fields).
0052 
0053 EXAMPLE
0054 -------
0055 See *ubftest/test_genbuf.c* for sample code.
0056 
0057 BUGS
0058 ----
0059 Report bugs to support@mavimax.com
0060 
0061 SEE ALSO
0062 --------
0063 *CBget(3)* *CBchg(3)*
0064 
0065 COPYING
0066 -------
0067 (C) Mavimax, Ltd
0068