/*
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program 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 Library General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

#ifndef CHAIN_STRING_H
#define CHAIN_STRING_H

#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <stdlib.h>

#include "wrapper.h"

struct chain_string {
  char * value;
  int length;
  struct chain_string *previous;
  struct chain_string *next;
};
/*----------------------------------------------------------*/
/* Prototype */
struct chain_string *new_chain_string(const char *);
struct chain_string *new_chains_string(struct chain_string *, ...);
void drop_all_chain_string(struct chain_string *);
struct chain_string * add_chain_string(struct chain_string *, struct chain_string *, unsigned int);
struct chain_string * delete_chain_string(struct chain_string *, unsigned int);
struct chain_string * delete_chain_string_by_value(struct chain_string *, const char *);
unsigned int replace_chain_string_value(struct chain_string *, const char *, const char *);
struct chain_string * get_chain_string(struct chain_string *, unsigned int);
struct chain_string *get_chain_string_by_value(struct chain_string *, const char *);
struct chain_string * get_last_chain_string(struct chain_string *);
unsigned int get_nb_chain_string(struct chain_string *);
struct chain_string *explode_to_chain_string(const char *, const char *);
struct chain_string *copy_chain_string(struct chain_string *);
void append_chain_string(struct chain_string *, struct chain_string *);
char * chain_string_join(struct chain_string *, const char *, unsigned int);

/* !! Surtout utile pour du debug !! */
void print_chain_string(struct chain_string *);
void print_reverse_chain_string(struct chain_string *);
void print_all_chain_string(struct chain_string *);
/*----------------------------------------------------------*/
#endif


syntax highlighted by Code2HTML, v. 0.9.1