parse_event.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * $Id$
  3. *
  4. * Event header field body parser
  5. * This parser was written for Presence Agent module only.
  6. * it recognizes presence package only, no subpackages, no parameters
  7. * It should be replaced by a more generic parser if subpackages or
  8. * parameters should be parsed too.
  9. *
  10. * Copyright (C) 2001-2003 Fhg Fokus
  11. *
  12. * This file is part of ser, a free SIP server.
  13. *
  14. * ser is free software; you can redistribute it and/or modify
  15. * it under the terms of the GNU General Public License as published by
  16. * the Free Software Foundation; either version 2 of the License, or
  17. * (at your option) any later version
  18. *
  19. * For a license to use the ser software under conditions
  20. * other than those described here, or to purchase support for this
  21. * software, please contact iptel.org by e-mail at the following addresses:
  22. * [email protected]
  23. *
  24. * ser is distributed in the hope that it will be useful,
  25. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  26. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  27. * GNU General Public License for more details.
  28. *
  29. * You should have received a copy of the GNU General Public License
  30. * along with this program; if not, write to the Free Software
  31. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  32. */
  33. #ifndef PARSE_EVENT_H
  34. #define PARSE_EVENT_H
  35. #include "../str.h"
  36. #include "hf.h"
  37. #define EVENT_OTHER 0
  38. #define EVENT_PRESENCE 1
  39. typedef struct event {
  40. str text; /* Original string representation */
  41. int parsed; /* Parsed variant */
  42. } event_t;
  43. /*
  44. * Parse Event HF body
  45. */
  46. int parse_event(struct hdr_field* _h);
  47. /*
  48. * Release memory
  49. */
  50. void free_event(event_t** _e);
  51. /*
  52. * Print structure, for debugging only
  53. */
  54. void print_event(event_t* _e);
  55. #endif /* PARSE_EVENT_H */