Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. /*
  2.  * This file is part of libdom test suite.
  3.  * Licensed under the MIT License,
  4.  *                http://www.opensource.org/licenses/mit-license.php
  5.  * Copyright 2007 John-Mark Bell <jmb@netsurf-browser.org>
  6.  */
  7.  
  8. #ifndef utils_h_
  9. #define utils_h_
  10.  
  11. #include <stddef.h>
  12. #include <inttypes.h>
  13.  
  14. #ifndef max
  15. #define max(a,b) ((a)>(b)?(a):(b))
  16. #endif
  17.  
  18. #ifndef min
  19. #define min(a,b) ((a)<(b)?(a):(b))
  20. #endif
  21.  
  22. #ifndef SLEN
  23. /* Calculate length of a string constant */
  24. #define SLEN(s) (sizeof((s)) - 1) /* -1 for '\0' */
  25. #endif
  26.  
  27. #ifndef UNUSED
  28. #define UNUSED(x) ((x) = (x))
  29. #endif
  30.  
  31. void *myrealloc(void *ptr, size_t len, void *pw);
  32. void mymsg(uint32_t severity, void *ctx, const char *msg, ...);
  33.  
  34. char *domts_strndup(const char *s, size_t len);
  35.  
  36. #endif
  37.  
  38.