blob: 76b225ad31ad4f5f1db953294ec83bf22760dc73 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#ifndef IO_H_
#define IO_H_
#include <ctype.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "invertedIndex.h"
// Returns a malloc'ed char* of the next word in the file. NULL otherwise.
// Undefined behaviour if the word is greater than 100 chars.
char *getNextWord(FILE *const fptr);
// Returns true if a string in the second argument exists past the fptr in a
// file.
bool exists_after(FILE *const fptr, char *const string);
// Outputs the contents of an inverted index to the file specified by fptr.
void writeInvertedIndex(FILE *const fptr, struct InvertedIndexNode *node);
#endif
|