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

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

?? shell.c

?? sqlite 3.3.8 支持加密的版本
?? 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.24 2006/10/12 21:34:22 rmsimpson 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一区二区三区免费野_久草精品视频
欧美国产一区视频在线观看| 一二三区精品视频| 最新欧美精品一区二区三区| 午夜精品一区二区三区电影天堂| 国产精品亚洲午夜一区二区三区| 91精彩视频在线| 日本一区二区不卡视频| 婷婷久久综合九色综合伊人色| 国产风韵犹存在线视精品| 欧美日韩在线精品一区二区三区激情| 国产日韩精品一区二区三区 | 国产精品久久久一本精品 | 日韩一级大片在线| ㊣最新国产の精品bt伙计久久| 精品午夜久久福利影院| 欧美日韩一区二区三区在线看| 欧美国产视频在线| 久久国产精品无码网站| 激情文学综合网| 香蕉乱码成人久久天堂爱免费| 成人短视频下载| 日韩免费观看高清完整版在线观看| 亚洲精品视频在线观看网站| 成人的网站免费观看| 国产欧美一二三区| 黄色日韩网站视频| 精品剧情v国产在线观看在线| 日本美女一区二区三区视频| 欧美男人的天堂一二区| 亚洲一区在线观看视频| 97成人超碰视| 亚洲区小说区图片区qvod| av高清不卡在线| 成人欧美一区二区三区| 成人av高清在线| 国产精品传媒在线| www.综合网.com| 国产精品视频看| 91看片淫黄大片一级| 亚洲码国产岛国毛片在线| 色88888久久久久久影院按摩| 亚洲欧美日韩综合aⅴ视频| 91丨九色丨黑人外教| 国产精品看片你懂得| 91丝袜国产在线播放| 亚洲一区在线观看免费| 欧美日韩国产另类不卡| 日韩成人精品在线观看| 日韩欧美中文字幕精品| 韩国精品一区二区| 国产欧美精品一区二区色综合朱莉| 国产 欧美在线| 一区二区日韩电影| 欧美肥大bbwbbw高潮| 看国产成人h片视频| 精品91自产拍在线观看一区| 国产成人8x视频一区二区| 一区二区中文视频| 欧美日韩激情在线| 精品无人码麻豆乱码1区2区| 亚洲国产精品ⅴa在线观看| 色婷婷av一区二区三区大白胸| 亚洲成av人片在线观看无码| 欧美videofree性高清杂交| 成人av网址在线观看| 亚洲国产精品久久久男人的天堂| 日韩久久久精品| av激情亚洲男人天堂| 日本欧美一区二区在线观看| 国产精品入口麻豆原神| 欧美乱妇一区二区三区不卡视频| 国内精品免费**视频| 亚洲一区二区三区自拍| 26uuu精品一区二区 | 高清beeg欧美| 亚洲靠逼com| 日韩欧美中文字幕制服| 91视频在线观看| 久久精品国产一区二区三区免费看| 国产精品美女久久久久av爽李琼| 精品视频一区三区九区| 成人理论电影网| 裸体一区二区三区| √…a在线天堂一区| 欧美精品一区二区在线观看| 欧美私人免费视频| 成人av网站在线| 韩国一区二区视频| 亚洲不卡av一区二区三区| 欧美国产欧美综合| 日韩精品一区二区三区视频播放 | 欧美经典一区二区三区| 欧美老女人第四色| 波多野洁衣一区| 国内精品久久久久影院色 | 在线不卡中文字幕| 色拍拍在线精品视频8848| 九色综合狠狠综合久久| 亚洲sss视频在线视频| 国产精品国产三级国产普通话99 | 67194成人在线观看| 久久免费视频色| 欧美日韩一级二级三级| 91丨porny丨中文| av亚洲精华国产精华| 激情图区综合网| 久久精品国产亚洲a| 蜜臀国产一区二区三区在线播放| 亚洲成人自拍偷拍| 亚洲综合自拍偷拍| 亚洲欧美日韩国产一区二区三区 | 五月激情六月综合| 亚洲综合色噜噜狠狠| 亚洲黄一区二区三区| 亚洲男人的天堂在线观看| 自拍偷拍亚洲综合| 亚洲欧洲美洲综合色网| 亚洲欧美在线aaa| 亚洲欧美日韩国产综合在线| 一区二区三区免费在线观看| 亚洲摸摸操操av| 夜色激情一区二区| 亚洲国产美女搞黄色| 首页综合国产亚洲丝袜| 日欧美一区二区| 久久精品国产77777蜜臀| 国产一区二区调教| 国产高清在线精品| 99久久精品免费观看| 欧美午夜精品一区| 5月丁香婷婷综合| 精品国精品国产| 国产精品无人区| 亚洲欧美国产77777| 亚洲va欧美va国产va天堂影院| 视频一区中文字幕| 国产乱子伦一区二区三区国色天香| 国产经典欧美精品| 色婷婷久久一区二区三区麻豆| 欧美在线观看18| 日韩美女一区二区三区四区| 国产日韩v精品一区二区| 亚洲摸摸操操av| 蜜臀av一区二区在线免费观看| 国产精品综合av一区二区国产馆| 色综合天天综合色综合av | 日韩av一二三| 国产成人午夜精品影院观看视频| 99久久久免费精品国产一区二区| 欧美性xxxxxxxx| 久久综合色鬼综合色| 爽好多水快深点欧美视频| 国产成人h网站| 日本韩国视频一区二区| 精品美女一区二区| 亚洲免费在线电影| 久久精品99久久久| 91久久久免费一区二区| 日韩欧美一区在线观看| 亚洲欧洲av色图| 麻豆国产91在线播放| 色综合久久久久网| 精品乱码亚洲一区二区不卡| 一区二区三区不卡视频| 国产精品乡下勾搭老头1| 欧美撒尿777hd撒尿| 国产精品三级av在线播放| 免费在线一区观看| 色婷婷国产精品综合在线观看| 久久九九久久九九| 偷窥国产亚洲免费视频| 色婷婷综合激情| 欧美激情中文不卡| 极品少妇xxxx精品少妇| 欧美日韩精品一区二区三区蜜桃 | 中文字幕人成不卡一区| 黄色成人免费在线| 欧美日韩国产综合一区二区三区| 国产精品乱码久久久久久| 蜜桃av一区二区在线观看| 在线观看不卡视频| 亚洲人被黑人高潮完整版| 成人一级片网址| 2020国产精品久久精品美国| 日韩av在线播放中文字幕| 在线观看日产精品| 成人欧美一区二区三区白人| 高清av一区二区| 欧美激情在线观看视频免费| 国产一区二区不卡| 欧美大肚乱孕交hd孕妇| 日本不卡一区二区三区| 久久久久久久久一| 免费人成网站在线观看欧美高清| 欧美日韩综合在线免费观看| 亚洲一二三四在线观看| 91浏览器入口在线观看| 伊人色综合久久天天人手人婷| 91亚洲精品久久久蜜桃| 中文字幕综合网|