case_p_as.h

Go to the documentation of this file.
00001 /* 
00002  * $Id$
00003  * 
00004  * Copyright (C) 2010 iptelorg GmbH
00005  *
00006  * Permission to use, copy, modify, and distribute this software for any
00007  * purpose with or without fee is hereby granted, provided that the above
00008  * copyright notice and this permission notice appear in all copies.
00009  *
00010  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
00011  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
00012  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
00013  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
00014  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
00015  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
00016  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
00017  */
00018 /*
00019  * parser/case_p_as.h
00020  */
00021 /*
00022  * History:
00023  * --------
00024  *  2010-02-19  initial version (andrei)
00025 */
00026 
00033 #ifndef __case_p_as_h
00034 #define __case_p_as_h
00035 
00036 
00037 #define SERT_CASE                                               \
00038         switch(LOWER_DWORD(val)) {                      \
00039                 case _sert_:                                    \
00040                         p += 4;                                         \
00041                         val = READ(p);                          \
00042                         ED_I_CASE;                                      \
00043         }                                                                       
00044 
00045 
00046 #define ED_I_CASE                                               \
00047         switch(LOWER_DWORD(val)) {                      \
00048                 case _ed_i_:                                    \
00049                         p += 4;                                         \
00050                         val = READ(p);                          \
00051                         DENT_CASE;                                      \
00052         }                                                                       
00053 
00054 
00055 #define DENT_CASE                                               \
00056         switch(LOWER_DWORD(val)) {                      \
00057                 case _dent_:                                    \
00058                         p += 4;                                         \
00059                         val = READ(p);                          \
00060                         ITY_CASE;                                       \
00061         }                                                                       
00062 
00063 #define ITY_CASE                                                \
00064         switch(LOWER_DWORD(val)) {                      \
00065                 case _ity1_:                                    \
00066                         hdr->type = HDR_PAI_T;          \
00067                         hdr->name.len = 19;                     \
00068                         return (p + 4);                         \
00069                 case _ity2_:                                    \
00070                         hdr->type = HDR_PAI_T;          \
00071                         p+=4;                                           \
00072                         goto dc_end;                            \
00073         }                                                                       
00074 
00075 
00076 
00077 #define p_as_CASE               \
00078         p += 4;                         \
00079         val = READ(p);          \
00080         SERT_CASE;                      \
00081         goto other;
00082 
00083 
00084 
00085 #endif /*__case_p_as_h*/
00086 
00087 /* vi: set ts=4 sw=4 tw=79:ai:cindent: */