ADF.h File Reference

Go to the source code of this file.

Defines

#define EXTERN   extern
#define ADF_DATA_TYPE_LENGTH   32
#define ADF_DATE_LENGTH   32
#define ADF_FILENAME_LENGTH   1024
#define ADF_FORMAT_LENGTH   20
#define ADF_LABEL_LENGTH   32
#define ADF_MAXIMUM_LINK_DEPTH   100
#define ADF_MAX_DIMENSIONS   12
#define ADF_MAX_ERROR_STR_LENGTH   80
#define ADF_MAX_LINK_DATA_SIZE   4096
#define ADF_NAME_LENGTH   32
#define ADF_STATUS_LENGTH   32
#define ADF_VERSION_LENGTH   32
#define NO_ERROR   -1
#define NUMBER_LESS_THAN_MINIMUM   1
#define NUMBER_GREATER_THAN_MAXIMUM   2
#define STRING_LENGTH_ZERO   3
#define STRING_LENGTH_TOO_BIG   4
#define STRING_NOT_A_HEX_STRING   5
#define TOO_MANY_ADF_FILES_OPENED   6
#define ADF_FILE_STATUS_NOT_RECOGNIZED   7
#define FILE_OPEN_ERROR   8
#define ADF_FILE_NOT_OPENED   9
#define FILE_INDEX_OUT_OF_RANGE   10
#define BLOCK_OFFSET_OUT_OF_RANGE   11
#define NULL_STRING_POINTER   12
#define FSEEK_ERROR   13
#define FWRITE_ERROR   14
#define FREAD_ERROR   15
#define ADF_MEMORY_TAG_ERROR   16
#define ADF_DISK_TAG_ERROR   17
#define REQUESTED_NEW_FILE_EXISTS   18
#define ADF_FILE_FORMAT_NOT_RECOGNIZED   19
#define FREE_OF_ROOT_NODE   20
#define FREE_OF_FREE_CHUNK_TABLE   21
#define REQUESTED_OLD_FILE_NOT_FOUND   22
#define UNIMPLEMENTED_CODE   23
#define SUB_NODE_TABLE_ENTRIES_BAD   24
#define MEMORY_ALLOCATION_FAILED   25
#define DUPLICATE_CHILD_NAME   26
#define ZERO_DIMENSIONS   27
#define BAD_NUMBER_OF_DIMENSIONS   28
#define CHILD_NOT_OF_GIVEN_PARENT   29
#define DATA_TYPE_TOO_LONG   30
#define INVALID_DATA_TYPE   31
#define NULL_POINTER   32
#define NO_DATA   33
#define ERROR_ZEROING_OUT_MEMORY   34
#define REQUESTED_DATA_TOO_LONG   35
#define END_OUT_OF_DEFINED_RANGE   36
#define BAD_STRIDE_VALUE   37
#define MINIMUM_GT_MAXIMUM   38
#define MACHINE_FORMAT_NOT_RECOGNIZED   39
#define CANNOT_CONVERT_NATIVE_FORMAT   40
#define CONVERSION_FORMATS_EQUAL   41
#define DATA_TYPE_NOT_SUPPORTED   42
#define FILE_CLOSE_ERROR   43
#define NUMERIC_OVERFLOW   44
#define START_OUT_OF_DEFINED_RANGE   45
#define ZERO_LENGTH_VALUE   46
#define BAD_DIMENSION_VALUE   47
#define BAD_ERROR_STATE   48
#define UNEQUAL_MEMORY_AND_DISK_DIMS   49
#define LINKS_TOO_DEEP   50
#define NODE_IS_NOT_A_LINK   51
#define LINK_TARGET_NOT_THERE   52
#define LINKED_TO_FILE_NOT_THERE   53
#define NODE_ID_ZERO   54
#define INCOMPLETE_DATA   55
#define INVALID_NODE_NAME   56
#define INVALID_VERSION   57
#define NODES_NOT_IN_SAME_FILE   58
#define PRISTK_NOT_FOUND   59
#define MACHINE_FILE_INCOMPATABLE   60
#define FFLUSH_ERROR   61
#define NULL_NODEID_POINTER   62
#define MAX_FILE_SIZE_EXCEEDED   63

Functions

EXTERN void ADF_Children_Names (const double PID, const int istart, const int ilen, const int name_length, int *ilen_ret, char *names, int *error_return)
EXTERN void ADF_Children_IDs (const double PID, const int istart, const int ilen, int *ilen_ret, double *IDs, int *error_return)
EXTERN void ADF_Create (const double PID, const char *name, double *ID, int *error_return)
EXTERN void ADF_Database_Close (const double ID, int *error_return)
EXTERN void ADF_Database_Delete (const char *filename, int *error_return)
EXTERN void ADF_Database_Garbage_Collection (const double ID, int *error_return)
EXTERN void ADF_Database_Get_Format (const double Root_ID, char *format, int *error_return)
EXTERN void ADF_Database_Open (const char *filename, const char *status, const char *format, double *root_ID, int *error_return)
EXTERN void ADF_Database_Valid (const char *filename, int *error_return)
EXTERN void ADF_Database_Set_Format (const double Root_ID, const char *format, int *error_return)
EXTERN void ADF_Database_Version (const double Root_ID, char *version, char *creation_date, char *modification_date, int *error_return)
EXTERN void ADF_Delete (const double PID, const double ID, int *error_return)
EXTERN void ADF_Error_Message (const int error_return_input, char *error_string)
EXTERN void ADF_Flush_to_Disk (const double ID, int *error_return)
EXTERN void ADF_Get_Data_Type (const double ID, char *data_type, int *error_return)
EXTERN void ADF_Get_Dimension_Values (const double ID, int dim_vals[], int *error_return)
EXTERN void ADF_Get_Error_State (int *error_state, int *error_return)
EXTERN void ADF_Get_Label (const double ID, char *label, int *error_return)
EXTERN void ADF_Get_Link_Path (const double ID, char *filename, char *link_path, int *error_return)
EXTERN void ADF_Get_Name (const double ID, char *name, int *error_return)
EXTERN void ADF_Get_Node_ID (const double PID, const char *name, double *ID, int *error_return)
EXTERN void ADF_Get_Number_of_Dimensions (const double ID, int *num_dims, int *error_return)
EXTERN void ADF_Get_Root_ID (const double ID, double *Root_ID, int *error_return)
EXTERN void ADF_Is_Link (const double ID, int *link_path_length, int *error_return)
EXTERN void ADF_Library_Version (char *version, int *error_return)
EXTERN void ADF_Link (const double PID, const char *name, const char *file, const char *name_in_file, double *ID, int *error_return)
EXTERN void ADF_Link_Size (const double ID, int *len_file, int *len_name, int *error_return)
EXTERN void ADF_Move_Child (const double PID, const double ID, const double NPID, int *error_return)
EXTERN void ADF_Number_of_Children (const double ID, int *num_children, int *error_return)
EXTERN void ADF_Put_Dimension_Information (const double ID, const char *data_type, const int dims, const int dim_vals[], int *error_return)
EXTERN void ADF_Put_Name (const double PID, const double ID, const char *name, int *error_return)
EXTERN void ADF_Read_All_Data (const double ID, char *data, int *error_return)
EXTERN void ADF_Read_Block_Data (const double ID, const long b_start, const long b_end, char *data, int *error_return)
EXTERN void ADF_Read_Data (const double ID, const int s_start[], const int s_end[], const int s_stride[], const int m_num_dims, const int m_dims[], const int m_start[], const int m_end[], const int m_stride[], char *data, int *error_return)
EXTERN void ADF_Set_Error_State (const int error_state, int *error_return)
EXTERN void ADF_Set_Label (const double ID, const char *label, int *error_return)
EXTERN void ADF_Write_All_Data (const double ID, const char *data, int *error_return)
EXTERN void ADF_Write_Block_Data (const double ID, const long b_start, const long b_end, char *data, int *error_return)
EXTERN void ADF_Write_Data (const double ID, const int s_start[], const int s_end[], const int s_stride[], const int m_num_dims, const int m_dims[], const int m_start[], const int m_end[], const int m_stride[], const char *data, int *error_return)


Define Documentation

#define ADF_DATA_TYPE_LENGTH   32

Definition at line 30 of file ADF.h.

#define ADF_DATE_LENGTH   32

Definition at line 31 of file ADF.h.

#define ADF_DISK_TAG_ERROR   17

Definition at line 308 of file ADF.h.

#define ADF_FILE_FORMAT_NOT_RECOGNIZED   19

Definition at line 310 of file ADF.h.

#define ADF_FILE_NOT_OPENED   9

Definition at line 300 of file ADF.h.

#define ADF_FILE_STATUS_NOT_RECOGNIZED   7

Definition at line 298 of file ADF.h.

#define ADF_FILENAME_LENGTH   1024

Definition at line 32 of file ADF.h.

#define ADF_FORMAT_LENGTH   20

Definition at line 33 of file ADF.h.

#define ADF_LABEL_LENGTH   32

Definition at line 34 of file ADF.h.

#define ADF_MAX_DIMENSIONS   12

Definition at line 36 of file ADF.h.

#define ADF_MAX_ERROR_STR_LENGTH   80

Definition at line 37 of file ADF.h.

#define ADF_MAX_LINK_DATA_SIZE   4096

Definition at line 38 of file ADF.h.

#define ADF_MAXIMUM_LINK_DEPTH   100

Definition at line 35 of file ADF.h.

#define ADF_MEMORY_TAG_ERROR   16

Definition at line 307 of file ADF.h.

#define ADF_NAME_LENGTH   32

Definition at line 39 of file ADF.h.

#define ADF_STATUS_LENGTH   32

Definition at line 40 of file ADF.h.

#define ADF_VERSION_LENGTH   32

Definition at line 41 of file ADF.h.

#define BAD_DIMENSION_VALUE   47

Definition at line 338 of file ADF.h.

#define BAD_ERROR_STATE   48

Definition at line 339 of file ADF.h.

#define BAD_NUMBER_OF_DIMENSIONS   28

Definition at line 319 of file ADF.h.

#define BAD_STRIDE_VALUE   37

Definition at line 328 of file ADF.h.

#define BLOCK_OFFSET_OUT_OF_RANGE   11

Definition at line 302 of file ADF.h.

#define CANNOT_CONVERT_NATIVE_FORMAT   40

Definition at line 331 of file ADF.h.

#define CHILD_NOT_OF_GIVEN_PARENT   29

Definition at line 320 of file ADF.h.

#define CONVERSION_FORMATS_EQUAL   41

Definition at line 332 of file ADF.h.

#define DATA_TYPE_NOT_SUPPORTED   42

Definition at line 333 of file ADF.h.

#define DATA_TYPE_TOO_LONG   30

Definition at line 321 of file ADF.h.

#define DUPLICATE_CHILD_NAME   26

Definition at line 317 of file ADF.h.

#define END_OUT_OF_DEFINED_RANGE   36

Definition at line 327 of file ADF.h.

#define ERROR_ZEROING_OUT_MEMORY   34

Definition at line 325 of file ADF.h.

#define EXTERN   extern

File: ADF.h ---------------------------------------------------------------------- BOEING ---------------------------------------------------------------------- Project: CGNS Author: Tom Dickens 865-6122 tpd6908@yak.ca.boeing.com Date: 3/2/1995 Purpose: Provide prototype declarations for the ADF-Core routines. ---------------------------------------------------------------------- ----------------------------------------------------------------------

Definition at line 21 of file ADF.h.

#define FFLUSH_ERROR   61

Definition at line 352 of file ADF.h.

#define FILE_CLOSE_ERROR   43

Definition at line 334 of file ADF.h.

#define FILE_INDEX_OUT_OF_RANGE   10

Definition at line 301 of file ADF.h.

#define FILE_OPEN_ERROR   8

Definition at line 299 of file ADF.h.

#define FREAD_ERROR   15

Definition at line 306 of file ADF.h.

#define FREE_OF_FREE_CHUNK_TABLE   21

Definition at line 312 of file ADF.h.

#define FREE_OF_ROOT_NODE   20

Definition at line 311 of file ADF.h.

#define FSEEK_ERROR   13

Definition at line 304 of file ADF.h.

#define FWRITE_ERROR   14

Definition at line 305 of file ADF.h.

#define INCOMPLETE_DATA   55

Definition at line 346 of file ADF.h.

#define INVALID_DATA_TYPE   31

Definition at line 322 of file ADF.h.

#define INVALID_NODE_NAME   56

Definition at line 347 of file ADF.h.

#define INVALID_VERSION   57

Definition at line 348 of file ADF.h.

#define LINK_TARGET_NOT_THERE   52

Definition at line 343 of file ADF.h.

#define LINKED_TO_FILE_NOT_THERE   53

Definition at line 344 of file ADF.h.

#define LINKS_TOO_DEEP   50

Definition at line 341 of file ADF.h.

#define MACHINE_FILE_INCOMPATABLE   60

Definition at line 351 of file ADF.h.

#define MACHINE_FORMAT_NOT_RECOGNIZED   39

Definition at line 330 of file ADF.h.

#define MAX_FILE_SIZE_EXCEEDED   63

Definition at line 354 of file ADF.h.

#define MEMORY_ALLOCATION_FAILED   25

Definition at line 316 of file ADF.h.

#define MINIMUM_GT_MAXIMUM   38

Definition at line 329 of file ADF.h.

#define NO_DATA   33

Definition at line 324 of file ADF.h.

#define NO_ERROR   -1

Don't use zero since you can assign zero to a pointer

Definition at line 291 of file ADF.h.

#define NODE_ID_ZERO   54

Definition at line 345 of file ADF.h.

#define NODE_IS_NOT_A_LINK   51

Definition at line 342 of file ADF.h.

#define NODES_NOT_IN_SAME_FILE   58

Definition at line 349 of file ADF.h.

#define NULL_NODEID_POINTER   62

Definition at line 353 of file ADF.h.

#define NULL_POINTER   32

Definition at line 323 of file ADF.h.

#define NULL_STRING_POINTER   12

Definition at line 303 of file ADF.h.

#define NUMBER_GREATER_THAN_MAXIMUM   2

Definition at line 293 of file ADF.h.

#define NUMBER_LESS_THAN_MINIMUM   1

Definition at line 292 of file ADF.h.

#define NUMERIC_OVERFLOW   44

Definition at line 335 of file ADF.h.

#define PRISTK_NOT_FOUND   59

Definition at line 350 of file ADF.h.

#define REQUESTED_DATA_TOO_LONG   35

Definition at line 326 of file ADF.h.

#define REQUESTED_NEW_FILE_EXISTS   18

Definition at line 309 of file ADF.h.

#define REQUESTED_OLD_FILE_NOT_FOUND   22

Definition at line 313 of file ADF.h.

#define START_OUT_OF_DEFINED_RANGE   45

Definition at line 336 of file ADF.h.

#define STRING_LENGTH_TOO_BIG   4

Definition at line 295 of file ADF.h.

#define STRING_LENGTH_ZERO   3

Definition at line 294 of file ADF.h.

#define STRING_NOT_A_HEX_STRING   5

Definition at line 296 of file ADF.h.

#define SUB_NODE_TABLE_ENTRIES_BAD   24

Definition at line 315 of file ADF.h.

#define TOO_MANY_ADF_FILES_OPENED   6

Definition at line 297 of file ADF.h.

#define UNEQUAL_MEMORY_AND_DISK_DIMS   49

Definition at line 340 of file ADF.h.

#define UNIMPLEMENTED_CODE   23

Definition at line 314 of file ADF.h.

#define ZERO_DIMENSIONS   27

Definition at line 318 of file ADF.h.

#define ZERO_LENGTH_VALUE   46

Definition at line 337 of file ADF.h.


Function Documentation

EXTERN void ADF_Children_IDs ( const double  PID,
const int  istart,
const int  ilen,
int *  ilen_ret,
double *  IDs,
int *  error_return 
)

Check for zero children, return if 0

point to the first child wanted

Return the data for the requested children

Read the sub-node entry table

Get the ID from the sub-node table

Increment the disk-pointer and the number of IDs returned

Definition at line 370 of file ADF_interface.c.

EXTERN void ADF_Children_Names ( const double  PID,
const int  istart,
const int  ilen,
const int  name_length,
int *  ilen_ret,
char *  names,
int *  error_return 
)

Check for zero children, return if 0

point to the first child wanted

Return the data for the requested children

Read the sun-node entry table

Convert the child's name from blank-filled into a C string

Increment the disk-pointer and the number of names returned

Definition at line 278 of file ADF_interface.c.

EXTERN void ADF_Create ( const double  PID,
const char *  name,
double *  ID,
int *  error_return 
)

Initialize node header

Skip any leading blanks in the name

Check for uniqueness and legality of the name

Assign the name to the new node

Allocate disk space for the new node

Write out the new node header

OK, new node is on disk. Now, update the list of children for the parent...

Return the ID of the new child

Finally, update modification date

Definition at line 464 of file ADF_interface.c.

EXTERN void ADF_Database_Close ( const double  ID,
int *  error_return 
)

Get the file, block, and offset numbers from the ID

Close the ADF file (which may close other sub-files)

Definition at line 570 of file ADF_interface.c.

EXTERN void ADF_Database_Delete ( const char *  filename,
int *  error_return 
)

Definition at line 600 of file ADF_interface.c.

EXTERN void ADF_Database_Garbage_Collection ( const double  ID,
int *  error_return 
)

Definition at line 624 of file ADF_interface.c.

EXTERN void ADF_Database_Get_Format ( const double  Root_ID,
char *  format,
int *  error_return 
)

Get the file, block, and offset numbers from the ID

Get node_header for the node

Definition at line 647 of file ADF_interface.c.

EXTERN void ADF_Database_Open ( const char *  filename,
const char *  status,
const char *  format,
double *  root_ID,
int *  error_return 
)

DO NOT Check filename for NULL here, it may NOT be used...

Get this machine's numeric format

Determine the requested STATUS

Determine the assessability of the filename

Determine the assessability of the filename

open the file

Determine the assessability of the filename

Compose the file header

Open the new file

write out the file header

Compose Initial root-node header

Write out the root-node header

Compose Initial Free-Chunk Table

Write out Free-Chunk Table

Read the header of the ADF file

Check Database version numbers for compatibility

If a new feature is added which requires that the file version be changed then it is done here. Care must be take not to break forward compatibility by changing the file version. Thus new features may not be available for older file versions. For instance version A1 files cannot be upgraded to version A2 and above since a change was made to how links were store and the file version is used to decide how to treat links.

The link separator was changed from " " to ">" in order to support blanks in filenames under Windows. This change is for version A02 and higher

get the root ID for the user

Remember the file's data format

check machine modes, if machine is native the file must be !!

Close the ADF file and free its index

Definition at line 751 of file ADF_interface.c.

EXTERN void ADF_Database_Set_Format ( const double  Root_ID,
const char *  format,
int *  error_return 
)

Get the file, block, and offset numbers from the ID

Get node_header for the node

Get modification date to be updated with the header

Now write the disk header out...

Definition at line 1029 of file ADF_interface.c.

EXTERN void ADF_Database_Valid ( const char *  filename,
int *  error_return 
)

Definition at line 984 of file ADF_interface.c.

EXTERN void ADF_Database_Version ( const double  Root_ID,
char *  version,
char *  creation_date,
char *  modification_date,
int *  error_return 
)

Get the file, block, and offset numbers from the ID

Get node_header for the node

Convert the "what" string into a C string

Convert the creation date string into a C string

Convert the modification date string into a C string

Definition at line 1092 of file ADF_interface.c.

EXTERN void ADF_Delete ( const double  PID,
const double  ID,
int *  error_return 
)

Don't use ADFI_chase_link() - delete link nodes but NOT the nodes they are linked too

Delete node data

this node IS a link

Delete the link path data for this node

this node is NOT a link

Recursively delete all sub-nodes (children) of this node

Delete all data for this node

Disassociate node from parent

Delete this node's sub node table

Delete node header from disk

Finally, update modification date

Definition at line 1153 of file ADF_interface.c.

EXTERN void ADF_Error_Message ( const int  error_return_input,
char *  error_string 
)

If return pointer is NULL, print message to stdout

NO_ERROR is NOT zero for pointer-assignment checking

Check range of error code

Error-code good, copy it for the user

Definition at line 1247 of file ADF_interface.c.

EXTERN void ADF_Flush_to_Disk ( const double  ID,
int *  error_return 
)

Definition at line 1304 of file ADF_interface.c.

EXTERN void ADF_Get_Data_Type ( const double  ID,
char *  data_type,
int *  error_return 
)

Copy the blank-filled data-type into a C string

Definition at line 1334 of file ADF_interface.c.

EXTERN void ADF_Get_Dimension_Values ( const double  ID,
int  dim_vals[],
int *  error_return 
)

Check for zero dimensions

Check for too-large-of dimensions

Copy the dimension information

Definition at line 1375 of file ADF_interface.c.

EXTERN void ADF_Get_Error_State ( int *  error_state,
int *  error_return 
)

Definition at line 1425 of file ADF_interface.c.

EXTERN void ADF_Get_Label ( const double  ID,
char *  label,
int *  error_return 
)

Copy the blank-filled label type into a C string

Definition at line 1454 of file ADF_interface.c.

EXTERN void ADF_Get_Link_Path ( const double  ID,
char *  filename,
char *  link_path,
int *  error_return 
)

Get the file, block, and offset numbers from the ID

Get node_header for the node

Get tokenized datatype

look for file/link delimiter

no filename

no link ?

Definition at line 1495 of file ADF_interface.c.

EXTERN void ADF_Get_Name ( const double  ID,
char *  name,
int *  error_return 
)

Get the file, block, and offset numbers from the ID

Get node_header for the node

Copy the blank-filled name into a C string

Definition at line 1679 of file ADF_interface.c.

EXTERN void ADF_Get_Node_ID ( const double  PID,
const char *  name,
double *  ID,
int *  error_return 
)

initialize the ID variable to use in intermediate steps

start at the root node

according to user documentation, PID can be any valid node in the database, but we need to use it to get the root ID in order to start at the top

This is the root-node, return the Root-ID

NOT an error, just done and need to get out

start search for tokens (names separated by '/')

this should never happen but check anyway

Get file-index, etc. to start. Note: Parent ID may be a link

Track through the possible compound name string

Find this child under the current parent

Child NOT found

create the child ID

Get the next node-name token (NULL if no more). This is needed for the while-loop check and normally would be done at the end of the loop, but it is useful in the next step to see if there are any more branches in the path.

If this node is the last in the path it may be a link, but there needs to be a mechanism by which a link's ID can be determined and so we cannot follow the link at this time.

This child now becomes the parent. Do it again...

Definition at line 1747 of file ADF_interface.c.

EXTERN void ADF_Get_Number_of_Dimensions ( const double  ID,
int *  num_dims,
int *  error_return 
)

Return the number of dimensions

Definition at line 1878 of file ADF_interface.c.

EXTERN void ADF_Get_Root_ID ( const double  ID,
double *  Root_ID,
int *  error_return 
)

Get the file ID

Use the file header to find the root ID

Format the root ID

Definition at line 1913 of file ADF_interface.c.

EXTERN void ADF_Is_Link ( const double  ID,
int *  link_path_length,
int *  error_return 
)

Get the file, block, and offset numbers from the ID

Get node_header for the node

Definition at line 1959 of file ADF_interface.c.

EXTERN void ADF_Library_Version ( char *  version,
int *  error_return 
)

Copy the proper portion of the "what" string

remove trailing "what" delimiter ('>')

Definition at line 2002 of file ADF_interface.c.

EXTERN void ADF_Link ( const double  PID,
const char *  name,
const char *  file,
const char *  name_in_file,
double *  ID,
int *  error_return 
)

Don't check file since it can be a NULL pointer

Create the node in the normal way

Get the file, block, and offset numbers from the ID

Add the file and linked-to name as data in the child

We must use a datatype of "C1" to put the data into this node. With a datatype of "Lk" (a link), the written data will go into the linked-to node (that's the whole point). To set this up we must be careful...

Change the datatype to be LK, without deleting the data. We can't use ADF_Put_Dimension_Information since the change of datatype will delete the data. We must do this manually.

Finally, update modification date

Definition at line 2044 of file ADF_interface.c.

EXTERN void ADF_Link_Size ( const double  ID,
int *  len_file,
int *  len_name,
int *  error_return 
)

Get the file, block, and offset numbers from the ID

Get node_header for the node

Get tokenized datatype

look for file/link delimiter

no filename

Definition at line 1590 of file ADF_interface.c.

EXTERN void ADF_Move_Child ( const double  PID,
const double  ID,
const double  NPID,
int *  error_return 
)

check that child is really a child of parent

add child to its new parent's sub node table

remove child from its old parent's sub node table

Definition at line 2162 of file ADF_interface.c.

EXTERN void ADF_Number_of_Children ( const double  ID,
int *  num_children,
int *  error_return 
)

Return the number of children

Definition at line 2240 of file ADF_interface.c.

EXTERN void ADF_Put_Dimension_Information ( const double  ID,
const char *  data_type,
const int  dims,
const int  dim_vals[],
int *  error_return 
)

Check new datatype

Look at old datatype

Calculate new data-size

If the number of dimensions is zero, set data-bytes to zero

Calculate the total number of bytes in the data

Calculate old data-size

If the data-types are the same...

If a different datatype, throw-away the data, record new datatype

Copy the datatype

Blank fill the remaining space

Record the number of dimensions and the dimension values

Zero out remaining dimension values

Free the old data

Write modified node_header for the node

Finally, update modification date

Definition at line 2305 of file ADF_interface.c.

EXTERN void ADF_Put_Name ( const double  PID,
const double  ID,
const char *  name,
int *  error_return 
)

Get the file, block, and offset numbers from the PID

Get the file, block, and offset numbers from the ID

Get node_header for the node (parent)

Get node_header for the node (child)

Skip any leading blanks in the name

Need to check for uniqueness and legality of the name

Confirm that child is from the parent

Copy the name

Blank fill the remaining space

Write modified node_header

replace the child's name in the parent's sub-node_table

Finally, update modification date

Definition at line 2438 of file ADF_interface.c.

EXTERN void ADF_Read_All_Data ( const double  ID,
char *  data,
int *  error_return 
)

Get datatype size

Calculate total number of bytes in the data

If there is NO DATA, fill data space with zeros, return error

NO_DATA is really a warning, so don't check & abort...

Read the data from disk

Allocate memory for the required table space in memory

Read in the table

Read data from each entry in the table

Check to be sure we aren't reading too much data (shrinking a data block can cause this)

note: memory_bytes and file_bytes might be different (e.g., if machine is "IEEE_BIG" and file is "CRAY") in which case data pointer advances at a different rate from file pointer.

Definition at line 2567 of file ADF_interface.c.

EXTERN void ADF_Read_Block_Data ( const double  ID,
const long  b_start,
const long  b_end,
char *  data,
int *  error_return 
)

Get datatype size

Calculate total number of bytes in the data

Calculate the starting and ending range in the file

If there is NO DATA, fill data space with zeros, return error

NO_DATA is really a warning, so don't check & abort...

Read the data from disk

Allocate memory for the required table space in memory

Read in the table

Read data from each entry in the table

Check to be sure we don't think the chunk is bigger than it is (shrinking a data block can cause this)

If start of block not in this chunk then continue

Set offset into the current chunk

The start of the block is inside the current chunk so adjust the offset to the beginning of the block

Calculate the number of bytes needed in this chunk

note: memory_bytes and file_bytes might be different (e.g., if machine is "IEEE_BIG" and file is "CRAY") in which case data pointer advances at a different rate from file pointer.

Definition at line 2691 of file ADF_interface.c.

EXTERN void ADF_Read_Data ( const double  ID,
const int  s_start[],
const int  s_end[],
const int  s_stride[],
const int  m_num_dims,
const int  m_dims[],
const int  m_start[],
const int  m_end[],
const int  m_stride[],
char *  data,
int *  error_return 
)

Get datatype length

Check to see if there is actual data to use

Check for multiple data-chunks

A single data chunk

Point to the start of the data

Multiple data chunks

Allocate memory for the required table space in memory

Read in the table

Setup initial indexing

Adjust data pointer

If there is no data on disk, return zeros

A single data chunk

Get the data off of disk

Read the data off of disk directly

Read and translate data

Increment disk pointers, for the special case of one dimensional data we will a simple increment to maximize the throught. Thus for block reads you can temporarily change to 1D for the read to improve efficiency. Note total size shouldn't change!!

Multiple data chunks

Get the data off of disk

Read the data off of disk directly

Read and translate data

Increment disk pointers

Increment memory pointers

Adjust data pointer

Multiple data chunks

Definition at line 2872 of file ADF_interface.c.

EXTERN void ADF_Set_Error_State ( const int  error_state,
int *  error_return 
)

Definition at line 3143 of file ADF_interface.c.

EXTERN void ADF_Set_Label ( const double  ID,
const char *  label,
int *  error_return 
)

Don't check for NULL or BLANK label, these are OK

Copy the label

Blank fill the remaining space

Write modified node_header

Finally, update modification date

Definition at line 3170 of file ADF_interface.c.

EXTERN void ADF_Write_All_Data ( const double  ID,
const char *  data,
int *  error_return 
)

Get the datatype length

Calculate the total number of data bytes

If there currently is NO data, allocate disk space for it

Write the new data

Record the modified the node-header

Get the data length

Check start-of-chunk tag

Point to the start of the data

See if the new data exceedes the existing data space

If Data grew: Write old size, then allocate more data-space and write the rest

Write the part of the new data to existing data-chunk

Allocate a second data chunk

Write the rest of the data

note: memory_bytes and file_bytes might be different (e.g., if machine is "IEEE_BIG" and file is "CRAY") in which case data pointer advances at a different rate from file pointer.

Allocate a data-chunk-table for two entries

Write data-chunk-table to disk

get the size of the data_chunk for the table end pointer

get the size of the data_chunk for the table end pointer

Update node header with number of data-chunks = 2 and the pointer to the data-chunk-table

Write the new data to existing data-chunk

Multiple data chunks

Allocate memory for the data-chunk-table, with an additional entry in case we need to grow it

Read in the table

looping on the data-chunks, write the size of the current chunk

Limit the number of bytes written by whats left to write.

note: memory_bytes and file_bytes might be different (e.g., if machine is "IEEE_BIG" and file is "CRAY") in which case data pointer advances at a different rate from file pointer.

If we are out of data-chunks and have data left, allocate a new data-chunk in the file.

Write data-chunk-table to disk

allocate data space in the file

allocate space for the new data-chunk-entry-table

Free the old data-chunk-table

Update node header with number of data-chunks++ and the pointer to the data-chunk-table

Finally, update modification date

Definition at line 3225 of file ADF_interface.c.

EXTERN void ADF_Write_Block_Data ( const double  ID,
const long  b_start,
const long  b_end,
char *  data,
int *  error_return 
)

Get the datatype length

Calculate the total number of data bytes

Calculate the starting and ending range in the file

If there currently is NO data, allocate disk space for it

Write the new data

Record the modified the node-header

Get the data length

Check start-of-chunk tag

Point to the start of the data

See if the new data exceedes the existing data space

If Data grew: Write old size, then allocate more data-space and write the rest

Write the part of the new data to existing data-chunk

Allocate a second data chunk

Write the rest of the data

note: memory_bytes and file_bytes might be different (e.g., if machine is "IEEE_BIG" and file is "CRAY") in which case data pointer advances at a different rate from file pointer.

Allocate a data-chunk-table for two entries

Write data-chunk-table to disk

get the size of the data_chunk for the table end pointer

get the size of the data_chunk for the table end pointer

Update node header with number of data-chunks = 2 and the pointer to the data-chunk-table

Write the new data to existing data-chunk

Multiple data chunks

Allocate memory for the data-chunk-table, with an additional entry in case we need to grow it

Read in the table

looping on the data-chunks, write the size of the current chunk

If start of block not in this chunk then continue

Set offset into the current chunk

The start of the block is inside the current chunk so adjust the offset to the beginning of the block

Check to be sure we aren't writing too much data

Write the chunk

note: memory_bytes and file_bytes might be different (e.g., if machine is "IEEE_BIG" and file is "CRAY") in which case data pointer advances at a different rate from file pointer.

If we are out of data-chunks and have data left, allocate a new data-chunk in the file.

Write data-chunk-table to disk

allocate data space in the file

allocate space for the new data-chunk-entry-table

Free the old data-chunk-table

Update node header with number of data-chunks++ and the pointer to the data-chunk-table

Finally, update modification date

Definition at line 3502 of file ADF_interface.c.

EXTERN void ADF_Write_Data ( const double  ID,
const int  s_start[],
const int  s_end[],
const int  s_stride[],
const int  m_num_dims,
const int  m_dims[],
const int  m_start[],
const int  m_end[],
const int  m_stride[],
const char *  data,
int *  error_return 
)

Get datatype length

Calculate the total number of data bytes

check for need of data translation

If there currently is NO data, allocate disk space for it

initialize the new disk_space with zero's, then we'll write the partial data

Record the modified the node-header

If one data chunk, check to see if we need to add a second

Get the data length

Check start-of-chunk tag

Point to the start of the data

See if the new data exceedes the existing data space

If Data grew: Allocate more data-space and initialize to zero

Allocate memory for the data-chunk-table, with an additional entry in case we need to grow it

Allocate a second data chunk

Initialize the new data with zeros

Allocate a data-chunk-table for two entries

Write data-chunk-table to disk

get the size of the data_chunk for the table end pointer

get the size of the data_chunk for the table end pointer

Update node header with number of data-chunks = 2 and the pointer to the data-chunk-table

Multiple data chunks, check to see if we need to add one mode

Allocate memory for the data-chunk-table, with an additional entry in case we need to grow it

Read in the table

looping on the data-chunks, look at the size of the chunks

If we are out of data-chunks and have data left, allocate a new data-chunk in the file.

Write data-chunk-table to disk

allocate data space in the file

allocate space for the new data-chunk-entry-table

Initialize the new data chunk to zeros

Free the old data-chunk-table

Update node header with number of data-chunks++ and the pointer to the data-chunk-table

Do single data-chunks here...

Point to the start of the data

Setup initial indexing

Adjust data pointer

Put the data to disk

Here is where we need to check for spanning multiple data-chunks

Put the data out to disk

Increment disk/memory pointers, for the special case of one dimensional data we will a simple increment to maximize the throught. Thus for block writes you can temporarily change to 1D for the read to improve efficiency. Note total size shouldn't change!!

Adjust data pointer

Point to the start of the data

Setup initial indexing

Adjust data pointer

Put the data to disk

Put the data out to disk

Increment disk and memory pointers

Adjust data pointer

Finally, update modification date

Definition at line 3849 of file ADF_interface.c.


Generated on Thu Jun 25 10:29:47 2009 for CGNS by  doxygen 1.5.9