sdp_tag.h 2.29 KB
Newer Older
Pekka Pessi's avatar
Pekka Pessi committed
1 2 3 4 5 6 7
/*
 * This file is part of the Sofia-SIP package
 *
 * Copyright (C) 2005 Nokia Corporation.
 *
 * Contact: Pekka Pessi <pekka.pessi@nokia.com>
 *
8
 * This library is free software; you can redistribute it and/or
Pekka Pessi's avatar
Pekka Pessi committed
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
 * modify it under the terms of the GNU Lesser General Public License
 * as published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA
 *
 */

Pekka Pessi's avatar
Pekka Pessi committed
25 26
#ifndef SDP_TAG_H
/** Defined when <sofia-sip/sdp_tag.h> has been included. */
Pekka Pessi's avatar
Pekka Pessi committed
27
#define SDP_TAG_H
Pekka Pessi's avatar
Pekka Pessi committed
28

Pekka Pessi's avatar
Pekka Pessi committed
29
/**@file sofia-sip/sdp_tag.h   
Pekka Pessi's avatar
Pekka Pessi committed
30 31 32 33 34 35 36 37 38
 * @brief SDP tags
 *
 * @author Pekka Pessi <Pekka.Pessi@nokia.com>
 *
 * @date Created: Mon May 12 12:06:20 EEST 2003 ppessi
 * @{
 */

#ifndef SU_TAG_H
39
#include <sofia-sip/su_tag.h>
Pekka Pessi's avatar
Pekka Pessi committed
40 41
#endif
#ifndef SU_TAG_CLASS_H
42
#include <sofia-sip/su_tag_class.h>
Pekka Pessi's avatar
Pekka Pessi committed
43
#endif
Pekka Pessi's avatar
Pekka Pessi committed
44

45 46
SOFIA_BEGIN_DECLS

Pekka Pessi's avatar
Pekka Pessi committed
47 48
struct sdp_session_s;

49 50 51 52
/** Filter tag matching any sdp tag. */
#define SDPTAG_ANY()         sdptag_any, ((tag_value_t)0)
SDP_DLL extern tag_typedef_t sdptag_any;

Pekka Pessi's avatar
Pekka Pessi committed
53 54 55 56 57 58 59 60 61 62 63 64 65
/* Tags for parameters */

SDP_DLL extern tag_typedef_t sdptag_session;
/** SDP session description. @HI */
#define SDPTAG_SESSION(x) \
sdptag_session, sdptag_session_v((x))

SDP_DLL extern tag_typedef_t sdptag_session_ref;
#define SDPTAG_SESSION_REF(x) \
sdptag_session_ref, sdptag_session_vr(&(x))

/* Functions for typesafe parameter passing */

66
#if SU_HAVE_INLINE
67
su_inline
Pekka Pessi's avatar
Pekka Pessi committed
68
tag_value_t sdptag_session_v(struct sdp_session_s const *v) { 
Pekka Pessi's avatar
Pekka Pessi committed
69 70
  return (tag_value_t)v; 
}
71
su_inline
Pekka Pessi's avatar
Pekka Pessi committed
72
tag_value_t sdptag_session_vr(struct sdp_session_s const **vp) { 
Pekka Pessi's avatar
Pekka Pessi committed
73 74 75 76 77 78 79 80 81 82 83
  return (tag_value_t)vp; 
}
#else
#define sdptag_session_v(v)   (tag_value_t)(v)
#define sdptag_session_vr(vp) (tag_value_t)(vp)
#endif

/* Tag classes */

extern tag_class_t sdptag_session_class[];

Pekka Pessi's avatar
Pekka Pessi committed
84 85 86
#define SDPTAG_TYPEDEF(name) \
  {{ TAG_NAMESPACE, #name, sdptag_session_class }}

87 88
SOFIA_END_DECLS

Pekka Pessi's avatar
Pekka Pessi committed
89
#endif /* !defined(SDP_TAG_H) */