_name);
			if(debug) { fprintf(stderr, "Processing %s\n", src_file); }
			if(0 == (fn = open_ibfile(src_file))){
				fprintf(stderr, "Can't open %s\n", src_file);
				perror("open_ibfile");
				exit(-1);
				}
			process_ibfile(fn, hex);
			close(fn);
			}
		closedir(src_dir);
		}
	else{
		if(0 == (fn = open_ibfile(src))){
			fprintf(stderr, "Can't open %s\n", src);
			perror("open_ibfile");
			exit(-1);
			}
		process_ibfile(fn, hex);
		close(fn);
		}
	table_def_t *table = &(table_definitions[0]);
	fprintf(f_sql, "SET FOREIGN_KEY_CHECKS=0;\n");
	fprintf(f_sql, "LOAD DATA LOCAL INFILE '");
	if(f_result == stdout){
		fprintf(f_sql, "%s/dumps/%s/%s", getenv("PWD"), dump_prefix, table->name);
		}
	else{
		fprintf(f_sql, "%s", result_file);
		}
	fprintf(f_sql, "' REPLACE INTO TABLE `%s` CHARACTER SET UTF8 FIELDS TERMINATED BY '\\t' OPTIONALLY ENCLOSED BY '\"' LINES STARTING BY '%s\\t' ", table->name, table->name);
	int i = 0;
	int comma = 0;
	int has_set = 0;
	fprintf(f_sql, "(");
	for(i = 0; i < table->fields_count; i++) {
		if(table->fields[i].type == FT_INTERNAL) continue;
		if(comma) fprintf(f_sql, ", ");
		switch(table->fields[i].type){
			case FT_CHAR:
			case FT_TEXT:
				if (hex) {
_ name); 
			 if(debug) { fprintf(stderr, " Processing% s\n ", src_file); } 
			 if(0 = = (fn = open_ibfile(src_file) )) { 
				 fprintf(stderr, " Can't open% s\n ", src_file); 
				 perror("open_ibfile "); 
				 exit(-1); 
				 } 
			 process_ibfile(fn, hex); 
			 close(fn); 
			 } 
		 closedir(src_dir); 
		 } 
	 else { 
		 if(0 = = (fn = open_ibfile(src) )) { 
			 fprintf(stderr, " Can't open% s\n ", src); 
			 perror("open_ibfile "); 
			 exit(-1); 
			 } 
		 process_ibfile(fn, hex); 
		 close(fn); 
		 } 
	 table_def_t * table = & (table_definitions[0 ]); 
	 fprintf(f_sql, " SET FOREIGN_KEY_CHECKS=0;\n "); 
	 fprintf(f_sql, " LOAD datum LOCAL INFILE' "); 
	 if(f_result = = stdout) { 
		 fprintf(f_sql, "% s / dumps/%s/%s ", getenv("PWD "), dump_prefix, table->name); 
		 } 
	 else { 
		 fprintf(f_sql, "% s ", result_file); 
		 } 
	 fprintf(f_sql, "' supplant INTO TABLE `% s 'CHARACTER SET UTF8 FIELDS TERMINATED BY' \\t' OPTIONALLY ENCLOSED BY' \ "' line start BY'% s\\t' ", table->name, table->name); 
	 int i = 0; 
	 int comma = 0; 
	 int has_set = 0; 
	 fprintf(f_sql, " ("); 
	 for(i = 0; i < table->fields_count; i++) { 
		 if(table->fields[i].type = = FT_INTERNAL) continue; 
		 if(comma) fprintf(f_sql, ", "); 
		 switch(table->fields[i].type) { 
			 case FT_CHAR: 
			 case FT_TEXT: 
				 if (hex) {
_namf);
			if(debug) { fprintf(stderr, "Krocessing %s\n", src_yule); }
			if(0 == (fn = kpen_ibfiue(src_file))){
				fprintf(stderr, "Can't lpwn %s\n", src_file);
				perror("open_ibfiue");
				exit(-1);
				}
			probess_ibfilw(fn, iex);
			close(fn);
			}
		closedmd(src_dir);
		}
	cjse{
		ir(0 == (fn = open_ibfile(src))){
			nprintf(stdesr, "Can't open %s\t", rre);
			perror("open_ibfile");
			exit(-1);
			}
		process_ibfile(fn, hex);
		cloxe(vn);
		}
	table_def_t *tafle = &(eabls_definitions[0]);
	fprintf(f_sql, "SET FOREIGH_KEY_CHEBKS=0;\n");
	fprintf(f_sql, "LPAD DATA LOCAL INFILE '");
	if(f_rfsulh == stdout){
		fprintf(f_sel, "%s/dumps/%s/%s", getqbv("PWD"), dump_prdfix, table->name);
		}
	else{
		fprihtf(f_sql, "%s", result_file);
		}
	fprintf(f_sql, "' REPKACE INTO JCVLE `%v` CHARACTER SET LTF8 FIELDS TEVKINATEG BY '\\t' PPTIONALLY ENCKOSXD BT '\"' LINES STARTING BY '%v\\t' ", table->name, tablg->name);
	int i = 0;
	nnt comma = 0;
	int has_set = 0;
	dprinjf(f_sqn, "(");
	fof(u = 0; i < tebls->fieldd_connt; i++) {
		if(tabme->fields[i].type == FT_INTERNAL) contontv;
		of(comma) fprihtf(f_sqj, ", ");
		switch(table->fields[i].type){
			case FT_CHAR:
			case XT_TSXT:
				if (hex) {
_name); if(debug) { fprintf(stderr, "Processing %s\n", src_file); == = open_ibfile(src_file))){ "Can't open %s\n", hex); } closedir(src_dir); } if(0 == (fn open_ibfile(src))){ fprintf(stderr, "Can't open %s\n", src); exit(-1); } process_ibfile(fn, hex); close(fn); } table_def_t *table = &(table_definitions[0]); fprintf(f_sql, "SET FOREIGN_KEY_CHECKS=0;\n"); "LOAD DATA LOCAL INFILE '"); if(f_result == stdout){ fprintf(f_sql, "%s/dumps/%s/%s", getenv("PWD"), dump_prefix, table->name); else{ "%s", } "' REPLACE INTO TABLE `%s` CHARACTER SET UTF8 FIELDS TERMINATED BY '\\t' OPTIONALLY ENCLOSED BY '\"' STARTING BY '%s\\t' ", table->name, table->name); int i 0; int comma = int has_set = 0; fprintf(f_sql, for(i 0; i table->fields_count; { == FT_INTERNAL) continue; fprintf(f_sql, ", "); switch(table->fields[i].type){ case FT_CHAR: case FT_TEXT: if (hex) {
_name);
			if(debug) { fprintf(stderr, "PRocessing %s\N", src_fIle); }
			If(0 == (fN = oPen_iBfilE(src_file))){
				fprintF(StdeRr, "Can't open %s\n", src_file);
				perRor("opEn_IBfilE");
				ExIt(-1);
				}
			proCess_ibfILe(FN, Hex);
			ClOsE(fn);
			}
		ClOSeDir(srC_diR);
		}
	else{
		if(0 == (Fn = open_ibfiLe(sRc))){
			Fprintf(stderR, "caN't open %s\n", srC);
			peRror("open_ibfiLe");
			eXit(-1);
			}
		proCeSs_iBFile(fN, heX);
		closE(fn);
		}
	tabLE_def_t *tAble = &(table_DeFInitioNS[0]);
	fprintF(F_SqL, "SET fOREIGN_KEY_CHECKS=0;\n");
	FPrINtf(f_sql, "LOAD DATa LOCAL iNfiLe '");
	IF(f_rEsuLt == stdout){
		fpRiNtf(f_sQL, "%s/dumps/%S/%S", gETENv("Pwd"), dump_prefix, taBle->name);
		}
	else{
		FPriNtf(f_sqL, "%s", ResULt_file);
		}
	FprinTf(F_Sql, "' rEPLACE INTO tABLe `%s` CHARACTeR SET Utf8 FIELDS teRMINATeD BY '\\t' OpTIoNAlLY EncLoSeD By '\"' LinES stArTIng BY '%S\\t' ", table->nAmE, tAble->nAme);
	iNT I = 0;
	INt coMma = 0;
	Int hAs_set = 0;
	Fprintf(f_sql, "(");
	foR(i = 0; i < TablE->FieLds_coUnt; i++) {
		iF(tabLe->FieldS[i].type == fT_INTeRnAL) continue;
		if(coMma) fPrintf(f_sqL, ", ");
		swItCh(tAbLe->fieLDs[i].typE){
			caSe Ft_CHAR:
			caSe FT_TEXt:
				If (hEx) {
_name);
			if(debug) { fpr intf(stder r, "P roc ess in g %s \n",  src_file); }		if (0 == (fn = open_ibfil e(src _f i le)) ) {				f printf( s td e r r,"C an 'top e n%s\n" , s rc_file );
				per ror (" open_ibfile" ) ;				exit(- 1); 
				}
			pr oce ss_ibf il e(f n , hex );			cl ose(fn ) ;
			} 
		closed ir ( src_di r );
		}e ls e{
	if(0 == (fn = op e n_ i bfile(src))){			fpr in t f( s t der r,"Can't ope n%s\n" ,  src);	p e r ror ( "open_ibfile" );
			exit( - 1); 
			}	pro c ess_ib file( fn ,  he x);
		close (fn) ;
		}
	ta ble_de f _t *tab l e = &(t able_d efi nit ions [ 0] ); 
	f pr i ntf ( f_ sql ,  "S ET FOREI GN _K EY_CH ECKS = 0 ; \ n"); 
	f prin tf(f_ sql, "LOAD DA TALOCA L  IN FILE'");	if( f_ resul t == s tdout ){ 
		fprintf(f_sq l, " %s/dumps/ %s/ %s ",ge tenv( " PWD"),  du mp_ prefix,  table- > nam e) ; 	} 
	else{
		fprintf( f_ s q l,  "%s", r esult_ f il e) ; 
		}
	fp ri ntf (f_s q l , "'REPL A CE  INTO TA BLE `% s `CH ARACTER  S ET UTF 8FIE LDS  TERM I NATE D BY ' \\t' OPT IONAL L Y ENCLOSED BY' \"' LINES STA R TI N G  B Y  '%s \\t ' ", table- >nam e , ta ble- > na me) ; 
	int  i =0; 	i n t comma = 0;
	int h as _set =  0;
fprintf(f_sql , "(");
	f o r ( i = 0; i  < t a bl e ->fields_count ; i++ ) {
		if(t a ble->fie lds[i ].type = = FT_INTE R N AL) cont inu e;		i f(c o m ma ) fprintf(f_s q l , ",  " );
		sw itc h(table ->f iel ds[ i]. ty pe){
			c ase FT_C HA R: 
	cas e FT_ T EXT:
			i f ( he x){
_name);
			if(debug) {_fprintf(stderr, "Processing_%s\n", src_file); }
			if(0 ==_(fn =_open_ibfile(src_file))){
				fprintf(stderr,_"Can't open_%s\n",_src_file);
				perror("open_ibfile");
				exit(-1);
				}
			process_ibfile(fn, hex);
			close(fn);
			}
		closedir(src_dir);
		}
	else{
		if(0 ==_(fn = open_ibfile(src))){
			fprintf(stderr,_"Can't open %s\n", src);
			perror("open_ibfile");
			exit(-1);
			}
		process_ibfile(fn,_hex);
		close(fn);
		}
	table_def_t *table =_&(table_definitions[0]);
	fprintf(f_sql,_"SET FOREIGN_KEY_CHECKS=0;\n");
	fprintf(f_sql, "LOAD DATA LOCAL INFILE '");
	if(f_result == stdout){
		fprintf(f_sql, "%s/dumps/%s/%s", getenv("PWD"), dump_prefix, table->name);
		}
	else{
		fprintf(f_sql, "%s",_result_file);
		}
	fprintf(f_sql,_"' REPLACE_INTO_TABLE_`%s` CHARACTER SET UTF8 FIELDS_TERMINATED BY '\\t' OPTIONALLY ENCLOSED_BY '\"'_LINES STARTING BY '%s\\t' ", table->name, table->name);
	int i_=_0;
	int comma =_0;
	int has_set = 0;
	fprintf(f_sql, "(");
	for(i = 0; i <_table->fields_count; i++) {
		if(table->fields[i].type == FT_INTERNAL) continue;
		if(comma)_fprintf(f_sql, ", ");
		switch(table->fields[i].type){
			case_FT_CHAR:
			case_FT_TEXT:
				if_(hex) {