Skip to content

Commit

Permalink
Remove unnecessary times import.
Browse files Browse the repository at this point in the history
  • Loading branch information
yskszk63 committed Jul 16, 2022
1 parent 28f816c commit 7cf3ada
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ This is my experimental hobby project.
4. `WASI_SDK_PATH=/opt/wasi-sdk cargo wasi build --release`
5. `ls target/wasm32-wasi/release/libwasinodot.wasm`

## How to run

### cli

`echo 'graph { ok; }' | wasmtime target/wasm32-wasi/release/wasinodot.wasm`

### Browser

1. `cp target/wasm32-wasi/release/libwasinodot.wasm web/public/libwasinodot.wasm`
2. `cd web && npm ci && npm run dev`

## License

[MIT](LICENSE)
7 changes: 6 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::os::raw::{c_char, c_int};
use sys::{agclose, agmemread, gvAddLibrary, Agraph_t};

pub mod stub {
use std::os::raw::c_int;
use std::os::raw::{c_int, c_longlong};

#[no_mangle]
pub extern "C" fn tmpfile() -> c_int {
Expand All @@ -27,6 +27,11 @@ pub mod stub {
pub extern "C" fn longjmp(_env: jmp_buf, _val: c_int) {
unimplemented!();
}

#[no_mangle]
pub extern "C" fn times(_: c_int) -> c_longlong {
unimplemented!();
}
}

pub(crate) mod sys {
Expand Down
Binary file modified web/public/libwasinodot.wasm
Binary file not shown.
3 changes: 0 additions & 3 deletions web/src/lib/libgraphviz.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ export class LibGraphviz {
const instance = await WebAssembly.instantiate(module, {
...wasi.getImports(module),
env: {
times() {
throw new Error("not implemented.");
},
handle_err(buf: number, len: number) {
const mem = instance.exports.memory as WebAssembly.Memory;
const msg = new Uint8Array(mem.buffer, buf, len);
Expand Down

1 comment on commit 7cf3ada

@vercel
Copy link

@vercel vercel bot commented on 7cf3ada Jul 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

wasinodot – ./

wasinodot-git-main-yskszk63.vercel.app
wasinodot.vercel.app
wasinodot-yskszk63.vercel.app

Please sign in to comment.