rem: gchar **pointeur_char;  pointeur_char = g_strsplit ( xmlNodeGetContent ( node_detail_etat ), "/", 3 );  etat -> date_perso_fin = g_date_new_dmy ( my_atoi ( pointeur_char[0] ), my_atoi ( pointeur_char[1] ), my_atoi ( pointeur_char[2] )); g_strfreev ( pointeur_char );
add: if ( xmlNodeGetContent (node_detail_etat) && strlen (xmlNodeGetContent (node_detail_etat)) ) { gchar **pointeur_char;  pointeur_char = g_strsplit ( xmlNodeGetContent ( node_detail_etat ), "/", 3 ); etat -> date_perso_fin = g_date_new_dmy ( my_atoi ( pointeur_char[0] ), my_atoi ( pointeur_char[1] ), my_atoi ( pointeur_char[2] )); g_strfreev ( pointeur_char ); }
context: gboolean charge_etat_version_0_4_0 ( xmlDocPtr doc ){    xmlNodePtr node;    struct struct_etat *etat;    /*   on met  null le log_message, il sera affich  la fin en cas de pb */    log_message = NULL;    etat = calloc ( 1,		    sizeof ( struct struct_etat ));    /* on place node sur les generalites */    node = doc -> children -> children;    while ( node )    {	if ( !strcmp ( node -> name,		       "Generalites" ) )	{	    xmlNodePtr node_generalites;	    /* node_generalites va faire le tour des generalites */	    node_generalites = node -> children;	    while ( node_generalites )	    {		if ( !strcmp ( node_generalites -> name,			       "Nom" ))		    etat -> nom_etat = xmlNodeGetContent ( node_generalites );		node_generalites = node_generalites -> next;	    }	}	/* on recupre ici l'etat */	if ( !strcmp ( node -> name,		       "Details" ))	{	    xmlNodePtr node_detail_etat;	    node_detail_etat = node -> children;	    while ( node_detail_etat )	    {		if ( !strcmp ( node_detail_etat -> name,			       "Type_classement" )		     &&		     xmlNodeGetContent ( node_detail_etat ))		{		    gchar **pointeur_char;		    gint i;		    pointeur_char = g_strsplit ( xmlNodeGetContent ( node_detail_etat ),						 "/",						 0 );		    i=0;		    while ( pointeur_char[i] )		    {			etat -> type_classement = g_list_append ( etat -> type_classement,								  GINT_TO_POINTER ( my_atoi ( pointeur_char[i] )));			i++;		    }		    g_strfreev ( pointeur_char );		}		if ( !strcmp ( node_detail_etat -> name,			       "Aff_r" ))		    etat -> afficher_r = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Aff_ope" ))		    etat -> afficher_opes = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Aff_nb_ope" ))		    etat -> afficher_nb_opes = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Aff_no_ope" ))		    etat -> afficher_no_ope = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Aff_date_ope" ))		    etat -> afficher_date_ope = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Aff_tiers_ope" ))		    etat -> afficher_tiers_ope = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Aff_categ_ope" ))		    etat -> afficher_categ_ope = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Aff_ss_categ_ope" ))		    etat -> afficher_sous_categ_ope = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Aff_type_ope" ))		    etat -> afficher_type_ope = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Aff_ib_ope" ))		    etat -> afficher_ib_ope = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Aff_ss_ib_ope" ))		    etat ->afficher_sous_ib_ope  = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Aff_cheque_ope" ))		    etat -> afficher_cheque_ope = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Aff_notes_ope" ))		    etat -> afficher_notes_ope = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Aff_pc_ope" ))		    etat -> afficher_pc_ope = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Aff_rappr_ope" ))		    etat -> afficher_rappr_ope = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Aff_infobd_ope" ))		    etat -> afficher_infobd_ope = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Aff_exo_ope" ))		    etat -> afficher_exo_ope = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Class_ope" ))		    etat -> type_classement_ope = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Aff_titres_col" ))		    etat -> afficher_titre_colonnes = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Aff_titres_chgt" ))		    etat -> type_affichage_titres = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Pas_detail_ventil" ))		    etat -> pas_detailler_ventilation = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Sep_rev_dep" ))		    etat -> separer_revenus_depenses = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Devise_gen" ))		    etat -> devise_de_calcul_general = recupere_devise_par_nom_etat ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Incl_tiers" ))		    etat -> inclure_dans_tiers = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Ope_click" ))		    etat -> ope_clickables = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Exo_date" ))		    etat -> exo_date = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Detail_exo" ))		    etat -> utilise_detail_exo = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Liste_exo" ))		{		    xmlNodePtr node_exo;		    node_exo = node_detail_etat -> children;		    /*  on fait le tour des exos */		    while ( node_exo )		    {			gint no_exo;			no_exo = recupere_exo_par_nom_etat ( xmlGetProp ( node_exo,									  "Nom" ));			if ( no_exo )			    etat -> no_exercices = g_slist_append ( etat -> no_exercices,								    GINT_TO_POINTER ( no_exo ));			node_exo = node_exo -> next;		    }		}		if ( !strcmp ( node_detail_etat -> name,			       "Plage_date" ))		    etat -> no_plage_date = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Date_debut" )		     &&		     xmlNodeGetContent ( node_detail_etat ))		{		    gchar **pointeur_char;		    pointeur_char = g_strsplit ( xmlNodeGetContent ( node_detail_etat ),						 "/",						 3 );		    etat -> date_perso_debut = g_date_new_dmy ( my_atoi ( pointeur_char[0] ),								my_atoi ( pointeur_char[1] ),								my_atoi ( pointeur_char[2] ));		    g_strfreev ( pointeur_char );		}		if ( !strcmp ( node_detail_etat -> name,			       "Date_fin" )		     &&		     xmlNodeGetContent ( node_detail_etat ))		{		    gchar **pointeur_char;		    pointeur_char = g_strsplit ( xmlNodeGetContent ( node_detail_etat ),						 "/",						 3 );		    etat -> date_perso_fin = g_date_new_dmy ( my_atoi ( pointeur_char[0] ),							      my_atoi ( pointeur_char[1] ),							      my_atoi ( pointeur_char[2] ));		    g_strfreev ( pointeur_char );		}		if ( !strcmp ( node_detail_etat -> name,			       "Utilise_plages" ))		    etat -> separation_par_plage = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Sep_plages" ))		    etat -> type_separation_plage = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Deb_sem_plages" ))		    etat -> jour_debut_semaine = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Detail_comptes" ))		    etat -> utilise_detail_comptes = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Liste_comptes" ))		{		    xmlNodePtr node_compte;		    node_compte = node_detail_etat -> children;		    /*  on fait le tour des comptes */		    while ( node_compte )		    {			gint no_compte;			no_compte = recupere_compte_par_nom_etat ( xmlGetProp ( node_compte,										"Nom" ));			if ( no_compte != -1 )			    etat -> no_comptes = g_slist_append ( etat -> no_comptes,								  GINT_TO_POINTER ( no_compte ));			node_compte = node_compte -> next;		    }		}		if ( !strcmp ( node_detail_etat -> name,			       "Grp_ope_compte" ))		    etat -> regroupe_ope_par_compte = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Total_compte" ))		    etat -> affiche_sous_total_compte = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Aff_nom_compte" ))		    etat -> afficher_nom_compte = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Type_vir" ))		    etat -> type_virement = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Liste_comptes_vir" ))		{		    xmlNodePtr node_compte;		    node_compte = node_detail_etat -> children;		    /*  on fait le tour des comptes */		    while ( node_compte )		    {			gint no_compte;			no_compte = recupere_compte_par_nom_etat ( xmlGetProp ( node_compte,										"Nom" ));			if ( no_compte != -1 )			    etat -> no_comptes_virements = g_slist_append ( etat -> no_comptes_virements,									    GINT_TO_POINTER ( no_compte ));			node_compte = node_compte -> next;		    }		}		if ( !strcmp ( node_detail_etat -> name,			       "Exclure_non_vir" ))		    etat -> exclure_ope_non_virement = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Categ" ))		    etat -> utilise_categ = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Detail_categ" ))		    etat -> utilise_detail_categ = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Liste_categ" ))		{		    xmlNodePtr node_categ;		    node_categ = node_detail_etat -> children;		    /*  on fait le tour des categ */		    while ( node_categ )		    {			gint no_categ;			no_categ = recupere_categ_par_nom_etat ( xmlGetProp ( node_categ,									      "Nom" ));			if ( no_categ )			    etat -> no_categ = g_slist_append ( etat -> no_categ,								GINT_TO_POINTER ( no_categ ));			node_categ = node_categ -> next;		    }		}		if ( !strcmp ( node_detail_etat -> name,			       "Exclut_categ" ))		    etat -> exclure_ope_sans_categ = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Total_categ" ))		    etat -> affiche_sous_total_categ = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Aff_ss_categ" ))		    etat -> afficher_sous_categ = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Aff_pas_ss_categ" ))		    etat -> afficher_pas_de_sous_categ = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Total_ss_categ" ))		    etat -> affiche_sous_total_sous_categ = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Devise_categ" ))		    etat -> devise_de_calcul_categ = recupere_devise_par_nom_etat ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Aff_nom_categ" ))		    etat -> afficher_nom_categ = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "IB" ))		    etat -> utilise_ib = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Detail_ib" ))		    etat -> utilise_detail_ib = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Liste_ib" ))		{		    xmlNodePtr node_ib;		    node_ib = node_detail_etat -> children;		    /*  on fait le tour des ib */		    while ( node_ib )		    {			gint no_ib;			no_ib = recupere_ib_par_nom_etat ( xmlGetProp ( node_ib,									"Nom" ));			if ( no_ib )			    etat -> no_ib = g_slist_append ( etat -> no_ib,							     GINT_TO_POINTER ( no_ib ));			node_ib = node_ib -> next;		    }		}		if ( !strcmp ( node_detail_etat -> name,			       "Exclut_ib" ))		    etat -> exclure_ope_sans_ib = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Total_ib" ))		    etat -> affiche_sous_total_ib = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Aff_ss_ib" ))		    etat -> afficher_sous_ib = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Aff_pas_ss_ib" ))		    etat -> afficher_pas_de_sous_ib = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Total_ss_ib" ))		    etat -> affiche_sous_total_sous_ib = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Devise_ib" ))		    etat -> devise_de_calcul_ib = recupere_devise_par_nom_etat ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Aff_nom_ib" ))		    etat -> afficher_nom_ib = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Tiers" ))		    etat -> utilise_tiers = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Detail_tiers" ))		    etat -> utilise_detail_tiers = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Liste_tiers" ))		{		    xmlNodePtr node_tiers;		    node_tiers = node_detail_etat -> children;		    /*  on fait le tour des tiers */		    while ( node_tiers )		    {			gint no_tiers;			no_tiers = recupere_tiers_par_nom_etat ( xmlGetProp ( node_tiers,									      "Nom" ));			if ( no_tiers )			    etat -> no_tiers = g_slist_append ( etat -> no_tiers,								GINT_TO_POINTER ( no_tiers ));			node_tiers = node_tiers -> next;		    }		}		if ( !strcmp ( node_detail_etat -> name,			       "Total_tiers" ))		    etat -> affiche_sous_total_tiers = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Devise_tiers" ))		    etat -> devise_de_calcul_tiers = recupere_devise_par_nom_etat ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Aff_nom_tiers" ))		    etat -> afficher_nom_tiers = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Texte" ))		    etat -> utilise_texte = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Texte_comp" ))		{		    xmlNodePtr node_comp_textes;		    node_comp_textes = node_detail_etat -> children;		    /*  on fait le tour des comparaisons */		    while ( node_comp_textes )		    {			struct struct_comparaison_textes_etat *comp_textes;			comp_textes = calloc ( 1,					       sizeof ( struct struct_comparaison_textes_etat ));			comp_textes -> lien_struct_precedente = my_atoi ( xmlGetProp ( node_comp_textes,										    "Lien_struct" ));			comp_textes -> champ = my_atoi ( xmlGetProp ( node_comp_textes,								   "Champ" ));			comp_textes -> operateur = my_atoi ( xmlGetProp ( node_comp_textes,								       "Op" ));			comp_textes -> texte = xmlGetProp ( node_comp_textes,							    "Txt" );			comp_textes -> utilise_txt = my_atoi ( xmlGetProp ( node_comp_textes,									 "Util_txt" ));			comp_textes -> comparateur_1 = my_atoi ( xmlGetProp ( node_comp_textes,									   "Comp_1" ));			comp_textes -> lien_1_2 = my_atoi ( xmlGetProp ( node_comp_textes,								      "Lien_1_2" ));			comp_textes -> comparateur_2 = my_atoi ( xmlGetProp ( node_comp_textes,									   "Comp_2" ));			comp_textes -> montant_1 = my_atoi ( xmlGetProp ( node_comp_textes,								       "Mont_1" ));			comp_textes -> montant_2 = my_atoi ( xmlGetProp ( node_comp_textes,								       "Mont_2" ));			/* on a fini de remplir le dtail de la comparaison, on l'ajoute  la liste */			etat -> liste_struct_comparaison_textes = g_slist_append ( etat -> liste_struct_comparaison_textes,										   comp_textes );			node_comp_textes = node_comp_textes -> next;		    }		}		if ( !strcmp ( node_detail_etat -> name,			       "Montant" ))		    etat -> utilise_montant = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Montant_devise" ))		    etat -> choix_devise_montant = recupere_devise_par_nom_etat ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Montant_comp" ))		{		    xmlNodePtr node_comp_montants;		    node_comp_montants = node_detail_etat -> children;		    /*  on fait le tour des comparaisons */		    while ( node_comp_montants )		    {			struct struct_comparaison_montants_etat *comp_montants;			comp_montants = calloc ( 1,						 sizeof ( struct struct_comparaison_montants_etat ));			comp_montants -> lien_struct_precedente = my_atoi ( xmlGetProp ( node_comp_montants,										      "Lien_struct" ));			comp_montants -> comparateur_1 = my_atoi ( xmlGetProp ( node_comp_montants,									     "Comp_1" ));			comp_montants -> lien_1_2 = my_atoi ( xmlGetProp ( node_comp_montants,									"Lien_1_2" ));			comp_montants -> comparateur_2 = my_atoi ( xmlGetProp ( node_comp_montants,									     "Comp_2" ));			comp_montants -> montant_1 = my_strtod ( xmlGetProp ( node_comp_montants,									      "Mont_1" ),								 NULL );			comp_montants -> montant_2 = my_strtod ( xmlGetProp ( node_comp_montants,									      "Mont_2" ),								 NULL );			/* on a fini de remplir le dtail de la comparaison, on l'ajoute  la liste */			etat -> liste_struct_comparaison_montants = g_slist_append ( etat -> liste_struct_comparaison_montants,										     comp_montants );			node_comp_montants = node_comp_montants -> next;		    }		}		if ( !strcmp ( node_detail_etat -> name,			       "Excl_nul" ))		    etat -> exclure_montants_nuls = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Detail_mod_paie" ))		    etat -> utilise_mode_paiement = my_atoi ( xmlNodeGetContent ( node_detail_etat ));		if ( !strcmp ( node_detail_etat -> name,			       "Liste_mod_paie" ))		{		    xmlNodePtr node_mode_paiement;		    node_mode_paiement = node_detail_etat -> children;		    /*  on fait le tour des modes de paiement */		    while ( node_mode_paiement )		    {			etat -> noms_modes_paiement = g_slist_append ( etat -> noms_modes_paiement,								       xmlGetProp ( node_mode_paiement,										    "Nom" ));			node_mode_paiement = node_mode_paiement -> next;		    }		}		node_detail_etat = node_detail_etat -> next;	    }	    /* on a fini de remplir l'tat, on l'ajoute  la liste */	    liste_struct_etats = g_slist_append ( liste_struct_etats,						  etat );	}	node = node -> next;    }    /* on libre la memoire */    xmlFreeDoc ( doc );    /* on rafraichit la liste des tats */    remplissage_liste_etats ();    gtk_widget_set_sensitive ( bouton_effacer_etat,			       TRUE );    modification_fichier ( TRUE );    /* on affiche le log si ncessaire */    affiche_log_message ();    return ( TRUE );}