]> www.fi.muni.cz Git - evince.git/blobdiff - backend/dvi/mdvi-lib/common.h
[dvi] Use ANSI C memset() instead of bzero() if available
[evince.git] / backend / dvi / mdvi-lib / common.h
index fe4d6f7084f88db0095633d12f9c9afa9cc09efb..a5459308676aa8143dcef59c0697ec43b51ec75d 100644 (file)
@@ -39,7 +39,7 @@
 #  endif
 #endif
 
-#ifdef HAVE_MEMCPY
+#if defined(STDC_HEADERS) || defined(HAVE_MEMCPY)
 #define memzero(a,n) memset((a), 0, (n))
 #else
 #define memzero(a,n) bzero((a), (n))
@@ -136,11 +136,11 @@ extern char       *read_alloc_bcpl __PROTO((FILE *, size_t, size_t *));
 
 /* miscellaneous */
 
-extern void message __PROTO((const char *, ...));
-extern void crash __PROTO((const char *, ...));
-extern void fatal __PROTO((const char *, ...));
-extern void error __PROTO((const char *, ...));
-extern void warning __PROTO((const char *, ...));
+extern void mdvi_message __PROTO((const char *, ...));
+extern void mdvi_crash __PROTO((const char *, ...));
+extern void mdvi_fatal __PROTO((const char *, ...));
+extern void mdvi_error __PROTO((const char *, ...));
+extern void mdvi_warning __PROTO((const char *, ...));
 extern int  unit2pix __PROTO((int, const char *));
 extern double unit2pix_factor __PROTO((const char *));
 
@@ -182,12 +182,12 @@ extern Uint32 _mdvi_debug_mask;
 extern void __debug __PROTO((int, const char *, ...));
 #define DEBUG(x)       __debug x
 #define ASSERT(x) do { \
-       if(!(x)) crash("%s:%d: Assertion %s failed\n", \
+       if(!(x)) mdvi_crash("%s:%d: Assertion %s failed\n", \
                __FILE__, __LINE__, #x); \
        } while(0)
 #define ASSERT_VALUE(x,y) do { \
        if((x) != (y)) \
-               crash("%s:%d: Assertion failed (%d = %s != %s)\n", \
+               mdvi_crash("%s:%d: Assertion failed (%d = %s != %s)\n", \
                __FILE__, __LINE__, (x), #x, #x); \
        } while(0)
 #else
@@ -210,6 +210,8 @@ extern char *mdvi_strncpy __PROTO((char *, const char *, size_t));
 extern char *mdvi_strdup __PROTO((const char *));
 extern char *mdvi_strndup __PROTO((const char *, size_t));
 extern void *mdvi_memdup __PROTO((const void *, size_t));
+extern char *mdvi_build_path_from_cwd __PROTO((const char *));
+extern char *mdvi_strrstr __PROTO((const char *, const char *));
 
 /* macros to make memory allocation nicer */
 #define xalloc(t)      (t *)mdvi_malloc(sizeof(t))