00001 /* 00002 * Copyright (C) 2001-2003 FhG Fokus 00003 * 00004 * This file is part of sip-router, a free SIP server. 00005 * 00006 * sip-router is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 2 of the License, or 00009 * (at your option) any later version 00010 * 00011 * sip-router is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 */ 00020 00027 #include "str.h" 00028 #include "mem/mem.h" 00029 #include "str_list.h" 00030 00031 00043 struct str_list *append_str_list(char *s, int len, struct str_list **last, int *total) 00044 { 00045 struct str_list *new; 00046 new = pkg_malloc(sizeof(struct str_list)); 00047 if (!new) { 00048 PKG_MEM_ERROR; 00049 return 0; 00050 } 00051 new->s.s = s; 00052 new->s.len = len; 00053 new->next = 0; 00054 00055 (*last)->next = new; 00056 *last = new; 00057 *total += len; 00058 return new; 00059 }
1.7.1