Loading...
Searching...
No Matches
su_strlst.h
Go to the documentation of this file.
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2006 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_STRLST_H
#define SU_STRLST_H
#ifndef SU_ALLOC_H
#include <sofia-sip/su_alloc.h>
#endif
SOFIA_BEGIN_DECLS
typedef struct su_strlst_s su_strlst_t;
SU_DLL su_strlst_t *su_strlst_create(su_home_t *home)
__attribute__((__malloc__));
SU_DLL void su_strlst_destroy(su_strlst_t *);
SU_DLL su_strlst_t *su_strlst_create_with(su_home_t *, char const *, ...)
__attribute__((__malloc__, __sentinel__(0)));
SU_DLL su_strlst_t *su_strlst_create_with_dup(su_home_t *, char const *, ...)
__attribute__((__malloc__, __sentinel__(0)));
SU_DLL su_strlst_t *su_strlst_vcreate_with(su_home_t *,
char const *,
va_list va)
__attribute__((__malloc__));
SU_DLL su_strlst_t *su_strlst_vcreate_with_dup(su_home_t *,
char const *,
va_list va)
__attribute__((__malloc__));
SU_DLL su_strlst_t *su_strlst_copy(su_home_t *home, su_strlst_t const *orig);
SU_DLL su_strlst_t *su_strlst_dup(su_home_t *home, su_strlst_t const *orig);
SU_DLL char *su_strlst_dup_append(su_strlst_t *, char const *str);
SU_DLL char const *su_strlst_append(su_strlst_t *, char const *str);
SU_DLL char const *su_slprintf(su_strlst_t *self, char const *fmt, ...)
__attribute__ ((__format__ (printf, 2, 3)));
SU_DLL char const *su_slvprintf(su_strlst_t *self, char const *fmt, va_list ap);
SU_DLL char const *su_strlst_item(su_strlst_t const *, usize_t i);
SU_DLL char const *su_strlst_set_item(su_strlst_t *self, usize_t i,
char const *s);
SU_DLL char const *su_strlst_remove(su_strlst_t *, usize_t i);
SU_DLL char *su_strlst_join(su_strlst_t *s, su_home_t *home,
char const *sep)
__attribute__((__malloc__));
SU_DLL su_strlst_t *su_strlst_split(su_home_t *, char *s, char const *sep)
__attribute__((__malloc__));
SU_DLL su_strlst_t *su_strlst_dup_split(su_home_t *, char const *s,
char const *sep)
__attribute__((__malloc__));
SU_DLL usize_t su_strlst_len(su_strlst_t const *l);
#if SU_HAVE_INLINE
su_inline
su_home_t *su_strlst_home(su_strlst_t *s)
{
return (su_home_t *)s;
}
#else
#define su_strlst_home(s) ((su_home_t *)(s))
#endif
SU_DLL char const **su_strlst_get_array(su_strlst_t *self)
__attribute__((__malloc__));
SU_DLL void su_strlst_free_array(su_strlst_t *self, char const * array[]);
SOFIA_END_DECLS
#endif /* ! defined(SU_STRLST_H) */
array
Description of array.
Definition foo.c:52
su_alloc.h
Home-based memory management interface.
su_home_t
SU_HOME_T su_home_t
Memory home type.
Definition su_alloc.h:50
su_inline
#define su_inline
Define as suitable declarator static inline functions.
Definition su_configure.h:90
su_strlst_vcreate_with_dup
su_strlst_t * su_strlst_vcreate_with_dup(su_home_t *, char const *, va_list va))
Create a string list with duplicates of initial values.
Definition su_strlst.c:243
su_strlst_dup_append
char * su_strlst_dup_append(su_strlst_t *, char const *str)
Duplicate and append a string to list.
Definition su_strlst.c:352
su_strlst_remove
char const * su_strlst_remove(su_strlst_t *, usize_t i)
Remove a numbered item from list.
Definition su_strlst.c:510
su_strlst_create
su_strlst_t * su_strlst_create(su_home_t *home))
Create a string list.
Definition su_strlst.c:176
su_strlst_set_item
char const * su_strlst_set_item(su_strlst_t *self, usize_t i, char const *s)
Set a numbered item to list.
Definition su_strlst.c:479
su_strlst_len
usize_t su_strlst_len(su_strlst_t const *l)
Get number of items in list.
Definition su_strlst.c:666
su_strlst_join
char * su_strlst_join(su_strlst_t *s, su_home_t *home, char const *sep))
Concatenate list of strings to one string.
Definition su_strlst.c:547
su_strlst_item
char const * su_strlst_item(su_strlst_t const *, usize_t i)
Get a numbered item from list.
Definition su_strlst.c:459
su_strlst_destroy
void su_strlst_destroy(su_strlst_t *)
Destroy a string list.
Definition su_strlst.c:314
su_slvprintf
char const * su_slvprintf(su_strlst_t *self, char const *fmt, va_list ap)
Append a formatted string to the list.
Definition su_strlst.c:435
su_strlst_create_with
su_strlst_t * su_strlst_create_with(su_home_t *, char const *,...)))
Create a string list with initial values.
Definition su_strlst.c:194
su_strlst_get_array
char const ** su_strlst_get_array(su_strlst_t *self))
Get a string array from list.
Definition su_strlst.c:682
su_strlst_dup
su_strlst_t * su_strlst_dup(su_home_t *home, su_strlst_t const *orig)
Deep copy a string list.
Definition su_strlst.c:304
su_slprintf
char const * su_slprintf(su_strlst_t *self, char const *fmt,...)))
Append a formatted string to the list.
Definition su_strlst.c:411
su_strlst_copy
su_strlst_t * su_strlst_copy(su_home_t *home, su_strlst_t const *orig)
Shallow copy a string list.
Definition su_strlst.c:298
su_strlst_free_array
void su_strlst_free_array(su_strlst_t *self, char const *array[])
Free a string array.
su_strlst_dup_split
su_strlst_t * su_strlst_dup_split(su_home_t *, char const *s, char const *sep))
Duplicate and split a string.
Definition su_strlst.c:641
su_strlst_vcreate_with
su_strlst_t * su_strlst_vcreate_with(su_home_t *, char const *, va_list va))
Create a string list with initial values.
Definition su_strlst.c:212
su_strlst_create_with_dup
su_strlst_t * su_strlst_create_with_dup(su_home_t *, char const *,...)))
Create a string list with duplicatedd initial values.
Definition su_strlst.c:225
su_strlst_split
su_strlst_t * su_strlst_split(su_home_t *, char *s, char const *sep))
Split a string.
Definition su_strlst.c:616
su_strlst_append
char const * su_strlst_append(su_strlst_t *, char const *str)
Append a string to list.
Definition su_strlst.c:385

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