parse_nameaddr.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * Copyright (C) 2001-2003 FhG Fokus
  3. *
  4. * This file is part of ser, a free SIP server.
  5. *
  6. * ser 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. * ser 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. * History
  21. * --------
  22. * 2003-03-24 Created by janakj
  23. */
  24. /*! \file
  25. * \brief Parser :: Parse name-addr part
  26. *
  27. * \ingroup parser
  28. */
  29. #ifndef PARSE_NAMEADDR_H
  30. #define PARSE_NAMEADDR_H
  31. #include <stdio.h>
  32. #include "../str.h"
  33. /*! \brief
  34. * Name-addr structure, see RFC3261 for more details
  35. */
  36. typedef struct name_addr {
  37. str name; /*!< Display name part */
  38. str uri; /*!< Uri part without surrounding <> */
  39. int len; /*!< Total length of the field (including all
  40. * whitechars present in the parsed message */
  41. } name_addr_t;
  42. /*! \brief
  43. * Parse name-addr part, the given string can be longer,
  44. * parsing will stop when closing > is found
  45. */
  46. int parse_nameaddr(str* _s, name_addr_t* _a);
  47. /*! \brief
  48. * Print a name-addr structure, just for debugging
  49. */
  50. void print_nameaddr(FILE* _o, name_addr_t* _a);
  51. #endif /* PARSE_NAMEADDR_H */