亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? shell.c

?? 一個小型嵌入式數據庫SQLite的源碼,C語言
?? C
?? 第 1 頁 / 共 4 頁
字號:
/*** 2001 September 15**** The author disclaims copyright to this source code.  In place of** a legal notice, here is a blessing:****    May you do good and not evil.**    May you find forgiveness for yourself and forgive others.**    May you share freely, never taking more than you give.***************************************************************************** This file contains code to implement the "sqlite" command line** utility for accessing SQLite databases.**** $Id: shell.c,v 1.150 2006/09/25 13:09:23 drh Exp $*/#include <stdlib.h>#include <string.h>#include <stdio.h>#include <assert.h>#include "sqlite3.h"#include <ctype.h>#if !defined(_WIN32) && !defined(WIN32) && !defined(__MACOS__) && !defined(__OS2__)# include <signal.h># include <pwd.h># include <unistd.h># include <sys/types.h>#endif#ifdef __MACOS__# include <console.h># include <signal.h># include <unistd.h># include <extras.h># include <Files.h># include <Folders.h>#endif#ifdef __OS2__# include <unistd.h>#endif#if defined(HAVE_READLINE) && HAVE_READLINE==1# include <readline/readline.h># include <readline/history.h>#else# define readline(p) local_getline(p,stdin)# define add_history(X)# define read_history(X)# define write_history(X)# define stifle_history(X)#endif#if defined(_WIN32) || defined(WIN32)# include <io.h>#else/* Make sure isatty() has a prototype.*/extern int isatty();#endif/*** The following is the open SQLite database.  We make a pointer** to this database a static variable so that it can be accessed** by the SIGINT handler to interrupt database processing.*/static sqlite3 *db = 0;/*** True if an interrupt (Control-C) has been received.*/static volatile int seenInterrupt = 0;/*** This is the name of our program. It is set in main(), used** in a number of other places, mostly for error messages.*/static char *Argv0;/*** Prompt strings. Initialized in main. Settable with**   .prompt main continue*/static char mainPrompt[20];     /* First line prompt. default: "sqlite> "*/static char continuePrompt[20]; /* Continuation prompt. default: "   ...> " *//*** Determines if a string is a number of not.*/static int isNumber(const char *z, int *realnum){  if( *z=='-' || *z=='+' ) z++;  if( !isdigit(*z) ){    return 0;  }  z++;  if( realnum ) *realnum = 0;  while( isdigit(*z) ){ z++; }  if( *z=='.' ){    z++;    if( !isdigit(*z) ) return 0;    while( isdigit(*z) ){ z++; }    if( realnum ) *realnum = 1;  }  if( *z=='e' || *z=='E' ){    z++;    if( *z=='+' || *z=='-' ) z++;    if( !isdigit(*z) ) return 0;    while( isdigit(*z) ){ z++; }    if( realnum ) *realnum = 1;  }  return *z==0;}/*** A global char* and an SQL function to access its current value ** from within an SQL statement. This program used to use the ** sqlite_exec_printf() API to substitue a string into an SQL statement.** The correct way to do this with sqlite3 is to use the bind API, but** since the shell is built around the callback paradigm it would be a lot** of work. Instead just use this hack, which is quite harmless.*/static const char *zShellStatic = 0;static void shellstaticFunc(  sqlite3_context *context,  int argc,  sqlite3_value **argv){  assert( 0==argc );  assert( zShellStatic );  sqlite3_result_text(context, zShellStatic, -1, SQLITE_STATIC);}/*** This routine reads a line of text from FILE in, stores** the text in memory obtained from malloc() and returns a pointer** to the text.  NULL is returned at end of file, or if malloc()** fails.**** The interface is like "readline" but no command-line editing** is done.*/static char *local_getline(char *zPrompt, FILE *in){  char *zLine;  int nLine;  int n;  int eol;  if( zPrompt && *zPrompt ){    printf("%s",zPrompt);    fflush(stdout);  }  nLine = 100;  zLine = malloc( nLine );  if( zLine==0 ) return 0;  n = 0;  eol = 0;  while( !eol ){    if( n+100>nLine ){      nLine = nLine*2 + 100;      zLine = realloc(zLine, nLine);      if( zLine==0 ) return 0;    }    if( fgets(&zLine[n], nLine - n, in)==0 ){      if( n==0 ){        free(zLine);        return 0;      }      zLine[n] = 0;      eol = 1;      break;    }    while( zLine[n] ){ n++; }    if( n>0 && zLine[n-1]=='\n' ){      n--;      zLine[n] = 0;      eol = 1;    }  }  zLine = realloc( zLine, n+1 );  return zLine;}/*** Retrieve a single line of input text.  "isatty" is true if text** is coming from a terminal.  In that case, we issue a prompt and** attempt to use "readline" for command-line editing.  If "isatty"** is false, use "local_getline" instead of "readline" and issue no prompt.**** zPrior is a string of prior text retrieved.  If not the empty** string, then issue a continuation prompt.*/static char *one_input_line(const char *zPrior, FILE *in){  char *zPrompt;  char *zResult;  if( in!=0 ){    return local_getline(0, in);  }  if( zPrior && zPrior[0] ){    zPrompt = continuePrompt;  }else{    zPrompt = mainPrompt;  }  zResult = readline(zPrompt);#if defined(HAVE_READLINE) && HAVE_READLINE==1  if( zResult && *zResult ) add_history(zResult);#endif  return zResult;}struct previous_mode_data {  int valid;        /* Is there legit data in here? */  int mode;  int showHeader;  int colWidth[100];};/*** An pointer to an instance of this structure is passed from** the main program to the callback.  This is used to communicate** state and mode information.*/struct callback_data {  sqlite3 *db;            /* The database */  int echoOn;            /* True to echo input commands */  int cnt;               /* Number of records displayed so far */  FILE *out;             /* Write results here */  int mode;              /* An output mode setting */  int showHeader;        /* True to show column names in List or Column mode */  char *zDestTable;      /* Name of destination table when MODE_Insert */  char separator[20];    /* Separator character for MODE_List */  int colWidth[100];     /* Requested width of each column when in column mode*/  int actualWidth[100];  /* Actual width of each column */  char nullvalue[20];    /* The text to print when a NULL comes back from                         ** the database */  struct previous_mode_data explainPrev;                         /* Holds the mode information just before                         ** .explain ON */  char outfile[FILENAME_MAX]; /* Filename for *out */  const char *zDbFilename;    /* name of the database file */};/*** These are the allowed modes.*/#define MODE_Line     0  /* One column per line.  Blank line between records */#define MODE_Column   1  /* One record per line in neat columns */#define MODE_List     2  /* One record per line with a separator */#define MODE_Semi     3  /* Same as MODE_List but append ";" to each line */#define MODE_Html     4  /* Generate an XHTML table */#define MODE_Insert   5  /* Generate SQL "insert" statements */#define MODE_Tcl      6  /* Generate ANSI-C or TCL quoted elements */#define MODE_Csv      7  /* Quote strings, numbers are plain */#define MODE_NUM_OF   8  /* The number of modes (not a mode itself) */static const char *modeDescr[MODE_NUM_OF] = {  "line",  "column",  "list",  "semi",  "html",  "insert",  "tcl",  "csv",};/*** Number of elements in an array*/#define ArraySize(X)  (sizeof(X)/sizeof(X[0]))/*** Output the given string as a quoted string using SQL quoting conventions.*/static void output_quoted_string(FILE *out, const char *z){  int i;  int nSingle = 0;  for(i=0; z[i]; i++){    if( z[i]=='\'' ) nSingle++;  }  if( nSingle==0 ){    fprintf(out,"'%s'",z);  }else{    fprintf(out,"'");    while( *z ){      for(i=0; z[i] && z[i]!='\''; i++){}      if( i==0 ){        fprintf(out,"''");        z++;      }else if( z[i]=='\'' ){        fprintf(out,"%.*s''",i,z);        z += i+1;      }else{        fprintf(out,"%s",z);        break;      }    }    fprintf(out,"'");  }}/*** Output the given string as a quoted according to C or TCL quoting rules.*/static void output_c_string(FILE *out, const char *z){  unsigned int c;  fputc('"', out);  while( (c = *(z++))!=0 ){    if( c=='\\' ){      fputc(c, out);      fputc(c, out);    }else if( c=='\t' ){      fputc('\\', out);      fputc('t', out);    }else if( c=='\n' ){      fputc('\\', out);      fputc('n', out);    }else if( c=='\r' ){      fputc('\\', out);      fputc('r', out);    }else if( !isprint(c) ){      fprintf(out, "\\%03o", c&0xff);    }else{      fputc(c, out);    }  }  fputc('"', out);}/*** Output the given string with characters that are special to** HTML escaped.*/static void output_html_string(FILE *out, const char *z){  int i;  while( *z ){    for(i=0; z[i] && z[i]!='<' && z[i]!='&'; i++){}    if( i>0 ){      fprintf(out,"%.*s",i,z);    }    if( z[i]=='<' ){      fprintf(out,"&lt;");    }else if( z[i]=='&' ){      fprintf(out,"&amp;");    }else{      break;    }    z += i + 1;  }}/*** Output a single term of CSV.  Actually, p->separator is used for** the separator, which may or may not be a comma.  p->nullvalue is** the null value.  Strings are quoted using ANSI-C rules.  Numbers** appear outside of quotes.*/static void output_csv(struct callback_data *p, const char *z, int bSep){  if( z==0 ){    fprintf(p->out,"%s",p->nullvalue);  }else if( isNumber(z, 0) ){    fprintf(p->out,"%s",z);  }else{    output_c_string(p->out, z);  }  if( bSep ){    fprintf(p->out, p->separator);  }}#ifdef SIGINT/*** This routine runs when the user presses Ctrl-C*/static void interrupt_handler(int NotUsed){  seenInterrupt = 1;  if( db ) sqlite3_interrupt(db);}#endif/*** This is the callback routine that the SQLite library** invokes for each row of a query result.*/static int callback(void *pArg, int nArg, char **azArg, char **azCol){  int i;  struct callback_data *p = (struct callback_data*)pArg;  switch( p->mode ){    case MODE_Line: {      int w = 5;      if( azArg==0 ) break;      for(i=0; i<nArg; i++){        int len = strlen(azCol[i] ? azCol[i] : "");        if( len>w ) w = len;      }      if( p->cnt++>0 ) fprintf(p->out,"\n");      for(i=0; i<nArg; i++){        fprintf(p->out,"%*s = %s\n", w, azCol[i],                azArg[i] ? azArg[i] : p->nullvalue);      }      break;    }    case MODE_Column: {      if( p->cnt++==0 ){        for(i=0; i<nArg; i++){          int w, n;          if( i<ArraySize(p->colWidth) ){             w = p->colWidth[i];          }else{             w = 0;          }          if( w<=0 ){            w = strlen(azCol[i] ? azCol[i] : "");            if( w<10 ) w = 10;            n = strlen(azArg && azArg[i] ? azArg[i] : p->nullvalue);            if( w<n ) w = n;          }          if( i<ArraySize(p->actualWidth) ){            p->actualWidth[i] = w;          }          if( p->showHeader ){            fprintf(p->out,"%-*.*s%s",w,w,azCol[i], i==nArg-1 ? "\n": "  ");          }        }        if( p->showHeader ){          for(i=0; i<nArg; i++){            int w;            if( i<ArraySize(p->actualWidth) ){               w = p->actualWidth[i];            }else{               w = 10;            }            fprintf(p->out,"%-*.*s%s",w,w,"-----------------------------------"                   "----------------------------------------------------------",                    i==nArg-1 ? "\n": "  ");          }        }      }      if( azArg==0 ) break;      for(i=0; i<nArg; i++){        int w;        if( i<ArraySize(p->actualWidth) ){           w = p->actualWidth[i];        }else{           w = 10;        }        fprintf(p->out,"%-*.*s%s",w,w,            azArg[i] ? azArg[i] : p->nullvalue, i==nArg-1 ? "\n": "  ");      }      break;    }    case MODE_Semi:    case MODE_List: {      if( p->cnt++==0 && p->showHeader ){        for(i=0; i<nArg; i++){          fprintf(p->out,"%s%s",azCol[i], i==nArg-1 ? "\n" : p->separator);        }      }      if( azArg==0 ) break;      for(i=0; i<nArg; i++){        char *z = azArg[i];        if( z==0 ) z = p->nullvalue;        fprintf(p->out, "%s", z);        if( i<nArg-1 ){

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区三区日韩| 丁香桃色午夜亚洲一区二区三区| 伊人夜夜躁av伊人久久| 国产精品福利一区| 亚洲三级电影网站| 亚洲四区在线观看| 一区二区三区欧美日| 亚洲精品国产一区二区精华液 | 日韩一级片网站| 欧美日韩国产精选| 欧美精品18+| 日韩精品一区二区三区四区视频| 精品国产乱码久久久久久牛牛 | 中文字幕一区二区三区在线不卡| 久久精品视频网| 中文av一区二区| 综合欧美一区二区三区| 一区二区三区在线免费| 亚洲一区二区三区视频在线播放 | 国产成人精品免费一区二区| 国产成人精品一区二| 91日韩在线专区| 欧美日韩一级黄| 欧美大片日本大片免费观看| 久久亚洲精品小早川怜子| 日本一区二区高清| 亚洲欧美日韩在线| 午夜精品一区二区三区免费视频 | 中文字幕亚洲在| 亚洲女性喷水在线观看一区| 亚洲va天堂va国产va久| 毛片不卡一区二区| 丰满少妇在线播放bd日韩电影| 99re亚洲国产精品| 欧美一区二区在线视频| 国产偷国产偷精品高清尤物| 亚洲日本在线a| 日本大胆欧美人术艺术动态 | 欧美性猛交一区二区三区精品 | 香蕉久久一区二区不卡无毒影院| 日韩国产精品久久| 成人一二三区视频| 欧美日韩不卡一区| 欧美韩日一区二区三区| 一区二区三区**美女毛片| 蜜桃视频在线观看一区| 成人精品免费网站| 制服丝袜中文字幕一区| 中文字幕av在线一区二区三区| 亚洲国产精品久久人人爱| 激情欧美一区二区| 欧美日韩一区二区三区四区五区 | 亚洲人成亚洲人成在线观看图片| 秋霞电影一区二区| 99久久99久久综合| 精品国产伦一区二区三区观看体验 | 丁香天五香天堂综合| 欧美剧在线免费观看网站| 欧美激情一区二区在线| 日韩国产欧美三级| 91麻豆精品秘密| 26uuu精品一区二区在线观看| 亚洲一区免费视频| 成人免费视频视频在线观看免费 | 国产精品视频你懂的| 免费看日韩a级影片| 在线免费观看日本一区| 亚洲精品一区二区三区精华液| 久久色在线视频| 亚洲免费观看高清完整版在线观看熊| 综合欧美一区二区三区| 蜜桃av一区二区| 在线观看亚洲一区| 国产欧美日韩久久| 麻豆国产欧美日韩综合精品二区| 99国产精品久| 国产亚洲一区字幕| 日韩影院免费视频| 在线亚洲一区观看| 亚洲国产精品激情在线观看| 国内久久婷婷综合| 欧美三级一区二区| 夜夜揉揉日日人人青青一国产精品| 韩国v欧美v亚洲v日本v| 制服丝袜av成人在线看| 亚洲精品免费在线| 色综合天天综合网国产成人综合天| 欧美大片免费久久精品三p| 日韩中文字幕一区二区三区| 99久久精品99国产精品| 国产精品久久久一区麻豆最新章节| 免费在线观看视频一区| 欧美高清dvd| 夜夜嗨av一区二区三区中文字幕| 国产精品18久久久久| 日韩视频一区二区在线观看| 亚洲电影第三页| 在线观看91精品国产入口| 亚洲精品伦理在线| 99re视频这里只有精品| 中文字幕欧美激情| 国产一本一道久久香蕉| 亚洲精品在线观看视频| 欧美a级一区二区| 欧美一区二区在线免费观看| 亚洲第一会所有码转帖| 欧美精品乱人伦久久久久久| 亚洲一区二区三区在线看| 欧美日韩久久久| 一区二区三区欧美亚洲| 欧美人xxxx| 亚洲午夜av在线| 欧美麻豆精品久久久久久| 一级中文字幕一区二区| 欧美日韩视频一区二区| 亚洲亚洲精品在线观看| 欧美日韩mp4| 日韩—二三区免费观看av| 99久久99久久免费精品蜜臀| 中文字幕在线视频一区| 成人国产精品免费观看视频| 国产精品久久综合| 91亚洲永久精品| 一区二区激情视频| 欧美色综合网站| 乱一区二区av| 久久久久国产精品人| 国产jizzjizz一区二区| 国产精品欧美极品| 一本到高清视频免费精品| 亚洲制服欧美中文字幕中文字幕| 69av一区二区三区| 美国欧美日韩国产在线播放| 国产日本一区二区| 成人a级免费电影| 亚洲高清免费观看高清完整版在线观看| 欧美在线影院一区二区| 秋霞电影网一区二区| 亚洲精品免费电影| 欧美大片一区二区三区| 久久激情五月激情| 亚洲欧美综合网| av资源网一区| 天天色天天爱天天射综合| 精品免费视频一区二区| 成人性生交大片免费看视频在线 | 亚洲视频香蕉人妖| 777亚洲妇女| 国产一区二区精品久久| 亚洲在线视频网站| 日韩免费观看高清完整版在线观看| 国产一区91精品张津瑜| 亚洲欧美中日韩| 日韩一区二区在线播放| 国产ts人妖一区二区| 丝袜美腿成人在线| 久久久国产一区二区三区四区小说 | 精品欧美久久久| 色网综合在线观看| 日本亚洲欧美天堂免费| 中文字幕中文字幕中文字幕亚洲无线| 91蜜桃免费观看视频| 九九国产精品视频| 亚洲女人的天堂| 久久奇米777| 91在线无精精品入口| 精彩视频一区二区三区 | 福利一区福利二区| 日本伊人精品一区二区三区观看方式| 久久久久久久av麻豆果冻| 亚洲综合清纯丝袜自拍| 午夜精品福利久久久| 在线亚洲+欧美+日本专区| 亚洲国产一区二区三区| 久久久久久影视| 色老汉一区二区三区| 国产精品一区在线| 免费的国产精品| 一区二区三区在线观看国产| av欧美精品.com| 色哟哟国产精品免费观看| 中文字幕一区二区三区蜜月| 亚洲视频资源在线| 久久99精品一区二区三区| youjizz久久| 欧美高清视频一二三区 | 亚洲一二三专区| 青青草97国产精品免费观看 | 国产成人av一区二区三区在线| 午夜亚洲福利老司机| 国产日韩成人精品| 精品国产第一区二区三区观看体验| 色哟哟国产精品免费观看| 成人91在线观看| 久久99久久久欧美国产| 美国欧美日韩国产在线播放| 亚洲一区二区三区在线| 亚洲一区二区成人在线观看| 亚洲视频在线一区二区| 国产精品丝袜一区|