rdf_config.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * RDF System Configuration
  3. *
  4. * $Source$
  5. * $Id$
  6. *
  7. * (C) Dave Beckett 2000 ILRT, University of Bristol
  8. * http://www.ilrt.bristol.ac.uk/people/cmdjb/
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License as published by
  12. * the Free Software Foundation; either version 2 of the License, or
  13. * (at your option) any later version.
  14. *
  15. */
  16. #ifndef RDF_CONFIG_H
  17. #define RDF_CONFIG_H
  18. #ifdef HAVE_INLINE
  19. #define INLINE inline
  20. #else
  21. #define INLINE
  22. #endif
  23. #ifdef HAVE_INLINE
  24. #define RDF_URI_INLINE yes
  25. #endif
  26. /* for the memory allocation functions below */
  27. #ifdef HAVE_STDLIB_H
  28. #include <stdlib.h>
  29. #endif
  30. #define RDF_MALLOC(type, size) malloc(size)
  31. #define RDF_CALLOC(type, size, count) calloc(size, count)
  32. #define RDF_FREE(type, ptr) free(ptr)
  33. /* Debugging messages */
  34. #define RDF_DEBUG(function, msg) do {fprintf(stderr, "%s:%d:%s: " msg, __FILE__, __LINE__, #function); } while(0)
  35. #define RDF_DEBUG2(function, msg, arg1) do {fprintf(stderr, "%s:%d:%s: " msg, __FILE__, __LINE__, #function, arg1);} while(0)
  36. #define RDF_DEBUG3(function, msg, arg1, arg2) do {fprintf(stderr, "%s:%d:%s: " msg, __FILE__, __LINE__, #function, arg1, arg2);} while(0)
  37. #define RDF_DEBUG4(function, msg, arg1, arg2, arg3) do {fprintf(stderr, "%s:%d:%s: " msg, __FILE__, __LINE__, #function, arg1, arg2, arg3);} while(0)
  38. /* Fatal errors */
  39. #define RDF_FATAL(function, msg) do {fprintf(stderr, "%s:%d:%s: fatal error: " msg, __FILE__, __LINE__ , #function); exit(1);} while(0)
  40. #define RDF_FATAL2(function, msg,arg) do {fprintf(stderr, "%s:%d:%s: fatal error: " msg, __FILE__, __LINE__ , #function, arg); exit(1);} while(0)
  41. #endif