aboutsummaryrefslogtreecommitdiffhomepage
path: root/common.h
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2025-10-18 18:12:19 +0200
committerlemon <lsof@mailbox.org>2025-10-18 18:12:19 +0200
commit99adb48d94c59cb2e5701ca39d7c40d4f63459b3 (patch)
treebe3c432db54dd7f4e1ceab70848543bba1a4ead8 /common.h
parentffca6b54a9654005a121c3557bb8b245ae65ce55 (diff)
#pragma once
Diffstat (limited to 'common.h')
-rw-r--r--common.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/common.h b/common.h
index c5b7513..c6ebf9d 100644
--- a/common.h
+++ b/common.h
@@ -29,11 +29,12 @@ typedef unsigned uint;
#define arraylength(a) (sizeof(a) / sizeof 0[a])
struct bytes { uchar *p; uint n; };
+enum { SPANFILEBITS = 10 };
struct span {
struct span0 {
uint off;
- uint len : 24,
- file : 8;
+ uint len : 32-SPANFILEBITS,
+ file : SPANFILEBITS;
} sl, /* original source location */
ex; /* the location after #include/macro expansion */
};
@@ -571,6 +572,10 @@ const char *getfilename(int id);
struct memfile *getfile(int id);
void addfileline(int id, uint off);
void getfilepos(int *line, int *col, int id, uint off);
+bool isoncefile(int id);
+void markfileonce(int id);
+void markfileseen(int id);
+bool isfileseen(int id);
void closefile(int id);
void fatal(const struct span *, const char *, ...);
void error(const struct span *, const char *, ...);