* Copyright (C) 2001-2003 FhG Fokus
 * (at your option) any later version
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * GNU General Public License for more details.

 * @file 
 * @brief Kamailio core :: Simple str type list and helper functions
 * @ingroup core
 * Module: @ref core

#include "str.h"
#include "mem/mem.h"
#include "str_list.h"

 * @brief Add a new allocated list element to an existing list
 * Add a new allocated list element to an existing list, the allocation is done
 * from the private memory pool
 * @param s input character
 * @param len length of input character
 * @param last existing list
 * @param total length of total characters in list
 * @return extended list
struct str_list *append_str_list(char *s, int len, struct str_list **last, int *total)
	struct str_list *new;
	new = pkg_malloc(sizeof(struct str_list));
	if (!new) {
		return 0;
	new->s.s = s;
	new->s.len = len;
	new->next = 0;

	(*last)->next = new;
	*last = new;
	*total += len;
	return new;