logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

gd_nframes — report the size of a Dirfile

Description

       The  gd_nframes()  function  queries a dirfile(5) database specified by dirfile and returns the number of
       frames in the database.  Since different fields may have differing number of frames,  the  Dirfile  Stan‐
       dards  (see  dirfile(5))  dictate that the number of frames in the database is defined to be equal to the
       number of frames in the reference field defined by the /REFERENCE directive (see  dirfile-format(5))  or,
       if no such reference field is defined, by the first raw field specified in the format specification.

       If no vector fields are defined in the database, gd_nframes() returns zero and succeeds.

       The dirfile argument must point to a valid DIRFILE object previously created by a call to gd_open(3).

History

       The get_nframes() function appeared in GetData-0.3.0.

       In GeData-0.7.0, this function was renamed to gd_nframes().

Name

       gd_nframes — report the size of a Dirfile

Return Value

       Upon successful completion, gd_nframes() returns the number of frames in the dirfile, which is never neg‐
       ative.  On error, it returns a negative-valued error code.  Possible error codes are:

       GD_E_ALLOC
               The library was unable to allocate memory.

       GD_E_BAD_DIRFILE
               The supplied dirfile was invalid.

       GD_E_IO An  I/O  error  occurred while determining the number of samples in the data file associated with
               the reference field.

       GD_E_UNKNOWN_ENCODING
               The number of samples available for the reference field could not be determined because  the  en‐
               coding used to store the reference field's data file was not understood.

       GD_E_UNSUPPORTED
               GetData  does  not support determining the number of samples for the encoding of of the data file
               associated with the reference field.

       The error code is also stored in the DIRFILE object and may be retrieved after this function  returns  by
       calling   gd_error(3).    A   descriptive  error  string  for  the  error  may  be  obtained  by  calling
       gd_error_string(3).

See Also

dirfile(5), dirfile-encoding(5), gd_open(3), gd_bof(3), gd_eof(3), gd_error(3), gd_error_string(3)

Version 0.10.0                                  25 December 2016                                   gd_nframes(3)

Synopsis

#include<getdata.h>off_tgd_nframes(DIRFILE*dirfile);

See Also