aboutsummaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2024-03-28 18:50:23 +0000
committerubq323 <ubq323@ubq323.website>2024-03-28 18:50:23 +0000
commit1762e9f622c7a9045e6ea23a92a81d7dfa5dadda (patch)
tree78df664636234ccdd8de761bdda65339ed22d441 /server
parent52557c8a1c78ee02bd0eda1c740a37f8d6759b0c (diff)
reörganize
Diffstat (limited to 'server')
-rw-r--r--server/main.ha43
1 files changed, 43 insertions, 0 deletions
diff --git a/server/main.ha b/server/main.ha
new file mode 100644
index 0000000..43bdf34
--- /dev/null
+++ b/server/main.ha
@@ -0,0 +1,43 @@
+use fmt;
+use os;
+use io;
+use fs;
+use errors;
+use drawing::{pos};
+
+// type chunk = struct {
+// fd: io::file,
+// d: []u32,
+// };
+
+// def CHUNKSIZE: size = 512;
+// def CHUNK_LENGTH: size = CHUNKSIZE*CHUNKSIZE*size(u32);
+
+// fn open_chunk_file(chunkpos: pos) (chunk | fs::error) = {
+// const path = fmt::asprintf("c.{}.{}.dat", chunkpos.0, chunkpos.1);
+// defer free(path);
+// const fd = fs::create_file(os::cwd, path,
+// fs::mode::USER_RW | fs::mode::GROUP_RW,
+// fs::flag::RDWR)?;
+// io::trunc(fd, CHUNK_LENGTH)?;
+// const dp = io::mmap(null, CHUNK_LENGTH,
+// io::prot::READ | io::prot::WRITE,
+// io::mflag::SHARED,
+// fd, 0)?;
+// const d = (dp: *[*]u32)[..CHUNKSIZE*CHUNKSIZE];
+// return chunk { fd = fd, d = d };
+// };
+
+export fn main() void = {
+ // match (open_chunk_file((-3,12))) {
+ // case let e: fs::error =>
+ // fmt::fatal(fs::strerror(e));
+ // case let ch: chunk =>
+ // ch.d[0] = 0x12345678;
+ // ch.d[CHUNKSIZE*CHUNKSIZE - 1]=0xdeadbeef;
+ // };
+
+ const t = test2 { a=4, b=5 };
+ thethe(&t);
+
+};