aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/api
diff options
context:
space:
mode:
Diffstat (limited to 'ext/wasm/api')
-rw-r--r--ext/wasm/api/sqlite3-api-glue.js14
-rw-r--r--ext/wasm/api/sqlite3-api-oo1.js6
-rw-r--r--ext/wasm/api/sqlite3-api-prologue.js6
-rw-r--r--ext/wasm/api/sqlite3-vfs-opfs.c-pp.js8
4 files changed, 17 insertions, 17 deletions
diff --git a/ext/wasm/api/sqlite3-api-glue.js b/ext/wasm/api/sqlite3-api-glue.js
index 89c8044be..14c0d58a4 100644
--- a/ext/wasm/api/sqlite3-api-glue.js
+++ b/ext/wasm/api/sqlite3-api-glue.js
@@ -193,8 +193,8 @@ self.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
try {
let aVals = [], aNames = [], i = 0, offset = 0;
for( ; i < nCols; offset += (wasm.ptrSizeof * ++i) ){
- aVals.push( wasm.cstringToJs(wasm.getPtrValue(pColVals + offset)) );
- aNames.push( wasm.cstringToJs(wasm.getPtrValue(pColNames + offset)) );
+ aVals.push( wasm.cstrToJs(wasm.getPtrValue(pColVals + offset)) );
+ aNames.push( wasm.cstrToJs(wasm.getPtrValue(pColNames + offset)) );
}
rc = callback(pVoid, nCols, aVals, aNames) | 0;
/* The first 2 args of the callback are useless for JS but
@@ -610,7 +610,7 @@ self.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
toss("Maintenance required: increase sqlite3_wasm_enum_json()'s",
"static buffer size!");
}
- wasm.ctype = JSON.parse(wasm.cstringToJs(cJson));
+ wasm.ctype = JSON.parse(wasm.cstrToJs(cJson));
//console.debug('wasm.ctype length =',wasm.cstrlen(cJson));
const defineGroups = ['access', 'authorizer',
'blobFinalizers', 'dataTypes',
@@ -702,7 +702,7 @@ self.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
try {
const zXKey = kvvfsMakeKey(zClass,zKey);
if(!zXKey) return -3/*OOM*/;
- const jKey = wasm.cstringToJs(zXKey);
+ const jKey = wasm.cstrToJs(zXKey);
const jV = kvvfsStorage(zClass).getItem(jKey);
if(!jV) return -1;
const nV = jV.length /* Note that we are relying 100% on v being
@@ -731,8 +731,8 @@ self.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
try {
const zXKey = kvvfsMakeKey(zClass,zKey);
if(!zXKey) return 1/*OOM*/;
- const jKey = wasm.cstringToJs(zXKey);
- kvvfsStorage(zClass).setItem(jKey, wasm.cstringToJs(zData));
+ const jKey = wasm.cstrToJs(zXKey);
+ kvvfsStorage(zClass).setItem(jKey, wasm.cstrToJs(zData));
return 0;
}catch(e){
console.error("kvstorageWrite()",e);
@@ -746,7 +746,7 @@ self.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
try {
const zXKey = kvvfsMakeKey(zClass,zKey);
if(!zXKey) return 1/*OOM*/;
- kvvfsStorage(zClass).removeItem(wasm.cstringToJs(zXKey));
+ kvvfsStorage(zClass).removeItem(wasm.cstrToJs(zXKey));
return 0;
}catch(e){
console.error("kvstorageDelete()",e);
diff --git a/ext/wasm/api/sqlite3-api-oo1.js b/ext/wasm/api/sqlite3-api-oo1.js
index 6253c659f..4ec61af07 100644
--- a/ext/wasm/api/sqlite3-api-oo1.js
+++ b/ext/wasm/api/sqlite3-api-oo1.js
@@ -73,7 +73,7 @@ self.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
if(capi.SQLITE_TRACE_STMT===t){
// x == SQL, p == sqlite3_stmt*
console.log("SQL TRACE #"+(++this.counter),
- wasm.cstringToJs(x));
+ wasm.cstrToJs(x));
}
}.bind({counter: 0}));
@@ -139,7 +139,7 @@ self.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
console.error("Invalid DB ctor args",opt,arguments);
toss3("Invalid arguments for DB constructor.");
}
- let fnJs = ('number'===typeof fn) ? wasm.cstringToJs(fn) : fn;
+ let fnJs = ('number'===typeof fn) ? wasm.cstrToJs(fn) : fn;
const vfsCheck = ctor._name2vfs[fnJs];
if(vfsCheck){
vfsName = vfsCheck.vfs;
@@ -600,7 +600,7 @@ self.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
);
if(pVfs){
const v = new capi.sqlite3_vfs(pVfs);
- try{ rc = wasm.cstringToJs(v.$zName) }
+ try{ rc = wasm.cstrToJs(v.$zName) }
finally { v.dispose() }
}
return rc;
diff --git a/ext/wasm/api/sqlite3-api-prologue.js b/ext/wasm/api/sqlite3-api-prologue.js
index 558fcda1e..bccae8b19 100644
--- a/ext/wasm/api/sqlite3-api-prologue.js
+++ b/ext/wasm/api/sqlite3-api-prologue.js
@@ -348,13 +348,13 @@ self.sqlite3ApiBootstrap = function sqlite3ApiBootstrap(
/**
If v is-a Array, its join("") result is returned. If
isSQLableTypedArray(v) is true then typedArrayToString(v) is
- returned. If it looks like a WASM pointer, wasm.cstringToJs(v) is
+ returned. If it looks like a WASM pointer, wasm.cstrToJs(v) is
returned. Else v is returned as-is.
*/
const flexibleString = function(v){
if(isSQLableTypedArray(v)) return typedArrayToString(v);
else if(Array.isArray(v)) return v.join("");
- else if(wasm.isPtr(v)) v = wasm.cstringToJs(v);
+ else if(wasm.isPtr(v)) v = wasm.cstrToJs(v);
return v;
};
@@ -1339,7 +1339,7 @@ self.sqlite3ApiBootstrap = function sqlite3ApiBootstrap(
let pVfs = capi.sqlite3_vfs_find(0);
while(pVfs){
const oVfs = new capi.sqlite3_vfs(pVfs);
- rc.push(wasm.cstringToJs(oVfs.$zName));
+ rc.push(wasm.cstrToJs(oVfs.$zName));
pVfs = oVfs.$pNext;
oVfs.dispose();
}
diff --git a/ext/wasm/api/sqlite3-vfs-opfs.c-pp.js b/ext/wasm/api/sqlite3-vfs-opfs.c-pp.js
index f5a1eb6cc..99d79641f 100644
--- a/ext/wasm/api/sqlite3-vfs-opfs.c-pp.js
+++ b/ext/wasm/api/sqlite3-vfs-opfs.c-pp.js
@@ -803,7 +803,7 @@ const installOpfsVfs = function callee(options){
const vfsSyncWrappers = {
xAccess: function(pVfs,zName,flags,pOut){
mTimeStart('xAccess');
- const rc = opRun('xAccess', wasm.cstringToJs(zName));
+ const rc = opRun('xAccess', wasm.cstrToJs(zName));
wasm.setMemValue( pOut, (rc ? 0 : 1), 'i32' );
mTimeEnd();
return 0;
@@ -823,7 +823,7 @@ const installOpfsVfs = function callee(options){
},
xDelete: function(pVfs, zName, doSyncDir){
mTimeStart('xDelete');
- opRun('xDelete', wasm.cstringToJs(zName), doSyncDir, false);
+ opRun('xDelete', wasm.cstrToJs(zName), doSyncDir, false);
/* We're ignoring errors because we cannot yet differentiate
between harmless and non-harmless failures. */
mTimeEnd();
@@ -855,7 +855,7 @@ const installOpfsVfs = function callee(options){
C-string here. */
opfsFlags |= state.opfsFlags.OPFS_UNLOCK_ASAP;
}
- zName = wasm.cstringToJs(zName);
+ zName = wasm.cstrToJs(zName);
}
const fh = Object.create(null);
fh.fid = pFile;
@@ -1231,7 +1231,7 @@ const installOpfsVfs = function callee(options){
const readBuf = wasm.scopedAlloc(16);
rc = ioSyncWrappers.xRead(sq3File.pointer, readBuf, 6, 2);
wasm.setMemValue(readBuf+6,0);
- let jRead = wasm.cstringToJs(readBuf);
+ let jRead = wasm.cstrToJs(readBuf);
log("xRead() got:",jRead);
if("sanity"!==jRead) toss("Unexpected xRead() value.");
if(vfsSyncWrappers.xSleep){