-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreader.h
More file actions
69 lines (57 loc) · 2.01 KB
/
reader.h
File metadata and controls
69 lines (57 loc) · 2.01 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
66
67
68
69
/**********************************************************************************************************************
************************************************ The reader module ***************************************************
**********************************************************************************************************************/
#ifndef ASSEMBLER_READER_H
#define ASSEMBLER_READER_H
#include <stdio.h>
#include "builder.h"
typedef struct reader_t *Reader; /*the Reader type definition*/
/**
* @brief created a new Reader object and allocated all its necessary memory
* @param objectFiles an array of the files names strings
* @param objectFilesSize the size of the array
* @return the newly created Reader object
*/
Reader reader_create(const char **objectFiles, size_t objectFilesSize);
/**
* @brief deallocates the reader object
* @param reader the reader to destroy
*/
void reader_destroy(Reader reader);
/**
* @brief loads the next file to the reader
* @param reader
* @return error code or NoErrorFound
*/
Error reader_load_next_file(Reader reader);
/**
* @brief runs the first pass
* @param reader
* @return error code or NoErrorFound
*/
Error reader_run_first_pass(Reader reader);
/**
* @brief runs the second pass
* @param reader
* @return error code or NoErrorFound
*/
Error reader_run_second_pass(Reader reader);
/**
* @brief frees an array of string
* @param array the strings array to destroy
* @param size the size of the given array
*/
void free_string_array(char **array, size_t size);
/**
* @brief return the current builder
* @param reader
* @return the current builder
*/
Builder reader_get_builder(Reader reader);
/**
* @brief return true if an error occurred
* @param reader
* @return True if an error occurred
*/
Bool reader_is_error_occurred(Reader reader);
#endif /*ASSEMBLER_READER_H*/