mirror of
				https://github.com/sqlite/sqlite.git
				synced 2025-10-24 09:53:10 +03:00 
			
		
		
		
	Use the new form of the sqlite3_create_function() API. (CVS 1460)
FossilOrigin-Name: 0317bef4b0c219ca2888c90553201e53230fb360
This commit is contained in:
		
							
								
								
									
										10
									
								
								src/func.c
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								src/func.c
									
									
									
									
									
								
							| @@ -16,7 +16,7 @@ | ||||
| ** sqliteRegisterBuildinFunctions() found at the bottom of the file. | ||||
| ** All other code has file scope. | ||||
| ** | ||||
| ** $Id: func.c,v 1.55 2004/05/25 12:05:57 danielk1977 Exp $ | ||||
| ** $Id: func.c,v 1.56 2004/05/26 06:18:37 danielk1977 Exp $ | ||||
| */ | ||||
| #include <ctype.h> | ||||
| #include <math.h> | ||||
| @@ -668,16 +668,16 @@ void sqlite3RegisterBuiltinFunctions(sqlite *db){ | ||||
|  | ||||
|   for(i=0; i<sizeof(aFuncs)/sizeof(aFuncs[0]); i++){ | ||||
|     void *pArg = aFuncs[i].argType==2 ? (void*)(-1) : db; | ||||
|     sqlite3_create_function(db, aFuncs[i].zName, | ||||
|            aFuncs[i].nArg, aFuncs[i].xFunc, pArg); | ||||
|     sqlite3_create_function(db, aFuncs[i].zName, aFuncs[i].nArg, 0, 0, | ||||
|         pArg, aFuncs[i].xFunc, 0, 0); | ||||
|     if( aFuncs[i].xFunc ){ | ||||
|       sqlite3_function_type(db, aFuncs[i].zName, aFuncs[i].dataType); | ||||
|     } | ||||
|   } | ||||
|   for(i=0; i<sizeof(aAggs)/sizeof(aAggs[0]); i++){ | ||||
|     void *pArg = aAggs[i].argType==2 ? (void*)(-1) : db; | ||||
|     sqlite3_create_aggregate(db, aAggs[i].zName, | ||||
|            aAggs[i].nArg, aAggs[i].xStep, aAggs[i].xFinalize, pArg); | ||||
|     sqlite3_create_function(db, aAggs[i].zName, aAggs[i].nArg, 0, 0, pArg, | ||||
|         0, aAggs[i].xStep, aAggs[i].xFinalize); | ||||
|     sqlite3_function_type(db, aAggs[i].zName, aAggs[i].dataType); | ||||
|   } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user