gsdGet0x

Get a scalar value from a GSD file

Description:

This routine returns the value of a scalar GSD item. The item must be specified by the file desciptor, item descriptor array, data array and item number.




<t > <type > Fortran GSD




b char byte byte
l char logical1 logical
w short integer2 word
i int integer4 integer
r float real4 real
d double real8 double
c char[17] character16 char








This routine will convert between numeric types (all but GSD type char). That is to say, the calling routine can request, say, an integer value by calling gsdGet0i, even if the item in the GSD file has a different numeric type, say real. C casting rules are applied, which may differ from Fortran truncation rules. No test for conversion errors is performed.

Invocation

int gsdGet0{blwirdc}( void file_dsc, void item_dsc, char data_ptr, int itemno, <type > value );

Arguments

void file_dsc (Given)
The GSD file descriptor.
void item_dsc (Given)
The array of GSD item descriptors related to the GSD file.
char data_ptr (Given)
The buffer with all the data from the GSD file.
int itemno (Given)
The number of the item in the GSD file.
<type > value (Returned)
The data value. For gsdGet0c value should be declared with length 17 at least. The returned string is null-terminated in value[16].

Returned Value

int gsdGet0 <t >();
Status.
  • [1:] Failure to read the item value.

  • [2:] Numbered item cannot be found.

  • [3:] Item is not scalar.

  • [0:] Otherwise.

Prototype

available via #include "gsd.h"

Copyright

Copyright (C) 1986-1999 Particle Physics and Astronomy Research Council. All Rights Reserved.