Skip to content

Commit b13edf5

Browse files
committed
add in-code comments
1 parent 95e76be commit b13edf5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/stdlib_system.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,16 @@
99
#include <unistd.h>
1010
#endif /* ifdef _WIN32 */
1111

12+
// Returns the string describing the meaning of `errno` code (by calling `strerror`).
1213
char* stdlib_strerror(size_t* len){
1314
char* err = strerror(errno);
1415
*len = strlen(err);
1516
return err;
1617
}
1718

19+
// Wrapper to the platform's `mkdir`(make directory) call.
20+
// Uses `mkdir` on unix, `_mkdir` on windows.
21+
// Returns 0 if successful, otherwise returns the `errno`.
1822
int stdlib_make_directory(const char* path){
1923
int code;
2024
#ifdef _WIN32
@@ -27,6 +31,9 @@ int stdlib_make_directory(const char* path){
2731
return (!code) ? 0 : errno;
2832
}
2933

34+
// Wrapper to the platform's `rmdir`(remove directory) call.
35+
// Uses `rmdir` on unix, `_rmdir` on windows.
36+
// Returns 0 if successful, otherwise returns the `errno`.
3037
int stdlib_remove_directory(const char* path){
3138
int code;
3239
#ifdef _WIN32

0 commit comments

Comments
 (0)