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

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

?? shell.c

?? 調用sqlite開源數據的小程序
?? 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.128 2005/09/11 02:03:04 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__)# 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#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/* Make sure isatty() has a prototype.*/extern int isatty();/*** 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 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 unsigned 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 ) 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 */  char *zKey;                 /* Encryption key */};/*** 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) */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]);        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++){

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产自产视频一区二区三区| 51精品秘密在线观看| 欧美综合色免费| 欧美sm美女调教| 一区二区三区在线视频观看58| 久久精品理论片| 在线观看一区日韩| 国产精品国产三级国产aⅴ原创 | 欧美狂野另类xxxxoooo| 欧美极品另类videosde| 老司机免费视频一区二区| 欧美色老头old∨ideo| 1024成人网| 国产 欧美在线| 久久久精品国产免大香伊| 奇米影视在线99精品| 欧美乱熟臀69xxxxxx| 亚洲三级在线免费| 成人免费毛片嘿嘿连载视频| 久久综合九色综合欧美98| 日韩成人一区二区三区在线观看| 欧洲亚洲国产日韩| 亚洲精品国产成人久久av盗摄 | 欧美精彩视频一区二区三区| 久久精品国产网站| 欧美一级片免费看| 日韩影视精彩在线| 在线成人免费观看| 另类欧美日韩国产在线| 欧美一卡二卡在线| 久久精品国产亚洲5555| 久久综合九色综合久久久精品综合| 日韩av电影免费观看高清完整版| 欧美丰满高潮xxxx喷水动漫| 亚洲va欧美va国产va天堂影院| 欧美日韩一二区| 青青草一区二区三区| 日韩欧美高清一区| 国产乱人伦偷精品视频免下载| 精品久久国产97色综合| 国内精品伊人久久久久av一坑| 91精品国产免费久久综合| 日韩av网站在线观看| 欧美一级精品大片| 国产美女精品一区二区三区| 国产精品萝li| 色噜噜偷拍精品综合在线| 亚洲成av人片一区二区三区| 欧美高清视频在线高清观看mv色露露十八| 亚洲福中文字幕伊人影院| 国产精品美女视频| 91福利国产成人精品照片| 亚洲成人av电影在线| 日韩你懂的在线播放| 国产精品自拍三区| 亚洲激情图片一区| 欧美一区二区三区免费观看视频| 国产一区欧美一区| 最新中文字幕一区二区三区| 91.xcao| 丰满少妇在线播放bd日韩电影| 亚洲男帅同性gay1069| 91麻豆精品国产自产在线观看一区| 激情成人综合网| 亚洲激情一二三区| 欧美sm美女调教| 日本大香伊一区二区三区| 久久99久久久欧美国产| 综合中文字幕亚洲| 日韩免费观看2025年上映的电影| 岛国精品在线播放| 日韩黄色免费电影| 国产精品国产三级国产普通话三级 | 欧美日韩中文另类| 日av在线不卡| 一区二区三区四区蜜桃| 国产亚洲午夜高清国产拍精品| 91小视频在线免费看| 麻豆视频观看网址久久| 一区二区三区不卡视频在线观看| 欧美v亚洲v综合ⅴ国产v| 色综合久久中文综合久久97| 久久99国产精品免费网站| 一个色综合av| 国产精品高潮久久久久无| 欧美成人bangbros| 欧美日韩一区高清| www.成人网.com| 国产v综合v亚洲欧| 六月婷婷色综合| 午夜欧美视频在线观看| 亚洲天堂网中文字| 国产免费成人在线视频| 久久综合九色综合97婷婷女人 | 日本午夜精品视频在线观看| 亚洲人xxxx| 欧美国产精品专区| 欧美不卡123| 欧美一级夜夜爽| 欧美剧在线免费观看网站| 欧美优质美女网站| 色哟哟精品一区| 91亚洲国产成人精品一区二三| 国产不卡一区视频| 狠狠狠色丁香婷婷综合激情| 免费看欧美美女黄的网站| 图片区小说区区亚洲影院| 亚洲6080在线| 午夜私人影院久久久久| www.爱久久.com| 不卡电影一区二区三区| 成人18视频日本| 成人毛片在线观看| 99久久婷婷国产| 99免费精品在线| 色综合久久99| 欧美日韩免费视频| 91精品国产色综合久久| 精品国精品国产尤物美女| 欧美精品一区二区三区蜜桃视频| 欧美成人vps| 日本一区二区三区免费乱视频| 国产亚洲精品bt天堂精选| 亚洲国产精品二十页| 国产精品成人网| 亚洲一区二区在线免费观看视频| 亚洲国产成人精品视频| 天使萌一区二区三区免费观看| 五月激情六月综合| 国产曰批免费观看久久久| 成人久久久精品乱码一区二区三区 | 在线国产电影不卡| 精品视频一区三区九区| 91精品国产91久久久久久最新毛片| 日韩午夜激情av| 国产精品免费aⅴ片在线观看| 综合久久久久久| 视频一区二区三区在线| 激情成人综合网| 99re热这里只有精品免费视频| 在线免费观看日本欧美| 日韩一卡二卡三卡| 国产精品私人影院| 亚洲电影你懂得| 国产成人精品午夜视频免费| 色婷婷一区二区| 精品国产麻豆免费人成网站| 国产精品免费久久| 免费在线观看一区| av午夜精品一区二区三区| 欧美色老头old∨ideo| 久久久噜噜噜久久中文字幕色伊伊| 一区二区中文视频| 蜜乳av一区二区三区| 99久久精品国产一区| 在线成人av影院| 亚洲女厕所小便bbb| 久久av老司机精品网站导航| 91影院在线观看| 亚洲精品一区在线观看| 亚洲一区二区av电影| 成人午夜在线视频| 欧美一区中文字幕| 亚洲免费观看高清完整| 久久国产欧美日韩精品| 欧美色区777第一页| 欧美高清在线一区二区| 精品在线视频一区| 欧美日韩综合不卡| 亚洲精品视频自拍| 懂色av一区二区夜夜嗨| 精品国产网站在线观看| 亚洲午夜久久久久中文字幕久| 国产精品一区二区男女羞羞无遮挡| 欧美日韩中文精品| 亚洲免费成人av| 91在线观看地址| 国产精品乱码妇女bbbb| 国产大陆精品国产| 精品欧美黑人一区二区三区| 日韩综合一区二区| 中文字幕高清一区| 国产一区激情在线| 欧美大片拔萝卜| 日本不卡一二三| 欧美日韩国产免费| 亚洲国产中文字幕在线视频综合| 成人av先锋影音| 中文字幕av一区二区三区高| 国产一区二区三区日韩| 精品少妇一区二区三区视频免付费 | 国产激情一区二区三区四区| 日韩精品中午字幕| 免费观看在线色综合| 91精品视频网| 青娱乐精品视频在线| 日韩精品专区在线影院重磅| 麻豆成人av在线| 日韩精品最新网址| 国产综合色在线|