Add the sqlite3_uri_parameter() interface function for use in building
new VFSes.

FossilOrigin-Name: 6b5de95fb575c7ceb3034068c4f5e0fccb1b15ac
diff --git a/src/main.c b/src/main.c
index d19f5f9..6dd591c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -2908,3 +2908,25 @@
 #endif /* SQLITE_OMIT_BUILTIN_TEST */
   return rc;
 }
+
+/*
+** This is a utility routine, useful to VFS implementations, that checks
+** to see if a database file was a URI that contained a specific query 
+** parameter, and if so obtains the value of the query parameter.
+**
+** The zFilename argument is the filename pointer passed into the xOpen()
+** method of a VFS implementation.  The zParam argument is the name of the
+** query parameter we seek.  This routine returns the value of the zParam
+** parameter if it exists.  If the parameter does not exist, this routine
+** returns a NULL pointer.
+*/
+const char *sqlite3_uri_parameter(const char *zFilename, const char *zParam){
+  zFilename += sqlite3Strlen30(zFilename);
+  while( zFilename[0] ){
+    int x = strcmp(zFilename, zParam);
+    zFilename += sqlite3Strlen30(zFilename);
+    if( x==0 ) return zFilename;
+    zFilename += sqlite3Strlen30(zFilename);
+  }
+  return 0;
+}
diff --git a/src/sqlite.h.in b/src/sqlite.h.in
index 4bcba18..f955d63 100644
--- a/src/sqlite.h.in
+++ b/src/sqlite.h.in
@@ -2554,6 +2554,26 @@
 );
 
 /*
+** CAPI3REF: Obtain Values For URI Parameters
+**
+** This is a utility routine, useful to VFS implementations, that checks
+** to see if a database file was a URI that contained a specific query 
+** parameter, and if so obtains the value of the query parameter.
+**
+** The zFilename argument is the filename pointer passed into the xOpen()
+** method of a VFS implementation.  The zParam argument is the name of the
+** query parameter we seek.  This routine returns the value of the zParam
+** parameter if it exists.  If the parameter does not exist, this routine
+** returns a NULL pointer.
+**
+** If the zFilename argument to this function is not a pointer that SQLite
+** passed into the xOpen VFS method, then the behavior of this routine
+** is undefined and probably undesirable.
+*/
+const char *sqlite3_uri_parameter(const char *zFilename, const char *zParam);
+
+
+/*
 ** CAPI3REF: Error Codes And Messages
 **
 ** ^The sqlite3_errcode() interface returns the numeric [result code] or