diff options
author | Max Kellermann <max@duempel.org> | 2009-01-03 14:53:42 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-01-03 14:53:42 +0100 |
commit | 38bf81285f492b38530f16f8c0e372b0f9b6a116 (patch) | |
tree | 8551346e0f37c4a203c5ad84fb5742a39585e97f /src/utils.h | |
parent | b42e10b83979dd3636b27867bfd46240f73dce79 (diff) | |
download | mpd-38bf81285f492b38530f16f8c0e372b0f9b6a116.tar.gz mpd-38bf81285f492b38530f16f8c0e372b0f9b6a116.tar.xz mpd-38bf81285f492b38530f16f8c0e372b0f9b6a116.zip |
utils: removed unused functions
Removed all allocation functions, xwrite(), xread(), ARRAY_SIZE().
Those have been superseded by GLib.
Diffstat (limited to '')
-rw-r--r-- | src/utils.h | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/src/utils.h b/src/utils.h index dff41bab6..d3fb7a61c 100644 --- a/src/utils.h +++ b/src/utils.h @@ -19,14 +19,6 @@ #ifndef MPD_UTILS_H #define MPD_UTILS_H -#include <glib.h> -#include <unistd.h> -#include <stdlib.h> -#include <stdio.h> -#include <errno.h> - -#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) - #ifndef assert_static /* Compile time assertion developed by Ralf Holly */ /* http://pera-software.com/articles/compile-time-assertions.pdf */ @@ -38,55 +30,6 @@ void my_usleep(long usec); -/* trivial functions, keep them inlined */ -static inline void xclose(int fd) -{ - while (close(fd) && errno == EINTR); -} - -static inline ssize_t xread(int fd, void *buf, size_t len) -{ - ssize_t nr; - while (1) { - nr = read(fd, buf, len); - if ((nr < 0) && (errno == EAGAIN || errno == EINTR)) - continue; - return nr; - } -} - -static inline ssize_t xwrite(int fd, const void *buf, size_t len) -{ - ssize_t nr; - while (1) { - nr = write(fd, buf, len); - if ((nr < 0) && (errno == EAGAIN || errno == EINTR)) - continue; - return nr; - } -} - -G_GNUC_MALLOC char *xstrdup(const char *s); - -G_GNUC_MALLOC void *xmalloc(size_t size); - -G_GNUC_MALLOC void *xrealloc(void *ptr, size_t size); - -G_GNUC_MALLOC void *xcalloc(size_t nmemb, size_t size); - -/** - * free a const pointer - unfortunately free() expects a non-const - * pointer, for whatever reason - */ -static inline void xfree(const void *p) -{ - union { - const void *in; - void *out; - } deconst = { .in = p }; - free(deconst.out); -} - char *parsePath(char *path); int set_nonblocking(int fd); |