-
Notifications
You must be signed in to change notification settings - Fork 0
/
stats.h
95 lines (83 loc) · 2.35 KB
/
stats.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include "linkedList.h"
#ifndef STATS_H_INCLUDED
#define STATS_H_INCLUDED
/**
* Saves the statistics for a recipes book to a text file.
*
* @param book a pointer to the recipes book to save the statistics for
* @param file_name the name of the file to save the statistics to
* @param recipes_file_name the name of the file the recipes were loaded from
*/
void produce_stats(recipes_book *book, char *file_name, char *recipes_file_name);
/**
* Gets the number of lines in the input file
*
* @param file_name the file name of the recipes file
*
* @return the number of lines in the input file
*/
int num_lines(char *file_name);
/**
* Gets the number of unique words in the input file
*
* @param recipes_file_name the name of the file the recipes were loaded from
*
* @return the number of unique words in the input file
*/
int num_unique_words(char *recipes_file_name);
/**
* Gets the number of words (including duplicates) in the input file
*
* @param recipes_file_name the name of the file the recipes were loaded from
*
* @return the number of unique words in the input file
*/
int num_words(char *recipes_file_name);
/**
* Gets the most frequent letter in the input file (ignoring duplicates)
*
* @param recipes_file_name the name of the file the recipes were loaded from
*
* @return the most frequent letter in the input file (ignoring duplicates)
*/
char most_frequent_letter(char *recipes_file_name);
/**
* Gets the number of categories in the recipe book
*
* @param book the recipe book
*
* @return the number of categories in the input file
*/
int num_categories(recipes_book *book);
/**
* Gets the number of recipes in the recipe book
*
* Isn't used or implemented because it is the same
* as the number of lines in the file
*
* @param book the recipes book
*
* @return the number of recipes in the input file
*/
int num_recipes(recipes_book *book);
/**
* Gets the category with the most recipes
*
* @param book the recipes book
*
* @return the category with the most recipes
*/
char *category_with_most_recipes(recipes_book *book);
/**
* Gets the longest recipe (in terms of number of characters)
*
* @param book the recipes book
*
* @return the longest recipe (in terms of number of characters)
*/
char *longest_recipe(recipes_book *book);
#endif