Skip to content
Snippets Groups Projects
Commit 757d2502 authored by lhausamm's avatar lhausamm Committed by Loic Hausammann
Browse files

File Header working

parent fb100c1b
Branches
Tags
1 merge request!502Logger
......@@ -304,9 +304,7 @@ void logger_write_file_header(struct dump *dump) {
memcpy(buff, LOGGER_VERSION, LOGGER_VERSION_SIZE);
/* write number of bytes used for the offsets */
message("Start %lu", *file_offset);
buff = dump_get(dump, LOGGER_OFFSET_SIZE, file_offset);
message("End %lu", *file_offset);
memcpy(buff, &log_const.offset, LOGGER_OFFSET_SIZE);
/* will write the offset of the first particle here */
......@@ -320,6 +318,7 @@ void logger_write_file_header(struct dump *dump) {
buff = dump_get(dump, LOGGER_NBER_SIZE, file_offset);
memcpy(buff, &log_const.number, LOGGER_NBER_SIZE);
/* write masks */
mask_size = log_const.nber_mask * (log_const.name + log_const.mask);
name_buff = dump_get(dump, mask_size, file_offset);
for(i=0; i<log_const.nber_mask; i++) {
......@@ -337,6 +336,7 @@ void logger_write_file_header(struct dump *dump) {
/* last step */
memcpy(skip_header, file_offset, log_const.offset);
message("First offset %lu", *file_offset);
logger_const_free(&log_const);
}
......@@ -346,7 +346,7 @@ void logger_const_init(struct logger_const* log_const) {
log_const->mask = 1;
log_const->number = 1;
log_const->nber_mask = 8;
log_const->nber_mask = 1;
char *cur_name;
char tmp[log_const->name];
......
......@@ -84,7 +84,7 @@ struct dump;
* Size in bytes
*/
#define LOGGER_VERSION_SIZE 20 // size of the version message
#define LOGGER_NAME_SIZE 1 // size of the labels
#define LOGGER_NAME_SIZE 2 // size of the labels
#define LOGGER_MASK_SIZE 1 // size of the masks
#define LOGGER_NBER_SIZE 1 // size of the number of elements
#define LOGGER_OFFSET_SIZE 1// size of the offset size information
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment