su 1.12.11devel
|
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__, __sentinel__(0))); 00051 00052 SU_DLL su_strlst_t *su_strlst_create_with_dup(su_home_t *, char const *, ...) 00053 __attribute__((__malloc__, __sentinel__(0))); 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 __attribute__ ((__format__ (printf, 2, 3))); 00080 00082 SU_DLL char const *su_slvprintf(su_strlst_t *self, char const *fmt, va_list ap); 00083 00085 SU_DLL char const *su_strlst_item(su_strlst_t const *, usize_t i); 00086 00088 SU_DLL char const *su_strlst_set_item(su_strlst_t *self, usize_t i, 00089 char const *s); 00090 00092 SU_DLL char const *su_strlst_remove(su_strlst_t *, usize_t i); 00093 00095 SU_DLL char *su_strlst_join(su_strlst_t *s, su_home_t *home, 00096 char const *sep) 00097 __attribute__((__malloc__)); 00098 00100 SU_DLL su_strlst_t *su_strlst_split(su_home_t *, char *s, char const *sep) 00101 __attribute__((__malloc__)); 00102 00104 SU_DLL su_strlst_t *su_strlst_dup_split(su_home_t *, char const *s, 00105 char const *sep) 00106 __attribute__((__malloc__)); 00107 00109 SU_DLL usize_t su_strlst_len(su_strlst_t const *l); 00110 00111 #if SU_HAVE_INLINE 00112 su_inline 00113 su_home_t *su_strlst_home(su_strlst_t *s) 00114 { 00115 return (su_home_t *)s; 00116 } 00117 #else 00118 #define su_strlst_home(s) ((su_home_t *)(s)) 00119 #endif 00120 00122 SU_DLL char const **su_strlst_get_array(su_strlst_t *self) 00123 __attribute__((__malloc__)); 00124 00126 SU_DLL void su_strlst_free_array(su_strlst_t *self, char const * array[]); 00127 00128 SOFIA_END_DECLS 00129 00130 #endif /* ! defined(SU_STRLST_H) */