1
2
3
4
5
6
7
8
9gd_native_type(3)                   GETDATA                  gd_native_type(3)
10
11
12

NAME

14       gd_native_type — returns the native data type of a field in a Dirfile
15
16

SYNOPSIS

18       #include <getdata.h>
19
20       gd_type_t gd_native_type(DIRFILE *dirfile, const char *field_code);
21
22

DESCRIPTION

24       The  gd_native_type()  function queries a dirfile(5) database specified
25       by dirfile  and  determines  the  native  type  of  data  specified  by
26       field_code, which may contain a representation suffix.
27
28       The  dirfile  argument  must point to a valid DIRFILE object previously
29       created by a call to gd_open(3).
30
31       The native data type of a field of a given entry type is calculated as:
32
33       BIT
34       INDEX   GD_UINT64;
35
36       CONST
37       CARRAY  the data type of the field;
38
39       DIVIDE
40       MULTIPLY
41               if either input field is complex valued: GD_COMPLEX128,  other‐
42               wise: GD_FLOAT64;
43
44       INDIR   the data type of the input CARRAY;
45
46       LINCOM
47       POLYNOM if  any  of  the scalar parameters is complex valued, or if the
48               native data type of any of the input fields is complex  valued:
49               GD_COMPLEX128, otherwise: GD_FLOAT64;
50
51       LINTERP if  the  look-up table is complex valued: GD_COMPLEX128, other‐
52               wise: GD_FLOAT64;
53
54       MPLEX
55       WINDOW  the native data type of the data field;
56
57       PHASE   the native data type of the input field;
58
59       RAW     the data type of the raw data on disk;
60
61       RECIP   if the dividend or the native data type of the input  field  is
62               complex valued: GD_COMPLEX128, otherwise: GD_FLOAT64;
63
64       SARRAY
65       SINDIR
66       STRING  GD_STRING;
67
68       SBIT    GD_INT64.
69
70       Furthermore,  if the supplied field_code contains a representation suf‐
71       fix, and the native data type of the field is complex valued,  the  na‐
72       tive type returned will be the corresponding real valued type.
73
74

RETURN VALUE

76       Upon  successful  completion,  gd_native_type() returns the native data
77       type of the field code specified.  This will equal one of the symbols:
78
79              GD_UINT8, GD_INT8, GD_UINT16, GD_INT16, GD_UINT32, GD_INT32,
80              GD_FLOAT32, GD_FLOAT64, GD_COMPLEX64, GD_COMPLEX128, GD_STRING.
81
82       The meanings of these symbols are explained in the gd_getdata(3) manual
83       page.
84
85       On error, this function returns GD_UNKNOWN and stores a negative-valued
86       error code in the DIRFILE object which may be retrieved by a subsequent
87       call to gd_error(3).  Possible error codes are:
88
89       GD_E_ALLOC
90               The library was unable to allocate memory.
91
92       GD_E_BAD_CODE
93               The field specified by field_code or one of the fields it  uses
94               as input was not found in the database.
95
96       GD_E_BAD_DIRFILE
97               The supplied dirfile was invalid.
98
99       GD_E_DIMENSION
100               A scalar field was found where a vector field was expected.
101
102       GD_E_IO An  error  occurred  while  trying to read a LINTERP table from
103               disk.
104
105       GD_E_LUT
106               A LINTERP table was malformed.
107
108       GD_E_RECURSE_LEVEL
109               Too many levels of recursion were encountered while  trying  to
110               resolve  field_code.   This usually indicates a circular depen‐
111               dency in field specification in the dirfile.
112
113       A descriptive error string for the error may  be  obtained  by  calling
114       gd_error_string(3).
115
116

HISTORY

118       The  get_native_type()  function appeared in GetData-0.6.0.  The return
119       type for STRING fields was GD_NULL.
120
121       In GetData-0.7.0, this function was renamed to gd_native_type().
122
123       Before GetData-0.10.0, the return type for STRING fields was GD_NULL.
124
125

SEE ALSO

127       gd_error(3), gd_error_string(3) gd_getdata(3), gd_open(3), dirfile(5)
128
129
130
131Version 0.10.0                  25 January 2017              gd_native_type(3)
Impressum