lib: Add a helper to convert struct stat → GFileInfo

It's more natural for a few calling places. Prep for patches to go the other
way, which in turn are prep for adding a commit filter v2 that takes `struct
stat`.

`ot_gfile_type_for_mode()` was only used in this function, so inline it here.

Closes: #974
Approved by: jlebon
This commit is contained in:
Colin Walters authored and Atomic Bot committed 2017-06-29 18:17:28 +00:00
1 parent 1a9a473580
commit d57410a7e6
8 files changed
+58 -72

No files matched your search

-16
View File
@@ -35,22 +35,6 @@
#define O_BINARY 0
#endif
GFileType
ot_gfile_type_for_mode (guint32 mode)
{
if (S_ISDIR (mode))
return G_FILE_TYPE_DIRECTORY;
else if (S_ISREG (mode))
return G_FILE_TYPE_REGULAR;
else if (S_ISLNK (mode))
return G_FILE_TYPE_SYMBOLIC_LINK;
else if (S_ISBLK (mode) || S_ISCHR(mode) || S_ISFIFO(mode))
return G_FILE_TYPE_SPECIAL;
else
return G_FILE_TYPE_UNKNOWN;
}
GFile *
ot_gfile_resolve_path_printf (GFile *path,
const char *format,
-2
View File
@@ -33,8 +33,6 @@ G_BEGIN_DECLS
#define OSTREE_GIO_FAST_QUERYINFO ("standard::name,standard::type,standard::size,standard::is-symlink,standard::symlink-target," \
"unix::device,unix::inode,unix::mode,unix::uid,unix::gid,unix::rdev")
GFileType ot_gfile_type_for_mode (guint32 mode);
GFile * ot_gfile_resolve_path_printf (GFile *path,
const char *format,
...) G_GNUC_PRINTF(2, 3);