next up previous contents
Next: Manual Pages Up: Two Templates for SDDS Previous: Accessing Data Stored in   Contents

SDDS Output of Internally-Generated Data

SDDS_TABLE SDDS_table;

/* open the file and set a few data set properites */ 
SDDS_InitializeOutput(&SDDS_table, ...)

/* define columns */ 
SDDS_DefineColumn(&SDDS_table, column_name, ...); 
...

/* define arrays */ 
SDDS_DefineArray(&SDDS_table, array_name, ...);
...

/* define parameters */ 
SDDS_DefineParameter(&SDDS_table, parameter_name, ...); 
...

/* save the header */ 
SDDS_SaveLayout(&SDDS_table);

/* write the header */ 
SDDS_WriteLayout(&SDDS_table);

/* generate and output the data */ 
while (DataGenerated(my_data_structure)) { 
    /* start a new SDDS data table */ 
    SDDS_StartTable(&SDDS_table, rows);

    /* put data into SDDS parameters and columns */ 
    SDDS_SetParameters(&SDDS_table, ...); 
    ... 
    SDDS_SetArray(&SDDS_table, ...); 
    ... 
    SDDS_SetColumn(&SDDS_table, ...); 
    ...

    /* write the new data table */ SDDS_WriteTable(&SDDS_table);
}

SDDS_Terminate(&SDDS_table);



Robert Soliday 2006-06-29