<commit_before>#ifndef _POSITIONS_H
#define _POSITIONS_H

#include <stdio.h>

#include "devices.h"

typedef struct {
  size_t pos;                    // 8
  double submittime, finishtime; // 16
  unsigned int len;              // 4;
  unsigned short seed;           // 2
  unsigned short q;              // 2
  char  action;                  // 1: 'R' or 'W'
  char  success:4;               // 0.5
  char  verify:4;                // 0.5
} positionType;

typedef struct {
  positionType *positions;
  size_t sz;
  char *string;
  char *device;
  size_t bdSize;
  size_t minbs;
  size_t maxbs;
  size_t writtenBytes;
  size_t writtenIOs;
  size_t readBytes;
  size_t readIOs;
  size_t UUID;
  double elapsedTime;
} positionContainer;

positionType *createPositions(size_t num);

int checkPositionArray(const positionType *positions, size_t num, size_t bdSizeBytes, size_t exitonerror);
void positionContainerSave(const positionContainer *p, const char *name, const size_t bdSizeBytes, const size_t flushEvery);<commit_msg>Bit-field only available in gcc<commit_after>#ifndef _POSITIONS_H
#define _POSITIONS_H

#include <stdio.h>

#include "devices.h"

typedef struct {
  size_t pos;                    // 8
  double submittime, finishtime; // 16
  unsigned int len;              // 4;
  unsigned short seed;           // 2
  unsigned short q;              // 2
  char  action;                  // 1: 'R' or 'W'
  unsigned int  success:4;               // 0.5
  unsigned int  verify:4;                // 0.5
} positionType;

typedef struct {
  positionType *positions;
  size_t sz;
  char *string;
  char *device;
  size_t bdSize;
  size_t minbs;
  size_t maxbs;
  size_t writtenBytes;
  size_t writtenIOs;
  size_t readBytes;
  size_t readIOs;
  size_t UUID;
  double elapsedTime;
} positionContainer;

positionType *createPositions(size_t num);

int checkPositionArray(const positionType *positions, size_t num, size_t bdSizeBytes, size_t exitonerror);
void positionContainerSave(const positionContainer *p, const char *name, const size_t bdSizeBytes, const size_t flushEvery);
{'fraction_non_alphanumeric': 0.08614051973051011, 'fraction_numerical': 0.012512030798845043, 'mean_word_length': 2.660211267605634, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3693598', 'n_tokens_mistral': 724, 'n_tokens_neox': 682, 'n_words': 199}