summaryrefslogtreecommitdiff
path: root/static/netbsd/man3/sqlite3_collation_needed.3
diff options
context:
space:
mode:
Diffstat (limited to 'static/netbsd/man3/sqlite3_collation_needed.3')
-rw-r--r--static/netbsd/man3/sqlite3_collation_needed.366
1 files changed, 66 insertions, 0 deletions
diff --git a/static/netbsd/man3/sqlite3_collation_needed.3 b/static/netbsd/man3/sqlite3_collation_needed.3
new file mode 100644
index 00000000..1eb17e8f
--- /dev/null
+++ b/static/netbsd/man3/sqlite3_collation_needed.3
@@ -0,0 +1,66 @@
+.Dd January 24, 2024
+.Dt SQLITE3_COLLATION_NEEDED 3
+.Os
+.Sh NAME
+.Nm sqlite3_collation_needed ,
+.Nm sqlite3_collation_needed16
+.Nd collation needed callbacks
+.Sh SYNOPSIS
+.In sqlite3.h
+.Ft int
+.Fo sqlite3_collation_needed
+.Fa "sqlite3*"
+.Fa "void*"
+.Fa "void(*)(void*,sqlite3*,int eTextRep,const char*)"
+.Fc
+.Ft int
+.Fo sqlite3_collation_needed16
+.Fa "sqlite3*"
+.Fa "void*"
+.Fa "void(*)(void*,sqlite3*,int eTextRep,const void*)"
+.Fc
+.Sh DESCRIPTION
+To avoid having to register all collation sequences before a database
+can be used, a single callback function may be registered with the
+database connection to be invoked whenever an undefined
+collation sequence is required.
+.Pp
+If the function is registered using the sqlite3_collation_needed()
+API, then it is passed the names of undefined collation sequences as
+strings encoded in UTF-8.
+If sqlite3_collation_needed16() is used, the names are passed as UTF-16
+in machine native byte order.
+A call to either function replaces the existing collation-needed callback.
+.Pp
+When the callback is invoked, the first argument passed is a copy of
+the second argument to sqlite3_collation_needed() or sqlite3_collation_needed16().
+The second argument is the database connection.
+The third argument is one of SQLITE_UTF8, SQLITE_UTF16BE,
+or SQLITE_UTF16LE, indicating the most desirable form
+of the collation sequence function required.
+The fourth parameter is the name of the required collation sequence.
+.Pp
+The callback function should register the desired collation using
+.Fn sqlite3_create_collation ,
+.Fn sqlite3_create_collation16 ,
+or
+.Fn sqlite3_create_collation_v2 .
+.Sh IMPLEMENTATION NOTES
+These declarations were extracted from the
+interface documentation at line 6350.
+.Bd -literal
+SQLITE_API int sqlite3_collation_needed(
+ sqlite3*,
+ void*,
+ void(*)(void*,sqlite3*,int eTextRep,const char*)
+);
+SQLITE_API int sqlite3_collation_needed16(
+ sqlite3*,
+ void*,
+ void(*)(void*,sqlite3*,int eTextRep,const void*)
+);
+.Ed
+.Sh SEE ALSO
+.Xr sqlite3 3 ,
+.Xr sqlite3_create_collation 3 ,
+.Xr SQLITE_UTF8 3