<commit_before>#ifndef OEPCIE_H
#define OEPCIE_H

#include "oedevices.h"

typedef enum oe_stream_opts{
	OE_HEADER_STREAMPATH,
	OE_CONFIG_STREAMPATH,
	OE_DATA_STREAMPATH,
	OE_HARDWARECONFIG,
	OE_HARDWAREOFFSET,
	OE_NUMDEVICES
} oe_stream_opt_t;

typedef enum oe_error{
	OE_EHPATHINVALID = -1, // Invalid header path, fail on open
	OE_ECPATHINVALID = -2, // '' config
	OE_EDPATHINVALID = -3, // '' data
	OE_ENOTINIT, // Invalid operation on non-initialized ctx
	OE_EPREINIT = -4, // Double initialization attempt
	OE_EIDINVALID = -5, // Invalid device ID on init or reg op
	OE_EREADFAILURE = -6, // Failure to read from a stream/register
	OE_EWRITEFAILURE = -7, // Failure to write to a stream/register
	OE_ENULLCTX = -8, // Attempt to call function w null state
	OE_ENOOP = -9, // Invalid flag pass to get/set opt
	OE_ESEEKFAILURE = - 10 // Failure to seek on stream
} oe_error_t;

typedef struct oe_ctx_impl *oe_ctx;

int oe_init(oe_ctx* state);

oe_ctx* oe_create_ctx();

int oe_destroy_ctx(oe_ctx* state);

int oe_set_opt(oe_ctx* state, int option, const void* option_value, size_t option_len);

int oe_get_opt(const oe_ctx* state, int option, void* option_value, size_t *option_len);

int oe_write_reg(const oe_ctx* state, int device_idx, int addr, int value);

int oe_read_reg(const oe_ctx* state, int device_idx, int addr, int* value);

int oe_read(const oe_ctx* state, void *data, size_t size);

// int oe_write(const oe_ctx* state, void* data, size_t size);

static int oe_all_read(int fd, void* data, size_t size);
static int oe_reg_prep(oe_ctx ctx, int device_id, int addr);

// DEBUGGING FUNCTIONALITY - These are here for only debug purposes, since
// the impl information isn't provided to the user.

void OEDEBUG_print(oe_ctx* state);

#endif<commit_msg>forgot value for one error code<commit_after>#ifndef OEPCIE_H
#define OEPCIE_H

#include "oedevices.h"

typedef enum oe_stream_opts{
	OE_HEADER_STREAMPATH,
	OE_CONFIG_STREAMPATH,
	OE_DATA_STREAMPATH,
	OE_HARDWARECONFIG,
	OE_HARDWAREOFFSET,
	OE_NUMDEVICES
} oe_stream_opt_t;

typedef enum oe_error{
	OE_EHPATHINVALID = -1, // Invalid header path, fail on open
	OE_ECPATHINVALID = -2, // '' config
	OE_EDPATHINVALID = -3, // '' data
	OE_ENOTINIT = -11, // Invalid operation on non-initialized ctx
	OE_EPREINIT = -4, // Double initialization attempt
	OE_EIDINVALID = -5, // Invalid device ID on init or reg op
	OE_EREADFAILURE = -6, // Failure to read from a stream/register
	OE_EWRITEFAILURE = -7, // Failure to write to a stream/register
	OE_ENULLCTX = -8, // Attempt to call function w null state
	OE_ENOOP = -9, // Invalid flag pass to get/set opt
	OE_ESEEKFAILURE = - 10 // Failure to seek on stream
} oe_error_t;

typedef struct oe_ctx_impl *oe_ctx;

int oe_init(oe_ctx* state);

oe_ctx* oe_create_ctx();

int oe_destroy_ctx(oe_ctx* state);

int oe_set_opt(oe_ctx* state, int option, const void* option_value, size_t option_len);

int oe_get_opt(const oe_ctx* state, int option, void* option_value, size_t *option_len);

int oe_write_reg(const oe_ctx* state, int device_idx, int addr, int value);

int oe_read_reg(const oe_ctx* state, int device_idx, int addr, int* value);

int oe_read(const oe_ctx* state, void *data, size_t size);

// int oe_write(const oe_ctx* state, void* data, size_t size);

static int oe_all_read(int fd, void* data, size_t size);
static int oe_reg_prep(oe_ctx ctx, int device_id, int addr);

#endif
{'fraction_non_alphanumeric': 0.09546258102533883, 'fraction_numerical': 0.007071302298173247, 'mean_word_length': 4.705882352941177, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3187992', 'n_tokens_mistral': 1351, 'n_tokens_neox': 1300, 'n_words': 386}