def create_function( db, name, args, text, cookie, func, step, final )
if func || ( step && final )
cb = API::CallbackData.new
cb.proc = cb.proc2 = nil
cb.data = cookie
end
if func
cb.proc = func
func = API::Sqlite3_ruby_function_step
step = final = nil
elsif step && final
cb.proc = step
cb.proc2 = final
func = nil
step = API::Sqlite3_ruby_function_step
final = API::Sqlite3_ruby_function_final
end
result = API.sqlite3_create_function( db, name, args, text, cb, func, step, final )
if cb
@callback_data[ name ] = cb
else
@callback_data.delete( name )
end
return result
end