parse_nameaddr.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * $Id$
  3. *
  4. * Copyright (C) 2001-2003 FhG Fokus
  5. *
  6. * This file is part of ser, a free SIP server.
  7. *
  8. * ser is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version
  12. *
  13. * ser is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  21. *
  22. * History
  23. * --------
  24. * 2003-03-24 Created by janakj
  25. */
  26. /*! \file
  27. * \brief Parser :: Parse name-addr part
  28. *
  29. * \ingroup parser
  30. */
  31. #ifndef PARSE_NAMEADDR_H
  32. #define PARSE_NAMEADDR_H
  33. #include <stdio.h>
  34. #include "../str.h"
  35. /*! \brief
  36. * Name-addr structure, see RFC3261 for more details
  37. */
  38. typedef struct name_addr {
  39. str name; /*!< Display name part */
  40. str uri; /*!< Uri part without surrounding <> */
  41. int len; /*!< Total length of the field (including all
  42. * whitechars present in the parsed message */
  43. } name_addr_t;
  44. /*! \brief
  45. * Parse name-addr part, the given string can be longer,
  46. * parsing will stop when closing > is found
  47. */
  48. int parse_nameaddr(str* _s, name_addr_t* _a);
  49. /*! \brief
  50. * Print a name-addr structure, just for debugging
  51. */
  52. void print_nameaddr(FILE* _o, name_addr_t* _a);
  53. #endif /* PARSE_NAMEADDR_H */