Lines Matching defs:in
4 ** The author disclaims copyright to this source code. In place of
28 ** No support for loadable extensions in VxWorks.
157 ** to be disabled in some cases (ex: when generating CSV output and when
221 /* Return the difference of two time_structs in seconds */
265 /* GetProcessTimes() isn't supported in WIN95 and some other Windows
297 /* Return the difference of two FILETIME structs in seconds */
348 ** in order to translate UTF-8 into MBCS. The following variable is
366 ** This is the name of our program. It is set in main(), used
367 ** in a number of other places, mostly for error messages.
372 ** Prompt strings. Initialized in main. Settable with
418 ** This routine works like printf in that its first argument is a
420 ** in place of % fields. The result of formatting this string
438 ** then right-justify the text. W is the width in UTF-8 characters, not
439 ** in bytes. This is different from the %*.*s specification in printf
440 ** since with %*.*s the width is measured in bytes, not characters.
495 ** Compute a string length that is limited to what can be stored in
505 ** This routine reads a line of text from FILE in, stores
506 ** the text in memory obtained from malloc() and returns a pointer
513 static char *local_getline(char *zLine, FILE *in){
523 if( fgets(&zLine[n], nLine - n, in)==0 ){
542 if( stdin_is_interactive && in==stdin ){
564 ** If in==0 then read from standard input and prompt before each line.
571 ** The result is stored in space obtained from malloc() and must either
575 static char *one_input_line(FILE *in, char *zPrior, int isContinuation){
578 if( in!=0 ){
579 zResult = local_getline(zPrior, in);
615 in memory obtained
617 ** added to zIn, and the result returned in memory obtained from malloc().
665 ** SQLite keyword. Be conservative in this estimate: When in doubt assume
671 /* All SQLite keywords, in alphabetical order */
681 "IGNORE", "IMMEDIATE", "IN", "INDEX", "INDEXED", "INITIALLY", "INNER",
740 ** State structure for a SHA3 hash in progress
754 ** a macro in the termios.h header file */
1079 ** in bits and should be one of 224, 256, 384, or 512. Or iSize
1227 ** This function compiles and runs the SQL statement(s) given in the
1250 ** For each SQL statement in the X input, there is one S segment. Each
1251 ** S segment is followed by zero or more R segments, one for each row in the
1253 ** one for each column in the result set. Segments are concatentated directly
1264 int nCol; /* Number of columns in the result set */
1391 int valid; /* Is there legit data in here? */
1398 ** State information about the database connection is contained in an
1417 int showHeader; /* True to show column names in List or Column mode */
1424 int colWidth[100]; /* Requested width of each column when in column mode*/
1434 int *aiIndent; /* Array of indents used in MODE_Explain */
1436 int iIndent; /* Index of current op in aiIndent[] */
1439 OpenSession aSession[4]; /* Array of sessions. [0] is in focus. */
1465 #define MODE_Column 1 /* One record per line in neat columns */
1506 ** Number of elements in an array
1532 ** Find a string that is not found anywhere in z[]. Return a pointer
1535 ** Try to use zA and zB first. If both of those are already found in z[]
1536 ** then make up some string and store it in the buffer zBuf.
1539 const char *z, /* Result must not appear anywhere in z */
1590 ** get corrupted by end-of-line translation facilities in some operating
1721 ** If a field contains any character identified by a 1 in the following
1843 ** in FTS3/4/5 into CREATE TABLE IF NOT EXISTS statements.
2226 ** Generate an appropriate SELFTEST table in the main database.
2276 ** the name of the table given. Escape any quote characters in the
2384 FILE *in;
2387 in = fopen(z, "rb");
2388 if( in==0 ) return;
2389 while( fgets(z, sizeof(z), in)!=0 ){
2411 fclose(in);
2597 ** is equal, according to strcmp(), to any of the strings in the array.
2619 ** * For each "Goto", if the jump destination is earlier in the program
2631 int iOp; /* Index of operation in p->aiIndent[] */
2660 ** instruction in the aiIndent[] array. p2 and p2op may be different if
2818 ** This is very similar to SQLite's built-in sqlite3_exec()
2910 /* If the shell is currently in ".explain" mode, gather the extra
2966 ** columns in table zTab. The memory to hold the names is dynamically
2971 ** value that needs to be preserved, then azCol[0] is filled in with the
2974 ** The first regular column in the table is azCol[1]. The list is terminated
3022 ** columns in the table named "rowid", "_rowid_", and "oid".
3029 ** there is a "pk" entry in "PRAGMA index_list". There will be
3055 ** ordinary column in the table. Verify that azRowid[j] is a valid
3141 ** in case it is a keyword. Ex: INSERT INTO "table" ... */
3145 ** In other words: "INSERT INTO tab(rowid,a,b,c,...) VALUES(...)"
3248 ".dump ?TABLE? ... Dump the database in an SQL text format\n"
3286 ".nullvalue STRING Use STRING in place of NULL values\n"
3294 ".read FILENAME Execute SQL in FILENAME\n"
3296 ".save FILE Write in-memory database into FILE\n"
3300 ".selftest ?--init? Run tests defined in the SELFTEST table\n"
3307 ".shell CMD ARGS... Run CMD ARGS... in a system shell\n"
3310 ".system CMD ARGS... Run CMD ARGS... in a system shell\n"
3350 static int process_input(ShellState *p, FILE *in);
3361 ** from the file before the buffer is returned. This byte is not included in
3365 ** is undefined in this case.
3368 FILE *in = fopen(zName, "rb");
3372 if( in==0 ) return 0;
3373 fseek(in, 0, SEEK_END);
3374 nIn = ftell(in);
3375 rewind(in);
3378 nRead = fread(pBuf, nIn, 1, in);
3379 fclose(in);
3551 ** \NNN -> ascii character NNN in octal
3757 FILE *in; /* Read the CSV text from this input stream */
3759 int n; /* Number of bytes in z */
3783 ** + Input comes from p->in.
3784 ** + Store results in p->z of length p->n. Space to hold p->z comes
3788 ** + Keep track of the line number in p->nLine.
3789 ** + Store the character that terminates the field in p->cTerm. Store
3798 c = fgetc(p->in);
3809 c = fgetc(p->in);
3843 c = fgetc(p->in);
3857 ** + Input comes from p->in.
3858 ** + Store results in p->z of length p->n. Space to hold p->z comes
3862 ** + Keep track of the row number in p->nLine.
3863 ** + Store the character that terminates the field in p->cTerm. Store
3872 c = fgetc(p->in);
3879 c = fgetc(p->in);
4245 ** Compare the pattern in zGlob[] against the text in z[]. Return TRUE
4257 ** [^...] Matches one character not in the enclosed list.
4260 ** optional + or - sign in front
4428 int nArg /* Number of entries in azArg[] */
4441 ** in the schema of the main database. The column values are:
4604 int nArg /* Number of entries in azArg[] */
4861 /* When playing back a "dump", the content might appear in an order
4884 "WHERE sql NOT NULL AND type IN ('index','trigger','view')", 0
4897 " AND type IN ('index','trigger','view')"
5033 int nCol; /* Number of columns in the table */
5034 int nByte; /* Number of bytes in an SQL string */
5037 int nSep; /* Number of bytes in p->colSeparator[] */
5085 raw_printf(stderr, "Error: pipes are not supported in this OS\n");
5088 sCtx.in = popen(sCtx.zFile+1, "r");
5093 sCtx.in = fopen(sCtx.zFile, "rb");
5101 if( sCtx.in==0 ){
5110 xCloser(sCtx.in);
5127 xCloser(sCtx.in);
5138 xCloser(sCtx.in);
5147 xCloser(sCtx.in);
5157 xCloser(sCtx.in);
5173 xCloser(sCtx.in);
5189 ** columns in ASCII mode? If so, stop instead of NULL filling
5221 xCloser(sCtx.in);
5285 utf8_printf(stderr, "Error in [%s]: %s\n", zSql, sqlite3_errmsg(p->db));
5475 int iName = 1; /* Index in azArg[] of the filename */
5537 raw_printf(stderr, "Error: pipes are not supported in this OS\n");
5659 raw_printf(stderr, "Warning: .scanstats not available in this build.\n");
5980 int nRow = 0; /* Number of rows in the SELFTEST table */
5981 int nCol = 4; /* Number of columns in the SELFTEST table */
6299 /* Create an SQL statement to query for the list of tables in the
6305 " WHERE type IN ('table','view')"
6328 " WHERE type IN ('table','view')"
6349 ** as an array of nul-terminated strings in azResult[]. */
6741 ** Return TRUE if a semicolon occurs anywhere in the first N characters
6775 ** Return TRUE if the line typed in is an SQL command terminator other
6793 ** ends in the middle of a string literal or C-style comment.
6808 static int runOneSqlLine(ShellState *p, char *zSql, FILE *in, int startline){
6819 if( in!=0 || !stdin_is_interactive ){
6842 ** Read input from *in and process it. If *in==0 then input
6850 static int process_input(ShellState *p, FILE *in){
6862 while( errCnt==0 || !bail_on_error || (in==0 && stdin_is_interactive) ){
6864 zLine = one_input_line(in, zLine, nSql>0);
6867 if( in==0 && stdin_is_interactive ) printf("\n");
6871 if( in!=0 ) break;
6916 errCnt += runOneSqlLine(p, zSql, in, startline);
6928 runOneSqlLine(p, zSql, in, startline);
7017 FILE *in = NULL;
7030 in = fopen(sqliterc,"rb");
7031 if( in ){
7035 process_input(p,in);
7036 fclose(in);
7093 ** Initialize the state information in data
7111 ** Output text to the console in a font that attracts extra attention.
7209 ** this compile-time option to embed this shell program in larger
7253 ** we do the actual processing of arguments later in a second pass.
7353 ** settings in the initialization file.
7403 ** Causes C-style backslash escapes to be evaluated in SQL statements
7405 ** crazy bytes in the middle of SQL statements for testing and debugging.
7442 ** be better if all commands ran in the order that they appear. But
7504 printBold("transient in-memory database");