select_buf.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Copyright (C) 2005-2006 iptelorg GmbH
  3. *
  4. * This file is part of Kamailio, a free SIP server.
  5. *
  6. * Kamailio is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version
  10. *
  11. * Kamailio is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  19. *
  20. */
  21. /*!
  22. * \file
  23. * \brief Kamailio core :: Select result buffers
  24. * \author mma
  25. * \ingroup core
  26. * Module: \ref core
  27. */
  28. #ifndef SELECT_BUFFER_H
  29. #define SELECT_BUFFER_H
  30. #include "str.h"
  31. /**
  32. * Request for space from buffer
  33. *
  34. * Returns: NULL memory allocation failure (no more space)
  35. * pointer to the space on success
  36. */
  37. char* get_static_buffer(int req_size);
  38. /** Internal function - called before request is going to be processed
  39. *
  40. * Reset offset to unused space
  41. */
  42. int reset_static_buffer(void);
  43. int str_to_static_buffer(str* res, str* s);
  44. int int_to_static_buffer(str* res, int val);
  45. int uint_to_static_buffer(str* res, unsigned int val);
  46. int uint_to_static_buffer_ex(str* res, unsigned int val, int base, int pad);
  47. #endif /* SELECT_BUFFER_H */