zstructArrayNew

Description: Creates a new array struct for storing and retrieving array data.

Declaration:

zStructArray* zstructArrayNew(const char* pathname);

Parameters:

const char* pathname
        The pathname of the record to store or retrieve.

Returns:

zStructArray*
        An address to the struct for use with zarrayRetrieve() or zarrayStore().

Remarks:

Always call function zstructFree(struct) when finished using. You must not reuse this struct. Make a new one for every dataset.

See Also:

zarrayStore()
zarrayRetrieve()

zStructArray


typedef struct {

   //  Private
   int structType;

   /*  Required  */
   char *pathname;

   int *intArray;
   int numberIntArray;

   float *floatArray;
   int numberFloatArray;

   double *doubleArray;
   int numberDoubleArray;

   /*  User header, used for further description of data/gage */
   /*  Not often used */
   int *userHeader;
   int userHeaderSize;    //  Size user header array; maximum to read
   int userHeaderNumber;  //  number read

   //  Informational only (on return only)
   int dataType;
   long long lastWrittenTime;  //  Seconds since 1970
   long long fileLastWrittenTime;
   char programName[17];

   int numberAttributes;
   char **attributeKeys;
   char **attributes;

   //  Private - knowing which variables were allocated by the new functions,
   //  instead of the calling program
   char allocated[zSTRUCT_length];

} zStructArray;
CODE


zarrayRetrieve

Description: Retrieve a generic array record

Declaration:

int zarrayRetrieve(long long *ifltab, zStructArray *arrayStruct);

Parameters:

long long *ifltab
       The file table of the opened DSS file (from zopen).

zStructArray *arrayStruct

An array struct that will contain either an int array, or a float array or a double array. You can only have one array in a struct array. This struct is created by the following method: zStructArray* zstructArrayNew(const char* pathname); with pathname being an valid existing pathname. When you are finished with the struct, the struct must be freed by a call to void zstructFree(zStructArray* zstructArrayNew).


Returns:

STATUS_OKAY
error code - value contains a description of the error and where it occurred. See zerrorDecode for descriptions.

Remarks:

Always call function zstructFree(struct) when finished using. Never reuse a zStructArray, always free and create a new one.

zarrayStore

Description: Store a generic array record

Declaration:

int zarrayStore(long long *ifltab, zStructArray *arrayStruct);

Parameters:

long long *ifltab
       The file table of the opened DSS file (from zopen).

zStructArray *arrayStruct

An array struct that contains either an int array, or a float array or a double array. You can only have one array in a struct array. This struct is created by the following method: zStructArray* zstructArrayNew(const char* pathname); with pathname being an valid existing pathname. When you are finished with the struct, the struct must be freed by a call to void zstructFree(zStructArray* zstructArrayNew).

Returns:

STATUS_OKAY
error code - value contains a description of the error and where it occurred. See zerrorDecode for descriptions.

Remarks:

Always call function zstructFree(struct) when finished using. Never reuse a zStructArray, always free and create a new one.

zbinaryRetrieveToFile

Description: Retrieve a binary record (BLOB) and save to an external file

Declaration:

int zbinaryRetrieveToFile(long long *ifltab, const char *pathname,
const char *filename);

Parameters:

long long ifltab
       The file table of the opened DSS file (from zopen).

const char *pathname
       The pathname of the dataset to retrieve

const char *filename
       The name of the file to write the dataset to.

Returns:

STATUS_OKAY
error code - value contains a description of the error and where it occurred. See zerrorDecode for descriptions.

Remarks:

After storing the dataset in the external file, you can usually tell Windows to run the application associated with the extension of the file using the command:
       "exec: rundll32 url.dll,FileProtocolHandler fileName"

zbinaryStoreFromFile

Description: Save a binary record (BLOB) from data in an external file

Declaration:

int zbinaryStoreFromFile(long long *ifltab, const char *pathname, const char *filename);

Parameters:

long long ifltab
       The file table of the opened DSS file (from zopen).

const char *pathname
       The pathname of the dataset to store

const char *filename
       The name of the file to read the dataset from.

Returns:

STATUS_OKAY
error code - value contains a description of the error and where it occurred. See zerrorDecode for descriptions.