parser/parse_disposition.h
432fb736
 /*
c32feee5
  * Copyright (C) 2001-2003 FhG Fokus
432fb736
  *
07ca8c05
  * This file is part of Kamailio, a free SIP server.
432fb736
  *
07ca8c05
  * Kamailio is free software; you can redistribute it and/or modify
432fb736
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version
  *
07ca8c05
  * Kamailio is distributed in the hope that it will be useful,
432fb736
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License 
  * along with this program; if not, write to the Free Software 
9e1ff448
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
432fb736
  *
  */
 
7b7456b0
 /*! \file
  * \brief Parser :: Content-Disposition header
  *
  * \ingroup parser
  */
 
 
432fb736
 #ifndef _PARSE_DISPOSITION_H_
 #define _PARSE_DISPOSITION_H_
 
 #include "../str.h"
 #include "msg_parser.h"
 
 
 #define get_content_disposition(_msg_) \
62be90d5
 	((struct disposition*)((_msg_)->content_disposition->parsed))
432fb736
 
 
 struct disposition_param {
 	str name;
 	str body;
 	int is_quoted;
 	struct disposition_param *next;
 };
 
 
 struct disposition {
 	str type;
 	struct disposition_param *params;
 };
 
 
7b7456b0
 /*! \brief looks inside the message, gets the Content-Disposition hdr, parse it, builds
c32feee5
  * and fills a disposition structure for it what will be attached to hdr as
432fb736
  * parsed link.
  * Returns:  -1 : error
  *            0 : success
  *            1 : hdr not found
  */
 int parse_content_disposition( struct sip_msg *msg );
 
 
7b7456b0
 /*! \brief parse a string that supposed to be a disposition and fills up the structure
432fb736
  * Returns: -1 : error
c32feee5
  *           o : success */
432fb736
 int parse_disposition( str *s, struct disposition *disp);
 
 
7b7456b0
 /*! \brief Frees the entire disposition structure (params + itself) */
432fb736
 void free_disposition( struct disposition **disp);
 
7b7456b0
 /*! \brief Prints recursive a disposition structure */
432fb736
 void print_disposition( struct disposition *disp);
 
 #endif