You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
naka/include/display.h

36 lines
699 B

#ifndef _DISPLAY_H
#define _DISPLAY_H
#include <stdio.h>
#include "macros.h"
#include "ints.h"
#include "slice.h"
typedef enum display_kind {
DISPK_NORMAL = 0,
DISPK_CSV,
DISPK_BINARY,
DISPK_INI,
} dispkind_t;
#define X(n) AS(1lu << (n), usize)
typedef enum display_flags {
DISPF_SHOW_NUMBER = X(0),
DISPF_SHOW_LENGTH = X(1),
DISPF_SHOW_SLICE = X(2),
DISPF_SHOW_FAILURES = X(3),
} dispflags_t;
#define DISPLAY_FLAGS_DEFAULT (DISPF_SHOW_SLICE | DISPF_SHOW_NUMBER | DISPF_SHOW_FAILURES)
#undef X
typedef struct {
slice_t cslice;
const void* base;
usize index;
} dispin_t;
void display_result(FILE* output, dispin_t input, dispkind_t how, dispflags_t flags);
#endif /* _DISPLAY_H */