blob: a65caa47eaaeb4572e895ce423a07262d060e14d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
/*
*/
#ifndef H_CDF
#define H_CDF
#define _GNU_SOURCE /* Enable getline on Linux */
#define _POSIX_C_SOURCE 200809L /* Enable POSIX features */
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <getopt.h>
#include <ctype.h>
#include <string.h>
#include <stdint.h>
#include <inttypes.h>
#include <assert.h>
typedef union {
int64_t i;
uint64_t u;
double d;
} Number;
typedef struct {
Number data;
uint64_t count;
} DistRecord;
static int parse_options(int argc, char*const* argv);
static void help();
static int process_data(FILE *file);
static DistRecord *expand_array(DistRecord *records, size_t *capacity);
#endif
|