X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;ds=sidebyside;f=backend%2Fdvi%2Fmdvi-lib%2Futil.c;h=0fe66cd97e617f08bdbdee2e5e33723d3cde294f;hb=03a4afa9aeab342a63530db46888e405ea1c8afc;hp=788b7744cf7d09f4ecfac4e6233cd566ba396b62;hpb=d24b16f917ca749e9ffebbec8eca0ee791e1b67a;p=evince.git diff --git a/backend/dvi/mdvi-lib/util.c b/backend/dvi/mdvi-lib/util.c index 788b7744..0fe66cd9 100644 --- a/backend/dvi/mdvi-lib/util.c +++ b/backend/dvi/mdvi-lib/util.c @@ -16,6 +16,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include #include @@ -114,7 +115,7 @@ void __debug(int mask, const char *format, ...) } #endif -void message(const char *format, ...) +void mdvi_message(const char *format, ...) { va_list ap; @@ -131,7 +132,7 @@ void message(const char *format, ...) va_end(ap); } -void crash(const char *format, ...) +void mdvi_crash(const char *format, ...) { va_list ap; @@ -150,7 +151,7 @@ void crash(const char *format, ...) abort(); } -void error(const char *format, ...) +void mdvi_error(const char *format, ...) { va_list ap; @@ -166,7 +167,7 @@ void error(const char *format, ...) va_end(ap); } -void warning(const char *format, ...) +void mdvi_warning(const char *format, ...) { va_list ap; @@ -182,7 +183,7 @@ void warning(const char *format, ...) va_end(ap); } -void fatal(const char *format, ...) +void mdvi_fatal(const char *format, ...) { va_list ap; @@ -208,8 +209,8 @@ void *mdvi_malloc(size_t nelems) void *ptr = malloc(nelems); if(ptr == NULL) - fatal(_("out of memory allocating %u bytes\n"), - (unsigned)nelems); + mdvi_fatal(_("out of memory allocating %u bytes\n"), + (unsigned)nelems); return ptr; } @@ -218,10 +219,10 @@ void *mdvi_realloc(void *data, size_t newsize) void *ptr; if(newsize == 0) - crash(_("attempted to reallocate with zero size\n")); + mdvi_crash(_("attempted to reallocate with zero size\n")); ptr = realloc(data, newsize); if(ptr == NULL) - fatal(_("failed to reallocate %u bytes\n"), (unsigned)newsize); + mdvi_fatal(_("failed to reallocate %u bytes\n"), (unsigned)newsize); return ptr; } @@ -230,21 +231,21 @@ void *mdvi_calloc(size_t nmemb, size_t size) void *ptr; if(nmemb == 0) - crash(_("attempted to callocate 0 members\n")); + mdvi_crash(_("attempted to callocate 0 members\n")); if(size == 0) - crash(_("attempted to callocate %u members with size 0\n"), + mdvi_crash(_("attempted to callocate %u members with size 0\n"), (unsigned)nmemb); ptr = calloc(nmemb, size); if(ptr == 0) - fatal(_("failed to allocate %ux%u bytes\n"), - (unsigned)nmemb, (unsigned)size); + mdvi_fatal(_("failed to allocate %ux%u bytes\n"), + (unsigned)nmemb, (unsigned)size); return ptr; } void mdvi_free(void *ptr) { if(ptr == NULL) - crash(_("attempted to free NULL pointer\n")); + mdvi_crash(_("attempted to free NULL pointer\n")); free(ptr); }