1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

More MEM changes in the vdbe.c. Still will not compile. (CVS 1469)

FossilOrigin-Name: dbdd1a7f316e576d0611748ec63c9ef00d4c10db
This commit is contained in:
drh
2004-05-27 01:53:56 +00:00
parent ea61b2c4fc
commit eb2e176a12
13 changed files with 403 additions and 831 deletions

View File

@@ -198,6 +198,50 @@ int sqlite3_step(sqlite3_stmt *pStmt){
return rc;
}
/*
** Extract the user data from a sqlite3_context structure and return a
** pointer to it.
*/
void *sqlite3_user_data(sqlite3_context *p){
assert( p && p->pFunc );
return p->pFunc->pUserData;
}
/*
** Allocate or return the aggregate context for a user function. A new
** context is allocated on the first call. Subsequent calls return the
** same context that was returned on prior calls.
**
** This routine is defined here in vdbe.c because it depends on knowing
** the internals of the sqlite3_context structure which is only defined in
** this source file.
*/
void *sqlite3_aggregate_context(sqlite3_context *p, int nByte){
assert( p && p->pFunc && p->pFunc->xStep );
if( p->pAgg==0 ){
if( nByte<=NBFS ){
p->pAgg = (void*)p->s.z;
memset(p->pAgg, 0, nByte);
}else{
p->pAgg = sqliteMalloc( nByte );
}
}
return p->pAgg;
}
/*
** Return the number of times the Step function of a aggregate has been
** called.
**
** This routine is defined here in vdbe.c because it depends on knowing
** the internals of the sqlite3_context structure which is only defined in
** this source file.
*/
int sqlite3_aggregate_count(sqlite3_context *p){
assert( p && p->pFunc && p->pFunc->xStep );
return p->cnt;
}
/*
** Return the number of columns in the result set for the statement pStmt.
*/