blob: 1d8387b2d369a0442445a1e788e0195c9aed7542 (
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
|
/*
*/
#ifndef H_CUMSUM
#define H_CUMSUM
#define _GNU_SOURCE /* Enable getline on Linux */
#define _POSIX_C_SOURCE 200809L /* Enable POSIX features */
#include <stdlib.h>
#include <errno.h>
#include <unistd.h>
#include <stdio.h>
#include <ctype.h>
#include <getopt.h>
#include <string.h>
#include <stdint.h>
#include <inttypes.h>
#include <assert.h>
typedef union {
int64_t i;
uint64_t u;
double d;
} Number;
static int parse_options(int argc, char*const* argv);
static void help();
static int process_data(FILE *file);
static void print_sum(Number sum);
#endif
|