-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDataShell.h
More file actions
150 lines (132 loc) · 2.45 KB
/
DataShell.h
File metadata and controls
150 lines (132 loc) · 2.45 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
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
//
// DataShell.h
//
//
// Created by Samantha Morris 25/03/2021.
//
#ifndef DataShell_h
#define DataShell_h
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
/* Set EXTERN macro: */
#ifndef DataShell_IMPORT
#define EXTERN
#else
#define EXTERN extern
#endif
/* Function prototypes. */
typedef uint8_t BYTE;
EXTERN int NumberLines(char *fileName);
/*
*
* The function NumberLines sees how many lines there are in a csv.
*
* @params
* char *fileName
* Name of file
*
*
* @returns
* int
*/
FILE* openMyfile (char *fileName, const char mode);
/*
*
* The function openMyfile opens a file.
*
* @params
* char *fileName
* Name of file
*
*
* @returns
* FILE*
*/
void closeMyfile(FILE *file);
/*
*
* The function closeMyfile close a file.
*
* @params
* char *fileName
* Name of file
*
*
* @returns
* void
*/
void readDB (float **Matrix, char *fileName, int numElements);
/*
*
* The function readDB reads a Data Base.
*
* @params
* float **Matrix
* Matrix where the DB is gonna be store
* char *fileName
* Name of file
* int numElements
* Number of elements in a line
*
*
* @returns
* void
*/
int countElements(char *fileName);
/*
*
* The function countElements counts the number of elements in a line from a csv.
*
* @params
* char *fileName
* Name of file
*
*
* @returns
* int
*/
void printMatrix (float **Matrix, int *numLines, int *numElements);
/*
*
* The function printMatrix prints the matrix that contains all data from a csv file.
*
* @params
* float **Matrix
* Matrix where the DB is gonna be store
* int numLines
* Number of lines in a csv file.
* int numElements
* Number of elements in a line
*
*
* @returns
* void
*/
void menuOne(char **fileName);
/*
*
* The function menuOne asks user for the name of the csv file that wants to open.
*
* @params
* char *fileName
* Name of file
*
*
* @returns
* void
*/
int menuTwo(void);
/*
*
* The function menuTwo asks user if he wants to print data.
*
* @params
* void
*
*
* @returns
* int
*/
#endif /* DataShell.h */