|
| 1 | +<!DOCTYPE html> |
| 2 | +<html lang="en"> |
| 3 | + <head> |
| 4 | + <meta charset="utf-8"> |
| 5 | + <title>title</title> |
| 6 | + <script> |
| 7 | + const importObject = { |
| 8 | + ic0: { |
| 9 | + debug_print: console.log, |
| 10 | + }, |
| 11 | + // wasi_snapshot_preview1: { |
| 12 | + // args_get: (...args) => console.log("args_get", ...args), |
| 13 | + // args_sizes_get: (...args) => console.log("args_sizes_get", ...args), |
| 14 | + // clock_res_get: (...args) => console.log("clock_res_get", ...args), |
| 15 | + // clock_time_get: (...args) => console.log("clock_time_get", ...args), |
| 16 | + // environ_get: (...args) => console.log("environ_get", ...args), |
| 17 | + // environ_sizes_get: (...args) => console.log("environ_sizes_get", ...args), |
| 18 | + // fd_advise: (...args) => console.log("fd_advise", ...args), |
| 19 | + // fd_allocate: (...args) => console.log("fd_allocate", ...args), |
| 20 | + // fd_close: (...args) => console.log("fd_close", ...args), |
| 21 | + // fd_datasync: (...args) => console.log("fd_datasync", ...args), |
| 22 | + // fd_fdstat_get: (...args) => console.log("fd_fdstat_get", ...args), |
| 23 | + // fd_fdstat_set_flags: (...args) => console.log("fd_fdstat_set_flags", ...args), |
| 24 | + // fd_fdstat_set_rights: (...args) => console.log("fd_fdstat_set_rights", ...args), |
| 25 | + // fd_filestat_get: (...args) => console.log("fd_filestat_get", ...args), |
| 26 | + // fd_filestat_set_size: (...args) => console.log("fd_filestat_set_size", ...args), |
| 27 | + // fd_filestat_set_times: (...args) => console.log("fd_filestat_set_times", ...args), |
| 28 | + // fd_pread: (...args) => console.log("fd_pread", ...args), |
| 29 | + // /* fd_prestat_dir_name: (...args) => console.log("fd_prestat_dir_name", ...args), */ |
| 30 | + // fd_prestat_dir_name: () => {}, |
| 31 | + // /* fd_prestat_get: (...args) => console.log("fd_prestat_get", ...args), */ |
| 32 | + // fd_prestat_get: () => {}, |
| 33 | + // fd_pwrite: (...args) => console.log("fd_pwrite", ...args), |
| 34 | + // fd_read: (...args) => console.log("fd_read", ...args), |
| 35 | + // fd_readdir: (...args) => console.log("fd_readdir", ...args), |
| 36 | + // fd_renumber: (...args) => console.log("fd_renumber", ...args), |
| 37 | + // fd_seek: (...args) => console.log("fd_seek", ...args), |
| 38 | + // fd_sync: (...args) => console.log("fd_sync", ...args), |
| 39 | + // fd_tell: (...args) => console.log("fd_tell", ...args), |
| 40 | + // fd_write: (...args) => console.log("fd_write", ...args), |
| 41 | + // path_create_directory: (...args) => console.log("path_create_directory", ...args), |
| 42 | + // path_filestat_get: (...args) => console.log("path_filestat_get", ...args), |
| 43 | + // path_filestat_set_times: (...args) => console.log("path_filestat_set_times", ...args), |
| 44 | + // path_link: (...args) => console.log("path_link", ...args), |
| 45 | + // path_open: (...args) => console.log("path_open", ...args), |
| 46 | + // path_readlink: (...args) => console.log("path_readlink", ...args), |
| 47 | + // path_remove_directory: (...args) => console.log("path_remove_directory", ...args), |
| 48 | + // path_rename: (...args) => console.log("path_rename", ...args), |
| 49 | + // path_symlink: (...args) => console.log("path_symlink", ...args), |
| 50 | + // path_unlink_file: (...args) => console.log("path_unlink_file", ...args), |
| 51 | + // poll_oneoff: (...args) => console.log("poll_oneoff", ...args), |
| 52 | + // proc_exit: (...args) => console.log("proc_exit", ...args), |
| 53 | + // proc_raise: (...args) => console.log("proc_raise", ...args), |
| 54 | + // random_get: (...args) => console.log("random_get", ...args), |
| 55 | + // sched_yield: (...args) => console.log("sched_yield", ...args), |
| 56 | + // sock_recv: (...args) => console.log("sock_recv", ...args), |
| 57 | + // sock_send: (...args) => console.log("sock_send", ...args), |
| 58 | + // sock_shutdown: (...args) => console.log("sock_shutdown", ...args), |
| 59 | + // } |
| 60 | + }; |
| 61 | + |
| 62 | + WebAssembly.instantiateStreaming(fetch(".build/wasm32-unknown-wasi/release/API.wasm"), importObject) |
| 63 | + .then((obj) => { |
| 64 | + console.log("obj", obj); |
| 65 | + |
| 66 | + obj.instance.exports.canister_init(); |
| 67 | + }) |
| 68 | + .catch(console.error); |
| 69 | + </script> |
| 70 | + </head> |
| 71 | + <body> |
| 72 | + </body> |
| 73 | +</html> |
0 commit comments