diff --git a/NEWS.md b/NEWS.md index d35ef50..fb58bca 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,17 +1,18 @@ -Release 1.2-r135 (27 May 2024) +Release 1.2-r137 (27 May 2024) ------------------------------ New functions: - * `read_file()`: read an entire file as an ArrayBuffer - * `decode()`: convert an ArrayBuffer/Bytes object to a string - * `encode()`: convert a string to an ArrayBuffer + * `k8_read_file()`: read an entire file as an ArrayBuffer + * `k8_decode()`: convert an ArrayBuffer/Bytes object to a string + * `k8_encode()`: convert a string to an ArrayBuffer + * `k8_revcomp()`: reverse complement a DNA sequence Improved: - * `Bytes.read()`: more flexible API to read the rest of a file + * `Bytes.read()`: allow to read the rest of a file -(1.2: 27 May 2024, r135) +(1.2: 27 May 2024, r137) diff --git a/README.md b/README.md index 5899f1b..1871210 100644 --- a/README.md +++ b/README.md @@ -71,20 +71,20 @@ function exit(code: number) function load(fileName: string) // Read entire file as an ArrayBuffer -function read_file(fileName: string): ArrayBuffer +function k8_read_file(fileName: string): ArrayBuffer // Decode $buf to string under the $enc encoding; only "utf-8" is supported for now // Missing or unknown encoding is treated as Latin-1 -function decode(buf: ArrayBuffer|Bytes, enc?: string): string +function k8_decode(buf: ArrayBuffer|Bytes, enc?: string): string // Encode $str into an ArrayBuffer -function encode(str: string, enc?: string): ArrayBuffer +function k8_encode(str: string, enc?: string): ArrayBuffer // Reverse complement a DNA sequence in string -function revcomp(seq: string): string +function k8_revcomp(seq: string): string // Reverse complement a DNA sequence in place -function revcomp(seq: ArrayBuffer|Bytes) +function k8_revcomp(seq: ArrayBuffer|Bytes) // Get version string function k8_version() diff --git a/k8.cc b/k8.cc index edd96c9..680b49f 100644 --- a/k8.cc +++ b/k8.cc @@ -23,7 +23,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#define K8_VERSION "1.1-r136-dirty" +#define K8_VERSION "1.2-r137" #include #include @@ -911,10 +911,10 @@ static v8::Local k8_create_shell_context(v8::Isolate* isolate) global->Set(isolate, "warn", v8::FunctionTemplate::New(isolate, k8_warn)); global->Set(isolate, "exit", v8::FunctionTemplate::New(isolate, k8_exit)); global->Set(isolate, "load", v8::FunctionTemplate::New(isolate, k8_load)); - global->Set(isolate, "read_file", v8::FunctionTemplate::New(isolate, k8_read_file)); - global->Set(isolate, "encode", v8::FunctionTemplate::New(isolate, k8_encode)); - global->Set(isolate, "decode", v8::FunctionTemplate::New(isolate, k8_decode)); - global->Set(isolate, "revcomp", v8::FunctionTemplate::New(isolate, k8_revcomp)); + global->Set(isolate, "k8_read_file", v8::FunctionTemplate::New(isolate, k8_read_file)); + global->Set(isolate, "k8_encode", v8::FunctionTemplate::New(isolate, k8_encode)); + global->Set(isolate, "k8_decode", v8::FunctionTemplate::New(isolate, k8_decode)); + global->Set(isolate, "k8_revcomp", v8::FunctionTemplate::New(isolate, k8_revcomp)); global->Set(isolate, "k8_version", v8::FunctionTemplate::New(isolate, k8_version)); { // add the 'Bytes' object v8::HandleScope scope(isolate);