gd_native_type(3)
π gd_native_type β the getdata manual, bestie edition π
okay so this is gd_native_type(3), a page from the GETDATA manual, and I'm gonna walk you through it like we're texting at 2am. it's literally just "what type of data is this field, natively?" and honestly? iconic. let's go. π¦
β¨ NAME β¨
gd_native_type β returns the native data type of a field in a Dirfile. no cap, that's the whole job. π
πΈ SYNOPSIS πΈ
#include <getdata.h>
gd_type_t gd_native_type(DIRFILE *dirfile, const char *field_code);
π DESCRIPTION π
The gd_native_type() function queries a dirfile(5) database β the one you point at with dirfile β and figures out the native type of the data specified by field_code. and yes bestie, field_code may contain a representation suffix. we love a suffix. π
The dirfile argument must point to a valid DIRFILE object, one that was previously created by a call to gd_open(3). don't be out here passing random garbage, it's giving invalid-dirfile energy. π
So here's the tea β the native data type of a field depends on its entry type, calculated like this:
BIT,INDEXβGD_UINT64CONST,CARRAYβ the data type of the fieldDIVIDE,MULTIPLYβ if either input field is complex valued:GD_COMPLEX128, otherwise:GD_FLOAT64INDIRβ the data type of the inputCARRAYLINCOM,POLYNOMβ if any of the scalar parameters is complex valued, or if the native data type of any of the input fields is complex valued:GD_COMPLEX128, otherwise:GD_FLOAT64LINTERPβ if the look-up table is complex valued:GD_COMPLEX128, otherwise:GD_FLOAT64MPLEX,WINDOWβ the native data type of the data fieldPHASEβ the native data type of the input fieldRAWβ the data type of the raw data on diskRECIPβ if the dividend or the native data type of the input field is complex valued:GD_COMPLEX128, otherwise:GD_FLOAT64SARRAY,SINDIR,STRINGβGD_STRINGSBITβGD_INT64
And one more thing, super important: if the field_code you handed over contains a representation suffix, and the native data type of the field is complex valued, then the native type it returns will be the corresponding real valued type. slay. β¨
π RETURN VALUE π
If it works out, gd_native_type() returns the native data type of the field code you specified. and that's gonna equal one of these symbols, periodt:
GD_UINT8, GD_INT8, GD_UINT16, GD_INT16, GD_UINT32, GD_INT32,
GD_FLOAT32, GD_FLOAT64, GD_COMPLEX64, GD_COMPLEX128, GD_STRING.
The meanings of these symbols are explained in the gd_getdata(3) manual page. go read it, iykyk. π
On error, this function returnsGD_UNKNOWNand stores a negative-valued error code in theDIRFILEobject, which you can retrieve with a subsequent call togd_error(3). not the vibe we wanted but okay.
Possible error codes, bestie, brace yourself:
GD_E_ALLOCβ The library was unable to allocate memory. πGD_E_BAD_CODEβ The field specified byfield_code, or one of the fields it uses as input, was not found in the database.GD_E_BAD_DIRFILEβ The supplied dirfile was invalid.GD_E_DIMENSIONβ A scalar field was found where a vector field was expected.GD_E_IOβ An error occurred while trying to read aLINTERPtable from disk.GD_E_LUTβ ALINTERPtable was malformed.GD_E_RECURSE_LEVELβ Too many levels of recursion were encountered while trying to resolvefield_code. This usually indicates a circular dependency in field specification in the dirfile. (we've all been in a circular dependency, it's fine, it's a phase.) π
A descriptive error string for the error may be obtained by calling gd_error_string(3). π«Ά
π¦ HISTORY π¦
- The
get_native_type()function appeared in GetData-0.6.0. The return type forSTRINGfields wasGD_NULL. - In GetData-0.7.0, this function was renamed to
gd_native_type(). - Before GetData-0.10.0, the return type for
STRINGfields wasGD_NULL.
a whole glow-up arc, honestly. π
π SEE ALSO π
gd_error(3), gd_error_string(3) gd_getdata(3), gd_open(3), dirfile(5)
Version 0.10.0 Β· 25 January 2017
and that's the whole page bestie, mwah π
β¨ ily, go read your dirfiles, and remember: GD_UNKNOWN is a mood but not a lifestyle. ππ¦
π¦ where this page comes from
- debian bookworm: libgetdata-doc 0.11.0-6
- debian trixie: libgetdata-doc 0.11.0-15
- fedora 43: getdata-devel 0.11.0-13.fc43 Β· GPL-2.0-or-later
- fedora 43: getdata-devel 0.11.0-13.fc43 Β· GPL-2.0-or-later
- fedora 44: getdata-devel 0.11.0-14.fc44 Β· GPL-2.0-or-later
- fedora 44: getdata-devel 0.11.0-14.fc44 Β· GPL-2.0-or-later
- nixos 26.05: getdata 0.11.0
- nixpkgs unstable: getdata 0.11.0
- ubuntu jammy: libgetdata-doc 0.11.0-3ubuntu1
- ubuntu noble: libgetdata-doc 0.11.0-13
- ubuntu questing: libgetdata-doc 0.11.0-15
- ubuntu resolute: libgetdata-doc 0.11.0-17build1
- ubuntu stonking: libgetdata-doc 0.11.0-17build2
- Copyright (C) 2016 D. V. Wiebe
- Copyright (C) 2009, 2010, 2011, 2012, 2014, 2016 D.V. Wiebe
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms