@@ -19,8 +19,7 @@ struct TidyResult{
19
19
TidyBoolean error ;
20
20
};
21
21
typedef struct TidyResult TidyResult ;
22
-
23
- TidyBoolean tidyFML_exists (const char [] tidyPath ){
22
+ TidyBoolean tidyFML_exists (const char tidyPath []){
24
23
#ifdef _WIN32
25
24
DWORD tidyAttributes = GetFileAttributes (tidyPath );
26
25
if (tidyAttributes != INVALID_FILE_ATTRIBUTES ){
@@ -39,7 +38,7 @@ TidyBoolean tidyFML_exists(const char[] tidyPath){
39
38
#endif
40
39
}
41
40
42
- TidyResult tidyFML_isFolder (const char [] tidyPath ){
41
+ TidyResult tidyFML_isFolder (const char tidyPath [] ){
43
42
TidyResult resultHere ;
44
43
#ifdef _WIN32
45
44
DWORD tidyAttributes = getFileAttributes (tidyPath );
@@ -59,7 +58,7 @@ TidyResult tidyFML_isFolder(const char[] tidyPath){
59
58
if (stat (tidyPath , & tidyPathStat ) != 0 ){
60
59
resultHere .error = TRUE;
61
60
}
62
- if (S_ISDIR (tidyathStat .st_mode )){
61
+ if (S_ISDIR (tidyPathStat .st_mode )){
63
62
resultHere .error = FALSE;
64
63
resultHere .result = TRUE;
65
64
}
@@ -71,7 +70,7 @@ TidyResult tidyFML_isFolder(const char[] tidyPath){
71
70
return resultHere ;
72
71
}
73
72
74
- TidyResult tidyFML_isFile (const char [] tidyPath ){
73
+ TidyResult tidyFML_isFile (const char tidyPath [] ){
75
74
TidyResult resultHere ;
76
75
#ifdef _WIN32
77
76
DWORD tidyAttributes = getFileAttributes (tidyPath );
@@ -91,7 +90,7 @@ TidyResult tidyFML_isFile(const char[] tidyPath){
91
90
if (stat (tidyPath , & tidyPathStat ) != 0 ){
92
91
resultHere .error = TRUE;
93
92
}
94
- if (S_ISREG (tidyathStat .st_mode )){
93
+ if (S_ISREG (tidyPathStat .st_mode )){
95
94
resultHere .error = FALSE;
96
95
resultHere .result = TRUE;
97
96
}
@@ -103,7 +102,7 @@ TidyResult tidyFML_isFile(const char[] tidyPath){
103
102
return resultHere ;
104
103
}
105
104
106
- TidyBoolean tidyFML_createFolder (char [] tidyPath ){
105
+ TidyBoolean tidyFML_createFolder (const char tidyPath [] ){
107
106
#ifdef _WIN32
108
107
if (CreateDirectory (tidyPath , NULL )){
109
108
return TRUE;
@@ -121,9 +120,9 @@ TidyBoolean tidyFML_createFolder(char[] tidyPath){
121
120
#endif
122
121
}
123
122
124
- TidyBoolean tidyFML_delete (char [] tidyPath ){
123
+ TidyBoolean tidyFML_delete (const char tidyPath [] ){
125
124
TidyResult tidyIsFile = tidyFML_isFile (tidyPath );
126
- TidyResult tidyIsDirectory = tidyFML_isDirectory (tidyPath )
125
+ TidyResult tidyIsDirectory = tidyFML_isFolder (tidyPath );
127
126
if (tidyIsFile .error == FALSE && tidyIsFile .result == TRUE){
128
127
#ifdef _WIN32
129
128
if (DeleteFile (tidyPath )){
@@ -141,7 +140,7 @@ TidyBoolean tidyFML_delete(char[] tidyPath){
141
140
}
142
141
#endif
143
142
}
144
- if (tidyIsDirectory .error == FALSE && tidyIsDirectory .result = TRUE){
143
+ if (tidyIsDirectory .error == FALSE && tidyIsDirectory .result == TRUE){
145
144
#ifdef _WIN32
146
145
if (RemoveDirectory (tidyPath )){
147
146
return TRUE;
@@ -160,18 +159,18 @@ TidyBoolean tidyFML_delete(char[] tidyPath){
160
159
}
161
160
}
162
161
163
- TidyBoolean tidyFML_createFile (char [] tidyPath ){
162
+ TidyBoolean tidyFML_createFile (const char tidyPath [] ){
164
163
FILE * fileHere = fopen (tidyPath , "w" );
165
164
if (fileHere == NULL ){
166
- return FALSE
165
+ return FALSE;
167
166
}
168
167
if (fclose (fileHere ) != 0 ){
169
- return FALSE
168
+ return FALSE;
170
169
}
171
- return TRUE
170
+ return TRUE;
172
171
}
173
172
174
- TidyBoolean tidyFML_clear (char [] tidyPath ){
173
+ TidyBoolean tidyFML_clear (const char tidyPath [] ){
175
174
if (tidyFML_delete (tidyPath ) == FALSE){
176
175
return FALSE;
177
176
}
0 commit comments