From 310b51c8833cabccb9c606ba243d763b0131df28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20D=C3=A4schle?= Date: Wed, 4 Aug 2021 16:56:08 +0200 Subject: [PATCH] vlib: remove unused `os2` module (#11053) --- vlib/os2/keep_vfmt_happy.v | 2 -- vlib/os2/os2_darwin.c.v | 36 ------------------------------------ vlib/os2/os2_test.v | 11 ----------- 3 files changed, 49 deletions(-) delete mode 100644 vlib/os2/keep_vfmt_happy.v delete mode 100644 vlib/os2/os2_darwin.c.v delete mode 100644 vlib/os2/os2_test.v diff --git a/vlib/os2/keep_vfmt_happy.v b/vlib/os2/keep_vfmt_happy.v deleted file mode 100644 index 4b719f90a6..0000000000 --- a/vlib/os2/keep_vfmt_happy.v +++ /dev/null @@ -1,2 +0,0 @@ -// this keeps vfmt happy -module os2 diff --git a/vlib/os2/os2_darwin.c.v b/vlib/os2/os2_darwin.c.v deleted file mode 100644 index b04ee115ae..0000000000 --- a/vlib/os2/os2_darwin.c.v +++ /dev/null @@ -1,36 +0,0 @@ -module os2 - -#include - -struct File { - fd int -} - -fn C.perror(&char) - -fn C.open(&byte, int, int) int - -fn C.write(voidptr, &byte, int) int - -fn C.close(int) int - -pub fn create(path string) ?File { - fd := C.open(path.str, C.O_CREAT | C.O_TRUNC | C.O_WRONLY, o644) // 511 - if fd == -1 { - return error('failed to create "$path":') - // os.print_c_errno() - } - return File{fd} -} - -pub fn (f File) writeln(s string) { - ss := s + '\n' - ret := C.write(f.fd, ss.str, s.len + 1) - if ret == -1 { - C.perror('failed to write') - } -} - -pub fn (f File) close() { - C.close(f.fd) -} diff --git a/vlib/os2/os2_test.v b/vlib/os2/os2_test.v deleted file mode 100644 index 997e3413bc..0000000000 --- a/vlib/os2/os2_test.v +++ /dev/null @@ -1,11 +0,0 @@ -// import os2 - -fn test_open() { - /* - $if macos { - f := os2.create('os2.test') - f.writeln('hello world!') - f.close() - } - */ -}