aboutsummaryrefslogtreecommitdiffstats
path: root/src/word.h
blob: f7006a36636eb1d512f78ac4cc45635a97640ef8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#ifndef WORD_H
#define WORD_H

#include <stdio.h>

/**
 * Read in a word from a file up to size length.
 *
 * @param fp[in] The file to read a word from.
 * @param word[out] The word that was read as a null-terminated string.
 * @param length[in] The length of the word to read in.
 *
 * @note `length` should be the number of characters you'd
 *       like to read in plus one to take into account the
 *       null terminator.
 */
int read_word(FILE *fp, char *word, size_t length);

#endif