[utils] is_relative_path
This commit is contained in:
@@ -32,6 +32,10 @@ char *file_getline(FILE * f)
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool is_relative_path(struct dirent *ent) {
|
||||
return strcmp(ent->d_name, ".") == 0 || strcmp(ent->d_name, "..") == 0;
|
||||
}
|
||||
|
||||
|
||||
bool file_read_int32(FILE *file, int32_t *value) {
|
||||
unsigned char buf[4];
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <dirent.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -25,6 +26,8 @@ extern "C" {
|
||||
|
||||
char *file_getline(FILE * f);
|
||||
|
||||
bool is_relative_path(struct dirent *ent);
|
||||
|
||||
bool file_read_int32(FILE *file, int32_t *value);
|
||||
bool file_write_int32(FILE *file, int32_t value);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user