0001 BVOCCUR(3)
0002 ==========
0003 :doctype: manpage
0004
0005
0006 NAME
0007 ----
0008 Bvoccur - Return number of view field array occurrences
0009
0010
0011 SYNOPSIS
0012 --------
0013
0014 #include <ubf.h>
0015
0016 BFLDOCC Bvoccur(char *'cstruct', char *'view', char *'cname',
0017 BFLDOCC *'maxocc', BFLDOCC *'realocc', long *'dim_size', int *'fldtype');
0018
0019 Link with '-lubf -lnstd -lm -lpthread'
0020
0021 DESCRIPTION
0022 -----------
0023 Return the occurrences set in buffer. This will either return 'C' (C_<field>)
0024 count field value, or will return max array size. 'cstruct' is view structure
0025 instance (object). 'view' is view name of which 'cstruct' is instance of. 'maxocc'
0026 is number of maximum possible occurrences for view field (this is basically number
0027 defined in 'COUNT' column in view file). 'maxocc' is optional and can be NULL.
0028 'realocc' is number of filled occurrences in array tested from the C_<field>
0029 indicator position or from the end of the array. The 'realocc' will return
0030 number of occurrences as number to which corresponds first non NULL element
0031 when testing from the end of the array. 'realocc' is optional and can be NULL.
0032 'dim_size' returns the number bytes takes one view field element (or field it self
0033 if count is set to 1 in view file). 'fldtype' is view field type, see 'BLFD_*'
0034 constants.
0035
0036
0037 RETURN VALUE
0038 ------------
0039 On success, *Bvoccur()* returns number of field occurrences (max or set in count);
0040 on error, *-1* is returned, with *Berror* set to indicate the error.
0041
0042
0043 ERRORS
0044 ------
0045 Bstrerror(3) can give more description for error (for last call).
0046
0047 *BEINVAL* 'view' is NULL or empty, 'cname' is NULL or empty, 'cstruct' is null.
0048
0049 *BBADVIEW* 'view' is not found in loaded view files (see *VIEWDIR* and *VIEWFILES*
0050 in ex_env(3).
0051
0052 *BNOCNAME* 'cname' field is not present in view.
0053
0054 EXAMPLE
0055 -------
0056 See *atmitest/test040_typedview/vaccutil.c* for sample code.
0057
0058 BUGS
0059 ----
0060 Report bugs to support@mavimax.com
0061
0062 SEE ALSO
0063 --------
0064 *CBchg(3)* *Bvsetoccur(3)* *viewfile(5)*
0065
0066 COPYING
0067 -------
0068 (C) Mavimax, Ltd