Lines Matching refs:sCtx
16366 ImportCtx sCtx; /* Reader context */ in do_meta_command() local
16373 memset(&sCtx, 0, sizeof(sCtx)); in do_meta_command()
16398 sCtx.cColSep = SEP_Unit[0]; in do_meta_command()
16399 sCtx.cRowSep = SEP_Record[0]; in do_meta_command()
16403 sCtx.cColSep = ','; in do_meta_command()
16404 sCtx.cRowSep = '\n'; in do_meta_command()
16461 sCtx.cColSep = p->colSeparator[0]; in do_meta_command()
16462 sCtx.cRowSep = p->rowSeparator[0]; in do_meta_command()
16464 sCtx.zFile = zFile; in do_meta_command()
16465 sCtx.nLine = 1; in do_meta_command()
16466 if( sCtx.zFile[0]=='|' ){ in do_meta_command()
16472 sCtx.in = popen(sCtx.zFile+1, "r"); in do_meta_command()
16473 sCtx.zFile = "<pipe>"; in do_meta_command()
16477 sCtx.in = fopen(sCtx.zFile, "rb"); in do_meta_command()
16480 if( sCtx.in==0 ){ in do_meta_command()
16488 zSep[0] = sCtx.cColSep; in do_meta_command()
16492 zSep[0] = sCtx.cRowSep; in do_meta_command()
16497 while( xRead(&sCtx) && sCtx.cTerm==sCtx.cColSep ){} in do_meta_command()
16498 sCtx.nLine++; in do_meta_command()
16502 xCloser(sCtx.in); in do_meta_command()
16507 import_append_char(&sCtx, 0); /* To ensure sCtx.z is allocated */ in do_meta_command()
16511 while( xRead(&sCtx) ){ in do_meta_command()
16512 zCreate = sqlite3_mprintf("%z%c\n \"%w\" TEXT", zCreate, cSep, sCtx.z); in do_meta_command()
16514 if( sCtx.cTerm!=sCtx.cColSep ) break; in do_meta_command()
16518 sqlite3_free(sCtx.z); in do_meta_command()
16519 xCloser(sCtx.in); in do_meta_command()
16520 utf8_printf(stderr,"%s: empty file\n", sCtx.zFile); in do_meta_command()
16533 sqlite3_free(sCtx.z); in do_meta_command()
16534 xCloser(sCtx.in); in do_meta_command()
16544 xCloser(sCtx.in); in do_meta_command()
16554 xCloser(sCtx.in); in do_meta_command()
16573 xCloser(sCtx.in); in do_meta_command()
16580 int startLine = sCtx.nLine; in do_meta_command()
16582 char *z = xRead(&sCtx); in do_meta_command()
16595 if( i<nCol-1 && sCtx.cTerm!=sCtx.cColSep ){ in do_meta_command()
16598 sCtx.zFile, startLine, nCol, i+1); in do_meta_command()
16603 if( sCtx.cTerm==sCtx.cColSep ){ in do_meta_command()
16605 xRead(&sCtx); in do_meta_command()
16607 }while( sCtx.cTerm==sCtx.cColSep ); in do_meta_command()
16610 sCtx.zFile, startLine, nCol, i); in do_meta_command()
16616 utf8_printf(stderr, "%s:%d: INSERT failed: %s\n", sCtx.zFile, in do_meta_command()
16618 sCtx.nErr++; in do_meta_command()
16620 sCtx.nRow++; in do_meta_command()
16623 }while( sCtx.cTerm!=EOF ); in do_meta_command()
16625 xCloser(sCtx.in); in do_meta_command()
16626 sqlite3_free(sCtx.z); in do_meta_command()
16632 sCtx.nRow, sCtx.nErr, sCtx.nLine-1); in do_meta_command()