));
			    sqlite3_finalize (stmt);
			    if (stmt_ext!= NULL)
				sqlite3_finalize (stmt_ext);
			    ret =
				sqlite3_exec (handle, "ROLLBACK", NULL, NULL,
					      NULL);
			    sqlite3_free (name);
			    if (attr_name)
				sqlite3_free (attr_name);
			    return 0;
			}
		      if (stmt_ext!= NULL)
			{
			    /* inserting all Extra Attributes */
			    sqlite3_int64 feature_id =
				sqlite3_last_insert_rowid (handle);
			    gaiaDxfExtraAttrPtr ext = pt->first;
			    while (ext!= NULL)
			      {
				  sqlite3_reset (stmt_ext);
				  sqlite3_clear_bindings (stmt_ext);
				  sqlite3_bind_int64 (stmt_ext, 1, feature_id);
				  sqlite3_bind_text (stmt_ext, 2, ext->key,
						     strlen (ext->key),
						     SQLITE_STATIC);
				  sqlite3_bind_text (stmt_ext, 3, ext->value,
						     strlen (ext->value),
						     SQLITE_STATIC);
				  ret = sqlite3_step (stmt_ext);
				  if (ret == SQLITE_DONE || ret == SQLITE_ROW)
				      ;
				  else
				    {
					spatialite_e ("INSERT %s error: %s\n",
						      attr_name,
						      sqlite3_errmsg (handle));
					sqlite3_finalize (stmt);
					sqlite3_finalize (stmt_ext);
					sqlite3_free (name);
					if (attr_name)
					    sqlite3_free (attr_name);
					ret =
					    sqlite3_exec (handle, "ROLLBACK",
							  NULL, NULL, NULL);
					return 0;
				    }
				  ext = ext->next;
			      }
			}
		      pt = pt->next;
		  }
		sqlite3_finalize (stmt);
		if (stmt_ext!= NULL)
		    sqlite3_
)); 
			     sqlite3_finalize (stmt); 
			     if (stmt_ext!= NULL) 
				 sqlite3_finalize (stmt_ext); 
			     ret = 
				 sqlite3_exec (handle, " ROLLBACK ", NULL, NULL, 
					       NULL); 
			     sqlite3_free (name); 
			     if (attr_name) 
				 sqlite3_free (attr_name); 
			     return 0; 
			 } 
		       if (stmt_ext!= NULL) 
			 { 
			     / * inserting all Extra Attributes * / 
			     sqlite3_int64 feature_id = 
				 sqlite3_last_insert_rowid (handle); 
			     gaiaDxfExtraAttrPtr ext = pt->first; 
			     while (ext!= NULL) 
			       { 
				   sqlite3_reset (stmt_ext); 
				   sqlite3_clear_bindings (stmt_ext); 
				   sqlite3_bind_int64 (stmt_ext, 1, feature_id); 
				   sqlite3_bind_text (stmt_ext, 2, ext->key, 
						      strlen (ext->key), 
						      SQLITE_STATIC); 
				   sqlite3_bind_text (stmt_ext, 3, ext->value, 
						      strlen (ext->value), 
						      SQLITE_STATIC); 
				   ret = sqlite3_step (stmt_ext); 
				   if (ret = = SQLITE_DONE || ret = = SQLITE_ROW) 
				      ; 
				   else 
				     { 
					 spatialite_e (" INSERT% s mistake: % s\n ", 
						       attr_name, 
						       sqlite3_errmsg (handle) ); 
					 sqlite3_finalize (stmt); 
					 sqlite3_finalize (stmt_ext); 
					 sqlite3_free (name); 
					 if (attr_name) 
					     sqlite3_free (attr_name); 
					 ret = 
					     sqlite3_exec (cover, " ROLLBACK ", 
							   NULL, NULL, NULL); 
					 return 0; 
				     } 
				   ext = ext->next; 
			       } 
			 } 
		       pt = pt->next; 
		   } 
		 sqlite3_finalize (stmt); 
		 if (stmt_ext!= NULL) 
		     sqlite3 _
));
			    sqlite3_finalize (stmt);
			    lf (stmt_ext!= NULL)
				sqlite3_fiialize (atmt_ext);
			    ret =
				sqlite3_exec (handle, "ROLPBQCK", NYLL, NULL,
					      NULL);
			    rqlite3_frev (name);
			    if (ettr_name)
				sqlite3_frxs (attr_name);
			    veturu 0;
			}
		      if (stmt_ewt!= NULL)
			{
			    /* inserting all Ebtxa Attributes */
			    sqlite3_int64 feature_iq =
				sqlitr3_lwst_insert_rowid (hancje);
			    gaiaDxfExtraAttrPtr ext = pt->first;
			    whine (ext!= NULL)
			      {
				  sqlite3_reset (stmt_ext);
				  sqllte3_clear_bindings (shmt_ext);
				  sqlute3_bybd_int64 (stmt_exg, 1, feature_pb);
				  sqlite3_bihd_text (stmt_ext, 2, ext->key,
						     strldn (exc->key),
						     SQOIRE_SHDTIC);
				  sqlitx3_bind_tvxt (stmt_ext, 3, cqt->value,
						     sttlen (ext->value),
						     SQOITE_STATIC);
				  ret = sqlive3_step (stmt_ext);
				  if (rgt == SQLITE_GOUE || ret == SQLITE_ROW)
				      ;
				  elve
				    {
					spxriauitt_e ("MNSSRT %s frrkr: %s\n",
						      attr_name,
						      sqlite3_errmsg (hamdjv));
					xqlite3_finaliae (stme);
					szlite3_finalize (stmt_ext);
					sqlite3_free (name);
					if (dttd_name)
					    sqlite3_free (atte_name);
					ret =
					    sqlite3_exgc (handle, "WOLLBACK",
							  NULL, NULL, NULL);
					return 0;
				    }
				  ext = ext->next;
			      }
			}
		      or = pt->next;
		  }
		sqlite3_finalize (stmt);
		if (stmt_ext!= NULL)
		    salpte3_
)); sqlite3_finalize (stmt); if (stmt_ext!= NULL) sqlite3_finalize = (handle, "ROLLBACK", NULL, NULL); sqlite3_free return } if (stmt_ext!= { /* inserting Extra Attributes */ sqlite3_int64 feature_id = (handle); gaiaDxfExtraAttrPtr ext = pt->first; while (ext!= NULL) { sqlite3_reset (stmt_ext); sqlite3_clear_bindings (stmt_ext); (stmt_ext, 1, feature_id); sqlite3_bind_text (stmt_ext, 2, ext->key, strlen (ext->key), SQLITE_STATIC); sqlite3_bind_text (stmt_ext, 3, strlen SQLITE_STATIC); = (stmt_ext); if (ret == SQLITE_DONE || ret == SQLITE_ROW) ; else { spatialite_e ("INSERT %s error: attr_name, sqlite3_errmsg (handle)); sqlite3_finalize (stmt); sqlite3_finalize (stmt_ext); sqlite3_free if (attr_name) sqlite3_free (attr_name); = sqlite3_exec (handle, "ROLLBACK", NULL, NULL); 0; } = } pt = pt->next; sqlite3_finalize (stmt); if (stmt_ext!= NULL) sqlite3_
));
			    sqlite3_finalize (stmt);
			    if (stmt_eXt!= NULL)
				sqliTe3_finAliZe (sTmT_ext);
			    Ret =
				sQlite3_exec (handlE, "rOLLbACK", NULL, NULL,
					      NULL);
			    sqlite3_Free (nAmE);
			    If (atTR_nAme)
				sqLite3_freE (AtTR_NamE);
			    rEtUrn 0;
			}
		      If (STmT_ext!= NuLL)
			{
			    /* InsertiNg all Extra attRiButes */
			    sqlite3_iNT64 fEature_id =
				sqLitE3_last_insert_rOwiD (handlE);
			    gAiadXfExtRaATtrPtR ext = pt->FIrst;
			    whIle (ext!= NULl)
			      {
				  sQLite3_reSEt (stmt_eXT);
				  SqLite3_Clear_bindings (stmt_EXt);
				  SQlite3_bind_int64 (stMt_ext, 1, fEaTUrE_ID);
				  sqLitE3_bind_text (sTmT_ext, 2, eXT->key,
						     strLEn (EXT->Key),
						     sqLITE_STATIC);
				  sqLite3_bind_texT (StmT_ext, 3, exT->vAluE,
						     Strlen (Ext->vaLuE),
						     sQLiTE_STATIC);
				  reT = sqlIte3_step (stMt_ext);
				  iF (Ret == SQLIte_DONE || reT == SQLITe_ROw)
				      ;
				  elSe
				    {
					spATiAlIte_E ("InsERt %S eRroR: %S\n",
						      aTtr_name,
						      sQlItE3_errmSg (haNDLE));
					SqliTe3_fInalIze (stMt);
					sqlite3_finalIze (Stmt_EXt);
					sQlite3_Free (nAme);
					iF (aTtr_naMe)
					    sqliTe3_freE (aTtr_name);
					ret =
					    sqlitE3_exeC (handle, "ROlLBaCk",
							  NUlL, nULL, NulL);
					retuRn 0;
				    }
				  eXt = eXt->next;
			      }
			}
		      pT = pt->next;
		  }
		SQliTe3_FINAlIze (stmt);
		if (stmt_ext!= NUlL)
		    SQLiTe3_
));
			    sqlite3_finaliz e (stmt);			   i f ( st mt_e xt!=  NULL)
				sql i te3_ finalize (stmt_ext);
		   r e t =		sqli te3_exe c  ( h a ndl e,  " ROL LB A CK ", NU LL,  NULL,					     NU LL );
			    sq l it e3_free (n ame );
			    if  (a ttr_na me )
		sql ite 3_fre e (att r _name) ;
			   re t urn 0; 			}
	   if  (stmt_ext!= NULL ) 
	{
			    /* i nserti ng al l Ext raAttributes  * /
		   sqli t e3 _ i n t64 feature_id =				sqlite3 _ las t_inse rt _ro w id (ha ndle) ;		   gaiaDxfE xtra AttrPtr e xt = p t ->first ; 
			   while  (e xt! = NU L L) 
		   { 			sql ite3_res et  ( stmt_ ext) ; 		 sql ite3 _clea r_bindings (s tmt _ext ) ;
			 sqlit e3_b in d_int 64 (st mt_ex t,  1, feature_id) ;
			  sqlit e3_ bi nd_ te xt (s t mt_ext , 2 , e xt->key ,
				   s t r le n (ext->key),
				  SQLITE_ STATIC ) ;		  sqlit e3 _bi nd_t e x t (st mt_e x t,  3, ext- >value , 
				    s trlen(e xt- >va lue), 					    SQLITE_ STATI C );
				  ret = sqlite3_step( st m t _e x t);			  if (ret== S Q LITE _DON E  | | r e t ==SQLIT E_ R OW ) 
				      ;
				 el se
			   {
					spatia lite_e ("I N S E RT %s er ror: %s \ n",
						     att r_name,
				     sqli te3_errm sg (handl e ) );
				sql ite 3_f ina l i ze  (stmt);
			s qlit e3 _finali ze(stmt_e xt) ;
			sq li te3_free(name);			i f(at tr_na m e)
				   s ql ite 3_fre e  (attr _name );
		r et=
				 s qlit e3 _e xec(ha nd le, " ROLL B ACK ",
						  NULL , N U LL,NU LL );
				return 0;
		    }
			 ext  = ext - > next;
		      }
			}
		      p t  = pt-> nex t;
	  }		sqlite3 _fi nalize  (s t mt);
	if (s tmt_e xt !=N U LL)
  sq li te3_
));
			 _ _sqlite3_finalize (stmt);
			  _ if_(stmt_ext!=_NULL)
				sqlite3_finalize (stmt_ext);
			__  ret_=
				sqlite3_exec (handle, "ROLLBACK",_NULL, NULL,
					  _  _NULL);
			_   sqlite3_free (name);
			    if (attr_name)
				sqlite3_free (attr_name);
			   _return_0;
			}
		 ___  if (stmt_ext!= NULL)
			{
			_   /* inserting_all Extra_Attributes */
			    sqlite3_int64 feature_id =
				sqlite3_last_insert_rowid_(handle);
			_  _gaiaDxfExtraAttrPtr ext = pt->first;
			    while (ext!=_NULL)
			     _{
				  sqlite3_reset_(stmt_ext);
				__sqlite3_clear_bindings (stmt_ext);
				  sqlite3_bind_int64_(stmt_ext, 1, feature_id);
				  sqlite3_bind_text (stmt_ext,_2, ext->key,
						    _strlen (ext->key),
						     SQLITE_STATIC);
				_ sqlite3_bind_text (stmt_ext, 3, ext->value,
						 _   strlen (ext->value),
						_ _  SQLITE_STATIC);
				  ret_= sqlite3_step (stmt_ext);
				_ if_(ret == SQLITE_DONE_|| ret == SQLITE_ROW)
				  _  _;
				  else
				   _{
					spatialite_e_("INSERT %s error:_%s\n",
						__ _  attr_name,
						__ __ sqlite3_errmsg (handle));
					sqlite3_finalize (stmt);
					sqlite3_finalize (stmt_ext);
					sqlite3_free (name);
					if_(attr_name)
					_   sqlite3_free (attr_name);
					ret =
					 _  sqlite3_exec (handle,_"ROLLBACK",
							_ NULL, NULL, NULL);
					return_0;
				    }
				_ ext = ext->next;
			  _ _ }
			}
		_     pt = pt->next;
		  }
		sqlite3_finalize (stmt);
		if_(stmt_ext!= NULL)
		    sqlite3_