parser/case_acce.h
67386619
 /*
  * Accept, Accept-Language, Accept-Contact, Accept-Disposition Header Field Name Parsing Macros
3cc6cc18
  *
c32feee5
  * Copyright (C) 2001-2003 FhG Fokus
3cc6cc18
  *
249269d2
  * This file is part of Kamailio, a free SIP server.
3cc6cc18
  *
249269d2
  * Kamailio is free software; you can redistribute it and/or modify
3cc6cc18
  * 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
  *
249269d2
  * Kamailio is distributed in the hope that it will be useful,
3cc6cc18
  * 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.
  *
67386619
  * 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
3cc6cc18
  */
 
8c4ed5f0
 /*! \file 
  * \brief Parser :: Accept, Accept-Language, Accept-Contact, Accept-Disposition Header Field Name Parsing Macros
  *
  * \ingroup parser
  */
 
3cc6cc18
 #ifndef CASE_ACCE_H
 #define CASE_ACCE_H
 
 
2f43c732
 #define age_CASE                                \
         switch(LOWER_DWORD(val)) {              \
         case _age1_:                            \
5c28a534
 	        hdr->type = HDR_ACCEPTLANGUAGE_T; \
2f43c732
 	        hdr->name.len = 15;             \
 	        return (p + 4);                 \
                                                 \
         case _age2_:                            \
5c28a534
                 hdr->type = HDR_ACCEPTLANGUAGE_T; \
2f43c732
                 p += 4;                         \
 	        goto dc_end;                    \
         }
 
 
 #define angu_CASE                  \
         switch(LOWER_DWORD(val)) { \
         case _angu_:               \
 		p += 4;            \
 		val = READ(p);     \
 		age_CASE;          \
 		goto other;        \
 	}
 
 
67386619
 #define accept_contact_ct_CASE                             \
         if (LOWER_BYTE(*p) == 'c') {                       \
                 p++;                                       \
                 if (LOWER_BYTE(*p) == 't') {               \
                         hdr->type = HDR_ACCEPTCONTACT_T;   \
                         p++;                               \
                         goto dc_end;                       \
                 }                                          \
         }
6a2b0dec
 
67386619
 #define accept_c_onta_CASE         \
         switch(LOWER_DWORD(val)) { \
         case _onta_:               \
                 p += 4;            \
                 val = READ(p);     \
                 accept_contact_ct_CASE;  \
                 goto other;        \
         }
 
 
 #define ptldc_CASE                 \
2f43c732
         switch(LOWER_DWORD(val)) { \
         case _pt_l_:               \
 		p += 4;            \
 		val = READ(p);     \
 		angu_CASE;         \
 		goto other;        \
6a2b0dec
                                    \
67386619
         case _pt_c_:               \
                 p += 4;            \
                 val = READ(p);     \
                 accept_c_onta_CASE;\
                 goto other;        \
2f43c732
 	}
 
 
3cc6cc18
 #define acce_CASE                           \
     p += 4;                                 \
2f43c732
     val = READ(p);                          \
67386619
     ptldc_CASE;                             \
2f43c732
                                             \
3cc6cc18
     if (LOWER_BYTE(*p) == 'p') {            \
             p++;                            \
             if (LOWER_BYTE(*p) == 't') {    \
5c28a534
                     hdr->type = HDR_ACCEPT_T; \
3cc6cc18
                     p++;                    \
                     goto dc_end;            \
             }                               \
     }                                       \
     goto other;
 
 
 #endif /* CASE_ACCE_H */