commit 9fb0055e78430ab8713d0f5ca585d54def5d4a4a
parent 041c9b4770b933bdc2338cdbf4afe5af4d9a0396
Author: Virgil Dupras <hsoft@hardcoded.net>
Date: Wed, 14 Sep 2022 14:12:26 -0400
app/cos: blkpack almost compiles...
Diffstat:
3 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/fs/app/cos/tools/blkpack.c b/fs/app/cos/tools/blkpack.c
@@ -1,4 +1,5 @@
// This doesn't actually work, I'm just drafting how it would look.
+// TODO: add ! operator
#[ 10 const BUMP_GRANULARITY ]#
@@ -14,10 +15,8 @@ void emptylines(int n)
int getmarker(char *line) // returns -1 on error, blkid otherwise
{
- int blkid;
- int r = sscanf(line, "( ----- %d )\n", &blkid);
- if (r == 1) {
- return blkid;
+ if (sscanf("( ----- %d )\n", line)) {
+ return pspop();
} else {
return -1;
}
diff --git a/fs/app/cos/tools/blkpack.fs b/fs/app/cos/tools/blkpack.fs
@@ -0,0 +1,3 @@
+?f<< /cc/lib.fs
+cc<< /app/cos/tools/blkpack.c
+
diff --git a/fs/cc/lib.fs b/fs/cc/lib.fs
@@ -1,5 +1,6 @@
\ C library
\ Isn't needed by the compiler, so it can have C code.
+?f<< /cc/cc.fs
?f<< /lib/str.fs
0 const NULL