1 /*
2  * This file is part of the Sofia-SIP package
3  *
4  * Copyright (C) 2005 Nokia Corporation.
5  *
6  * Contact: Pekka Pessi <pekka.pessi@nokia.com>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation; either version 2.1 of
11  * the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21  * 02110-1301 USA
22  *
23  */
24 
25 #ifndef SDP_TAG_H
26 /** Defined when <sofia-sip/sdp_tag.h> has been included. */
27 #define SDP_TAG_H
28 
29 /**@file sofia-sip/sdp_tag.h
30  * @brief SDP tags
31  *
32  * @author Pekka Pessi <Pekka.Pessi@nokia.com>
33  *
34  * @date Created: Mon May 12 12:06:20 EEST 2003 ppessi
35  * @{
36  */
37 
38 #ifndef SU_TAG_H
39 #include <sofia-sip/su_tag.h>
40 #endif
41 #ifndef SU_TAG_CLASS_H
42 #include <sofia-sip/su_tag_class.h>
43 #endif
44 
45 SOFIA_BEGIN_DECLS
46 
47 struct sdp_session_s;
48 
49 /** Filter tag matching any sdp tag. */
50 #define SDPTAG_ANY()         sdptag_any, ((tag_value_t)0)
51 SDP_DLL extern tag_typedef_t sdptag_any;
52 
53 /* Tags for parameters */
54 
55 SDP_DLL extern tag_typedef_t sdptag_session;
56 /** SDP session description. @HI */
57 #define SDPTAG_SESSION(x) \
58 sdptag_session, sdptag_session_v((x))
59 
60 SDP_DLL extern tag_typedef_t sdptag_session_ref;
61 #define SDPTAG_SESSION_REF(x) \
62 sdptag_session_ref, sdptag_session_vr(&(x))
63 
64 /* Functions for typesafe parameter passing */
65 
66 #if SU_HAVE_INLINE
67 su_inline
sdptag_session_v(struct sdp_session_s const * v)68 tag_value_t sdptag_session_v(struct sdp_session_s const *v) {
69   return (tag_value_t)v;
70 }
71 su_inline
sdptag_session_vr(struct sdp_session_s const ** vp)72 tag_value_t sdptag_session_vr(struct sdp_session_s const **vp) {
73   return (tag_value_t)vp;
74 }
75 #else
76 #define sdptag_session_v(v)   (tag_value_t)(v)
77 #define sdptag_session_vr(vp) (tag_value_t)(vp)
78 #endif
79 
80 /* Tag classes */
81 
82 extern tag_class_t sdptag_session_class[];
83 
84 #define SDPTAG_TYPEDEF(name) \
85   {{ TAG_NAMESPACE, #name, sdptag_session_class }}
86 
87 SOFIA_END_DECLS
88 
89 #endif /* !defined(SDP_TAG_H) */
90