Change the name of the sqlite3_freemem API function to just sqlite3_free. (CVS 1512)

FossilOrigin-Name: f3b80bbb97ed0b0c1cf634068f28f23802ec71a8
This commit is contained in:
drh 2004-05-31 19:34:33 +00:00
parent 9c054830b4
commit 3f4fedb2c4
7 changed files with 32 additions and 34 deletions

View File

@ -1,5 +1,5 @@
C Change\sall\sSQLITE3\spreprocessor\smacros\sto\sSQLITE.\s\sDocumentation\supdates.\s(CVS\s1511)
D 2004-05-31T18:51:58
C Change\sthe\sname\sof\sthe\ssqlite3_freemem\sAPI\sfunction\sto\sjust\ssqlite3_free.\s(CVS\s1512)
D 2004-05-31T19:34:33
F Makefile.in ab7b0d5118e2da97bac66be8684a1034e3500f5a
F Makefile.linux-gcc b86a99c493a5bfb402d1d9178dcdc4bd4b32f906
F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd
@ -36,7 +36,7 @@ F src/hash.c 440c2f8cb373ee1b4e13a0988489c7cd95d55b6f
F src/hash.h 762d95f1e567664d1eafc1687de755626be962fb
F src/insert.c 4268d9e3959cc845ea243fb4ec7507269404dad9
F src/legacy.c ad23746f15f67e34577621b1875f639c94839e1f
F src/main.c b4aed6c790ecae05a345c684e178aa88dccd274b
F src/main.c 2a5d141a8301888268d02d4366ea568ff440200f
F src/md5.c 4302e84ae516c616bb079c4e6d038c0addb33481
F src/os.h ab42f4a7c4c716f26b988e759b6e12085a3bfc67
F src/os_common.h 744286a27de55c52f1b18921e8d17abbf7fafc0f
@ -53,15 +53,15 @@ F src/pragma.c 7f432dee3c94460638df1e5fffeb59a560943d13
F src/printf.c ef750e8e2398ca7e8b58be991075f08c6a7f0e53
F src/random.c eff68e3f257e05e81eae6c4d50a51eb88beb4ff3
F src/select.c 0297717eb7331604687c2e29c147d3a311359df1
F src/shell.c b71bdc3586c1c254941a236f3461615fd032eab1
F src/sqlite.h.in 88b6f09398c9e5b4d2dd7420597e0d6490a81b1f
F src/shell.c cca774504cefa4cf4db27dce175081c6bb7993be
F src/sqlite.h.in 3e2a7cdbfad6b8d1c7f2f3c363476d48388711b3
F src/sqliteInt.h 950104baea45ee81c9113e3c41b5e9f30def9eaa
F src/table.c af14284fa36c8d41f6829e3f2819dce07d3e2de2
F src/tclsqlite.c 8146beb4ade50cd83d3bf7a41c8ebddb9840e967
F src/test1.c 187992df6d835d1d713dd154c6ea4a6929302378
F src/test1.c 60a589a17ab104b2b4851e6860b08be0c7d753b9
F src/test2.c 6195a1ca2c8d0d2d93644e86da3289b403486872
F src/test3.c 86117b74ec7353d76f5cd85c144c7cda23a7e11b
F src/test4.c 34848a9fd31aa65857b20a8bfc03aff77d8c3426
F src/test4.c caf675e443460ec76b04d78e1688986c17c82cec
F src/test5.c a894fbfa8a7dcdc2cbc0c38c11149cc5c8252cea
F src/tokenize.c b68758abaccd8882c48209b7a54db975f17d498a
F src/trigger.c 04b2c310d0d056b213609cab6df5fff03d5eaf88
@ -212,7 +212,7 @@ F www/support.tcl 67682848d6ddd283370451dc3da2e56cded9fc9a
F www/tclsqlite.tcl 19191cf2a1010eaeff74c51d83fd5f5a4d899075
F www/vdbe.tcl 59288db1ac5c0616296b26dce071c36cb611dfe9
F www/whentouse.tcl a8335bce47cc2fddb07f19052cb0cb4d9129a8e4
P 4c37b6d2b78e88e2a9dfed4d764caeb0f626f92e
R 89ae3d2c6e5f559c1b737a98efcaeabb
P adf7e29ff60dc559f64832fadb09f0b9decc0e76
R 35dba1e1591a2b1e6f000ae81b864894
U drh
Z b0d4078bb2a2022230156e75979ba4b4
Z 43fbc82bf31fc6953836ccd5c4550934

View File

@ -1 +1 @@
adf7e29ff60dc559f64832fadb09f0b9decc0e76
f3b80bbb97ed0b0c1cf634068f28f23802ec71a8

View File

@ -14,7 +14,7 @@
** other files are for internal use by SQLite and should not be
** accessed by users of the library.
**
** $Id: main.c,v 1.199 2004/05/31 18:51:58 drh Exp $
** $Id: main.c,v 1.200 2004/05/31 19:34:33 drh Exp $
*/
#include "sqliteInt.h"
#include "os.h"
@ -91,7 +91,7 @@ int sqlite3InitCallback(void *pInit, int argc, char **argv, char **azColName){
db->init.newTnum = atoi(argv[2]);
if( sqlite3_exec(db, argv[3], 0, 0, &zErr) ){
corruptSchema(pData, zErr);
sqlite3_freemem(zErr);
sqlite3_free(zErr);
}
db->init.iDb = 0;
}else{
@ -638,7 +638,7 @@ void sqlite3_interrupt(sqlite *db){
** string that is exported from SQLite should have already passed through
** sqlite3StrRealloc().
*/
void sqlite3_freemem(void *p){ free(p); }
void sqlite3_free(char *p){ free(p); }
/*
** Windows systems need functions to call to return the sqlite3_version

View File

@ -12,7 +12,7 @@
** This file contains code to implement the "sqlite" command line
** utility for accessing SQLite databases.
**
** $Id: shell.c,v 1.99 2004/05/31 18:23:08 drh Exp $
** $Id: shell.c,v 1.100 2004/05/31 19:34:33 drh Exp $
*/
#include <stdlib.h>
#include <string.h>
@ -576,7 +576,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){
sqlite3_exec(p->db, "PRAGMA database_list; ", callback, &data, &zErrMsg);
if( zErrMsg ){
fprintf(stderr,"Error: %s\n", zErrMsg);
sqlite3_freemem(zErrMsg);
sqlite3_free(zErrMsg);
}
}else
@ -604,7 +604,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){
}
if( zErrMsg ){
fprintf(stderr,"Error: %s\n", zErrMsg);
sqlite3_freemem(zErrMsg);
sqlite3_free(zErrMsg);
}else{
fprintf(p->out, "COMMIT;\n");
}
@ -710,7 +710,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){
);
if( zErrMsg ){
fprintf(stderr,"Error: %s\n", zErrMsg);
sqlite3_freemem(zErrMsg);
sqlite3_free(zErrMsg);
}
}else
@ -794,7 +794,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){
}else if( strcmp(azArg[2], azArg[3]) ){
fprintf(stderr,"2nd copy of new key does not match the 1st\n");
}else{
sqlite3_freemem(p->zKey);
sqlite3_free(p->zKey);
p->zKey = sqlite3_mprintf("%s", azArg[2]);
sqlite_rekey(p->db, p->zKey, strlen(p->zKey));
}
@ -857,7 +857,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){
}
if( zErrMsg ){
fprintf(stderr,"Error: %s\n", zErrMsg);
sqlite3_freemem(zErrMsg);
sqlite3_free(zErrMsg);
}
}else
@ -910,7 +910,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){
}
if( zErrMsg ){
fprintf(stderr,"Error: %s\n", zErrMsg);
sqlite3_freemem(zErrMsg);
sqlite3_free(zErrMsg);
}
if( rc==SQLITE_OK ){
int len, maxlen = 0;
@ -1060,7 +1060,7 @@ static void process_input(struct callback_data *p, FILE *in){
if( in!=0 && !p->echoOn ) printf("%s\n",zSql);
if( zErrMsg!=0 ){
printf("SQL error: %s\n", zErrMsg);
sqlite3_freemem(zErrMsg);
sqlite3_free(zErrMsg);
zErrMsg = 0;
}else{
printf("SQL error: %s\n", sqlite3_error_string(rc));

View File

@ -12,7 +12,7 @@
** This header file defines the interface that the SQLite library
** presents to client programs.
**
** @(#) $Id: sqlite.h.in,v 1.86 2004/05/31 18:51:58 drh Exp $
** @(#) $Id: sqlite.h.in,v 1.87 2004/05/31 19:34:33 drh Exp $
*/
#ifndef _SQLITE_H_
#define _SQLITE_H_
@ -101,7 +101,7 @@ typedef int (*sqlite_callback)(void*,int,char**, char**);
** message is written into memory obtained from malloc() and
** *errmsg is made to point to that message. The calling function
** is responsible for freeing the memory that holds the error
** message. Use sqlite3_freemem() for this. If errmsg==NULL,
** message. Use sqlite3_free() for this. If errmsg==NULL,
** then no error message is ever written.
**
** The return value is is SQLITE_OK if there are no errors and
@ -377,8 +377,6 @@ char *sqlite3_mprintf(const char*,...);
char *sqlite3_vmprintf(const char*, va_list);
void sqlite3_free(char *z);
void sqlite3_freemem(void *z);
/*
** Windows systems need functions to call to return the sqlite3_version
** and sqlite3_encoding strings.

View File

@ -13,7 +13,7 @@
** is not included in the SQLite library. It is used for automated
** testing of the SQLite library.
**
** $Id: test1.c,v 1.66 2004/05/31 18:51:58 drh Exp $
** $Id: test1.c,v 1.67 2004/05/31 19:34:33 drh Exp $
*/
#include "sqliteInt.h"
#include "tcl.h"
@ -514,7 +514,7 @@ static int sqlite3_mprintf_int(
}
z = sqlite3_mprintf(argv[1], a[0], a[1], a[2]);
Tcl_AppendResult(interp, z, 0);
sqlite3_freemem(z);
sqlite3_free(z);
return TCL_OK;
}
@ -541,7 +541,7 @@ static int sqlite3_mprintf_str(
}
z = sqlite3_mprintf(argv[1], a[0], a[1], argc>4 ? argv[4] : NULL);
Tcl_AppendResult(interp, z, 0);
sqlite3_freemem(z);
sqlite3_free(z);
return TCL_OK;
}
@ -570,7 +570,7 @@ static int sqlite3_mprintf_double(
if( Tcl_GetDouble(interp, argv[4], &r) ) return TCL_ERROR;
z = sqlite3_mprintf(argv[1], a[0], a[1], r);
Tcl_AppendResult(interp, z, 0);
sqlite3_freemem(z);
sqlite3_free(z);
return TCL_OK;
}
@ -600,7 +600,7 @@ static int sqlite3_mprintf_scaled(
}
z = sqlite3_mprintf(argv[1], r[0]*r[1]);
Tcl_AppendResult(interp, z, 0);
sqlite3_freemem(z);
sqlite3_free(z);
return TCL_OK;
}

View File

@ -11,7 +11,7 @@
*************************************************************************
** Code for testing the the SQLite library in a multithreaded environment.
**
** $Id: test4.c,v 1.8 2004/05/26 23:25:31 drh Exp $
** $Id: test4.c,v 1.9 2004/05/31 19:34:33 drh Exp $
*/
#include "sqliteInt.h"
#include "tcl.h"
@ -77,7 +77,7 @@ static void *thread_main(void *pArg){
while( p->opnum<=p->completed ) sched_yield();
while( p->xOp ){
if( p->zErr && p->zErr!=p->zStaticErr ){
sqlite3_freemem(p->zErr);
sqlite3_free(p->zErr);
p->zErr = 0;
}
(*p->xOp)(p);
@ -93,7 +93,7 @@ static void *thread_main(void *pArg){
p->db = 0;
}
if( p->zErr && p->zErr!=p->zStaticErr ){
sqlite3_freemem(p->zErr);
sqlite3_free(p->zErr);
p->zErr = 0;
}
p->completed++;