SQLite Archiver
Check-in [9c655b6516]
Not logged in

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

Overview
Comment:Basic check-in is working now.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:9c655b6516e9c91511669b3f243da2bca3326f8e
User & Date: drh 2014-03-13 17:49:45
Context
2014-03-13
23:58
Store mode and mtime. Get extraction working. check-in: abdc055608 user: drh tags: trunk
17:49
Basic check-in is working now. check-in: 9c655b6516 user: drh tags: trunk
17:40
Initial code check-in. Untested. check-in: 168f7a4e17 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to sar.c.

126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
...
177
178
179
180
181
182
183
184
185
186
187
188
189
               "REPLACE INTO sar(filename,sz,data) VALUES(?1,?2,?3)",
               -1, &pIns, 0);
    if( rc ) errorMsg("%s\n", sqlite3_errmsg(db));
  }
  sqlite3_bind_text(pIns, 1, zFilename, -1, SQLITE_STATIC);
  sqlite3_bind_int(pIns, 2, sz);
  nCompr = 13 + sz + (sz+999)/1000;
  zCompr = sqlite3_malloc( nCompr);
  if( zCompr==0 ) errorMsg("out of memory\n");
  rc = uncompress(zCompr, &nCompr, zIn, sz);
  if( rc!=Z_OK ) errorMsg("Cannot compress %s\n", zFilename);
  sqlite3_free(zIn);
  sqlite3_bind_blob(pIns, 3, zCompr, nCompr, sqlite3_free);
  rc = sqlite3_step(pIns);
  if( rc!=SQLITE_DONE ){
    errorMsg("Insert failed for %s: %s\n", zFilename, sqlite3_errmsg(db));
  }
................................................................................
  if( zArchive==0 ) showHelp(argv[0]);
  if( listFlag ){
  }else if( extractFlag ){
  }else{
    if( azFiles==0 ) showHelp(argv[0]);
    db_open(zArchive, 1);
    for(i=0; i<nFiles; i++){
      add_file(argv[i]);
    }
    db_close(1);
  }
  return 0;
}







|

|







 







|





126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
...
177
178
179
180
181
182
183
184
185
186
187
188
189
               "REPLACE INTO sar(filename,sz,data) VALUES(?1,?2,?3)",
               -1, &pIns, 0);
    if( rc ) errorMsg("%s\n", sqlite3_errmsg(db));
  }
  sqlite3_bind_text(pIns, 1, zFilename, -1, SQLITE_STATIC);
  sqlite3_bind_int(pIns, 2, sz);
  nCompr = 13 + sz + (sz+999)/1000;
  zCompr = sqlite3_malloc( nCompr+1 );
  if( zCompr==0 ) errorMsg("out of memory\n");
  rc = compress(zCompr, &nCompr, zIn, sz);
  if( rc!=Z_OK ) errorMsg("Cannot compress %s\n", zFilename);
  sqlite3_free(zIn);
  sqlite3_bind_blob(pIns, 3, zCompr, nCompr, sqlite3_free);
  rc = sqlite3_step(pIns);
  if( rc!=SQLITE_DONE ){
    errorMsg("Insert failed for %s: %s\n", zFilename, sqlite3_errmsg(db));
  }
................................................................................
  if( zArchive==0 ) showHelp(argv[0]);
  if( listFlag ){
  }else if( extractFlag ){
  }else{
    if( azFiles==0 ) showHelp(argv[0]);
    db_open(zArchive, 1);
    for(i=0; i<nFiles; i++){
      add_file(azFiles[i]);
    }
    db_close(1);
  }
  return 0;
}