-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.h
More file actions
45 lines (33 loc) · 1.22 KB
/
setup.h
File metadata and controls
45 lines (33 loc) · 1.22 KB
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
#include "getopt.h"
#include <gdbm.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*Useful setup info for the Rhyming Dictionary
Copyright (C) 2000,2001,2002 Brian Langenberger
Released under the terms of the GNU Public License.
See the file "COPYING" for full details.*/
#ifndef DEFAULT_RHYMEPATH
#define DEFAULT_RHYMEPATH "/usr/share/rhyme"
#endif
#define WORDS_NAME "/words.db"
#define RHYMES_NAME "/rhymes.db"
#define MULTIPLES_NAME "/multiple.db"
#define RHYME_ENV "RHYMEPATH"
#define VERSION "0.9"
/*I only have three flags so the binary representation is rather simple*/
#define FLAG_SYLLABLE 1
#define FLAG_INTERACTIVE 2
#define FLAG_MERGED 4
/*something to print if gdbm dies horribly*/
void fatalError(const char s[]);
/*The wordfile, rhymefile and multiplefile are set by this function
The flags are the bits set by the command-line arguments.
The wordindex is where the actual words begin, set by this function.*/
void rhymeSetup(GDBM_FILE *wordfile, GDBM_FILE *rhymefile,
GDBM_FILE *multiplefile,
int *flags, int argc, char *argv[], int *wordindex);
GDBM_FILE openGDBMFile(char *dir, char *file);
void printHelp(FILE *stream);
void swapSyllableModes(int *flags);
void swapMergedModes(int *flag);