#include <assert.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
|
#define | MAX(x, y) ((x) > (y) ? (x) : (y)) |
|
#define | FMT_LEN(f, x) (size_t)(snprintf(NULL, 0, (f), (x))) |
|
|
void | reader_destroy (struct reader *r) |
|
const char * | reader_getline (struct reader *r, FILE *f) |
|
static void | result_destroy (struct result *r) |
|
static void | results_destroy (struct results *r) |
|
static void | results_append (struct results *r, size_t t_len, long t, char *msg) |
|
static bool | parse_line (const char *line, size_t *out_t_len, long *out_t, const char **out_msg) |
|
static void | calc_max (const struct results *r, size_t *max, size_t *max_sub0, size_t *max_sub1, size_t *max_div0, size_t *max_div1) |
|
static void | print_header (size_t max, size_t max_sub0, size_t max_sub1, size_t max_div0, size_t max_div1) |
|
static void | print_result (double t0, double t_prev, size_t max, size_t max_sub0, size_t max_sub1, size_t max_div0, size_t max_div1, double t, const char *msg) |
|
static void | print_table (const struct results *r) |
|
int | main () |
|
◆ FMT_LEN
#define FMT_LEN |
( |
| f, |
|
|
| x ) (size_t)(snprintf(NULL, 0, (f), (x))) |
◆ MAX
#define MAX |
( |
| x, |
|
|
| y ) ((x) > (y) ? (x) : (y)) |
◆ calc_max()
static void calc_max |
( |
const struct results * | r, |
|
|
size_t * | max, |
|
|
size_t * | max_sub0, |
|
|
size_t * | max_sub1, |
|
|
size_t * | max_div0, |
|
|
size_t * | max_div1 ) |
|
static |
◆ main()
◆ parse_line()
static bool parse_line |
( |
const char * | line, |
|
|
size_t * | out_t_len, |
|
|
long * | out_t, |
|
|
const char ** | out_msg ) |
|
static |
◆ print_header()
static void print_header |
( |
size_t | max, |
|
|
size_t | max_sub0, |
|
|
size_t | max_sub1, |
|
|
size_t | max_div0, |
|
|
size_t | max_div1 ) |
|
static |
◆ print_result()
static void print_result |
( |
double | t0, |
|
|
double | t_prev, |
|
|
size_t | max, |
|
|
size_t | max_sub0, |
|
|
size_t | max_sub1, |
|
|
size_t | max_div0, |
|
|
size_t | max_div1, |
|
|
double | t, |
|
|
const char * | msg ) |
|
static |
◆ print_table()
static void print_table |
( |
const struct results * | r | ) |
|
|
static |
◆ reader_destroy()
void reader_destroy |
( |
struct reader * | r | ) |
|
◆ reader_getline()
const char * reader_getline |
( |
struct reader * | r, |
|
|
FILE * | f ) |
◆ result_destroy()
static void result_destroy |
( |
struct result * | r | ) |
|
|
static |
◆ results_append()
static void results_append |
( |
struct results * | r, |
|
|
size_t | t_len, |
|
|
long | t, |
|
|
char * | msg ) |
|
static |
◆ results_destroy()
static void results_destroy |
( |
struct results * | r | ) |
|
|
static |