sofia-sip/su_strlst.h

Go to the documentation of this file.
00001 /*
00002  * This file is part of the Sofia-SIP package
00003  *
00004  * Copyright (C) 2006 Nokia Corporation.
00005  *
00006  * Contact: Pekka Pessi <pekka.pessi@nokia-email.address.hidden>
00007  *
00008  * This library is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU Lesser General Public License
00010  * as published by the Free Software Foundation; either version 2.1 of
00011  * the License, or (at your option) any later version.
00012  *
00013  * This library is distributed in the hope that it will be useful, but
00014  * WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00016  * Lesser General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU Lesser General Public
00019  * License along with this library; if not, write to the Free Software
00020  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
00021  * 02110-1301 USA
00022  *
00023  */
00024 
00025 #ifndef SU_STRLST_H  
00026 #define SU_STRLST_H
00027 
00035 #ifndef SU_ALLOC_H
00036 #include <sofia-sip/su_alloc.h>
00037 #endif
00038 
00039 SOFIA_BEGIN_DECLS
00040 
00041 typedef struct su_strlst_s su_strlst_t;
00042 
00044 SU_DLL su_strlst_t *su_strlst_create(su_home_t *home)
00045      __attribute__((__malloc__));
00047 SU_DLL void su_strlst_destroy(su_strlst_t *);
00048 
00049 SU_DLL su_strlst_t *su_strlst_create_with(su_home_t *, char const *, ...)
00050      __attribute__((__malloc__));
00051 
00052 SU_DLL su_strlst_t *su_strlst_create_with_dup(su_home_t *, char const *, ...)
00053      __attribute__((__malloc__));
00054 
00055 SU_DLL su_strlst_t *su_strlst_vcreate_with(su_home_t *,
00056                                            char const *,
00057                                            va_list va)
00058      __attribute__((__malloc__));
00059 
00060 SU_DLL su_strlst_t *su_strlst_vcreate_with_dup(su_home_t *,
00061                                                char const *, 
00062                                                va_list va)
00063      __attribute__((__malloc__));
00064 
00066 SU_DLL su_strlst_t *su_strlst_copy(su_home_t *home, su_strlst_t const *orig);
00067 
00069 SU_DLL su_strlst_t *su_strlst_dup(su_home_t *home, su_strlst_t const *orig);
00070 
00072 SU_DLL char *su_strlst_dup_append(su_strlst_t *, char const *str);
00073 
00075 SU_DLL char const *su_strlst_append(su_strlst_t *, char const *str);
00076 
00078 SU_DLL char const *su_slprintf(su_strlst_t *self, char const *fmt, ...);
00079 
00081 SU_DLL char const *su_slvprintf(su_strlst_t *self, char const *fmt, va_list ap);
00082 
00084 SU_DLL char const *su_strlst_item(su_strlst_t const *, usize_t i);
00085 
00087 SU_DLL char const *su_strlst_set_item(su_strlst_t *self, usize_t i, 
00088                                       char const *s);
00089 
00091 SU_DLL char const *su_strlst_remove(su_strlst_t *, usize_t i);
00092 
00094 SU_DLL char *su_strlst_join(su_strlst_t *s, su_home_t *home, 
00095                              char const *sep)
00096      __attribute__((__malloc__));
00097 
00099 SU_DLL su_strlst_t *su_strlst_split(su_home_t *, char *s, char const *sep)
00100      __attribute__((__malloc__));
00101 
00103 SU_DLL su_strlst_t *su_strlst_dup_split(su_home_t *, char const *s, 
00104                                         char const *sep)
00105      __attribute__((__malloc__));
00106 
00108 SU_DLL usize_t su_strlst_len(su_strlst_t const *l);
00109 
00110 #if SU_HAVE_INLINE
00111 su_inline
00112 su_home_t *su_strlst_home(su_strlst_t *s)
00113 {
00114   return (su_home_t *)s;
00115 }
00116 #else
00117 #define su_strlst_home(s) ((su_home_t *)(s))
00118 #endif
00119 
00121 SU_DLL char const **su_strlst_get_array(su_strlst_t *self)
00122      __attribute__((__malloc__));
00123 
00125 SU_DLL void su_strlst_free_array(su_strlst_t *self, char const * array[]);
00126 
00127 SOFIA_END_DECLS
00128 
00129 #endif /* ! defined(SU_STRLST_H) */

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