GetData - Perl bindings to the GetData library for Dirfile
access
use GetData;
my $DIRFILE = GetData::open("./dirfile/", $GetData::RDONLY);
# the following calls are equivalent
my $data = GetData::getdata($DIRFILE, "field", 5, 0, 1,
$GetData::UINT8);
my $data = $DIRFILE->getdata("field", 5, 0, 1, $GetData::UINT8);
This module provides simple, lightweight bindings from Perl to the
C GetData library. It provides a simple mapping between public C functions
and Perl methods. All C functions and constants are replicated in the
GetData package. These methods have the same name as their C counterparts,
excluding the C namespace prefix `gd_' (or `GD_', for C preprocessor
constants).
The dirfile lvalue returned by GetData::open is a simplistic
object. Any GetData method which takes a dirfile as a parameter, may instead
be called as method of the dirfile object itself. (See the synopsis above
for an example.) Dirfile metadata entries (which are C structs of type
gd_entry_t) are represented as simple hashes.
By default, GetData does not export any symbols. All symbols in
the GetData package may be exported with:
use GetData "all";
but this is discouraged, as it will overwrite useful things like
&CORE::open.
Throughout the module, complex data are generally represented as
"Math::Complex" objects, but may be
simplified to ordinary floating point numbers if the imaginary part is
zero.
The module defines a large number of symbolic constants used by
the API which mirror the constants defined in the C API. The
"constants" tag may be used to export just the constants from the
module, if desired. Some genericly useful sets of constants are discussed
below. Other constants are discussed in the method descriptions where they
are used.
GetData knows the following data types:
- $GetData::NULL
- the null data type, which returns no data.
- $GetData::UINT8
- unsigned 8-bit integer
- $GetData::INT8
- signed (two's complement) 8-bit integer
- $GetData::UINT16
- unsigned 16-bit integer
- $GetData::INT16
- signed (two's complement) 16-bit integer
- $GetData::UINT32
- unsigned 32-bit integer
- $GetData::INT32
- signed (two's complement) 32-bit integer
- $GetData::UINT64
- unsigned 64-bit integer
- $GetData::INT64
- signed (two's complement) 64-bit integer
- $GetData::FLOAT32
- IEEE-754 standard 32-bit single precision floating point number
- $GetData::FLOAT64
- IEEE-754 standard 64-bit double precision floating point number
- $GetData::COMPLEX64
- FORTRAN and C99 conformant 64-bit single precision floating point complex
number
- $GetData::COMPLEX128
- FORTRAN and C99 conformant 128-bit double precision floating point complex
number
The following encoding types are known by GetData:
$GetData::BZIP2_ENCODED,
$GetData::FLAC_ENCODED,
$GetData::GZIP_ENCODED,
$GetData::LZMA_ENCODED,
$GetData::SIE_ENCODED,
$GetData::SLIM_ENCODED,
$GetData::TEXT_ENCODED,
$GetData::ZZIP_ENCODED,
$GetData::ZZSLIM_ENCODED,
$GetData::UNENCODED.
Details of these encoding types are given in the
dirfile-format(5) manual page.
The following symbols are used to indicate entry types:
$GetData::NO_ENTRY,
$GetData::BIT_ENTRY,
$GetData::CARRAY_ENTRY,
$GetData::CONST_ENTRY,
$GetData::DIVIDE_ENTRY,
$GetData::INDEX_ENTRY,
$GetData::LINCOM_ENTRY,
$GetData::LINTERP_ENTRY,
$GetData::MPLEX_ENTRY,
$GetData::MULTIPLY_ENTRY,
$GetData::PHASE_ENTRY,
$GetData::POLYNOM_ENTRY,
$GetData::RAW_ENTRY,
$GetData::RECIP_ENTRY,
$GetData::SBIT_ENTRY,
$GetData::STRING_ENTRY,
$GetData::WINDOW_ENTRY
Of these, $GetData::NO_ENTRY is used to
flag invalid entry types and $GetData::INDEX_ENTRY
is used only for the implicit INDEX field. See gd_entry(3) and
dirfile-format(5) for details of the other entry types.
The following symbols are used to indicate WINDOW operators:
$GetData::WINDOP_EQ,
$GetData::WINDOP_GE,
$GetData::WINDOP_GT,
$GetData::WINDOP_LE,
$GetData::WINDOP_LT,
$GetData::WINDOP_NE,
$GetData::WINDOP_CLR,
$GetData::WINDOP_SET.
Functions which take sets of data as input (add_carray,
madd_carray, put_carray, put_carray_slice, and putdata) accept data in a
number of ways. The arguments specifying the data always appear at the end
of the argument list. They are represented as
"{DATA...}" in the method descriptions
below. Input data arguments are parsed as follows.
- 1.
- If the first data argument is undef, then it is ignored and all subsequent
arguments are taken as data:
$dirfile->putdata("field_code", $first_frame, $first_sample,
undef, @data)
or
$dirfile->putdata("field_code", $first_frame, $first_sample,
undef, $data[0], $data[1], $data[2], ...)
- 2.
- Otherwise, if the first data argument is a reference to an array, the
array is taken as data (and any further arguments are ignored):
$dirfile->putdata("field_code", $first_frame, $first_sample,
\@data)
- 3.
- Otherwise, if only two arguments make up the data argument list, and the
second is a reference to an array, the first is taken as a type code
specifing the conversion type, and the second is taken as the data:
$dirfile->putdata("field_code", $first_frame, $first_sample,
$GetData::UINT8, \@data)
- 4.
- Otherwise, if only two arguments make up the data argument list, and the
second is not a reference to an array, the first is, again, taken as a
type code, and the second is assumed to be a packed string containing the
data in a format appropriate for the type code specified:
$packed_data = pack("C", @data)
$dirfile->putdata("field_code", $first_frame, $first_sample,
$GetData::UINT8, $packed_data)
- 5.
- Otherwise, finally, the data argument list elements are simply taken as
data themselves:
$dirfile->putdata("field_code", $first_frame, $first_sample,
@data)
or
$dirfile->putdata("field_code", $first_frame, $first_sample,
$data[0], $data[1], $data[2], ...)
GetData internally converts the Perl data into a format readable
by the C API. In cases 3 and 4 above, the type the data is converted into is
specified explicitly in the call. In the other cases, GetData must guess an
appropriate C type into which to convert the data. It does so by looking at
the first data value:
- if the value is a "Math::Complex"
object, the data are converted to double precision complex data
("COMPLEX128")
- if the value is an integer, the data are converted to a 64-bit signed
integer ("INT64")
- otherwise, the data are converted to a double precision float
("FLOAT64").
Of the above methods, the first is only necessary when the data
array has only two elements, and so would be mistaken for method four if
specified without the initial undef. Furthermore, the fourth method is
typically the most efficient, since the packed data scalar can often be used
as the input to the C API without need for type conversion.
The replacement for the
"gd_entry_t" object of the C API is a
simple hash. The key names are the same as the names of the
"gd_entry_t" members. (See
gd_entry(3) for details).
In entry hashes returned by GetData, only those keys appropriate
for the entry type specified will be present. Entry hashes passed to GetData
from the caller may have other keys than those required by the entry type.
They will be ignored.
The value associated with the
"field_type" key will be one of the
symbols listed under "Entry Types" above. For entry types which
have (potentially) more than one input field (DIVIDE, LINCOM, MPLEX,
MULTIPLY, WINDOW), the value associated with the
"in_fields" key will be a list of strings,
regardless of how many elements it has; other entry types which provide
"in_fields" will be a scalar, even though
the key name is still plural.
Elements of the "scalar" array
which are undef indicate literal parameters (equivalent to
"NULL" in the
"gd_entry_t"'s
"scalar" member). Similarly, undef is used
in "scalar_ind" where the C API uses -1,
to indicate CONST fields, instead of CARRAYs.
- encoding_support
($ENCODING)
- Returns $GetData::RDWR if the library can both
read and write the specified encoding,
$GetData::RDONLY if it can only read, or -1
otherwise. $ENCODING should be one of the encoding
symbols listed above in the "Encoding Types" section.
- open ($DIRFILENAME, $FLAGS,
$SEHANDLER=undef, $EXTRA=undef)
- Create or open a Dirfile database called
$DIRFILENAME. $FLAGS
should be either $GetData::RDONLY (for read-only
access) or $GetData::RDWR (for read-write access),
optionally bitwise or'd with any of the following flags:
$GetData::ARM_ENDIAN,
$GetData::BIG_ENDIAN,
$GetData::CREAT,
$GetData::EXCL,
$GetData::FORCE_ENCODING,
$GetData::FORCE_ENDIAN,
$GetData::IGNORE_DUPS,
$GetData::IGNORE_REFS,
$GetData::LITTLE_ENDIAN,
$GetData::NOT_ARM_ENDIAN,
$GetData::PEDANTIC,
$GetData::PERMISSIVE,
$GetData::PRETTY_PRINT,
$GetData::TRUNC,
$GetData::TRUNCSUB,
$GetData::VERBOSE,
and at most one of the encoding symbols listed above in the
"Encoding Types" section or else
$GetData::AUTO_ENCODED indicating that GetData
should attempt to automatically determine the encoding. The meaning of the
dirfile flags may be found in the gd_cbopen(3) manual page.
$SEHANDLER is a Perl callback function
which will be executed whenever a syntax error is encountered. It may be
undef, if no callback is desired. When called,
$SEHANDLER will be passed two arguments. The first
is a reference to a hash containing the parser data. The second is the
$EXTRA scalar passed to this method.
$SEHANDLER is called in scalar context, and should
return either:
- •
- an integer, one of the symbolic constants:
$GetData::SYNTAX_ABORT,
$GetData::SYNTAX_CONTINUE,
$GetData::SYNTAX_IGNORE,
$GetData::SYNTAX_RESCAN;
(see gd_cbopen(3) for their meaning), or
- a string containing the corrected line, in which case
$GetData::SYNTAX_RESCAN is assumed; or,
- a reference to a list consisting of an integer, one of the
"$GetData::SYNTAX_..." constants listed
above, and then, optionally, a string containing the corrected line.
This function always returns a Dirfile object, even if the call
failed; the caller should use the returned dirfile's error() method to test
for success. On error, the returned object will be flagged as invalid.
- invalid_dirfile
()
- This function always returns a newly created, but invalid, Dirfile object.
Unlike an invalid dirfile created (either accidentally or purposefully)
using open(), the dirfile returned by this function always has a zero
error code. See gd_invalid_dirfile(3).
The following methods all operate on a dirfile object returned by
one of the above methods and can either be called as:
$GetData::method($dirfile, ...)
or else, as
$dirfile->method(...)
without change in operation.
- $dirfile->add_carray ($FIELD_NAME, $DATA_TYPE, $FRAGMENT_INDEX,
{DATA...})
- Adds a new CARRAY field called $FIELD_NAME to the
metadata fragment indexed by $FRAGMENT_INDEX. The
storage type of the CARRAY is given by $DATA_TYPE,
which should be one of the symbols listed above under "Data
Types". The value of the CARRAY is then set to the data given in the
"{DATA...}" argument list, which also
determines its length. See the "Input Data" section above for
details on the allowed forms of
"{DATA...}". See
gd_add_carray(3).
- $dirfile->add_const ($FIELD_NAME, $DATA_TYPE, [$VALUE,
$FRAGMENT_INDEX])
- Adds a new CONST field called $FIELD_NAME to the
metadata fragment indexed by $FRAGMENT_INDEX, or
to the primary format file if omitted. The
$DATA_TYPE argument indicates the storage type,
which should be one of the symbols listed above under "Data
Types". If given, the value of the field is set to
$VALUE, otherwise the field will be initialised to
zero. See gd_add_const(3).
- $dirfile->aliases ($FIELD_CODE)
- In scalar context, returns the number of aliases of
$FIELD_CODE. In list context, returns an array of
alias names for $FIELD_CODE. See
gd_naliases(3) and gd_aliases(3).
- $dirfile->carrays ($RETURN_TYPE)
- Returns the value of all carrays (excluding metafields) in the dirfile
after converting them to the return type
$RETURN_TYPE, which should be one of the symbols
listed under "Data Types" above. If called in scalar context,
returns a reference to an array of packed string data. If called in list
context, returns an array of arrays of unpacked data. See
gd_carrays(3).
- $dirfile->close ()
- Closes the dirfile, writing changes to disk. Upon successful completion,
the dirfile object will be invalidated, prohibiting further operation on
it. A dirfile which is destroyed by garbage collection is discarded (see
"discard" below). This function should be called if metadata
need to be written to disk before the object goes out of scope. See
gd_close(3).
- $dirfile->constants ($RETURN_TYPE)
- Returns the value of all constants (excluding metafields) in the dirfile
after converting them to the return type
$RETURN_TYPE, which should be one of the symbols
listed under "Data Types" above. If called in scalar context,
returns a packed string containing the data. If called in list context,
the data will be unpacked and returned as an array. See
gd_constants(3).
- $dirfile->discard ()
- Closes the dirfile, ignoring changes to metadata, but writing changed data
to disk. Upon successful completion, the dirfile object will be
invalidated, prohibiting further operation on it. This function is called
automatically by the dirfile destructor, and need not be called
explicitly. To save the metadata on close, use "close". See
gd_discard(3).
- $dirfile->entry ($FIELD_CODE)
- If called in scalar context, returns the entry type of
$FIELD_CODE, one of the symbols listed above under
"Entry Types". In array context, returns a hash describing the
indicated field. See gd_entry_type(3) and gd_entry(3).
- $dirfile->match_entries ($REGEX, $FRAGMENT, $TYPE, $FLAGS)
- In scalar context, returns the number of entries matching the supplied
criteria. In list context, returns an array of the names of the entries.
If $REGEX is not undef, it is a regular expression
which is matched against entry names.
NB: The regular expression handling is done in the
underlying C library, not in Perl. As a result, using Perl's regex
grammar in $REGEX usually won't work as desired.
If the C GetData library has Perl-Compatible Regular Expression (PCRE)
support, the $GetData::REGEX_PCRE flag can be
used to select a regular expression grammar which is very similar to
Perl's own.
If $FRAGMENT is not
$GetData::ALL_FRAGMENTS or undef, only entries
defined in the specified fragment are searched. If
$TYPE is one of the entry types listed above
under "Entry Types", only entries of that type are considered.
Alternatley, $TYPE may be one of:
$GetData::ALL_ENTRIES,
$GetData::SCALAR_ENTRIES,
$GetData::VECTOR_ENTRIES.
Setting $TYPE to undef is equivalent to
setting it to $GetData::ALL_ENTRIES. If not undef,
which is treated as zero, $FLAGS should be zero or
more of the following flags:
$GetData::ENTRIES_HIDDEN,
$GetData::ENTRIES_NOALIAS,
$GetData::REGEX_PCRE,
$GetData::REGEX_EXTENDED,
$GetData::REGEX_ICASE,
$GetData::REGEX_CASELESS,
$GetData::REGEX_JAVASCRIPT,
$GetData::REGEX_UNICODE
See gd_match_entries(3) for the meaning of these
symbols.
- $dirfile->entry_list ($PARENT, $TYPE, $FLAGS)
- In scalar context, returns the number of entries matching the supplied
criteria. In list context, returns an array of the names of the entries.
If $PARENT is undef, top-level entries are
considered, otherwise meta entries under $PARENT
are considered. For $TYPE and
$FLAGS, see
"$dirfile-"match_entries> above (the
regex flags listed there are ignored by this function), and also
gd_nentries(3) and gd_entry_list(3).
- $dirfile->error ()
- Returns the error code of the last operation on this dirfile. See
gd_error(3).
- $dirfile->error_string ()
- Returns a string describing the error encountered (if any) by the last
operation on this dirfile. See gd_error_string(3).
- $dirfile->field_list ()
- Equivalent to: "$dirfile->entry_list(undef,
undef, undef)".
- $dirfile->field_list_by_type ($TYPE)
- Equivalent to: "$dirfile->entry_list(undef,
$TYPE, undef)".
- $dirfile->fragment_affixes ($FRAGMENT_INDEX)
- Returns an array containing the prefix (first) and suffix (second) of the
fragment indexed by $FRAGMENT_INDEX. See
gd_fragment_affixes(3).
- $dirfile->fragments ()
- In scalar context, returns the number of metadata fragments in the
dirfile. In list context, returns an array of pathnames to the fragments
on disk, in the order that they're indexed. See gd_nfragments(3)
and gd_fragmentname(3).
- $dirfile->get_carray ($FIELD_CODE, $RETURN_TYPE)
- Returns the value of the CARRAY named $FIELD_CODE
after converting its elements to the return type
$RETURN_TYPE, which should be one of the symbols
listed under "Data Types" above. If
$RETURN_TYPE is
$GetData::NULL, in scalar context this function
returns undef. Otherwise, if called in scalar context, returns a packed
string containing the data. If called in list context, the data will be
unpacked and returned as an array. See gd_get_carray(3).
- $dirfile->get_carray_slice ($FIELD_CODE, $START, $LEN,
$RETURN_TYPE)
- Returns the value of a portion of the CARRAY named
$FIELD_CODE after converting its elements to the
return type $RETURN_TYPE, which should be one of
the symbols listed under "Data Types" above. The first element
returned is given by $START, and the number of
elements by $LEN. If
$RETURN_TYPE is
$GetData::NULL, in scalar context this function
returns undef. Otherwise, if called in scalar context, returns a packed
string containing the data. If called in list context, the data will be
unpacked and returned as an array. Less data than requested may be
returned, if insufficient data exist. See
gd_get_carray_slice(3).
- $dirfile->get_constant ($FIELD_CODE, $RETURN_TYPE)
- Returns the value of the CONST named $FIELD_CODE
after converting it to the return type
$RETURN_TYPE, which should be one of the symbols
listed under "Data Types" above. If
$RETURN_TYPE is
$GetData::NULL, returns undef on success. See
gd_get_constant(3).
- $dirfile->getdata ($FIELD_CODE, $FIRST_FRAME, $FIRST_SAMP, $NUM_FRAMES,
$NUM_SAMP, $RETURN_TYPE)
- Returns data from the field specified by
$FIELD_CODE after converting them to the return
type $RETURN_TYPE, which should be one of the
symbols listed under "Data Types" above. The first sample
returned is $FIRST_SAMP samples after the start of
$FIRST_FRAME and the amount of data returned is
$NUM_FRAMES frames plus
$NUM_SAMP samples. If
$RETURN_TYPE is
$GetData::NULL, in scalar context this function
returns the number of samples read. Otherwise, if called in scalar
context, it returns a string of packed data. If called in array context,
the data will be unpacked and returned as an array. Complex data are
returned as "Math::Complex" objects. See
gd_getdata(3).
- $dirfile->get_string ($FIELD_CODE)
- Returns the value of the STRING named $FIELD_CODE.
See gd_get_string(3).
- $dirfile->include ($FILE, $PARENT_FRAGMENT, $FLAGS, [$PREFIX,
$SUFFIX])
- Includes the fragment metadata file $FILE under
the fragment indexed by $PARENT_FRAGMENT.
$FLAGS should be a bitwise or'd collection of zero
or more of the following flags:
$GetData::BIG_ENDIAN,
$GetData::CREAT,
$GetData::EXCL,
$GetData::FORCE_ENCODING,
$GetData::FORCE_ENDIAN,
$GetData::IGNORE_DUPS,
$GetData::IGNORE_REFS,
$GetData::LITTLE_ENDIAN,
$GetData::PEDANTIC,
$GetData::TRUNC,
and at most one of the encoding symbols listed above in the
"Encoding Types" section or else
$GetData::AUTO_ENCODED indicating that GetData
should attempt to automatically determine the encoding. If
$PREFIX or $SUFFIX are
omitted or undef, the added fragment will contain no such affix. See
gd_include_affix(3).
- $dirfile->madd_carray ($PARENT, $FIELD_NAME, $DATA_TYPE,
{DATA...})
- Adds a new CARRAY metafield called $FIELD_NAME
under the parent field $PARENT. The storage type
of the CARRAY is given by $DATA_TYPE, which should
be one of the symbols listed above under "Data Types". The value
of the CARRAY is then set to the data given in the
"{DATA...}" argument list, which also
determines its length. See the "Input Data" section above for
details on the allowed forms of
"{DATA...}". See
gd_madd_carray(3).
- $dirfile->madd_const ($PARENT, $FIELD_NAME, $DATA_TYPE, [$VALUE])
- Adds a new CONST metafield called $FIELD_NAME
under the field $PARENT. The
$DATA_TYPE argument indicates the storage type,
which should be one of the symbols listed above under "Data
Types". If given, the value of the field is set to
$VALUE, otherwise the field will be initialised to
zero. See gd_madd_const(3).
- $dirfile->mcarrays ($PARENT, $RETURN_TYPE)
- Behaves analogously to carrays() (q.v.), but returns CARRAYs which
are metafields under the parent specified by
$PARENT.
- $dirfile->mconstants ($PARENT, $RETURN_TYPE)
- Behaves analogously to constants() (q.v.), but returns CONSTs which
are metafields under the parent specified by
$PARENT.
- $dirfile->mfield_list ($PARENT)
- Equivalent to "$dirfile->entry_list($PARENT,
undef, undef)".
- $dirfile->mfield_list_by_type ($PARENT, $TYPE)
- Equivalent to "$dirfile->entry_list($PARENT,
$TYPE, undef)".
- $dirfile->mstrings ($PARENT)
- Behaves analogously to strings() (q.v.), but returns STRINGs which
are metafields under the parent specified by
$PARENT.
- $dirfile->mvector_list ($PARENT)
- Equivalent to:
$dirfile->entry_list($PARENT,
$GetData::VECTOR_ENTRIES, undef).
- $dirfile->parser_callback ($SEHANDLER, $EXTRA=undef)
- Sets the registered parser callback function for the dirfile to
$SEHANDLER, or to nothing if undef, and updates
the $EXTRA parameter. See
gd_parser_callback(3).
- $dirfile->put_carray ($FIELD_CODE, {DATA...})
- Sets the value of the CARRAY named $FIELD_CODE to
the values contained in the "{DATA...}"
argument list. See the "Input Data" section above for details on
the allowed forms of "{DATA...}". See
gd_put_carray(3).
- $dirfile->put_carray_slice ($FIELD_CODE, $START, {DATA...})
- Sets a value of the portion of the CARRAY named
$FIELD_CODE beginning with element numbered
$START to the values contained in the
"{DATA...}" argument list. See the
"Input Data" section above for details on the allowed forms of
"{DATA...}". See
gd_put_carray_slice(3).
- $dirfile->put_constant ($FIELD_CODE, $DATUM)
- Sets the value of the CONST field $FIELD_CODE to
the value $DATUM. See
gd_put_constant(3).
- $dirfile->putdata ($FIELD_CODE, $FIRST_FRAME, $FIRST_SAMPLE,
{DATA...})
- Sets a portion of the vector given by $FIELD_CODE
to the values contained in the
"{DATA...}" argument list. The first
sample written is $FIRST_SAMPLE samples after the
start of $FIRST_FRAME. See the "Input
Data" section above for details on the allowed forms of
"{DATA...}". See
gd_putdata(3).
- $dirfile->strings ()
- In scalar context, returns the number of STRING fields. In list context,
returns an array of strings containing the values of all the STRING
fields. See gd_strings(3).
- $dirfile->strtok ($STRING)
- Tokenises $STRING, returning an array of tokens.
See gd_strtok(3).
- $dirfile->vector_list ()
- Equivalent to:
$dirfile->entry_list(undef,
$GetData::VECTOR_ENTRIES, undef).
For the most part, following methods behave identically to their C
API counterpart. See the corresponding C API manual page for details.
Different behaviour, if any, is indicated.
- $dirfile->add ($ENTRY)
- $ENTRY should be a reference to an entry hash; see
"ENTRY HASHES" above.
- $dirfile->add_alias ($FIELD_CODE, $TARGET, [$FRAGMENT_INDEX])
- $FRAGMENT_INDEX = 0 is assumed if not
specified.
- $dirfile->add_bit ($FIELD_CODE, $IN_FIELD, $BITNUM, $NUMBITS,
[$FRAGMENT_INDEX])
- $FRAGMENT_INDEX = 0 is assumed if not
specified.
- $dirfile->add_divide ($FIELD_CODE, $IN_FIELD1, $IN_FIELD2,
[$FRAGMENT_INDEX])
- $FRAGMENT_INDEX = 0 is assumed if not
specified.
- $dirfile->add_lincom ($FIELD_CODE, $N_FIELDS, $IN_FIELDS, $M, $B,
[$FRAGMENT_INDEX])
- $IN_FIELDS, $M, and
$B should be references to arrays of the
appropriate length. The elements of $M and
$B may be of any numerical type, including
"Math::Complex".
$FRAGMENT_INDEX = 0 is assumed if not
specified.
- $dirfile->add_linterp ($FIELD_CODE, $IN_FIELD, $TABLE,
[$FRAGMENT_INDEX])
- $FRAGMENT_INDEX = 0 is assumed if not
specified.
- $dirfile->add_mplex ($FIELD_CODE, $IN_FIELD, $COUNT_FIELD, $COUNT_VAL,
$COUNT_MAX, [$FRAGMENT_INDEX])
- $FRAGMENT_INDEX = 0 is assumed if not
specified.
- $dirfile->add_multiply ($FIELD_CODE, $IN_FIELD1, $IN_FIELD2,
[$FRAGMENT_INDEX])
- $FRAGMENT_INDEX = 0 is assumed if not
specified.
- $dirfile->add_phase ($FIELD_CODE, $IN_FIELD, $SHIFT,
[$FRAGMENT_INDEX])
- $FRAGMENT_INDEX = 0 is assumed if not
specified.
- $dirfile->add_polynom ($FIELD_CODE, $POLY_ORD, $IN_FIELD, $A,
[$FRAGMENT_INDEX])
- $A should be a reference to an array of numbers
(of any numerical type, including
"Math::Complex") of the appropriate
length. $FRAGMENT_INDEX = 0 is assumed if not
specified.
- $dirfile->add_raw ($FIELD_CODE, $DATA_TYPE, $SPF,
[$FRAGMENT_INDEX])
- $DATA_TYPE should be one of the symbols listed
under "Data Types" above.
$FRAGMENT_INDEX = 0 is assumed if not
specified.
- $dirfile->add_recip ($FIELD_CODE, $IN_FIELD, $DIVIDEND,
[$FRAGMENT_INDEX])
- $DIVIDEND may be of any numerical type, including
"Math::Complex".
$FRAGMENT_INDEX = 0 is assumed if not
specified.
- $dirfile->add_sbit ($FIELD_CODE, $IN_FIELD, $BITNUM, $NUMBITS,
[$FRAGMENT_INDEX])
- $FRAGMENT_INDEX = 0 is assumed if not
specified.
- $dirfile->add_spec ($LINE, [$FRAGMENT_INDEX])
- $FRAGMENT_INDEX = 0 is assumed if not
specified.
- $dirfile->add_string ($FIELD_CODE, $VALUE, [$FRAGMENT_INDEX])
- $FRAGMENT_INDEX = 0 is assumed if not
specified.
- $dirfile->add_window ($FIELD_CODE, $IN_FIELD, $CHECK_FIELD, $WINDOP,
$THRESHOLD, [$FRAGMENT_INDEX])
- $WINDOP should be one of the symbols listed under
"WINDOW Operators" above.
$FRAGMENT_INDEX = 0 is assumed if not
specified.
- $dirfile->alias_target ($FIELD_CODE)
-
- $dirfile->alter_affixes ($FRAGMENT_INDEX, $PREFIX, [$SUFFIX])
- If $PREFIX or $SUFFIX are
undef, or if $SUFFIX is omitted, that affix is not
changed.
- $dirfile->alter_bit ($FIELD_CODE, [$IN_FIELD, $BITNUM, $NUMBITS])
- Arguments not given or set to undef are not changed. Additionally, if
"$BITNUM == -1", or
"$NUMBITS == 0", that parameter is not
changed.
- $dirfile->alter_carray ($FIELD_CODE, $CONST_TYPE, $ARRAY_LEN)
- $CONST_TYPE should be one of the symbols listed
under "Data Types" above.
- $dirfile->alter_const ($FIELD_CODE, [$CONST_TYPE])
- If $CONST_TYPE is omitted, or equal to
$GetData::NULL, it is not changed; otherwise, it
should be one of the symbols listed under "Data Types"
above.
- $dirfile->alter_divide ($FIELD_CODE, [$IN_FIELD1, $IN_FIELD2])
- Arguments not given or set to undef are not changed.
- $dirfile->alter_encoding ($ENCODING, [$FRAGMENT_INDEX, $RECODE])
- Both $FRAGMENT_INDEX and
$RECODE default to 0 if not given.
- $dirfile->alter_endianness ($BYTE_SEX, [$FRAGMENT_INDEX, $RECODE])
- Both $FRAGMENT_INDEX and
$RECODE default to 0 if not given.
- $dirfile->alter_entry ($FIELD_CODE, $ENTRY, [$RECODE])
- $ENTRY should be a reference to an entry hash; see
"ENTRY HASHES" above. If not given,
$RECODE defaults to 0.
- $dirfile->alter_frameoffset ($OFFSET, [$FRAGMENT_INDEX, $RECODE])
- Both $FRAGMENT_INDEX and
$RECODE default to 0 if not given.
- $dirfile->alter_lincom ($FIELD_CODE, [$N_FIELDS, $IN_FIELDS, $M,
$B])
- Arguments not given or set to undef are not changed. If given,
$IN_FIELDS, $M, and
$B should be references to arrays of the
appropriate length.
- $dirfile->alter_linterp ($FIELD_CODE, [$IN_FIELD, $TABLE,
$RENAME_TABLE])
- Arguments not given or set to undef are not changed. If not given,
$RENAME_TABLE defaults to 0.
- $dirfile->alter_mplex ($FIELD_CODE, [$IN_FIELD, $COUNT_FIELD,
$COUNT_VAL, $COUNT_MAX])
- Arguments not given or set to undef are not changed. Additionally, if
$COUNT_VAL or $COUNT_MAX
are -1, that parameter is not chaged.
- $dirfile->alter_multiply ($FIELD_CODE, [$IN_FIELD1, $IN_FIELD2])
- Arguments not given or set to undef are not changed.
- $dirfile->alter_phase ($FIELD_CODE, $IN_FIELD, $SHIFT)
- If "$IN_FIELD == undef", it is not
changed.
- $dirfile->alter_polynom ($FIELD_CODE, [$POLY_ORD, $IN_FIELD, $A])
- Arguments not given or set to undef are not changed. Additionally, if
"$POLY_ORD == 0", it is not
changed.
- $dirfile->alter_protection ($PROTECTION_LEVEL, $FRAGMENT_INDEX)
-
- $dirfile->alter_raw ($FIELD_CODE, [$DATA_TYPE, $SPF, $RECODE])
- Arguments not given or set to undef are not changed. Additionally, if
"$DATA_TYPE == $GetData::NULL" or
"$SPF == 0", that parameter is not
changed. If not given, $RECODE defaults to 0.
- $dirfile->alter_recip ($FIELD_CODE, [$IN_FIELD, $DIVIDEND])
- Arguments not given or set to undef are not changed. Additionally, if
"$DIVIDEND == 0", it is not changed.
$DIVIDEND may be of any numerical type, including
"Math::Complex".
- $dirfile->alter_sbit ($FIELD_CODE, [$IN_FIELD, $BITNUM, $NUMBITS])
- Arguments not given or set to undef are not changed. Additionally, if
"$BITNUM == -1", or
"$NUMBITS == 0", that parameter is not
changed.
- $dirfile->alter_spec ($LINE, [$RECODE])
- If not given, $RECODE defaults to 0.
- $dirfile->alter_window ($FIELD_CODE, $IN_FIELD, $CHECK_FIELD, $WINDOP,
$THRESHOLD)
- If $IN_FIELD or
$CHECK_FIELD are undef, or if
$WINDOP ==
$GetData::WINDOP_UNK, that paremeter is not
changed. Otherwise, $WINDOP should be one of the
symbols listed under "WINDOW Operators" above.
- $dirfile->array_len ($FIELD_CODE)
-
- $dirfile->bof ($FIELD_CODE)
-
- $dirfile->delete ($FIELD_CODE, [$FLAGS])
- If not given, $FLAGS defaults to 0. Otherwise, it
should be a bitwise or'd collection of zero or more of the following
flags:
$GetData::DEL_DATA,
$GetData::DEL_DEREF,
$GetData::DEL_FORCE,
$GetData::DEL_META.
- $dirfile->desync ([$FLAGS])
- If omitted, $FLAGS defaults to zero. Otherwise, it
should be zero or more of the following flags bitwise or'd together:
$GetData::DESYNC_PATHCHECK,
$GetData::DESYNC_REOPEN.
- $dirfile->dirfilename ()
-
- $dirfile->dirfile_standards ([$VERSION])
- In addition to a simple integer verison number,
$VERSION may be one of the symbols
$GetData::VERSION_CURRENT,
$GetData::VERSION_EARLIEST,
$GetData::VERSION_LATEST.
If not given, $GetData::VERSION_CURRENT is
assumed.
- $dirfile->encoding ($FRAGMENT_INDEX)
-
- $dirfile->endianness ($FRAGMENT_INDEX)
-
- $dirfile->eof ($FIELD_CODE)
-
- $dirfile->error_count ()
-
- $dirfile->flags ([$SET, $RESET])
- If omitted, $SET and
$RESET default to 0. Otherwise, they should be
zero or more of the following flags, bitwise or'd together:
$GetData::PRETTY_PRINT,
$GetData::VERBOSE.
- $dirfile->flush ($FIELD_CODE)
-
- $dirfile->fragment_index ($FIELD_CODE)
-
- $dirfile->fragmentname ($FRAGMENT_INDEX)
-
- $dirfile->frameoffset ($FRAGMENT_INDEX)
-
- $dirfile->framenum ($FIELD_CODE, $VALUE, [$START, $END])
- $START and $END default to
0 if not given.
- $dirfile->hidden ($FIELD_CODE)
-
- $dirfile->hide ($FIELD_CODE)
-
- $dirfile->madd ($ENTRY, $PARENT)
- $ENTRY should be a reference to an entry hash; see
"ENTRY HASHES" above.
- $dirfile->madd_alias ($PARENT, $FIELD_CODE, $TARGET)
-
- $dirfile->madd_bit ($PARENT, $FIELD_CODE, $IN_FIELD, $BITNUM,
$NUMBITS)
-
- $dirfile->madd_divide ($PARENT, $FIELD_CODE, $IN_FIELD1,
$IN_FIELD2)
-
- $dirfile->madd_lincom ($PARENT, $FIELD_CODE, $N_FIELDS, $IN_FIELDS, $M,
$B)
- $IN_FIELDS, $M, and
$B should be references to arrays of the
appropriate length. The elements of $M and
$B may be of any numerical type, including
"Math::Complex".
- $dirfile->madd_linterp ($PARENT, $FIELD_CODE, $IN_FIELD, $TABLE)
-
- $dirfile->madd_mplex ($PARENT, $FIELD_CODE, $IN_FIELD, $COUNT_FIELD,
$COUNT_VAL, $COUNT_MAX)
-
- $dirfile->madd_multiply ($PARENT, $FIELD_CODE, $IN_FIELD1,
$IN_FIELD2)
-
- $dirfile->madd_phase ($PARENT, $FIELD_CODE, $IN_FIELD, $SHIFT)
-
- $dirfile->madd_polynom ($PARENT, $FIELD_CODE, $POLY_ORD, $IN_FIELD,
$A)
- $A should be a reference to an array of numbers
(of any numerical type, including
"Math::Complex") of the appropriate
length.
- $dirfile->madd_recip ($PARENT, $FIELD_CODE, $IN_FIELD, $DIVIDEND)
- $DIVIDEND may be of any numerical type, including
"Math::Complex".
- $dirfile->madd_sbit ($PARENT, $FIELD_CODE, $IN_FIELD, $BITNUM,
$NUMBITS)
-
- $dirfile->madd_spec ($LINE, $PARENT)
-
- $dirfile->madd_string ($PARENT, $FIELD_CODE, $VALUE)
-
- $dirfile->madd_window ($PARENT, $FIELD_CODE, $IN_FIELD, $CHECK_FIELD,
$WINDOP, $THRESHOLD)
- $WINDOP should be one of the symbols listed under
"WINDOW Operators" above.
- $dirfile->malter_spec ($LINE, $PARENT, [$RECODE])
- If not given, $RECODE defaults to 0.
- $dirfile->metaflush ()
-
- $dirfile->move ($FIELD_CODE, $NEW_FRAGMENT, [$MOVE_DATA])
- If not given, $FLAGS defaults to 0. Otherwise, it
should be a bitwise or'd collection of zero or more of the following
flags:
$GetData::REN_DANGLE,
$GetData::REN_DATA,
$GetData::REN_FORCE,
$GetData::REN_UPDB.
- $dirfile->mplex_lookback ($LOOKBACK)
-
- $dirfile->native_type ($FIELD_CODE)
- The returned value will be one of the symbols listed above under
"Data Types".
- $dirfile->nframes ()
-
- $dirfile->parent_fragment ($FRAGMENT_INDEX)
-
- $dirfile->protection ($FRAGMENT_INDEX)
-
- $dirfile->put_string ($FIELD_CODE, $STRING)
-
- $dirfile->raw_close ($FIELD_CODE)
-
- $dirfile->raw_filename ($FIELD_CODE)
-
- $dirfile->reference ([$FIELD_CODE])
- If $FIELD_CODE is not given or undef, this
function simply reports the current reference field.
- $dirfile->rename ($OLD_CODE, $NEW_NAME, [$FLAGS])
- If not given, $FLAGS defaults to 0. Otherwise, it
should be a bitwise or'd collection of zero or more of the following
flags:
$GetData::REN_DANGLE,
$GetData::REN_DATA,
$GetData::REN_FORCE,
$GetData::REN_UPDB.
- $dirfile->rewrite_fragment ($FRAGMENT_INDEX)
-
- $dirfile->seek ($FIELD_CODE, $FRAME_NUM, $SAMPLE_NUM, [$FLAGS])
- If not given, $FLAGS defaults to
$GetData::SEEK_SET. Otherwise, it should be one
of:
$GetData::SEEK_CUR,
$GetData::SEEK_END,
$GetData::SEEK_SET.
Furthermore, this value should be bitwise or'd with
$GetData::SEEK_WRITE if the next operation on the
field is a write (via "putdata").
- $dirfile->spf ($FIELD_CODE)
-
- $dirfile->sync ($FIELD_CODE)
-
- $dirfile->tell ($FIELD_CODE)
-
- $dirfile->unhide ($FIELD_CODE)
-
- $dirfile->uninclude ($FRAGMENT_INDEX, [$DEL])
- If not given, $DEL defaults to 0.
- $dirfile->validate ($FIELD_CODE)
-
- $dirfile->verbose_prefix ([$PREFIX])
- If $PREFIX is omitted or undef, the prefix is
removed.
Copyright (C) 2012-2015 D. V. Wiebe
GetData is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by the
Free Software Foundation: either version 2.1 of the License, or (at your
option) any later version.
GetData is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. See the GNU Lesser General Public
License for more details.
Math::Complex(3), dirfile(5)