#include "list.h"

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

#include "../var/var.h"
#include "../virtual/virtual.h"
#include "../int/int.h"

TextData *l_new(void);

void    l_incSize(ListVariable *list);
void    l_addText(ListVariable *list, char *txt);

unsigned  l_remove(ListVariable *list, char const *txt);
void    l_cleanup(ListVariable *list, unsigned toRemove);

inline List *l_listPtr(Variable *var)
{
    return &var->data->list;
}

inline uint16_t *l_sizePtr(Variable *var)
{
    return &l_listPtr(var)->size;
}

inline List const *l_listConstPtr(Variable const *var)
{
    return &var->data->list;
}

inline uint16_t l_size(Variable const *var)
{
    return l_listConstPtr(var)->size;
}

inline char **l_element(Variable *var)
{
    return l_listPtr(var)->element;
}

inline char const **l_constElement(Variable const *var)
{
    return (char const **)l_listConstPtr(var)->element;
}




