summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-09-03 09:03:27 +0200
committerDaniel Friesel <derf@finalrewind.org>2011-09-03 09:03:27 +0200
commitfd6326c2d169a80ceda2c202d5ef4c17cd60e3c9 (patch)
treea583b6367a1a1da462c620d51cf62ea91c600892
parent39be7968fb3c73ed351b054be051eb37ff716813 (diff)
utils.c: Remove unused functions stroflen, feh_get_tmp_dir, feh_get_user_name
-rw-r--r--src/utils.c44
-rw-r--r--src/utils.h3
2 files changed, 0 insertions, 47 deletions
diff --git a/src/utils.c b/src/utils.c
index e7ffa45..037010e 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -27,9 +27,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "debug.h"
#include "options.h"
-static char *feh_user_name = NULL;
-static char *feh_tmp_dir = NULL;
-
/* eprintf: print error message and exit */
void eprintf(char *fmt, ...)
{
@@ -146,18 +143,6 @@ char *estrjoin(const char *separator, ...)
return string;
}
-char *stroflen(char c, int l)
-{
- static char buf[1024];
- int i = 0;
-
- buf[0] = '\0';
- while (l--)
- buf[i++] = c;
- buf[i] = '\0';
- return buf;
-}
-
/* free the result please */
char *feh_unique_filename(char *path, char *basename)
{
@@ -205,32 +190,3 @@ char *ereadfile(char *path)
return estrdup(buffer);
}
-
-char *feh_get_tmp_dir(void)
-{
- char *tmp;
- if (feh_tmp_dir)
- return feh_tmp_dir;
- tmp = getenv("TMPDIR");
- if (!tmp)
- tmp = getenv("TMP");
- if (!tmp)
- tmp = getenv("TEMP");
- if (!tmp)
- tmp = "/tmp";
- feh_tmp_dir = estrdup(tmp);
- return feh_tmp_dir;
-}
-
-char *feh_get_user_name(void)
-{
- struct passwd *pw = NULL;
-
- if (feh_user_name)
- return feh_user_name;
- setpwent();
- pw = getpwuid(getuid());
- endpwent();
- feh_user_name = estrdup(pw->pw_name);
- return feh_user_name;
-}
diff --git a/src/utils.h b/src/utils.h
index d0d7665..a619a4c 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -36,11 +36,8 @@ char *_estrdup(char *s);
void *_emalloc(size_t n);
void *_erealloc(void *ptr, size_t n);
char *estrjoin(const char *separator, ...);
-char *stroflen(char, int);
char *feh_unique_filename(char *path, char *basename);
char *ereadfile(char *path);
-char *feh_get_tmp_dir(void);
-char *feh_get_user_name(void);
#define ESTRAPPEND(a,b) \
{\