PageRenderTime 46ms CodeModel.GetById 22ms RepoModel.GetById 1ms app.codeStats 0ms

/xdebug_str.h

http://github.com/derickr/xdebug
C Header | 44 lines | 20 code | 7 blank | 17 comment | 0 complexity | 2b731180bf163537b25b6b88a1d9edad MD5 | raw file
Possible License(s): MPL-2.0-no-copyleft-exception
  1. /*
  2. +----------------------------------------------------------------------+
  3. | Xdebug |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 2002-2016 Derick Rethans |
  6. +----------------------------------------------------------------------+
  7. | This source file is subject to version 1.0 of the Xdebug license, |
  8. | that is bundled with this package in the file LICENSE, and is |
  9. | available at through the world-wide-web at |
  10. | http://xdebug.derickrethans.nl/license.php |
  11. | If you did not receive a copy of the Xdebug license and are unable |
  12. | to obtain it through the world-wide-web, please send a note to |
  13. | xdebug@derickrethans.nl so we can mail you a copy immediately. |
  14. +----------------------------------------------------------------------+
  15. | Authors: Derick Rethans <derick@xdebug.org> |
  16. +----------------------------------------------------------------------+
  17. */
  18. #ifndef __HAVE_XDEBUG_STR_H__
  19. #define __HAVE_XDEBUG_STR_H__
  20. #include "xdebug_mm.h"
  21. #define XDEBUG_STR_INITIALIZER { 0, 0, NULL }
  22. #define XDEBUG_STR_PREALLOC 1024
  23. #define xdebug_str_ptr_init(str) str = xdmalloc(sizeof(xdebug_str)); str->l = 0; str->a = 0; str->d = NULL;
  24. #define xdebug_str_ptr_dtor(str) xdfree(str->d); xdfree(str)
  25. #define xdebug_str_dtor(str) xdfree(str.d)
  26. typedef struct xdebug_str {
  27. signed long l;
  28. signed long a;
  29. char *d;
  30. } xdebug_str;
  31. void xdebug_str_add(xdebug_str *xs, char *str, int f);
  32. void xdebug_str_addl(xdebug_str *xs, char *str, int le, int f);
  33. void xdebug_str_chop(xdebug_str *xs, int c);
  34. void xdebug_str_free(xdebug_str *s);
  35. char* xdebug_sprintf (const char* fmt, ...);
  36. char* xdebug_strndup(const char *s, int length);
  37. #endif