-
Notifications
You must be signed in to change notification settings - Fork 1
/
bf_play_main.h
48 lines (40 loc) · 1.03 KB
/
bf_play_main.h
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
37
38
39
40
41
42
43
44
45
46
47
48
/**
* Interactive Bloom filter.
*
* Load a Bloom filter and use it to evaluate a query.
*
* Author: Gati Aher
*/
#ifndef MAIN_H
#define MAIN_H
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <libgen.h>
#include <errno.h>
#include <string.h>
#include <getopt.h>
#include <stdint.h>
#define OPTSTR "vf:i:sxh"
#define USAGE_FMT "%s [-v] [-f file_load_bloom_from] [-i file_read_input_from] [-s mode_display_selected] [-x mode_select_in] [-h]\n \
\tDefault: load Bloom filter from `bf_saved.txt`, read input from stdin, m = 60, k = 3, -s OFF (print all text), -x OFF (color out-of-set terms red) \n"
#define ERR_FOPEN_READ_INPUT_FROM "Error while opening the file: fopen(file_read_input_from, r)"
#define ERR_RUN_BLOOM "bf_play failed"
#define DEFAULT_PROGNAME "bf_play"
enum modes
{
M_DEF = 0,
M_SEL = 1,
M_IN = 2
};
typedef struct
{
int verbose;
FILE *fread_input_from;
char *loc_load_bloom;
int mode;
} options_t;
#include "bf_play.h"
/* print program details */
void usage(char *progname);
#endif