ADF_internals.h File Reference

#include "ADF.h"
#include <ctype.h>
#include "ADF_fbind.h"

Go to the source code of this file.

Data Structures

struct  DISK_POINTER
struct  FILE_HEADER
struct  FREE_CHUNK_TABLE
struct  FREE_CHUNK
struct  NODE_HEADER
struct  DATA_CHUNK_TABLE_ENTRY
struct  SUB_NODE_TABLE_ENTRY
struct  TOKENIZED_DATA_TYPE
struct  ADF_FILE

Defines

#define LIST_CHUNK   8
#define LIST_CHUNK_GROW_FACTOR   1.5
#define DISK_BLOCK_SIZE   4096
#define MAXIMUM_FILES   0x3fff
#define MAXIMUM_32_BITS   (4294967295U)
#define BLANK_FILE_BLOCK   0
#define BLANK_BLOCK_OFFSET   DISK_BLOCK_SIZE
#define FILE_HEADER_SIZE   186
#define FREE_CHUNK_TABLE_SIZE   80
#define FREE_CHUNK_ENTRY_SIZE   32
#define NODE_HEADER_SIZE   246
#define DISK_POINTER_SIZE   12
#define TAG_SIZE   4
#define WHAT_STRING_SIZE   32
#define DATE_TIME_SIZE   28
#define SMALLEST_CHUNK_SIZE   NODE_HEADER_SIZE
#define SMALL_CHUNK_MAXIMUM   1024
#define MEDIUM_CHUNK_MAXIMUM   DISK_BLOCK_SIZE
#define FREE_CHUNKS_BLOCK   0
#define FREE_CHUNKS_OFFSET   FILE_HEADER_SIZE
#define ROOT_NODE_BLOCK   0
#define ROOT_NODE_OFFSET   (FREE_CHUNKS_OFFSET + FREE_CHUNK_TABLE_SIZE)
#define ROOT_NODE_NAME   "ADF MotherNode"
#define ROOT_NODE_LABEL   "Root Node of ADF File"
#define UNDEFINED_FORMAT   0
#define IEEE_BIG_32_FORMAT   1
#define IEEE_LITTLE_32_FORMAT   2
#define IEEE_BIG_64_FORMAT   3
#define IEEE_LITTLE_64_FORMAT   4
#define CRAY_FORMAT   5
#define NATIVE_FORMAT   99
#define UNDEFINED_FORMAT_CHAR   'U'
#define IEEE_BIG_FORMAT_CHAR   'B'
#define IEEE_LITTLE_FORMAT_CHAR   'L'
#define CRAY_FORMAT_CHAR   'C'
#define NATIVE_FORMAT_CHAR   'N'
#define OS_64_BIT   'B'
#define OS_32_BIT   'L'
#define IEEE_BIG_32_FORMAT_STRING   "IEEE_BIG_32"
#define IEEE_LITTLE_32_FORMAT_STRING   "IEEE_LITTLE_32"
#define IEEE_BIG_64_FORMAT_STRING   "IEEE_BIG_64"
#define IEEE_LITTLE_64_FORMAT_STRING   "IEEE_LITTLE_64"
#define CRAY_FORMAT_STRING   "CRAY"
#define NATIVE_FORMAT_STRING   "NATIVE"
#define FALSE   (0)
#define TRUE   (-1)
#define TO_UPPER(c)   ((islower(c))?(toupper(c)):(c))
#define MIN(a, b)   (((a)<(b))?(a):(b))
#define MAX(a, b)   (((a)>(b))?(a):(b))

Functions

void ADFI_Abort (const int error_code)
void ADFI_ASCII_Hex_2_unsigned_int (const unsigned int minimum, const unsigned int maximum, const unsigned int string_length, const char string[], unsigned int *number, int *error_return)
void ADFI_add_2_sub_node_table (const int file_index, const struct DISK_POINTER *parent, const struct DISK_POINTER *child, int *error_return)
void ADFI_adjust_disk_pointer (struct DISK_POINTER *block_offset, int *error_return)
void ADFI_big_endian_to_cray (const char from_format, const char from_os_size, const char to_format, const char to_os_size, const char data_type[2], const unsigned long delta_from_bytes, const unsigned long delta_to_bytes, const unsigned char *from_data, unsigned char *to_data, int *error_return)
void ADFI_big_little_endian_swap (const char from_format, const char from_os_size, const char to_format, const char to_os_size, const char data_type[2], const unsigned long delta_from_bytes, const unsigned long delta_to_bytes, const unsigned char *from_data, unsigned char *to_data, int *error_return)
void ADFI_big_endian_32_swap_64 (const char from_format, const char from_os_size, const char to_format, const char to_os_size, const char data_type[2], const unsigned long delta_from_bytes, const unsigned long delta_to_bytes, const unsigned char *from_data, unsigned char *to_data, int *error_return)
void ADFI_blank_fill_string (char *str, const int length)
void ADFI_chase_link (const double ID, double *LID, unsigned int *file_index, struct DISK_POINTER *block_offset, struct NODE_HEADER *node_header, int *error_return)
void ADFI_check_4_child_name (const int file_index, const struct DISK_POINTER *parent, const char *name, int *found, struct DISK_POINTER *sub_node_entry_location, struct SUB_NODE_TABLE_ENTRY *sub_node_entry, int *error_return)
void ADFI_check_string_length (const char *str, const int max_length, int *error_return)
void ADFI_close_file (const int top_file_index, int *error_return)
void ADFI_compare_node_names (const char *name, const char *new_name, int *names_match, int *error_return)
void ADFI_convert_number_format (const char from_format, const char from_os_size, const char to_format, const char to_os_size, const int convert_dir, const struct TOKENIZED_DATA_TYPE *tokenized_data_type, const unsigned int length, unsigned char *from_data, unsigned char *to_data, int *error_return)
void ADFI_count_total_array_points (const unsigned int ndim, const unsigned int dims[], const int dim_start[], const int dim_end[], const int dim_stride[], unsigned long *total_points, unsigned long *starting_offset, int *error_return)
void ADFI_cray_to_big_endian (const char from_format, const char from_os_size, const char to_format, const char to_os_size, const char data_type[2], const unsigned long delta_from_bytes, const unsigned long delta_to_bytes, const unsigned char *from_data, unsigned char *to_data, int *error_return)
void ADFI_cray_to_little_endian (const char from_format, const char from_os_size, const char to_format, const char to_os_size, const char data_type[2], const unsigned long delta_from_bytes, const unsigned long delta_to_bytes, const unsigned char *from_data, unsigned char *to_data, int *error_return)
void ADFI_delete_data (const int file_index, const struct NODE_HEADER *node_header, int *error_return)
void ADFI_delete_from_sub_node_table (const int file_index, const struct DISK_POINTER *parent, const struct DISK_POINTER *child, int *error_return)
void ADFI_delete_sub_node_table (const int file_index, const struct DISK_POINTER *block_offset, const unsigned int size_sub_node_table, int *error_return)
void ADFI_disk_pointer_2_ASCII_Hex (const struct DISK_POINTER *block_offset, char block[8], char offset[4], int *error_return)
void ADFI_disk_pointer_from_ASCII_Hex (const char block[8], const char offset[4], struct DISK_POINTER *block_offset, int *error_return)
void ADFI_evaluate_datatype (const int file_index, const char data_type[], int *bytes_file, int *bytes_machine, struct TOKENIZED_DATA_TYPE *tokenized_data_type, char *file_format, char *machine_format, int *error_return)
void ADFI_figure_machine_format (const char *format, char *machine_format, char *format_to_use, char *os_to_use, int *error_return)
void ADFI_file_and_machine_compare (const int file_index, const struct TOKENIZED_DATA_TYPE *tokenized_data_type, int *compare, int *error_return)
void ADFI_file_block_offset_2_ID (const int file_index, const unsigned long file_block, const unsigned long block_offset, double *ID, int *error_return)
void ADFI_file_free (const int file_index, const struct DISK_POINTER *block_offset, const long number_of_bytes, int *error_return)
void ADFI_file_malloc (const int file_index, const long size_bytes, struct DISK_POINTER *block_offset, int *error_return)
void ADFI_fill_initial_file_header (const char format, const char os_size, const char *what_string, struct FILE_HEADER *file_header, int *error_return)
void ADFI_fill_initial_free_chunk_table (struct FREE_CHUNK_TABLE *free_chunk_table, int *error_return)
void ADFI_fill_initial_node_header (struct NODE_HEADER *node_header, int *error_return)
void ADFI_fseek_file (const unsigned int file_index, const unsigned long file_block, const unsigned long block_offset, int *error_return)
void ADFI_get_current_date (char date[])
void ADFI_get_direct_children_ids (const unsigned int file_index, const struct DISK_POINTER *node_block_offset, int *num_ids, double **ids, int *error_return)
void ADFI_get_file_index_from_name (const char *file_name, int *found, unsigned int *file_index, double *ID, int *error_return)
void ADFI_ID_2_file_block_offset (const double ID, unsigned int *file_index, unsigned long *file_block, unsigned long *block_offset, int *error_return)
void ADFI_increment_array (const unsigned int ndim, const unsigned int dims[], const int dim_start[], const int dim_end[], const int dim_stride[], int current_position[], unsigned long *element_offset, int *error_return)
void ADFI_is_block_in_core ()
void ADFI_little_endian_to_cray (const char from_format, const char from_os_size, const char to_format, const char to_os_size, const char data_type[2], const unsigned long delta_from_bytes, const unsigned long delta_to_bytes, const unsigned char *from_data, unsigned char *to_data, int *error_return)
void ADFI_little_endian_32_swap_64 (const char from_format, const char from_os_size, const char to_format, const char to_os_size, const char data_type[2], const unsigned long delta_from_bytes, const unsigned long delta_to_bytes, const unsigned char *from_data, unsigned char *to_data, int *error_return)
void ADFI_open_file (const char *file, const char *status, unsigned int *file_index, int *error_return)
void ADFI_read_chunk_length (const unsigned int file_index, const struct DISK_POINTER *block_offset, char tag[4], struct DISK_POINTER *end_of_chunk_tag, int *error_return)
void ADFI_read_data_chunk (const unsigned int file_index, const struct DISK_POINTER *block_offset, struct TOKENIZED_DATA_TYPE *tokenized_data_type, const int data_size, const long chunk_bytes, const long start_offset, const long total_bytes, char *data, int *error_return)
void ADFI_read_data_chunk_table (const unsigned int file_index, const struct DISK_POINTER *block_offset, struct DATA_CHUNK_TABLE_ENTRY data_chunk_table[], int *error_return)
void ADFI_read_data_translated (const unsigned int file_index, const unsigned long file_block, const unsigned long block_offset, const struct TOKENIZED_DATA_TYPE *tokenized_data_type, const int data_size, const long total_bytes, char *data, int *error_return)
void ADFI_read_disk_block ()
void ADFI_read_disk_pointer_from_disk (const unsigned int file_index, const unsigned long file_block, const unsigned long block_offset, struct DISK_POINTER *block_and_offset, int *error_return)
void ADFI_read_file (const unsigned int file_index, const unsigned long file_block, const unsigned long block_offset, const unsigned int data_length, char *data, int *error_return)
void ADFI_read_file_header (const unsigned int file_index, struct FILE_HEADER *file_header, int *error_return)
void ADFI_read_free_chunk (const unsigned int file_index, const struct DISK_POINTER *block_offset, struct FREE_CHUNK *free_chunk, int *error_return)
void ADFI_read_free_chunk_table (const unsigned int file_index, struct FREE_CHUNK_TABLE *free_chunk_table, int *error_return)
void ADFI_read_node_header (const unsigned int file_index, const struct DISK_POINTER *block_offset, struct NODE_HEADER *node_header, int *error_return)
void ADFI_read_sub_node_table (const unsigned int file_index, const struct DISK_POINTER *block_offset, struct SUB_NODE_TABLE_ENTRY sub_node_table[], int *error_return)
void ADFI_read_sub_node_table_entry (const unsigned int file_index, const struct DISK_POINTER *block_offset, struct SUB_NODE_TABLE_ENTRY *sub_node_table_entry, int *error_return)
void ADFI_remember_file_format (const int file_index, const char numeric_format, const char os_size, int *error_return)
void ADFI_remember_version_update (const int file_index, const char *what_string, int *error_return)
void ADFI_set_blank_disk_pointer (struct DISK_POINTER *block_offset)
int ADFI_stridx_c (const char *str1, const char *str2)
void ADFI_string_2_C_string (const char *string, const int string_length, char *c_string, int *error_return)
char * ADFI_strtok (char *string, char **string_pos, char *token)
void ADFI_unsigned_int_2_ASCII_Hex (const unsigned int number, const unsigned int minimum, const unsigned int maximum, const unsigned int string_length, char string[], int *error_return)
void ADFI_write_data_chunk (const unsigned int file_index, const struct DISK_POINTER *block_offset, const struct TOKENIZED_DATA_TYPE *tokenized_data_type, const int data_size, const long chunk_bytes, const long start_offset, const long total_bytes, const char *data, int *error_return)
void ADFI_write_data_chunk_table (const unsigned int file_index, const struct DISK_POINTER *block_offset, const int number_of_data_chunks, struct DATA_CHUNK_TABLE_ENTRY data_chunk_table[], int *error_return)
void ADFI_write_data_translated (const unsigned int file_index, const unsigned long file_block, const unsigned long block_offset, const struct TOKENIZED_DATA_TYPE *tokenized_data_type, const int data_size, const long total_bytes, const char *data, int *error_return)
void ADFI_write_disk_block ()
void ADFI_write_disk_pointer_2_disk (const unsigned int file_index, const unsigned long file_block, const unsigned long block_offset, const struct DISK_POINTER *block_and_offset, int *error_return)
void ADFI_write_file (const unsigned int file_index, const unsigned long file_block, const unsigned long block_offset, const unsigned int data_length, const char *data, int *error_return)
void ADFI_write_file_header (const int file_index, const struct FILE_HEADER *file_header, int *error_return)
void ADFI_write_free_chunk (const int file_index, const struct DISK_POINTER *block_offset, const struct FREE_CHUNK *free_chunk, int *error_return)
void ADFI_write_free_chunk_table (const int file_index, const struct FREE_CHUNK_TABLE *free_chunk_table, int *error_return)
void ADFI_write_modification_date (const int file_index, int *error_return)
void ADFI_write_node_header (const int file_index, const struct DISK_POINTER *block_offset, const struct NODE_HEADER *node_header, int *error_return)
void ADFI_write_sub_node_table (const unsigned int file_index, const struct DISK_POINTER *block_offset, const int number_of_sub_nodes, struct SUB_NODE_TABLE_ENTRY sub_node_table[], int *error_return)
void ADFI_write_sub_node_table_entry (const unsigned int file_index, const struct DISK_POINTER *block_offset, struct SUB_NODE_TABLE_ENTRY *sub_node_table_entry, int *error_return)
void ADFI_flush_buffers (const unsigned int file_index, int flush_mode, int *error_return)
void ADFI_fflush_file (const unsigned int file_index, int *error_return)
int ADFI_stack_control (const unsigned int file_index, const unsigned long file_block, const unsigned long block_offset, const int stack_mode, const int stack_type, const unsigned long data_length, char *stack_data)
void FNAME (adfcna2, ADFCNA2)(const Fdouble *PID
void FNAME (adfcid2, ADFCID2)(const Fdouble *PID
void FNAME (adfcre2, ADFCRE2)(const Fdouble *PID
void FNAME (adfdcl2, ADFDCL2)(const Fdouble *Root_ID
void FNAME (adfdde2, ADFDDE2)(const Fchar filename
void FNAME (adfdgc2, ADFDGC2)(const Fdouble *ID
void FNAME (adfdgf2, ADFDGF2)(const Fdouble *Root_ID
void FNAME (adfdop2, ADFDOP2)(const Fchar filename
void FNAME (adfdsf2, ADFDSF2)(const Fdouble *Root_ID
void FNAME (adfdve2, ADFDVE2)(const Fdouble *Root_ID
void FNAME (adfdel2, ADFDEL2)(const Fdouble *PID
void FNAME (adferr2, ADFERR2)(const Fint *error_return_input
void FNAME (adfftd2, ADFFTD2)(const Fdouble *ID
void FNAME (adfgdt2, ADFGDT2)(const Fdouble *ID
void FNAME (adfgdv2, ADFGDV2)(const Fdouble *ID
void FNAME (adfges2, ADFGES2)(Fint *error_state
void FNAME (adfglb2, ADFGLB2)(const Fdouble *ID
void FNAME (adfglk2, ADFGLK2)(const Fdouble *ID
void FNAME (adfgna2, ADFGNA2)(const Fdouble *ID
void FNAME (adfgni2, ADFGNI2)(const Fdouble *PID
void FNAME (adfgnd2, ADFGND2)(const Fdouble *ID
void FNAME (adfgri2, ADFGRI2)(const Fdouble *ID
void FNAME (adfisl2, ADFISL2)(const Fdouble *ID
void FNAME (adflve2, ADFLVE2)(Fchar version
void FNAME (adflin2, ADFLIN2)(const Fdouble *PID
void FNAME (adfmov2, ADFMOV2)(const Fdouble *PID
void FNAME (adfncl2, ADFNCL2)(const Fdouble *ID
void FNAME (adfpdi2, ADFPDI2)(const Fdouble *ID
void FNAME (adfpna2, ADFPNA2)(const Fdouble *PID
void FNAME (adfrall, ADFRALL)(const Fdouble *ID
void FNAME (adfrblk, ADFRBLK)(const Fdouble *ID
void FNAME (adfread, ADFREAD)(const Fdouble *ID
void FNAME (adfses2, ADFSES2)(const Fint *error_state
void FNAME (adfslb2, ADFSLB2)(const Fdouble *ID
void FNAME (adfwall, ADFWALL)(const Fdouble *ID
void FNAME (adfwblk, ADFWBLK)(const Fdouble *ID
void FNAME (adfwrit, ADFWRIT)(const Fdouble *ID

Variables

ADF_FILEADF_file
int maximum_files
void const Fintistart
void const Fint const Fintimaxnum
void const Fint const Fint
const Fint
idim
void const Fint const Fint
const Fint const Fint
name_length
void const Fint const Fint
const Fint const Fint Fint
inum_ret
void const Fint const Fint
const Fint const Fint Fint
Fchar 
names
void const Fint const Fint
const Fint const Fint Fint
Fchar Fint
error_return
void const Fint const Fint
Fint Fdouble
cIDs
void const Fchar name
void const Fchar const Fint
Fdouble
ID
void Fchar format
void Fchar const Fintformat_length
void const Fintfilename_length
void const Fint Fchar status_in
void const Fint Fchar const Fintstatus_length
void const Fint Fchar const
Fint const Fchar const Fint
Fdouble
Root_ID
void Fchar version
void Fchar Fchar creation_date
void Fchar Fchar Fchar modification_date
void Fchar Fchar Fchar const Fintv_length
void Fchar Fchar Fchar const
Fint const Fint
c_length
void Fchar Fchar Fchar const
Fint const Fint const Fint
m_length
void Fchar error_string
void Fchar const Fintstr_length
void Fchar data_type
void Fchar const Fintdata_type_length
void Fint dim_vals []
void Fchar label
void Fchar const Fintlabel_length
void Fchar filename
void Fchar const Fint Fchar link_path
void Fchar const Fint Fchar
const Fint
link_path_length
void Fintnum_dims
void const Fintversion_length
void const Fchar const Fchar file
void const Fchar const Fchar
const Fchar 
name_in_file
void const Fchar const Fchar
const Fchar const Fint const
Fint
file_length
void const Fchar const Fchar
const Fchar const Fint const
Fint const Fint
nfile_length
void const Fdouble const FdoubleNPID
void Fintnum_children
void const Fchar const Fint
const Fint
dims
void Fchar data
void const int * b_start
void const int const int * b_end
void const Fint s_start []
void const Fint const Fint s_end []
void const Fint const Fint
const Fint 
s_stride []
void const Fint const Fint
const Fint const Fint
m_num_dims
void const Fint const Fint
const Fint const Fint const
Fint 
m_dims []
void const Fint const Fint
const Fint const Fint const
Fint const Fint 
m_start []
void const Fint const Fint
const Fint const Fint const
Fint const Fint const Fint 
m_end []
void const Fint const Fint
const Fint const Fint const
Fint const Fint const Fint
const Fint 
m_stride []


Define Documentation

#define BLANK_BLOCK_OFFSET   DISK_BLOCK_SIZE

Definition at line 36 of file ADF_internals.h.

#define BLANK_FILE_BLOCK   0

Definition at line 35 of file ADF_internals.h.

#define CRAY_FORMAT   5

Definition at line 70 of file ADF_internals.h.

#define CRAY_FORMAT_CHAR   'C'

Definition at line 76 of file ADF_internals.h.

#define CRAY_FORMAT_STRING   "CRAY"

Definition at line 85 of file ADF_internals.h.

#define DATE_TIME_SIZE   28

Definition at line 46 of file ADF_internals.h.

#define DISK_BLOCK_SIZE   4096

File parameters

Definition at line 30 of file ADF_internals.h.

#define DISK_POINTER_SIZE   12

Definition at line 43 of file ADF_internals.h.

#define FALSE   (0)

Definition at line 89 of file ADF_internals.h.

#define FILE_HEADER_SIZE   186

Sizes of things on disk

Definition at line 39 of file ADF_internals.h.

#define FREE_CHUNK_ENTRY_SIZE   32

Definition at line 41 of file ADF_internals.h.

#define FREE_CHUNK_TABLE_SIZE   80

Definition at line 40 of file ADF_internals.h.

#define FREE_CHUNKS_BLOCK   0

Definition at line 56 of file ADF_internals.h.

#define FREE_CHUNKS_OFFSET   FILE_HEADER_SIZE

Definition at line 57 of file ADF_internals.h.

#define IEEE_BIG_32_FORMAT   1

Definition at line 66 of file ADF_internals.h.

#define IEEE_BIG_32_FORMAT_STRING   "IEEE_BIG_32"

Definition at line 81 of file ADF_internals.h.

#define IEEE_BIG_64_FORMAT   3

Definition at line 68 of file ADF_internals.h.

#define IEEE_BIG_64_FORMAT_STRING   "IEEE_BIG_64"

Definition at line 83 of file ADF_internals.h.

#define IEEE_BIG_FORMAT_CHAR   'B'

Definition at line 74 of file ADF_internals.h.

#define IEEE_LITTLE_32_FORMAT   2

Definition at line 67 of file ADF_internals.h.

#define IEEE_LITTLE_32_FORMAT_STRING   "IEEE_LITTLE_32"

Definition at line 82 of file ADF_internals.h.

#define IEEE_LITTLE_64_FORMAT   4

Definition at line 69 of file ADF_internals.h.

#define IEEE_LITTLE_64_FORMAT_STRING   "IEEE_LITTLE_64"

Definition at line 84 of file ADF_internals.h.

#define IEEE_LITTLE_FORMAT_CHAR   'L'

Definition at line 75 of file ADF_internals.h.

#define LIST_CHUNK   8

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

Definition at line 25 of file ADF_internals.h.

#define LIST_CHUNK_GROW_FACTOR   1.5

Definition at line 26 of file ADF_internals.h.

#define MAX ( a,
 )     (((a)>(b))?(a):(b))

Definition at line 104 of file ADF_internals.h.

#define MAXIMUM_32_BITS   (4294967295U)

Definition at line 33 of file ADF_internals.h.

#define MAXIMUM_FILES   0x3fff

Definition at line 32 of file ADF_internals.h.

#define MEDIUM_CHUNK_MAXIMUM   DISK_BLOCK_SIZE

Definition at line 54 of file ADF_internals.h.

#define MIN ( a,
 )     (((a)<(b))?(a):(b))

Definition at line 103 of file ADF_internals.h.

#define NATIVE_FORMAT   99

Definition at line 71 of file ADF_internals.h.

#define NATIVE_FORMAT_CHAR   'N'

Definition at line 77 of file ADF_internals.h.

#define NATIVE_FORMAT_STRING   "NATIVE"

Definition at line 86 of file ADF_internals.h.

#define NODE_HEADER_SIZE   246

Definition at line 42 of file ADF_internals.h.

#define OS_32_BIT   'L'

Definition at line 79 of file ADF_internals.h.

#define OS_64_BIT   'B'

Definition at line 78 of file ADF_internals.h.

#define ROOT_NODE_BLOCK   0

Definition at line 58 of file ADF_internals.h.

#define ROOT_NODE_LABEL   "Root Node of ADF File"

Definition at line 62 of file ADF_internals.h.

#define ROOT_NODE_NAME   "ADF MotherNode"

Definition at line 61 of file ADF_internals.h.

#define ROOT_NODE_OFFSET   (FREE_CHUNKS_OFFSET + FREE_CHUNK_TABLE_SIZE)

Definition at line 59 of file ADF_internals.h.

#define SMALL_CHUNK_MAXIMUM   1024

Definition at line 53 of file ADF_internals.h.

#define SMALLEST_CHUNK_SIZE   NODE_HEADER_SIZE

Definition at line 52 of file ADF_internals.h.

#define TAG_SIZE   4

Definition at line 44 of file ADF_internals.h.

#define TO_UPPER (  )     ((islower(c))?(toupper(c)):(c))

Upper case a character Need to use the system macros for the Cray optimizer

Definition at line 101 of file ADF_internals.h.

#define TRUE   (-1)

Definition at line 93 of file ADF_internals.h.

#define UNDEFINED_FORMAT   0

Machine formats

Definition at line 65 of file ADF_internals.h.

#define UNDEFINED_FORMAT_CHAR   'U'

Definition at line 73 of file ADF_internals.h.

#define WHAT_STRING_SIZE   32

Definition at line 45 of file ADF_internals.h.


Function Documentation

void ADFI_Abort ( const int  error_code  ) 

Definition at line 440 of file ADF_internals.c.

void ADFI_add_2_sub_node_table ( const int  file_index,
const struct DISK_POINTER parent,
const struct DISK_POINTER child,
int *  error_return 
)

Get node_header for the node (parent)

Get node_header for the node (child)

Check current length of sub-node_table, add space if needed

Increase the table space (double it)

Allocate memory for the required table space in memory

If sub-node table exists, get it

Blank out the new part of the sub-node_table

Allocate memory for the required table space on disk

Write out modified sub_node_table

Insert new entry in sub-node table

Write the child's name

Write out new sub_node_table entry

Write out modified parent node-header

Definition at line 550 of file ADF_internals.c.

void ADFI_adjust_disk_pointer ( struct DISK_POINTER block_offset,
int *  error_return 
)

Calculate the number of blocks in the current offset

Adjust block/offset checking for block roll-over

Definition at line 702 of file ADF_internals.c.

void ADFI_ASCII_Hex_2_unsigned_int ( const unsigned int  minimum,
const unsigned int  maximum,
const unsigned int  string_length,
const char  string[],
unsigned int *  number,
int *  error_return 
)

Index from 0 to string_length - 1

Index from string_length - 1 to 0

Temoprary integer variable

Working value of ther number

Convert the ASCII-Hex string into decimal

Return the number

Definition at line 360 of file ADF_internals.c.

void ADFI_big_endian_32_swap_64 ( const char  from_format,
const char  from_os_size,
const char  to_format,
const char  to_os_size,
const char  data_type[2],
const unsigned long  delta_from_bytes,
const unsigned long  delta_to_bytes,
const unsigned char *  from_data,
unsigned char *  to_data,
int *  error_return 
)

Definition at line 800 of file ADF_internals.c.

void ADFI_big_endian_to_cray ( const char  from_format,
const char  from_os_size,
const char  to_format,
const char  to_os_size,
const char  data_type[2],
const unsigned long  delta_from_bytes,
const unsigned long  delta_to_bytes,
const unsigned char *  from_data,
unsigned char *  to_data,
int *  error_return 
)

Check for zero: a special case on the Cray (exponent sign)

Convert the sign

Convert the exponent

8 bits to 14 bits. Sign extent from 8 to 14

Cray exponent is 2 greater than the Iris

Convert the mantissia

23 bits to 48 bits. Left shift 25 bits, zero fill

Check for zero: a special case on the Cray (exponent sign)

Convert the sign

Convert the exponent

11 bits to 14 bits. Sign extent from 11 to 14

Cray exponent is 2 greater than the Iris

Convert the mantissia

52 bits to 48 bits. Use 48, drop last 4 bits

Definition at line 939 of file ADF_internals.c.

void ADFI_big_little_endian_swap ( const char  from_format,
const char  from_os_size,
const char  to_format,
const char  to_os_size,
const char  data_type[2],
const unsigned long  delta_from_bytes,
const unsigned long  delta_to_bytes,
const unsigned char *  from_data,
unsigned char *  to_data,
int *  error_return 
)

end if

Definition at line 1220 of file ADF_internals.c.

void ADFI_blank_fill_string ( char *  str,
const int  length 
)

Definition at line 1268 of file ADF_internals.c.

void ADFI_chase_link ( const double  ID,
double *  LID,
unsigned int *  file_index,
struct DISK_POINTER block_offset,
struct NODE_HEADER node_header,
int *  error_return 
)

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

Get node_header for the node

node is a link get file and path data

Link_ID = root-node of the new file. note: the file could already be opened, and may be the current file!

Not found; try to open it

Get the node ID of the link to node (may be other links)

node is NOT a link

Definition at line 1377 of file ADF_internals.c.

void ADFI_check_4_child_name ( const int  file_index,
const struct DISK_POINTER parent,
const char *  name,
int *  found,
struct DISK_POINTER sub_node_entry_location,
struct SUB_NODE_TABLE_ENTRY sub_node_entry,
int *  error_return 
)

Get node_header for the node

Check for valid node name

If parent has no children, the new name MUST be NOT found

Allocate memory for the required table space in memory

Check all names for our new name

Also save off the child's name

Get out of the for loop

Definition at line 1504 of file ADF_internals.c.

void ADFI_check_string_length ( const char *  str,
const int  max_length,
int *  error_return 
)

Check for blank string

Definition at line 1615 of file ADF_internals.c.

void ADFI_close_file ( const int  top_file_index,
int *  error_return 
)

Clear this file's entry

Definition at line 1661 of file ADF_internals.c.

void ADFI_compare_node_names ( const char *  name,
const char *  new_name,
int *  names_match,
int *  error_return 
)

Name mattched for the length of the new name. The existing node name must only contian blanks from here

Definition at line 1738 of file ADF_internals.c.

void ADFI_convert_number_format ( const char  from_format,
const char  from_os_size,
const char  to_format,
const char  to_os_size,
const int  convert_dir,
const struct TOKENIZED_DATA_TYPE tokenized_data_type,
const unsigned int  length,
unsigned char *  from_data,
unsigned char *  to_data,
int *  error_return 
)

loop over each element

end if

end else

Increment the data pointers

Definition at line 1858 of file ADF_internals.c.

void ADFI_count_total_array_points ( const unsigned int  ndim,
const unsigned int  dims[],
const int  dim_start[],
const int  dim_end[],
const int  dim_stride[],
unsigned long *  total_points,
unsigned long *  starting_offset,
int *  error_return 
)

Chek the inputs

Check dims[] >=1

Check starting values >=1 and <= dims

Check ending values >=1 and <= dims and >= dim_start

Check stride >= 1

Definition at line 2047 of file ADF_internals.c.

void ADFI_cray_to_big_endian ( const char  from_format,
const char  from_os_size,
const char  to_format,
const char  to_os_size,
const char  data_type[2],
const unsigned long  delta_from_bytes,
const unsigned long  delta_to_bytes,
const unsigned char *  from_data,
unsigned char *  to_data,
int *  error_return 
)

Check for zero: a special case on the Cray (exponent sign)

Convert the sign

Convert the exponent

14 bits to 8 bits. Sign extent from 8 to 14

Cray exponent is 2 greater than the Iris

Convert the mantissia

48 bits to 23 bits, skip the first '1' (2.fract)

Check for zero: a special case on the Cray (exponent sign)

Convert the sign

Convert the exponent

14 bits to 11 bits

Cray exponent is 2 greater than the Iris

Convert the mantissia

48 bits to 52 bits, skip the first '1' (2.fract)

Definition at line 2183 of file ADF_internals.c.

void ADFI_cray_to_little_endian ( const char  from_format,
const char  from_os_size,
const char  to_format,
const char  to_os_size,
const char  data_type[2],
const unsigned long  delta_from_bytes,
const unsigned long  delta_to_bytes,
const unsigned char *  from_data,
unsigned char *  to_data,
int *  error_return 
)

Check for zero: a special case on the Cray (exponent sign)

Convert the sign

Convert the exponent

14 bits to 8 bits. Sign extent from 8 to 14

Cray exponent is 2 greater than the Iris

Convert the mantissia

48 bits to 23 bits, skip the first '1' (2.fract)

Check for zero: a special case on the Cray (exponent sign)

Convert the sign

Convert the exponent

14 bits to 11 bits

Cray exponent is 2 greater than the Iris

Convert the mantissia

48 bits to 52 bits, skip the first '1' (2.fract)

Definition at line 2437 of file ADF_internals.c.

void ADFI_delete_data ( const int  file_index,
const struct NODE_HEADER node_header,
int *  error_return 
)

No data to free, do nothing

A single data-chunk to free, so free it

Multiple data-chunks to free. Free them, and also the data_chunk table

Allocate memory for the required table space in memory

Read in the table

Free each entry in the table

Clear all disk entries off the priority stack for file

Definition at line 2637 of file ADF_internals.c.

void ADFI_delete_from_sub_node_table ( const int  file_index,
const struct DISK_POINTER parent,
const struct DISK_POINTER child,
int *  error_return 
)

Find the child in the parent's sub-node table

Move the rest of the table up to fill the hole

Re-write the parent's sub-node table

Update the sub-node count and write the parent's node-header

Clear all subnode/disk entries off the priority stack for file

Definition at line 2718 of file ADF_internals.c.

void ADFI_delete_sub_node_table ( const int  file_index,
const struct DISK_POINTER block_offset,
const unsigned int  size_sub_node_table,
int *  error_return 
)

Clear all subnode/disk entries off the priority stack for file

Definition at line 2833 of file ADF_internals.c.

void ADFI_disk_pointer_2_ASCII_Hex ( const struct DISK_POINTER block_offset,
char  block[8],
char  offset[4],
int *  error_return 
)

Convert into ASCII-Hex form

Definition at line 2888 of file ADF_internals.c.

void ADFI_disk_pointer_from_ASCII_Hex ( const char  block[8],
const char  offset[4],
struct DISK_POINTER block_offset,
int *  error_return 
)

Convert into numeric form

Definition at line 2935 of file ADF_internals.c.

void ADFI_evaluate_datatype ( const int  file_index,
const char  data_type[],
int *  bytes_file,
int *  bytes_machine,
struct TOKENIZED_DATA_TYPE tokenized_data_type,
char *  file_format,
char *  machine_format,
int *  error_return 
)

Return the file & machine's format info

Convert blank-filled datatype into C string

Upper_CASE the data-type string

end if

Get file_header for the file variable sizes

Loop to calculate the compound data-type length and validity

Look at the 2-byte datatype code

Error condition

Look for arrays '[', commas ',', of end-of-string ''

Check for comma between types

Error condition

Definition at line 3007 of file ADF_internals.c.

void ADFI_fflush_file ( const unsigned int  file_index,
int *  error_return 
)

Definition at line 3226 of file ADF_internals.c.

void ADFI_figure_machine_format ( const char *  format,
char *  machine_format,
char *  format_to_use,
char *  os_to_use,
int *  error_return 
)

Check requested format

Check for numeric bit patterns

Some other format, call it NATIVE

Definition at line 3332 of file ADF_internals.c.

void ADFI_file_and_machine_compare ( const int  file_index,
const struct TOKENIZED_DATA_TYPE tokenized_data_type,
int *  compare,
int *  error_return 
)

Get file_header for the file variable sizes

Make sure the sizes are the same or we are cooked!!

end if

end if

If the file and machine binary type are the same and only the sizes may be different (like long is 32 or 64), then if all the sizes are the same then no converion is necessary and ws can avoid the conversion overhead and just do direct read/writes.

Definition at line 3535 of file ADF_internals.c.

void ADFI_file_block_offset_2_ID ( const int  file_index,
const unsigned long  file_block,
const unsigned long  block_offset,
double *  ID,
int *  error_return 
)

Map the bytes into the character variable

Definition at line 3620 of file ADF_internals.c.

void ADFI_file_free ( const int  file_index,
const struct DISK_POINTER block_offset,
const long  number_of_bytes,
int *  error_return 
)

Check the disk tag to see what kind of disk chunk we have. We need this to determine the length of the chunk.

This is a node

Check disk boundary-tag

Trying to free the free-chunk-table. This is BAD.

Set a temporary block/offset to read disk pointer

Get the end_of_chunk-tag block/offset from disk

Check disk boundary-tag

Set a temporary block/offset to read disk pointer

Get the end_of_chunk-tag block/offset from disk

Check disk boundary-tag

Set a temporary block/offset to read disk pointer

Get the end_of_chunk-tag block/offset from disk

Check disk boundary-tag

Set a temporary block/offset to read disk pointer

Get the end_of_chunk-tag block/offset from disk

Check disk boundary-tag

Use the number of bytes passed in

Too small, z-gas

Initialize the block of 'Z's

Add this chunk to the free table

Get the free-chunk-table

SMALL chunk

If linked-list was empty, also point to this as the last.

MEDIUM chunk

If linked-list was empty, also point to this as the last.

LARGE chunk

If linked-list was empty, also point to this as the last.

Put the free-chunk tags in place

Write out the free chunk

Update the free-chunk-table

Delete the block/offset off the stack

Definition at line 3724 of file ADF_internals.c.

void ADFI_file_malloc ( const int  file_index,
const long  size_bytes,
struct DISK_POINTER block_offset,
int *  error_return 
)

The end-of_file pointer points to the last byte USED, NOT the next byte TO USE.

If the end-of_file is NOT at a block boundary, then see if the new allocated chunk will span a block boundary. If it will, then start at the new block if it will fit within the block. This helps efficiency to have file control headers located within a block boundry.

Free rest of block, allocate from next block

Use the remaining block

Write out the modified file header

Definition at line 4021 of file ADF_internals.c.

void ADFI_fill_initial_file_header ( const char  format,
const char  os_size,
const char *  what_string,
struct FILE_HEADER file_header,
int *  error_return 
)

Put the boundary tags in first. If we then overwrite them, we'll know

The UNIX "what" string" - blank terminated

File creation date/time - blank terminated

File modification date/time - same as creation time

Set sizeof() information for file data

end if

end else

Set root node table pointers

Definition at line 4235 of file ADF_internals.c.

void ADFI_fill_initial_free_chunk_table ( struct FREE_CHUNK_TABLE free_chunk_table,
int *  error_return 
)

Small: First and Last Blocks

Medium: First and Last Blocks

large: First and Last Blocks

Definition at line 4362 of file ADF_internals.c.

void ADFI_fill_initial_node_header ( struct NODE_HEADER node_header,
int *  error_return 
)

Blank out the name

Blank out the label

Set number of sub nodes to zero

Blank out the Data-Type, then set to eMpTy.

Zero out number of dimensions & Set dimension values to zero

Set number of data chunks to zero, zero out data chunk pointer

Definition at line 4400 of file ADF_internals.c.

void ADFI_flush_buffers ( const unsigned int  file_index,
int  flush_mode,
int *  error_return 
)

Flush any active write buffer, file block is set to a nonsense value so that the buffer flags are not reset

Reset control flags

Reset control flags

Definition at line 4456 of file ADF_internals.c.

void ADFI_fseek_file ( const unsigned int  file_index,
const unsigned long  file_block,
const unsigned long  block_offset,
int *  error_return 
)

Definition at line 4503 of file ADF_internals.c.

void ADFI_get_current_date ( char  date[]  ) 

get the current time

remove '
' from ctime format

blank fill

Definition at line 4554 of file ADF_internals.c.

void ADFI_get_direct_children_ids ( const unsigned int  file_index,
const struct DISK_POINTER node_block_offset,
int *  num_ids,
double **  ids,
int *  error_return 
)

Check for zero children, return if 0

point to the first child

Return the ids for all the children

Read one sub-node table entry

Get the ID from the sub-node table

Increment the disk-pointer

Definition at line 4605 of file ADF_internals.c.

void ADFI_get_file_index_from_name ( const char *  file_name,
int *  found,
unsigned int *  file_index,
double *  ID,
int *  error_return 
)

A Match!!!

Definition at line 4686 of file ADF_internals.c.

void ADFI_ID_2_file_block_offset ( const double  ID,
unsigned int *  file_index,
unsigned long *  file_block,
unsigned long *  block_offset,
int *  error_return 
)

Unmap the bytes from the character

Definition at line 470 of file ADF_internals.c.

void ADFI_increment_array ( const unsigned int  ndim,
const unsigned int  dims[],
const int  dim_start[],
const int  dim_end[],
const int  dim_stride[],
int  current_position[],
unsigned long *  element_offset,
int *  error_return 
)

The -1 above is to let the next loop add its stride

Definition at line 4746 of file ADF_internals.c.

void ADFI_is_block_in_core (  ) 

Definition at line 4801 of file ADF_internals.c.

void ADFI_little_endian_32_swap_64 ( const char  from_format,
const char  from_os_size,
const char  to_format,
const char  to_os_size,
const char  data_type[2],
const unsigned long  delta_from_bytes,
const unsigned long  delta_to_bytes,
const unsigned char *  from_data,
unsigned char *  to_data,
int *  error_return 
)

Definition at line 4874 of file ADF_internals.c.

void ADFI_little_endian_to_cray ( const char  from_format,
const char  from_os_size,
const char  to_format,
const char  to_os_size,
const char  data_type[2],
const unsigned long  delta_from_bytes,
const unsigned long  delta_to_bytes,
const unsigned char *  from_data,
unsigned char *  to_data,
int *  error_return 
)

Check for zero: a special case on the Cray (exponent sign)

Convert the sign

Convert the exponent

8 bits to 14 bits. Sign extent from 8 to 14

Cray exponent is 2 greater than the Iris

Convert the mantissia

23 bits to 48 bits. Left shift 25 bits, zero fill

Check for zero: a special case on the Cray (exponent sign)

Convert the sign

Convert the exponent

11 bits to 14 bits. Sign extent from 11 to 14

Cray exponent is 2 greater than the Iris

Convert the mantissia

52 bits to 48 bits. Use 48, drop last 4 bits

Definition at line 5013 of file ADF_internals.c.

void ADFI_open_file ( const char *  file,
const char *  status,
unsigned int *  file_index,
int *  error_return 
)

Clear this file's entry

Definition at line 5254 of file ADF_internals.c.

void ADFI_read_chunk_length ( const unsigned int  file_index,
const struct DISK_POINTER block_offset,
char  tag[4],
struct DISK_POINTER end_of_chunk_tag,
int *  error_return 
)

void ADFI_read_data_chunk ( const unsigned int  file_index,
const struct DISK_POINTER block_offset,
struct TOKENIZED_DATA_TYPE tokenized_data_type,
const int  data_size,
const long  chunk_bytes,
const long  start_offset,
const long  total_bytes,
char *  data,
int *  error_return 
)

Get tag and chunk length

Check start-of-chunk tag

Check end-of-chunk tag

Point to the start of the data

calculate the total number of data bytes

check for need of data translation

Read the data off of disk

Definition at line 5621 of file ADF_internals.c.

void ADFI_read_data_chunk_table ( const unsigned int  file_index,
const struct DISK_POINTER block_offset,
struct DATA_CHUNK_TABLE_ENTRY  data_chunk_table[],
int *  error_return 
)

Get the tag and the length

Compare the start tag

Read the data from disk

Compare the end tag

Definition at line 5740 of file ADF_internals.c.

void ADFI_read_data_translated ( const unsigned int  file_index,
const unsigned long  file_block,
const unsigned long  block_offset,
const struct TOKENIZED_DATA_TYPE tokenized_data_type,
const int  data_size,
const long  total_bytes,
char *  data,
int *  error_return 
)

Get machine size of element stored in the NULL element

Limit the number to the end of the data.

Definition at line 5834 of file ADF_internals.c.

void ADFI_read_disk_block (  ) 

Definition at line 5915 of file ADF_internals.c.

void ADFI_read_disk_pointer_from_disk ( const unsigned int  file_index,
const unsigned long  file_block,
const unsigned long  block_offset,
struct DISK_POINTER block_and_offset,
int *  error_return 
)

Check the stack for block/offset

Get the block/offset from disk

Set the block/offset onto the stack

Convert into numeric form

Definition at line 5937 of file ADF_internals.c.

void ADFI_read_file ( const unsigned int  file_index,
const unsigned long  file_block,
const unsigned long  block_offset,
const unsigned int  data_length,
char *  data,
int *  error_return 
)

No need to buffer large pieces of data or to take special measures to cross block boundaries

Position the file

Read the data from disk

For smaller pieces of data, read a block at a time. This will improve performance if neighboring data is requested a small piece at a time (strided reads, file overhead).

Some assumptions apply to the block size. With some experimenting, 1K blocks do not offer much improvement. 4K blocks (4096 bytes) do improve performance remarkably. This is due to the fact that the file structure is based of 4K blocks with offsets.

buffer is not current, re-read

Position the file

Read the data from disk

Remember buffer information

Definition at line 6050 of file ADF_internals.c.

void ADFI_read_file_header ( const unsigned int  file_index,
struct FILE_HEADER file_header,
int *  error_return 
)

Check the stack for header

Read in the header into memory

Check memory tags for proper data

Set the header onto the stack

OK the memory tags look good, let's convert disk-formatted header into memory

Check memory tags for proper data

Definition at line 6159 of file ADF_internals.c.

void ADFI_read_free_chunk ( const unsigned int  file_index,
const struct DISK_POINTER block_offset,
struct FREE_CHUNK free_chunk,
int *  error_return 
)

Get the tag and the length

Compare the start tag

Set block offset to the start of the chunk

Read the data from disk

Compare the end tag

Definition at line 6371 of file ADF_internals.c.

void ADFI_read_free_chunk_table ( const unsigned int  file_index,
struct FREE_CHUNK_TABLE free_chunk_table,
int *  error_return 
)

Check the stack for free chunk

Read the free-chunk table off of disk

Check disk tags

Set the free chunk onto the stack

Convert into memory

Check memory tags

Definition at line 6450 of file ADF_internals.c.

void ADFI_read_node_header ( const unsigned int  file_index,
const struct DISK_POINTER block_offset,
struct NODE_HEADER node_header,
int *  error_return 
)

Check the stack for header

Get the node header from disk

Check disk tags

Set the header onto the stack

Convert into memory

Check memory tags

Definition at line 6572 of file ADF_internals.c.

void ADFI_read_sub_node_table ( const unsigned int  file_index,
const struct DISK_POINTER block_offset,
struct SUB_NODE_TABLE_ENTRY  sub_node_table[],
int *  error_return 
)

Get tag and length

calculate the number of chuldren in the sub-node table

Read and convert the variable-length table into memory

Definition at line 6700 of file ADF_internals.c.

void ADFI_read_sub_node_table_entry ( const unsigned int  file_index,
const struct DISK_POINTER block_offset,
struct SUB_NODE_TABLE_ENTRY sub_node_table_entry,
int *  error_return 
)

Check the stack for subnode

Read the entry from disk

Set the subnode onto the stack

Copy the name

Convert the disk-pointer

Definition at line 6785 of file ADF_internals.c.

void ADFI_remember_file_format ( const int  file_index,
const char  numeric_format,
const char  os_size,
int *  error_return 
)

Definition at line 6849 of file ADF_internals.c.

void ADFI_remember_version_update ( const int  file_index,
const char *  what_string,
int *  error_return 
)

Definition at line 6881 of file ADF_internals.c.

void ADFI_set_blank_disk_pointer ( struct DISK_POINTER block_offset  ) 

Definition at line 6923 of file ADF_internals.c.

int ADFI_stack_control ( const unsigned int  file_index,
const unsigned long  file_block,
const unsigned long  block_offset,
const int  stack_mode,
const int  stack_type,
const unsigned long  data_length,
char *  stack_data 
)

Try and find the entry and delete it from the stack

Try and find the entry or an empty slot or the lowest priority slot. If it exist then it has its priority bumped to number 1

Definition at line 6952 of file ADF_internals.c.

int ADFI_stridx_c ( const char *  str1,
const char *  str2 
)

Definition at line 7119 of file ADF_internals.c.

void ADFI_string_2_C_string ( const char *  string,
const int  string_length,
char *  c_string,
int *  error_return 
)

Skip and trailing blanks

Copy the non-trailing blank portion of the string

NULL terminate the C string

Definition at line 7153 of file ADF_internals.c.

char* ADFI_strtok ( char *  string,
char **  string_pos,
char *  token 
)

Definition at line 8585 of file ADF_internals.c.

void ADFI_unsigned_int_2_ASCII_Hex ( const unsigned int  number,
const unsigned int  minimum,
const unsigned int  maximum,
const unsigned int  string_length,
char  string[],
int *  error_return 
)

Index from 0 to string_length - 1

Index from string_length - 1 to 0

Temoprary integer variable

Working value of ther number

Convert the number using power-of-2 table

Definition at line 7203 of file ADF_internals.c.

void ADFI_write_data_chunk ( const unsigned int  file_index,
const struct DISK_POINTER block_offset,
const struct TOKENIZED_DATA_TYPE tokenized_data_type,
const int  data_size,
const long  chunk_bytes,
const long  start_offset,
const long  total_bytes,
const char *  data,
int *  error_return 
)

Write the tag

Calculate the end-of-chunk-tag pointer

Adjust location and write end-of-chunk pointer

write the data

Zero out the file data

If the data-pointer is NULL, write zeros to the file

Initialize the block of zeros

If the number of bytes to write is larger than the block of zeros we have, write out a series of zero blocks...

write out the remainder of this block

Write blocks of zeros, then a partial block

Write a partial block of zeros to disk

check for need of data translation

Write the data to disk

Write the ending tag to disk

Definition at line 7276 of file ADF_internals.c.

void ADFI_write_data_chunk_table ( const unsigned int  file_index,
const struct DISK_POINTER block_offset,
const int  number_of_data_chunks,
struct DATA_CHUNK_TABLE_ENTRY  data_chunk_table[],
int *  error_return 
)

Write Starting boundary tag

Calculate the end-of-chunk-tag location

Write data chunk table entries

Write Ending boundary tag

Definition at line 7438 of file ADF_internals.c.

void ADFI_write_data_translated ( const unsigned int  file_index,
const unsigned long  file_block,
const unsigned long  block_offset,
const struct TOKENIZED_DATA_TYPE tokenized_data_type,
const int  data_size,
const long  total_bytes,
const char *  data,
int *  error_return 
)

Get machine size of element stored in the NULL element

Limit the number to the end of the data.

Definition at line 7528 of file ADF_internals.c.

void ADFI_write_disk_block (  ) 

Definition at line 7606 of file ADF_internals.c.

void ADFI_write_disk_pointer_2_disk ( const unsigned int  file_index,
const unsigned long  file_block,
const unsigned long  block_offset,
const struct DISK_POINTER block_and_offset,
int *  error_return 
)

Convert into ASCII_Hex form

Put the block/offset to disk

Set the block/offset onto the stack

Definition at line 7628 of file ADF_internals.c.

void ADFI_write_file ( const unsigned int  file_index,
const unsigned long  file_block,
const unsigned long  block_offset,
const unsigned int  data_length,
const char *  data,
int *  error_return 
)

If the read buffer overlaps the buffer then reset it to make sure its currrent

Check to see if we need to flush the write buffer. this happens if we are writing a large chunk or the write moves out of the current block. If the data length is zero then just flush the buffer and return. Note that the ADF_modification_date routine will flush the buffer after any write operations !!

Position the file

write the buffer

Make sure we don't flush twice due to error

If the write buffer overlaps the buffer then reset it to make sure its currrent, set flush buffer flag to false.

Just a buffer flush

No need to buffer large pieces of data or to take special measures to cross block boundaries

Position the file

write the data

For smaller pieces of data, write a block at a time. This will improve performance if neighboring data is writen a small piece at a time (strided reads, file overhead).

Some assumptions apply to the block size. With some experimenting, 1K blocks do not offer much improvement. 4K blocks (4096 bytes) do improve performance remarkably. This is due to the fact that the file structure is based of 4K blocks with offsets. Also the CRAY loves 4K block writes!!

buffer is not current, re-read

Position the file

Read the data from disk

Remember buffer information

Write into the buffer and set flush buffer flag

Definition at line 7723 of file ADF_internals.c.

void ADFI_write_file_header ( const int  file_index,
const struct FILE_HEADER file_header,
int *  error_return 
)

Check memory tags for proper data

OK the memory tags look good, let's format the file header information into the disk format and write it out.

Now write the disk header out...

Set the header onto the stack

Definition at line 7874 of file ADF_internals.c.

void ADFI_write_free_chunk ( const int  file_index,
const struct DISK_POINTER block_offset,
const struct FREE_CHUNK free_chunk,
int *  error_return 
)

Initialize the block of 'X's

Check memory tags for proper data

Write start TAG

Write disk pointers

Write out a bunch of 'x's in the free chunk's empty space

Fill in partial end of a block

Fill in intermediate whole blocks

Fill in partial block to end-of-free-chunk

Now (finally) write out the free_chunk-end_tag

Definition at line 8034 of file ADF_internals.c.

void ADFI_write_free_chunk_table ( const int  file_index,
const struct FREE_CHUNK_TABLE free_chunk_table,
int *  error_return 
)

Check memory tags for proper data

OK the memory tags look good, let's format the free_chunk header information into the disk format and write it out.

Now write the free_chunk header out to disk...

Set the free chunk onto the stack

Definition at line 8166 of file ADF_internals.c.

void ADFI_write_modification_date ( const int  file_index,
int *  error_return 
)

block offset depends on the location the of modification date in the FILE_HEADER structure

Flush the write buffer to ensure the file is current!!

reset the version to default so that it only gets updated once

Definition at line 8265 of file ADF_internals.c.

void ADFI_write_node_header ( const int  file_index,
const struct DISK_POINTER block_offset,
const struct NODE_HEADER node_header,
int *  error_return 
)

Check memory tags for proper data

OK the memory tags look good, let's format the node header information into the disk format and write it out.

Now write the node-header out to disk...

Set the header onto the stack

Definition at line 8323 of file ADF_internals.c.

void ADFI_write_sub_node_table ( const unsigned int  file_index,
const struct DISK_POINTER block_offset,
const int  number_of_sub_nodes,
struct SUB_NODE_TABLE_ENTRY  sub_node_table[],
int *  error_return 
)

calculate the end-of-chunk tag pointer

Write start TAG

Write disk pointer

Format and write out the table entries

Write closing tag

Definition at line 8428 of file ADF_internals.c.

void ADFI_write_sub_node_table_entry ( const unsigned int  file_index,
const struct DISK_POINTER block_offset,
struct SUB_NODE_TABLE_ENTRY sub_node_table_entry,
int *  error_return 
)

Format the tag and disk pointer in memory

Now write it out to disk

Set the subnode onto the stack

Definition at line 8525 of file ADF_internals.c.

void FNAME ( adfwrit  ,
ADFWRIT   
) const

void FNAME ( adfwblk  ,
ADFWBLK   
) const

void FNAME ( adfwall  ,
ADFWALL   
) const

void FNAME ( adfslb2  ,
ADFSLB2   
) const

void FNAME ( adfses2  ,
ADFSES2   
) const

void FNAME ( adfread  ,
ADFREAD   
) const

void FNAME ( adfrblk  ,
ADFRBLK   
) const

void FNAME ( adfrall  ,
ADFRALL   
) const

void FNAME ( adfpna2  ,
ADFPNA2   
) const

void FNAME ( adfpdi2  ,
ADFPDI2   
) const

void FNAME ( adfncl2  ,
ADFNCL2   
) const

void FNAME ( adfmov2  ,
ADFMOV2   
) const

void FNAME ( adflin2  ,
ADFLIN2   
) const

void FNAME ( adflve2  ,
ADFLVE2   
)

void FNAME ( adfisl2  ,
ADFISL2   
) const

void FNAME ( adfgri2  ,
ADFGRI2   
) const

void FNAME ( adfgnd2  ,
ADFGND2   
) const

void FNAME ( adfgni2  ,
ADFGNI2   
) const

void FNAME ( adfgna2  ,
ADFGNA2   
) const

void FNAME ( adfglk2  ,
ADFGLK2   
) const

void FNAME ( adfglb2  ,
ADFGLB2   
) const

void FNAME ( adfges2  ,
ADFGES2   
)

void FNAME ( adfgdv2  ,
ADFGDV2   
) const

void FNAME ( adfgdt2  ,
ADFGDT2   
) const

void FNAME ( adfftd2  ,
ADFFTD2   
) const

void FNAME ( adferr2  ,
ADFERR2   
) const

void FNAME ( adfdel2  ,
ADFDEL2   
) const

void FNAME ( adfdve2  ,
ADFDVE2   
) const

void FNAME ( adfdsf2  ,
ADFDSF2   
) const

void FNAME ( adfdop2  ,
ADFDOP2   
) const

void FNAME ( adfdgf2  ,
ADFDGF2   
) const

void FNAME ( adfdgc2  ,
ADFDGC2   
) const

void FNAME ( adfdde2  ,
ADFDDE2   
) const

void FNAME ( adfdcl2  ,
ADFDCL2   
) const

void FNAME ( adfcre2  ,
ADFCRE2   
) const

void FNAME ( adfcid2  ,
ADFCID2   
) const

void FNAME ( adfcna2  ,
ADFCNA2   
) const


Variable Documentation

Definition at line 231 of file ADF_internals.c.

void const int const int * b_end

Definition at line 974 of file ADF_internals.h.

void const int * b_start

Definition at line 974 of file ADF_internals.h.

void Fchar Fchar Fchar const Fint const Fint* c_length

Definition at line 846 of file ADF_internals.h.

void const Fint const Fint Fint Fdouble* cIDs

Definition at line 796 of file ADF_internals.h.

Definition at line 846 of file ADF_internals.h.

void const Fint const Fint const Fint const Fint const Fint const Fint const Fint const Fint const Fchar data

Definition at line 969 of file ADF_internals.h.

void const Fchar data_type

Definition at line 870 of file ADF_internals.h.

void const Fchar const Fint * data_type_length

Definition at line 870 of file ADF_internals.h.

void const Fchar const Fint const Fint const Fint dim_vals (  ) 

Definition at line 876 of file ADF_internals.h.

void const Fchar const Fint const Fint* dims

Definition at line 954 of file ADF_internals.h.

void const Fint const Fint const Fint const Fint const Fint const Fint const Fint const Fint const Fchar Fint * error_return

Definition at line 786 of file ADF_internals.h.

Definition at line 861 of file ADF_internals.h.

void const Fchar const Fchar file

Definition at line 932 of file ADF_internals.h.

void const Fchar const Fchar const Fchar const Fint const Fint* file_length

Definition at line 932 of file ADF_internals.h.

Definition at line 891 of file ADF_internals.h.

void Fchar const Fint * filename_length

Definition at line 830 of file ADF_internals.h.

void const Fchar format

Definition at line 824 of file ADF_internals.h.

void const Fchar const Fint * format_length

Definition at line 824 of file ADF_internals.h.

void const Fdouble * ID

Definition at line 804 of file ADF_internals.h.

void const Fint const Fint const Fint* idim

Definition at line 786 of file ADF_internals.h.

void const Fint const Fint * imaxnum

Definition at line 786 of file ADF_internals.h.

void const Fint const Fint Fint * inum_ret

Definition at line 786 of file ADF_internals.h.

void const Fint * istart

Definition at line 786 of file ADF_internals.h.

void const Fchar label

Definition at line 885 of file ADF_internals.h.

void const Fchar const Fint * label_length

Definition at line 885 of file ADF_internals.h.

void Fchar const Fint Fchar link_path

Definition at line 891 of file ADF_internals.h.

Definition at line 891 of file ADF_internals.h.

void const Fint const Fint const Fint const Fint const Fint m_dims

Definition at line 981 of file ADF_internals.h.

void const Fint const Fint const Fint const Fint const Fint const Fint const Fint m_end (  ) 

Definition at line 981 of file ADF_internals.h.

void Fchar Fchar Fchar const Fint const Fint const Fint* m_length

Definition at line 846 of file ADF_internals.h.

void const Fint const Fint const Fint const Fint * m_num_dims

Definition at line 981 of file ADF_internals.h.

void const Fint const Fint const Fint const Fint const Fint const Fint m_start (  ) 

Definition at line 981 of file ADF_internals.h.

void const Fint const Fint const Fint const Fint const Fint const Fint const Fint const Fint m_stride (  ) 

Definition at line 981 of file ADF_internals.h.

Definition at line 232 of file ADF_internals.c.

Definition at line 846 of file ADF_internals.h.

void const Fdouble const Fchar name

Definition at line 804 of file ADF_internals.h.

void const Fchar const Fchar const Fchar name_in_file

Definition at line 932 of file ADF_internals.h.

void const Fdouble const Fchar const Fint * name_length

Definition at line 786 of file ADF_internals.h.

void const Fint const Fint const Fint const Fint Fint Fchar names

Definition at line 786 of file ADF_internals.h.

void const Fchar const Fchar const Fchar const Fint const Fint const Fint* nfile_length

Definition at line 932 of file ADF_internals.h.

void const Fdouble const Fdouble* NPID

Definition at line 943 of file ADF_internals.h.

Definition at line 949 of file ADF_internals.h.

void Fint* num_dims

Definition at line 912 of file ADF_internals.h.

void Fdouble * Root_ID

Definition at line 830 of file ADF_internals.h.

void const Fint const Fint s_end (  ) 

Definition at line 981 of file ADF_internals.h.

void const Fint s_start

Definition at line 981 of file ADF_internals.h.

void const Fint const Fint const Fint s_stride (  ) 

Definition at line 981 of file ADF_internals.h.

void const Fint Fchar status_in

Definition at line 830 of file ADF_internals.h.

void const Fint Fchar const Fint* status_length

Definition at line 830 of file ADF_internals.h.

void Fchar const Fint* str_length

Definition at line 861 of file ADF_internals.h.

void Fchar Fchar Fchar const Fint* v_length

Definition at line 846 of file ADF_internals.h.

void Fchar version

Definition at line 846 of file ADF_internals.h.

void const Fint* version_length

Definition at line 927 of file ADF_internals.h.


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