Loading...
Searching...
No Matches
su_tag_class.h
Go to the documentation of this file.
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia-email.address.hidden>
*
* This library is free software; you can redistribute it and/or
* 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
*
*/
#ifndef SU_TAG_CLASS_H
#define SU_TAG_CLASS_H
#ifndef SU_TAG_H
#include <sofia-sip/su_tag.h>
#endif
SOFIA_BEGIN_DECLS
/* Macros for defining tag classes */
#ifndef TAG_NAMESPACE
#define TAG_NAMESPACE ""
#endif
#define TAG_TYPEDEF(t, type) \
{{ TAG_NAMESPACE, #t, type ## _tag_class, 0 }}
#define INTTAG_TYPEDEF(t) TAG_TYPEDEF(t, int)
#define UINTTAG_TYPEDEF(t) TAG_TYPEDEF(t, uint)
#define USIZETAG_TYPEDEF(t) TAG_TYPEDEF(t, usize)
#define SIZETAG_TYPEDEF(t) TAG_TYPEDEF(t, size)
#define BOOLTAG_TYPEDEF(t) TAG_TYPEDEF(t, bool)
#define PTRTAG_TYPEDEF(t) TAG_TYPEDEF(t, ptr)
#define SOCKETTAG_TYPEDEF(t) TAG_TYPEDEF(t, socket)
#define CSTRTAG_TYPEDEF(t) TAG_TYPEDEF(t, cstr)
#define STRTAG_TYPEDEF(t) TAG_TYPEDEF(t, str)
#define NSTAG_TYPEDEF(t) TAG_TYPEDEF(t, ns)
struct tag_class_s {
int tc_size;
tagi_t const *(*tc_next)(tagi_t const *t);
size_t (*tc_len)(tagi_t const *t);
tagi_t *(*tc_move)(tagi_t *dst, tagi_t const *src);
size_t (*tc_xtra)(tagi_t const *t, size_t offset);
tagi_t *(*tc_dup)(tagi_t *dst, tagi_t const *src, void **b);
tagi_t *(*tc_free)(tagi_t *t);
tagi_t const *(*tc_find)(tag_type_t t, tagi_t const lst[]);
int (*tc_snprintf)(tagi_t const *t, char b[], size_t size);
tagi_t *(*tc_filter)(tagi_t *dst, tagi_t const f[], tagi_t const *src,
void **bb);
int (*tc_ref_set)(tag_type_t tt, void *ref, tagi_t const value[]);
int (*tc_scan)(tag_type_t tt, su_home_t *home,
char const *str,
tag_value_t *return_value);
};
SOFIAPUBVAR tag_class_t end_tag_class[];
SOFIAPUBVAR tag_class_t int_tag_class[];
SOFIAPUBVAR tag_class_t uint_tag_class[];
SOFIAPUBVAR tag_class_t usize_tag_class[];
SOFIAPUBVAR tag_class_t size_tag_class[];
SOFIAPUBVAR tag_class_t bool_tag_class[];
SOFIAPUBVAR tag_class_t ptr_tag_class[];
SOFIAPUBVAR tag_class_t socket_tag_class[];
SOFIAPUBVAR tag_class_t cstr_tag_class[];
SOFIAPUBVAR tag_class_t str_tag_class[];
SOFIAPUBVAR tag_class_t ns_tag_class[];
#define REFTAG_TYPEDEF(tag) \
{{ TAG_NAMESPACE, #tag "_ref", ref_tag_class, (tag_value_t)tag }}
SOFIAPUBVAR tag_class_t ref_tag_class[];
SOFIAPUBFUN tagi_t *t_filter(tagi_t *, tagi_t const [],
tagi_t const *, void **);
SOFIAPUBFUN tagi_t *t_null_filter(tagi_t *dst, tagi_t const filter[],
tagi_t const *src, void **bb);
SOFIAPUBFUN tagi_t *t_end_filter(tagi_t *, tagi_t const [],
tagi_t const *, void **);
SOFIAPUBFUN int t_ptr_snprintf(tagi_t const *t, char b[], size_t size);
SOFIAPUBFUN int t_ptr_ref_set(tag_type_t tt, void *ref, tagi_t const value[]);
SOFIAPUBFUN int t_ptr_scan(tag_type_t, su_home_t *, char const *,
tag_value_t *return_value);
SOFIAPUBFUN int t_bool_snprintf(tagi_t const *t, char b[], size_t size);
SOFIAPUBFUN int t_bool_ref_set(tag_type_t tt, void *ref, tagi_t const value[]);
SOFIAPUBFUN int t_bool_scan(tag_type_t, su_home_t *, char const *,
tag_value_t *return_value);
SOFIAPUBFUN int t_int_snprintf(tagi_t const *t, char b[], size_t size);
SOFIAPUBFUN int t_int_ref_set(tag_type_t tt, void *ref, tagi_t const value[]);
SOFIAPUBFUN int t_int_scan(tag_type_t, su_home_t *, char const *,
tag_value_t *return_value);
SOFIAPUBFUN int t_uint_snprintf(tagi_t const *t, char b[], size_t size);
SOFIAPUBFUN int t_uint_ref_set(tag_type_t tt, void *ref, tagi_t const value[]);
SOFIAPUBFUN int t_uint_scan(tag_type_t, su_home_t *, char const *,
tag_value_t *return_value);
SOFIAPUBFUN int t_socket_snprintf(tagi_t const *t, char b[], size_t size);
SOFIAPUBFUN int t_socket_ref_set(tag_type_t tt, void *ref, tagi_t const value[]);
SOFIAPUBFUN tagi_t *t_str_dup(tagi_t *dst, tagi_t const *src, void **b);
SOFIAPUBFUN size_t t_str_xtra(tagi_t const *t, size_t offset);
SOFIAPUBFUN int t_str_snprintf(tagi_t const *t, char b[], size_t size);
SOFIAPUBFUN int t_str_scan(tag_type_t, su_home_t *, char const *,
tag_value_t *return_value);
SOFIA_END_DECLS
#endif /* !defined(SU_TAG_CLASS_H) */
tag_class_s
Virtual function table for tags.
Definition su_tag_class.h:65
tag_class_s::tc_size
int tc_size
Size of the tag_class_t structure.
Definition su_tag_class.h:66
tagi_t
Tag item.
Definition su_tag.h:63
su_home_t
SU_HOME_T su_home_t
Memory home type.
Definition su_alloc.h:50
SOFIAPUBFUN
#define SOFIAPUBFUN
SOFIAPUBFUN declares an exported function.
Definition su_config.h:66
SOFIAPUBVAR
#define SOFIAPUBVAR
SOFIAPUBVAR declares an exported variable.
Definition su_config.h:68
su_tag.h
\ Object-oriented tags and tag list interface.
tag_value_t
intptr_t tag_value_t
Tag item value.
Definition su_tag.h:57
tag_class_t
struct tag_class_s const tag_class_t
Tag type class.
Definition su_tag.h:69
tag_type_t
struct tag_type_s const * tag_type_t
Tag item type.
Definition su_tag.h:55
size_tag_class
tag_class_t size_tag_class[]
Tag class for tags with size_t value.
Definition su_taglist.c:1316
usize_tag_class
tag_class_t usize_tag_class[]
Tag class for tags with usize_t value.
Definition su_taglist.c:1364
t_filter
tagi_t * t_filter(tagi_t *, tagi_t const [], tagi_t const *, void **)
Filter an element in tag list.
Definition su_taglist.c:466
ns_tag_class
tag_class_t ns_tag_class[]
Namespace filtering class.
Definition su_taglist.c:1161
cstr_tag_class
tag_class_t cstr_tag_class[]
Tag class for constant strings.
Definition su_taglist.c:1588

Sofia-SIP 1.12.11devel - Copyright (C) 2006 Nokia Corporation. All rights reserved. Licensed under the terms of the GNU Lesser General Public License.