/usr/include/dx/extract.h is in libdx4-dev 1:4.4.4-9+b1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | /***********************************************************************/
/* Open Visualization Data Explorer */
/* (C) Copyright IBM Corp. 1989,1999 */
/* ALL RIGHTS RESERVED */
/* This code licensed under the */
/* "IBM PUBLIC LICENSE - Open Visualization Data Explorer" */
/***********************************************************************/
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
#ifndef _DXI_EXTRACT_H_
#define _DXI_EXTRACT_H_
/* TeX starts here. Do not remove this comment. */
/*
\section{Module parameters}
This section describes routines that aid in the parsing of parameters
to modules. Inputs to modules that are simple items such as integers,
floats and character strings are packaged as array objects. The
following routines simplify the extraction of such values. If the
object doesn't match (even if promoted as described below), the
routines return null but don't set the error code. Otherwise they
return the original object and fill in the pointer to the item.
If a float is expected, a short, int or long can be promoted to float.
If an integer is expected, a short can be promoted. If a float vector is
expected, an integer vector can be promoted. If a string is expected,
either a string object or a array of characters is accepted.
*/
Object DXExtractInteger(Object o, int *ip);
/**
\index{DXExtractInteger}
Checks that {\tt o} is an array with a type that can be converted to
an integer and returns the integer value in {\tt *ip}. Returns {\tt o}
on success, otherwise returns null but does not set the error code.
**/
Object DXExtractFloat(Object o, float *fp);
/**
\index{DXExtractFloat}
Checks that {\tt o} is an array with a type that can be converted to
an float and returns the float value in {\tt *fp}. Retruns {\tt o}
on success, otherwise returns null but does not set the error code.
**/
Object DXExtractString(Object o, char **cp);
/**
\index{DXExtractString}
Checks that {\tt o} is an array of characters or a string object, and
returns in {\tt **cp} a pointer to the string. Returns {\tt o} on
success, otherwise returns null but does not set the error code.
**/
Object DXExtractNthString(Object o, int n, char **cp);
/**
\index{DXExtractNthString}
Checks that {\tt o} is an array of null separated and terminated
strings or a string object. If it is, it returns a pointer to the
character that begins the {\tt n}th string. Strings are indexed from
0. Returns {\tt o} on success, otherwise returns null but does not
set the error code.
**/
Object DXQueryParameter(Object o, Type t, int dim, int *count);
/**
\index{DXQueryParameter}
Checks that {\tt o} is an array with a type that can be converted to
to type {\tt t}. Checks that the array has dimensionality {\tt dim}.
Dimensionality of 0 or 1 both match rank 0 or rank 1 with shape 1,
i.e. scalars or vectors with one element. Dimensionality greater than
{\tt dim} matches rank 1 with shape {\tt dim}, in vectors of dimensionality
{\tt dim}. Returns in {\tt *n} the number of items in the array.
Returns {\tt o} on success, otherwise returns null but does not set
the error code.
**/
Object DXExtractParameter(Object o, Type t, int dim, int count, Pointer p);
/**
\index{DXExtractParameter}
Checks the type and dimensionality of {\tt o} as for {\tt
DXQueryParameter()}. The array must have exactly {\tt n} items.
Returns the items converted to type {\tt t} in the buffer pointed to
by {\tt p}, which must be large enough to contain them. Returns {\tt
o} on success, otherwise returns null but does not set the error code.
**/
/*
\paragraph{Example.}
If a routine expects either a character string or an integer, the
following code would determine the case and return the value.
\begin{program}
Object o = input_object_to_check;
char **cp;
int i;
if (DXExtractInteger(o, &i))
x = i;
else if (DXExtractString(o, cp))
strcpy(buffer, *cp);
else
printf("bad input\n");
\end{program}
*/
Error DXQueryArrayConvert(Array a, Type t, Category c, int rank, ...);
Error DXQueryArrayConvertV(Array a, Type t, Category c, int rank, int *shape);
/** can the data in Array a be converted into the requested type, category,
rank and shape? returns OK if yes, sets an error code and returns
ERROR if not **/
Error DXQueryArrayCommon(Type *t, Category *c, int *rank, int *shape,
int n, Array a, ...);
Error DXQueryArrayCommonV(Type *t, Category *c, int *rank, int *shape,
int n, Array *alist);
/** do a list of arrays have a common data format which is legal for all types,
categories, ranks and shapes to be converted into? if so, returns the common
format. if not, sets an error code and returns ERROR **/
Array DXArrayConvert(Array a, Type t, Category c, int rank, ... );
Array DXArrayConvertV(Array a, Type t, Category c, int rank, int *shape);
/** if the data from Array A can be converted into the requested type,
category, rank and shape, returns a new array of that form containing the
converted data. sets an error code and returns ERROR if the data can't be
converted **/
#endif /* _DXI_EXTRACT_H_ */
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
|