-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathmre_file.h
160 lines (147 loc) · 5.63 KB
/
mre_file.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
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
151
152
153
154
155
156
157
158
159
160
/*
mre_file.h All file realted stuff's header file
*/
/*****************************************************************************
* FUNCTION
* mre_create_file
* DESCRIPTION
* This function creates a file with given name in a drive set earlier
* PARAMETERS
* file name [IN] name of file
* RETURNS
* result [OUT] some code for error and success
*****************************************************************************/
VMINT mre_create_file(VMSTR file_name);
/*****************************************************************************
* FUNCTION
* mre_write_file
* DESCRIPTION
* This function writes on the file given
* PARAMETERS
* file name [IN] name of file
* RETURNS
* result [OUT] some code for error and success
*****************************************************************************/
VMINT mre_write_file(VMSTR file_name);
/*****************************************************************************
* FUNCTION
* mre_check_modify_time
* DESCRIPTION
* This function displays file's modified time
* PARAMETERS
* file name [IN] name of file
* RETURNS
* result [OUT] some code for error and success
*****************************************************************************/
VMINT mre_check_modify_time(VMSTR file_name);
/*****************************************************************************
* FUNCTION
* mre_write_line_to_file
* DESCRIPTION
* This function writes a VMSTR line to a file
* PARAMETERS
* VMSTR file_name [IN] the file name in VMSTR
* VMSTR line [IN] the line to be written in VMSTR
* RETURNS
* VMINT MRE_SCILENT if success; MRE_FILE_NOT_WRITTEN if not
*****************************************************************************/
VMINT mre_write_line_to_file(VMSTR file_name, VMSTR line);
/*****************************************************************************
* FUNCTION
* vm_log_file
* DESCRIPTION
* This function logs a message to a file
* PARAMETERS
* VMSTR message [IN] the message log line
* RETURNS
* VMINT MRE_SCILENT if success; MRE_FILE_NOT_WRITTEN if not
*****************************************************************************/
VMINT vm_log_file(VMSTR message);
/*****************************************************************************
* FUNCTION
* does_this_file_exist
* DESCRIPTION
* Checks if the givenn filename exists
* PARAMETERS
* VMSTR filename [IN] filename in VMSTR
* RETURNS
* VMBOOL TRUE if file exists or FALSE if it doesnt
*****************************************************************************/
VMBOOL does_this_file_exist(VMSTR filename);
/*****************************************************************************
* FUNCTION
* does_this_wfile_exist
* DESCRIPTION
* Checks if the given filename(in VMWSTR) exists
* PARAMETERS
* VMWSTR wfilename [IN] filename in VMWSTR
* RETURNS
* VMBOOL TRUE if file exists or FALSE if it doesnt
*****************************************************************************/
VMBOOL does_this_wfile_exist(VMWSTR wfilename);
/*****************************************************************************
* FUNCTION
* mre_create_file_for_write
*
* DESCRIPTION
* it create file in which response data has been written
*
* PARAMETERS
* VMSTR filename
* VMINT *layer_hdl
* RETURNS
* VOID
*****************************************************************************/
void mre_create_file_for_write(VMSTR filename, VMINT *layer_hdl);
/*****************************************************************************
* FUNCTION
* mre_dump_to_file Declaration
*
* DESCRIPTION
* Write response data to specified file
*
* PARAMETERS
* tcp_buffer [IN] buffer pointer containing address of received buffer
* size [IN] size of received data
* layer_hdl [IN] VMINT *layer_hdl
*
* RETURNS
* VOID
*****************************************************************************/
void mre_dump_to_file(VMCHAR *tcp_buffer, VMINT size, VMINT *layer_hdl);
/*****************************************************************************
* FUNCTION DECLARATION
* mre_read_file
* DESCRIPTION
* This function reads the file's contents and returns it
* PARAMETERS
* file name [IN] name of file
*
* RETURNS
* result [OUT] some code for error and success
*****************************************************************************/
VMINT mre_read_file(VMSTR file_name, VMCHAR *data);
/*****************************************************************************
* FUNCTION DECLARATION
* mre_get_file_size
* DESCRIPTION
* This function gets the file size
* PARAMETERS
* file name VMSTR [IN] name of file
* RETURNS
* result VMINT [OUT] some code for error and success
*****************************************************************************/
VMINT mre_get_file_size(VMSTR file_name);
/*****************************************************************************
* FUNCTION DECLARATION
* mre_open_file
* DESCRIPTION
* This function opens the file and returns the handle
* PARAMETERS
* file_path VMSTR [IN] path of file
* mode VMUINT [IN] mode of file open
* binary VMUINT [IN] if file should be open as binary
* RETURNS
* result VMFILE [OUT] MRE's file handle
*****************************************************************************/
VMFILE mre_open_file(VMSTR file_path, VMUINT mode, VMUINT binary);