/ Check-in [58006e38]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Make static some symbols which shouldn't have been exported. (CVS 3371)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:58006e38af760b53cf72bf127d7c7b8a619a1282
User & Date: shess 2006-08-28 23:46:02
Context
2006-08-29
12:04
Improved built-in help in the command-line shell. Enable the fulltext search extension in the TCL interface. (CVS 3372) check-in: 9763b4bf user: drh tags: trunk
2006-08-28
23:46
Make static some symbols which shouldn't have been exported. (CVS 3371) check-in: 58006e38 user: shess tags: trunk
20:08
Make hi-bit characters delimiters. This is a stopgap until the tokenizer and fulltext.c recognize UTF-8 correctly. (CVS 3370) check-in: ca850d3d user: shess tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/fts1/fulltext.c.

    37     37   
    38     38   /* We may need up to VARINT_MAX bytes to store an encoded 64-bit integer. */
    39     39   #define VARINT_MAX 10
    40     40   
    41     41   /* Write a 64-bit variable-length integer to memory starting at p[0].
    42     42    * The length of data written will be between 1 and VARINT_MAX bytes.
    43     43    * The number of bytes written is returned. */
    44         -int putVarint(char *p, sqlite_int64 v){
           44  +static int putVarint(char *p, sqlite_int64 v){
    45     45     unsigned char *q = (unsigned char *) p;
    46     46     sqlite_uint64 vu = v;
    47     47     do{
    48     48       *q++ = (unsigned char) ((vu & 0x7f) | 0x80);
    49     49       vu >>= 7;
    50     50     }while( vu!=0 );
    51     51     q[-1] &= 0x7f;  /* turn off high bit in final byte */
................................................................................
    52     52     assert( q - (unsigned char *)p <= VARINT_MAX );
    53     53     return (int) (q - (unsigned char *)p);
    54     54   }
    55     55   
    56     56   /* Read a 64-bit variable-length integer from memory starting at p[0].
    57     57    * Return the number of bytes read, or 0 on error.
    58     58    * The value is stored in *v. */
    59         -int getVarint(const char *p, sqlite_int64 *v){
           59  +static int getVarint(const char *p, sqlite_int64 *v){
    60     60     const unsigned char *q = (const unsigned char *) p;
    61     61     sqlite_uint64 x = 0, y = 1;
    62     62     while( (*q & 0x80) == 0x80 ){
    63     63       x += y * (*q++ & 0x7f);
    64     64       y <<= 7;
    65     65       if( q - (unsigned char *)p >= VARINT_MAX ){  /* bad data */
    66     66         assert( 0 );
................................................................................
    68     68       }
    69     69     }
    70     70     x += y * (*q++);
    71     71     *v = (sqlite_int64) x;
    72     72     return (int) (q - (unsigned char *)p);
    73     73   }
    74     74   
    75         -int getVarint32(const char *p, int *pi){
           75  +static int getVarint32(const char *p, int *pi){
    76     76    sqlite_int64 i;
    77     77    int ret = getVarint(p, &i);
    78     78    *pi = (int) i;
    79     79    assert( *pi==i );
    80     80    return ret;
    81     81   }
    82     82   
................................................................................
   540    540   
   541    541   /* These must exactly match the enum above. */
   542    542   /* TODO(adam): Is there some risk that a statement (in particular,
   543    543   ** pTermSelectStmt) will be used in two cursors at once, e.g.  if a
   544    544   ** query joins a virtual table to itself?  If so perhaps we should
   545    545   ** move some of these to the cursor object.
   546    546   */
   547         -const char *fulltext_zStatement[MAX_STMT] = {
          547  +static const char *fulltext_zStatement[MAX_STMT] = {
   548    548     /* CONTENT_INSERT */ "insert into %_content (rowid, content) values (?, ?)",
   549    549     /* CONTENT_SELECT */ "select content from %_content where rowid = ?",
   550    550     /* CONTENT_DELETE */ "delete from %_content where rowid = ?",
   551    551   
   552    552     /* TERM_SELECT */
   553    553     "select rowid, doclist from %_term where term = ? and first = ?",
   554    554     /* TERM_CHUNK_SELECT */
................................................................................
  1113   1113    *   "nation", is_phrase = 0
  1114   1114    */
  1115   1115   typedef struct Query {
  1116   1116     int nTerms;
  1117   1117     QueryTerm *pTerm;
  1118   1118   } Query;
  1119   1119   
  1120         -void query_add(Query *q, int is_phrase, const char *zTerm){
         1120  +static void query_add(Query *q, int is_phrase, const char *zTerm){
  1121   1121     QueryTerm *t;
  1122   1122     ++q->nTerms;
  1123   1123     q->pTerm = realloc(q->pTerm, q->nTerms * sizeof(q->pTerm[0]));
  1124   1124     t = &q->pTerm[q->nTerms - 1];
  1125   1125     t->is_phrase = is_phrase;
  1126   1126     t->zTerm = zTerm;
  1127   1127   }
  1128   1128       
  1129         -void query_free(Query *q){
         1129  +static void query_free(Query *q){
  1130   1130     int i;
  1131   1131     for(i = 0; i < q->nTerms; ++i){
  1132   1132       free((void *) q->pTerm[i].zTerm);
  1133   1133     }
  1134   1134     free(q->pTerm);
  1135   1135   }
  1136   1136   
  1137         -int tokenize_segment(sqlite3_tokenizer *pTokenizer,
  1138         -                     const char *zQuery, int in_phrase,
  1139         -                     Query *pQuery){
         1137  +static int tokenize_segment(sqlite3_tokenizer *pTokenizer,
         1138  +                            const char *zQuery, int in_phrase,
         1139  +                            Query *pQuery){
  1140   1140     sqlite3_tokenizer_module *pModule = pTokenizer->pModule;
  1141   1141     sqlite3_tokenizer_cursor *pCursor;
  1142   1142     int is_first = 1;
  1143   1143     
  1144   1144     int rc = pModule->xOpen(pTokenizer, zQuery, -1, &pCursor);
  1145   1145     if( rc!=SQLITE_OK ) return rc;
  1146   1146     pCursor->pTokenizer = pTokenizer;
................................................................................
  1158   1158       is_first = 0;
  1159   1159     }
  1160   1160   
  1161   1161     return pModule->xClose(pCursor);
  1162   1162   }
  1163   1163   
  1164   1164   /* Parse a query string, yielding a Query object. */
  1165         -int parse_query(fulltext_vtab *v, const char *zQuery, Query *pQuery){
         1165  +static int parse_query(fulltext_vtab *v, const char *zQuery, Query *pQuery){
  1166   1166     char *zQuery1 = string_dup(zQuery);
  1167   1167     int in_phrase = 0;
  1168   1168     char *s = zQuery1;
  1169   1169     pQuery->nTerms = 0;
  1170   1170     pQuery->pTerm = NULL;
  1171   1171   
  1172   1172     while( *s ){