This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch master
in repository legacy-imlib2.
View the commit online.
commit cf5b462d92b00e2c889c2c298741caac7c80df7d
Author: NRK <n...@disroot.org>
AuthorDate: Mon Jul 3 08:40:31 2023 +0600
file: Remove unused functions some more
---
src/lib/file.c | 53 -----------------------------------------------------
src/lib/file.h | 3 ---
test/test_file.cpp | 25 -------------------------
3 files changed, 81 deletions(-)
diff --git a/src/lib/file.c b/src/lib/file.c
index 80d006d..6ff9c42 100644
--- a/src/lib/file.c
+++ b/src/lib/file.c
@@ -124,19 +124,6 @@ __imlib_FileIsFile(const char *s)
return (S_ISREG(st.st_mode)) ? 1 : 0;
}
-int
-__imlib_FileIsDir(const char *s)
-{
- struct stat st;
-
- DP("%s: '%s'\n", __func__, s);
-
- if (__imlib_FileStat(s, &st))
- return 0;
-
- return (S_ISDIR(st.st_mode)) ? 1 : 0;
-}
-
time_t
__imlib_FileModDate(const char *s)
{
@@ -243,46 +230,6 @@ __imlib_FileFreeDirList(char **l, int num)
free(l);
}
-void
-__imlib_FileDel(const char *s)
-{
- if ((!s) || (!*s))
- return;
- unlink(s);
-}
-
-char *
-__imlib_FileHomeDir(int uid)
-{
- static int usr_uid = -1;
- static char *usr_s = NULL;
- char *s;
- struct passwd *pwd;
-
- s = getenv("HOME");
- if (s)
- return strdup(s);
-
- if (usr_uid < 0)
- usr_uid = getuid();
-
- if ((uid == usr_uid) && (usr_s))
- {
- return strdup(usr_s);
- }
-
- pwd = getpwuid(uid);
- if (pwd)
- {
- s = strdup(pwd->pw_dir);
- if (uid == usr_uid)
- usr_s = strdup(s);
- return s;
- }
-
- return NULL;
-}
-
int
__imlib_ItemInList(char **list, int size, char *item)
{
diff --git a/src/lib/file.h b/src/lib/file.h
index 0108b6a..961dc8e 100644
--- a/src/lib/file.h
+++ b/src/lib/file.h
@@ -28,15 +28,12 @@ __imlib_StatIsDir(const struct stat *st)
}
int __imlib_FileIsFile(const char *s);
-int __imlib_FileIsDir(const char *s);
time_t __imlib_FileModDate(const char *s);
time_t __imlib_FileModDateFd(int fd);
char **__imlib_FileDir(const char *dir, int *num);
void __imlib_FileFreeDirList(char **l, int num);
-void __imlib_FileDel(const char *s);
-char *__imlib_FileHomeDir(int uid);
int __imlib_ItemInList(char **list, int size, char *item);
char **__imlib_PathToFilters(void);
diff --git a/test/test_file.cpp b/test/test_file.cpp
index fe371b3..057d0ed 100644
--- a/test/test_file.cpp
+++ b/test/test_file.cpp
@@ -14,9 +14,7 @@ char *__imlib_FileRealFile(const char *file);
char **__imlib_FileDir(const char *dir, int *num);
void __imlib_FileFreeDirList(char **l, int num);
-void __imlib_FileDel(const char *s);
time_t __imlib_FileModDate(const char *s);
-char *__imlib_FileHomeDir(int uid);
int __imlib_FilePermissions(const char *s);
#endif
@@ -71,29 +69,6 @@ TEST(FILE, file_is_file)
EXPECT_EQ(rc, 0);
}
-TEST(FILE, file_is_dir)
-{
- int rc;
-
- rc = __imlib_FileIsDir("./Makefile");
- EXPECT_EQ(rc, 0);
-
- rc = __imlib_FileIsDir(".");
- EXPECT_EQ(rc, 1);
-
- rc = __imlib_FileIsDir("./foob");
- EXPECT_EQ(rc, 0);
-
- rc = __imlib_FileIsDir("./Makefile:foo");
- EXPECT_EQ(rc, 0);
-
- rc = __imlib_FileIsDir(".:foo");
- EXPECT_EQ(rc, USE_REAL_FILE);
-
- rc = __imlib_FileIsDir("./foob:foo");
- EXPECT_EQ(rc, 0);
-}
-
TEST(FILE, file_key)
{
char *key;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.