Commit 0c660d2b authored by Ziirish's avatar Ziirish

adding new datatables clear function

parent fa64a147
......@@ -228,7 +228,7 @@ cid_free_datatable (CidDataTable *p_list)
}
void
cid_clear_datatable (CidDataTable *p_list)
cid_clear_datatable (CidDataTable **p_list)
{
if (*p_list != NULL)
{
......
......@@ -96,7 +96,14 @@ CidDataTable *cid_create_sized_datatable_with_default_full (size_t iSize, GType
* Fonction permettant de liberer notre liste
* @param pointeur vers notre liste
*/
void cid_free_datatable(CidDataTable **p_list);
void cid_free_datatable(CidDataTable *p_list);
/**
* Fonction permettant de liberer notre liste.
* De plus, le pointeur sera réinitialisé à NULL.
* @param pointeur vers notre liste
*/
void cid_clear_datatable (CidDataTable **p_list);
/**
* Permet de supprimer le premier element 'data' de la liste 'p_list'
......@@ -262,7 +269,7 @@ while(p_temp!=NULL) \
#define END_FOREACH_DT \
p_temp=p_temp->next; \
} \
cid_free_datatable(&p_dt);
cid_clear_datatable(&p_dt);
#define END_FOREACH_DT_NF \
p_temp=p_temp->next; \
......
......@@ -65,7 +65,7 @@ cid_str_replace_all (gchar **string, const gchar *sFrom, const gchar *sTo)
size_t size = cid_datatable_length(t_temp);
if (size < 2)
{
cid_free_datatable(&t_temp);
cid_clear_datatable(&t_temp);
return;
}
int length = (strlen(*string)+((strlen(sTo)-strlen(sFrom))*size))*sizeof(gchar)+1;
......@@ -78,7 +78,7 @@ cid_str_replace_all (gchar **string, const gchar *sFrom, const gchar *sTo)
pData[2] = string;
pData[3] = (gchar *)g_strdup(sTo);
cid_datatable_foreach(t_temp,(CidDataAction)cid_datacase_replace,pData);
cid_free_datatable(&t_temp);
cid_clear_datatable(&t_temp);
g_free (pData[3]);
g_free (pData);
}
......@@ -159,7 +159,7 @@ cid_substitute_user_params (gchar **cPath)
pData[0] = GINT_TO_POINTER(0);
pData[1] = cPath;
cid_datatable_foreach (table, (CidDataAction) cid_proceed_substitute, pData);
cid_free_datatable (&table);
cid_clear_datatable (&table);
g_free (pData);
}
......@@ -235,6 +235,6 @@ cid_str_prepare (gchar **cString)
pData[0] = GINT_TO_POINTER(0);
pData[1] = cString;
cid_datatable_foreach (table, (CidDataAction) cid_foreach_proceed_regex, pData);
cid_free_datatable (&table);
cid_clear_datatable (&table);
g_free (pData);
}
......@@ -118,8 +118,8 @@ cid_free_main_structure (CidMainContainer *pCid)
pCid->config->cConfFile = NULL;
pCid->config->cVerbosity = NULL;
cid_free_datatable (&pCid->runtime->pCoversList);
cid_free_datatable (&pCid->runtime->pImagesList);
cid_clear_datatable (&pCid->runtime->pCoversList);
cid_clear_datatable (&pCid->runtime->pImagesList);
if (pCid->runtime->pLookupDirectory)
g_dir_close (pCid->runtime->pLookupDirectory);
......
......@@ -344,7 +344,7 @@ main ( int argc, char **argv )
}
g_free (test);
cid_free_datatable (&table);
cid_clear_datatable (&table);
*/
fprintf (stdout,"Bye !\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment