Loading src/utils.c +0 −44 Original line number Diff line number Diff line Loading @@ -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, ...) { Loading Loading @@ -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) { Loading Loading @@ -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; } src/utils.h +0 −3 Original line number Diff line number Diff line Loading @@ -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) \ {\ Loading Loading
src/utils.c +0 −44 Original line number Diff line number Diff line Loading @@ -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, ...) { Loading Loading @@ -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) { Loading Loading @@ -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; }
src/utils.h +0 −3 Original line number Diff line number Diff line Loading @@ -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) \ {\ Loading