-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathworkers.h
More file actions
65 lines (46 loc) · 1.78 KB
/
workers.h
File metadata and controls
65 lines (46 loc) · 1.78 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#ifndef _WORKERS_H_
#define _WORKERS_H_
#include "retrie.h"
#include "main.h"
#include "map.h"
extern struct text_info *text_list_head;
extern struct answer_list_node *answer_list_head;
struct answer_list_node
{
int line_id;
int path_chars_counter;
char *path_name;
struct map_node *answer_map_node;
struct answer_list_node *answer_next;
};
struct text_info
{
struct text_info *text_list_next;
struct map_node *current_map_node_root;
struct trie_node *current_trie_node_root;
char *path_name;
int freq;
int path_chars_counter;
int path_n_text_chars_counter;
char path_n_text_name[0];
};
struct wc_answer_list_node
{
unsigned long int n_bytes;
unsigned long int n_words;
unsigned int n_lines;
};
struct answer_list_node *new_answer_node(void);
struct docfile_line_info *new_list_node(int path_length);
struct text_info *new_text_node(int path_n_text_length);
int worker_paths(char *fifo_name1);
void worker_dirs(struct docfile_line_info *line_list_head);
void worker_create_tries(struct text_info *text_list_head);
void search_word_n_update_log(struct text_info *text_list_node, struct word *worker_word, time_t query_arrival, FILE *log_fp);
void worker_update_answer_list(struct trie_node *trie_node_temp, struct text_info *text_list_temp);
void worker_get_wc_statistics(struct wc_answer_list_node *wc_answer_list_temp, struct text_info *incoming_struct);
void worker_update_wc_statistics(struct wc_answer_list_node *wc_answer_list_temp, struct map_node *incoming_map_node);
struct text_info *search_max(struct text_info *text_list_head, struct word *worker_word);
struct text_info *search_min(struct text_info *text_list_head, struct word *worker_word);
void free_line_list(struct docfile_line_info *incoming_struct);
#endif /* _WORKERS_H_ */