ext/wasm/module-symbols.html: add a hyperlink to the API docs for each exported sqlite3_...() function.

FossilOrigin-Name: 01d3a9bba3120cfec3f752048281f18ce7ab48fa7584750c097233a9ce095a20
This commit is contained in:
stephan 2022-12-12 11:22:05 +00:00
parent b2eb8a5352
commit 13e5512b28
4 changed files with 211 additions and 18 deletions

View File

@ -1959,6 +1959,10 @@ self.sqlite3ApiBootstrap = function sqlite3ApiBootstrap(
some initializers. Retain them when running in test mode
so that we can add tests for them. */
delete sqlite3.util;
/* It's conceivable that we might want to expose
StructBinder to client-side code, but it's only useful if
clients build their own sqlite3.wasm which contains their
one C struct types. */
delete sqlite3.StructBinder;
}
return sqlite3;

View File

@ -192,6 +192,177 @@
fossil-doc block so that this part can work without modification in
the wasm docs repo. */</script>
<script>(async function(){
const apiLinks = Object.assign(Object.create(null),{
sqlite3_aggregate_context: 'www:/c3ref/aggregate_context.html',
sqlite3_bind_blob: 'www:/c3ref/bind_blob.html',
sqlite3_bind_double: 'www:/c3ref/bind_blob.html',
sqlite3_bind_int: 'www:/c3ref/bind_blob.html',
sqlite3_bind_int64: 'www:/c3ref/bind_blob.html',
sqlite3_bind_null: 'www:/c3ref/bind_blob.html',
sqlite3_bind_parameter_count: 'www:/c3ref/bind_parameter_count.html',
sqlite3_bind_parameter_index: 'www:/c3ref/bind_parameter_index.html',
sqlite3_bind_pointer: 'www:/c3ref/bind_blob.html',
sqlite3_bind_text: 'www:/c3ref/bind_blob.html',
sqlite3_busy_handler: 'www:/c3ref/busy_handler.html',
sqlite3_busy_timeout: 'www:/c3ref/busy_timeout.html',
sqlite3_changes: 'www:/c3ref/changes.html',
sqlite3_changes64: 'www:/c3ref/changes.html',
sqlite3_clear_bindings: 'www:/c3ref/clear_bindings.html',
sqlite3_close_v2: 'www:/c3ref/close.html',
sqlite3_collation_needed: 'www:/c3ref/collation_needed.html',
sqlite3_column_blob: 'www:/c3ref/column_blob.html',
sqlite3_column_bytes: 'www:/c3ref/column.html',
sqlite3_column_count: 'www:/c3ref/column_count.html',
sqlite3_column_double: 'www:/c3ref/column_blob.html',
sqlite3_column_int: 'www:/c3ref/column_blob.html',
sqlite3_column_int64: 'www:/c3ref/column_blob.html',
sqlite3_column_name: 'www:/c3ref/column_name.html',
sqlite3_column_text: 'www:/c3ref/column_blob.html',
sqlite3_column_type: 'www:/c3ref/column_blob.html',
sqlite3_column_value: 'www:/c3ref/column_blob.html',
sqlite3_compileoption_get: 'www:/c3ref/compileoption_get.html',
sqlite3_compileoption_used: 'www:/c3ref/compileoption_get.html',
sqlite3_complete: 'www:/c3ref/complete.html',
sqlite3_create_collation: 'www:/c3ref/create_collation.html',
sqlite3_create_collation_v2: 'www:/c3ref/create_collation.html',
sqlite3_create_function: 'www:/c3ref/create_function.html',
sqlite3_create_function_v2: 'www:/c3ref/create_function.html',
sqlite3_create_module: 'www:/c3ref/create_module.html',
sqlite3_create_module_v2: 'www:/c3ref/create_module.html',
sqlite3_create_window_function: 'www:/c3ref/create_function.html',
sqlite3_db_config: 'www:/c3ref/db_config.html',
sqlite3_data_count: 'www:/c3ref/data_count.html',
sqlite3_db_filename: 'www:/c3ref/db_filename.html',
sqlite3_db_handle: 'www:/c3ref/db_handle.html',
sqlite3_db_name: 'www:/c3ref/db_name.html',
sqlite3_db_status: 'www:/c3ref/db_status.html',
sqlite3_declare_vtab: 'www:/c3ref/declare_vtab.html',
sqlite3_deserialize: 'www:/c3ref/deserialize.html',
sqlite3_drop_modules: 'www:/c3ref/drop_modules.html',
sqlite3_errcode: 'www:/c3ref/errcode.html',
sqlite3_errmsg: 'www:/c3ref/errcode.html',
sqlite3_error_offset: 'www:/c3ref/error_offset.html',
sqlite3_errstr: 'www:/c3ref/errcode.html',
sqlite3_exec: 'www:/c3ref/exec.html',
sqlite3_expanded_sql: 'www:/c3ref/expanded_sql.html',
sqlite3_extended_errcode: 'www:/c3ref/errcode.html',
sqlite3_extended_result_codes: 'www:/c3ref/extended_result_codes.html',
sqlite3_file_control: 'www:/c3ref/file_control.html',
sqlite3_finalize: 'www:/c3ref/finalize.html',
sqlite3_free: 'www:/c3ref/free.html',
sqlite3_get_auxdata: 'www:/c3ref/get_auxdata.html',
sqlite3_initialize: 'www:/c3ref/initialize.html',
sqlite3_keyword_check: 'www:/c3ref/keyword_check.html',
sqlite3_keyword_count: 'www:/c3ref/keyword_check.html',
sqlite3_keyword_name: 'www:/c3ref/keyword_check.html',
sqlite3_last_insert_rowid: 'www:/c3ref/last_insert_rowid.html',
sqlite3_libversion: 'www:/c3ref/libversion.html',
sqlite3_libversion_number: 'www:/c3ref/libversion.html',
sqlite3_limit: 'www:/c3ref/limit.html',
sqlite3_malloc: 'www:/c3ref/free.html',
sqlite3_malloc64: 'www:/c3ref/free.html',
sqlite3_msize: 'www:/c3ref/free.html',
sqlite3_open: 'www:/c3ref/open.html',
sqlite3_open_v2: 'www:/c3ref/open.html',
sqlite3_overload_function: 'www:/c3ref/overload_function.html',
sqlite3_prepare_v2: 'www:/c3ref/prepare.html',
sqlite3_prepare_v3: 'www:/c3ref/prepare.html',
sqlite3_progress_handler: 'www:/c3ref/progress_handler.html',
sqlite3_randomness: 'www:/c3ref/randomness.html',
sqlite3_realloc: 'www:/c3ref/free.html',
sqlite3_realloc64: 'www:/c3ref/free.html',
sqlite3_reset: 'www:/c3ref/reset.html',
sqlite3_result_blob: 'www:/c3ref/result_blob.html',
sqlite3_result_double: 'www:/c3ref/result_blob.html',
sqlite3_result_error: 'www:/c3ref/result_blob.html',
sqlite3_result_error_code: 'www:/c3ref/result_blob.html',
sqlite3_result_error_nomem: 'www:/c3ref/result_blob.html',
sqlite3_result_error_toobig: 'www:/c3ref/result_blob.html',
sqlite3_result_int: 'www:/c3ref/result_blob.html',
sqlite3_result_int64: 'www:/c3ref/result_blob.html',
sqlite3_result_null: 'www:/c3ref/result_blob.html',
sqlite3_result_pointer: 'www:/c3ref/result_blob.html',
sqlite3_result_subtype: 'www:/c3ref/result_subtype.html',
sqlite3_result_text: 'www:/c3ref/result_blob.html',
sqlite3_result_zeroblob: 'www:/c3ref/result_blob.html',
sqlite3_result_zeroblob64: 'www:/c3ref/result_blob.html',
sqlite3_serialize: 'www:/c3ref/serialize.html',
sqlite3_set_auxdata: 'www:/c3ref/set_auxdata.html',
sqlite3_set_last_insert_rowid: 'www:/c3ref/set_last_insert_rowid',
sqlite3_shutdown: 'www:/c3ref/initialize.html',
sqlite3_sourceid: 'www:/c3ref/libversion.html',
sqlite3_sql: 'www:/c3ref/expanded_sql.html',
sqlite3_status: 'www:/c3ref/status.html',
sqlite3_status64: 'www:/c3ref/status.html',
sqlite3_step: 'www:/c3ref/step.html',
sqlite3_stmt_isexplain: 'www:/c3ref/stmt_isexplain.html',
sqlite3_stmt_readonly: 'www:/c3ref/stmt_readonly.html',
sqlite3_stmt_status: 'www:/c3ref/stmt_status.html',
sqlite3_strglob: 'www:/c3ref/strglob.html',
sqlite3_stricmp: 'www:/c3ref/stricmp.html',
sqlite3_strlike: 'www:/c3ref/strlike.html',
sqlite3_strnicmp: 'www:/c3ref/strnicmp.html',
sqlite3_table_column_metadata: 'www:/c3ref/table_column_metadata.html',
sqlite3_total_changes: 'www:/c3ref/total_changes.html',
sqlite3_total_changes64: 'www:/c3ref/total_changes.html',
sqlite3_trace_v2: 'www:/c3ref/trace_v2.html',
sqlite3_txn_state: 'www:/c3ref/txn_state.html',
sqlite3_uri_boolean: 'www:/c3ref/uri_boolean.html',
sqlite3_uri_int64: 'www:/c3ref/uri_boolean.html',
sqlite3_uri_key: 'www:/c3ref/uri_boolean.html',
sqlite3_uri_parameter: 'www:/c3ref/uri_boolean.html',
sqlite3_user_data: 'www:/c3ref/user_data.html',
sqlite3_value_blob: 'www:/c3ref/value_blob.html',
sqlite3_value_bytes: 'www:/c3ref/value_blob.html',
sqlite3_value_double: 'www:/c3ref/value_blob.html',
sqlite3_value_dup: 'www:/c3ref/value_dup.html',
sqlite3_value_free: 'www:/c3ref/value_dup.html',
sqlite3_value_frombind: 'www:/c3ref/value_blob.html',
sqlite3_value_int: 'www:/c3ref/value_blob.html',
sqlite3_value_int64: 'www:/c3ref/value_blob.html',
sqlite3_value_nochange: 'www:/c3ref/value_blob.html',
sqlite3_value_numeric_type: 'www:/c3ref/value_blob.html',
sqlite3_value_pointer: 'www:/c3ref/value_blob.html',
sqlite3_value_subtype: 'www:/c3ref/value_subtype.html',
sqlite3_value_text: 'www:/c3ref/value_blob.html',
sqlite3_value_type: 'www:/c3ref/value_blob.html',
sqlite3_vfs_find: 'www:/c3ref/vfs_find.html',
sqlite3_vfs_register: 'www:/c3ref/vfs_find.html',
sqlite3_vfs_unregister: 'www:/c3ref/vfs_find.html',
sqlite3_vtab_collation: 'www:/c3ref/vtab_collation.html',
sqlite3_vtab_config: 'www:/c3ref/vtab_config.html',
sqlite3_vtab_distinct: 'www:/c3ref/vtab_distinct.html',
sqlite3_vtab_in: 'www:/c3ref/vtab_in.html',
sqlite3_vtab_in_first: 'www:/c3ref/vtab_in_first.html',
sqlite3_vtab_in_next: 'www:/c3ref/vtab_in_next.html',
sqlite3_vtab_nochange: 'www:/c3ref/vtab_nochange.html',
sqlite3_vtab_on_conflict: 'www:/c3ref/vtab_on_conflict.html',
sqlite3_vtab_rhs_value: 'www:/c3ref/vtab_rhs_value.html',
sqlite3_column_js: 'wasm:/api-c-style.md#sqlite3_column_js',
sqlite3_js_aggregate_context: 'wasm:/api-c-style.md#sqlite3_js_aggregate_context',
sqlite3_js_db_export: 'wasm:/api-c-style.md#sqlite3_js_db_export',
sqlite3_js_db_uses_vfs: 'wasm:/api-c-style.md#sqlite3_js_db_uses_vfs',
sqlite3_js_db_vfs: 'wasm:/api-c-style.md#sqlite3_js_db_vfs',
sqlite3_js_kvvfs_clear: 'wasm:/api-c-style.md#sqlite3_js_kvvfs',
sqlite3_js_kvvfs_size: 'wasm:/api-c-style.md#sqlite3_js_kvvfs',
sqlite3_js_rc_str: 'wasm:/api-c-style.md#sqlite3_js_rc_str',
sqlite3_js_vfs_create_file: 'wasm:/api-c-style.md#sqlite3_js_vfs_create_file',
sqlite3_js_vfs_list: 'wasm:/api-c-style.md#sqlite3_js_vfs_list',
sqlite3_result_error_js: 'wasm:/api-c-style.md#sqlite3_result_error_js',
sqlite3_result_js: 'wasm:/api-c-style.md#sqlite3_result_js',
sqlite3_value_to_js: 'wasm:/api-c-style.md#sqlite3_value_to_js',
sqlite3_values_to_js: 'wasm:/api-c-style.md#sqlite3_values_to_js',
xform: (v)=>{
if(v){
return v.replace('www:','https://sqlite.org')
.replace('wasm:','https://sqlite.org/wasm/doc/trunk');
}else{
return undefined;
}
}
});
const eNew = (tag,parent)=>{
const e = document.createElement(tag);
if(parent) parent.appendChild(e);
@ -202,6 +373,16 @@
e.innerText = label;
return e;
};
const eLink = (label,url,parent)=>{
const w = eNew('span',parent);
const e = eNew('a',w);
if(url){
e.href = url;
e.target = 'sqlite3-api-docs';
}
e.innerText = label;
return w;
};
const E = (sel)=>document.querySelector(sel);
const EAll = (sel)=>document.querySelectorAll(sel);
const eFuncs = E('#list-functions'),
@ -211,7 +392,7 @@
};
const renderFunc = function(name){
let lbl = name+'()';
const e = eLi(lbl, eFuncs);;
const e = eLink(lbl, apiLinks.xform(apiLinks[name]), eFuncs);
if(name.indexOf('_js')>0
|| name.indexOf('_wasm')>0){
e.classList.add('func-wasm');
@ -257,20 +438,28 @@
);
/* sqlite3_...() and SQLITE_... */
const lists = {c: [], f: []};
for(const [k,v] of Object.entries(capi)){
if(k.startsWith('SQLITE_')) lists.c.push(k);
else if(k.startsWith('sqlite3_')) lists.f.push(k);
}
const lists = {c: [/*constants*/], f: [/*functions*/],
s: [/*structs*/]};
/* Exclude these from the function list... */
const excludeCapi = [
// WASMFS stuff:
'sqlite3_wasmfs_filename_is_persistent',
'sqlite3_wasmfs_opfs_dir'
];
for(const [k,v] of Object.entries(capi)){
if(k.startsWith('SQLITE_')){
lists.c.push(k);
}else if(k.startsWith('sqlite3_')){
if(excludeCapi.indexOf(k)>=0) continue;
if(v.structInfo){
// assume this is a StructType-type.
continue;
}
lists.f.push(k);
}
}
lists.c.sort().forEach(renderConst);
lists.f
.filter((v)=>excludeCapi.indexOf(v)<0)
.sort()
.forEach(renderFunc);
lists.f.sort().forEach(renderFunc);
lists.c = lists.f = null;
renderX(E('#list-oo1'), sqlite3.oo1,

View File

@ -1,5 +1,5 @@
C Rework\sthe\sinternals\sof\show\sargument/result\stypes\sare\sconverted\sto/from\swasm\sin\sprep\sfor\sattempting\sto\ssupport\sautomated\sconversions\sof\sfunction\spointer\sargument\stypes.
D 2022-12-12T08:16:47.837
C ext/wasm/module-symbols.html:\sadd\sa\shyperlink\sto\sthe\sAPI\sdocs\sfor\seach\sexported\ssqlite3_...()\sfunction.
D 2022-12-12T11:22:05.476
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@ -505,7 +505,7 @@ F ext/wasm/api/pre-js.c-pp.js b88499dc303c21fc3f55f2c364a0f814f587b60a9578430388
F ext/wasm/api/sqlite3-api-cleanup.js 680d5ccfff54459db136a49b2199d9f879c8405d9c99af1dda0cc5e7c29056f4
F ext/wasm/api/sqlite3-api-glue.js 1d1c0542392a17e1ab9dc652c00091afefe8489108bb8da899b68eab50c3f813
F ext/wasm/api/sqlite3-api-oo1.js 6d10849609231ccd46fa11b1d3fbbe0f45d9fe84c66a0b054601036540844300
F ext/wasm/api/sqlite3-api-prologue.js 0127c8c25463dba0a3372939614474a95e046c05fda0282f86dd7d1cc1890a3b
F ext/wasm/api/sqlite3-api-prologue.js 979a469f329636e7345a1a720b0be6e93c7585231387ebdef2b4493ff9a2bf74
F ext/wasm/api/sqlite3-api-worker1.js e94ba98e44afccfa482874cd9acb325883ade50ed1f9f9526beb9de1711f182f
F ext/wasm/api/sqlite3-license-version-header.js a661182fc93fc2cf212dfd0b987f8e138a3ac98f850b1112e29b5fbdaecc87c3
F ext/wasm/api/sqlite3-opfs-async-proxy.js 7795b84b66a7a8dedc791340709b310bb497c3c72a80bef364fa2a58e2ddae3f
@ -541,7 +541,7 @@ F ext/wasm/index-dist.html c806b6005145b71d64240606e9c6e0bf56878ee8829c66fe7486c
F ext/wasm/index.html f151b7c7b5cfdc066567d556acd168e769efd4e982286dc5f849a5ee69ecd0ff
F ext/wasm/jaccwabyt/jaccwabyt.js 06f2ef1ad640c26c593def3d960336e9bb789819b920516480895c38ed5f58fa
F ext/wasm/jaccwabyt/jaccwabyt.md 37911f00db12cbcca73aa1ed72594430365f30aafae2fa9c886961de74e5e0eb
F ext/wasm/module-symbols.html 3517259495334d873b46918d14517f13d1eb190b42c3d11104141c046e28e163
F ext/wasm/module-symbols.html ea74b95c9dbdc479857941ed35cf1f842bfff91dfe1aa38280ba7a670c0a85ef
F ext/wasm/scratchpad-wasmfs-main.html 20cf6f1a8f368e70d01e8c17200e3eaa90f1c8e1029186d836d14b83845fbe06
F ext/wasm/scratchpad-wasmfs-main.js 4c140457f4d6da9d646a49addd91edb6e9ad1643c6c48e3258b5bce24725dc18
F ext/wasm/speedtest1-wasmfs.html bc28eb29b69a73864b8d7aae428448f8b7e1de81d8bfb9bba99541322054dbd0
@ -2067,8 +2067,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P 5a3f2224c37c7e28ce627bd98a9907a16635bffeea36e8ead707586aad37ccfe
R f46a7095aa975a79509232fc3fdad048
P 58052d8285cbc2aa8c4f8a9f5c2d33ac12014f6a70afbc93bc4ce5b9fd1f9ee5
R 819491edeaf6ff328d176f3bfbb78f44
U stephan
Z f352fee6fe16045a62c502e094ae567d
Z 006a199dedeefa1e377f24b77a4a4ef3
# Remove this line to create a well-formed Fossil manifest.

View File

@ -1 +1 @@
58052d8285cbc2aa8c4f8a9f5c2d33ac12014f6a70afbc93bc4ce5b9fd1f9ee5
01d3a9bba3120cfec3f752048281f18ce7ab48fa7584750c097233a9ce095a20