1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Revise the API for user-defined functions. (CVS 398)

FossilOrigin-Name: 633951f0fa11c91f93aa2862df84691750c01e73
This commit is contained in:
drh
2002-02-27 19:00:20 +00:00
parent 4e0f995347
commit 1350b030c1
10 changed files with 331 additions and 146 deletions

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.64 2002/02/27 01:53:13 drh Exp $
** $Id: main.c,v 1.65 2002/02/27 19:00:22 drh Exp $
*/
#include "sqliteInt.h"
#include "os.h"
@@ -643,7 +643,8 @@ int sqlite_create_function(
sqlite *db, /* Add the function to this database connection */
const char *zName, /* Name of the function to add */
int nArg, /* Number of arguments */
void (*xFunc)(void*,int,const char**) /* Implementation of the function */
void (*xFunc)(sqlite_func*,int,const char**), /* The implementation */
void *pUserData /* User data */
){
UserFunc *p;
if( db==0 || zName==0 ) return 1;
@@ -652,14 +653,16 @@ int sqlite_create_function(
p->xFunc = xFunc;
p->xStep = 0;
p->xFinalize = 0;
p->pUserData = pUserData;
return 0;
}
int sqlite_create_aggregate(
sqlite *db, /* Add the function to this database connection */
const char *zName, /* Name of the function to add */
int nArg, /* Number of arguments */
void *(*xStep)(void*,int,const char**), /* The step function */
void (*xFinalize)(void*,void*) /* The finalizer */
void (*xStep)(sqlite_func*,int,const char**), /* The step function */
void (*xFinalize)(sqlite_func*), /* The finalizer */
void *pUserData /* User data */
){
UserFunc *p;
if( db==0 || zName==0 ) return 1;
@@ -668,5 +671,6 @@ int sqlite_create_aggregate(
p->xFunc = 0;
p->xStep = xStep;
p->xFinalize = xFinalize;
p->pUserData = pUserData;
return 0;
}