aboutsummaryrefslogtreecommitdiff
path: root/include/venti.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/venti.h')
-rw-r--r--include/venti.h41
1 files changed, 36 insertions, 5 deletions
diff --git a/include/venti.h b/include/venti.h
index 7b14c1ae..ed50d680 100644
--- a/include/venti.h
+++ b/include/venti.h
@@ -4,6 +4,11 @@
extern "C" {
#endif
+#ifndef PLAN9PORT
+#pragma lib "libventi.a"
+#pragma src "/sys/src/libventi"
+#endif
+
AUTOLIB(venti)
/* XXX should be own library? */
@@ -38,12 +43,38 @@ int packetcmp(Packet*, Packet*);
void packetstats(void);
void packetsha1(Packet*, uchar sha1[20]);
-/* XXX begin actual venti.h */
+/* XXX should be own library? */
+/*
+ * Logging
+ */
+typedef struct VtLog VtLog;
+typedef struct VtLogChunk VtLogChunk;
-#ifndef PLAN9PORT
-#pragma lib "libventi.a"
-#pragma src "/sys/src/libventi"
-#endif
+struct VtLog
+{
+ VtLog *next; /* in hash table */
+ VtLogChunk *chunk;
+ uint nchunk;
+ VtLogChunk *w;
+ QLock lk;
+ int ref;
+};
+
+struct VtLogchunk
+{
+ char *buf;
+ uint nbuf;
+ char *w;
+};
+
+VtLog *vtlogopen(char *name, uint size);
+void vtlogprint(VtLog *log, char *fmt, ...);
+void vtlog(char *name, char *fmt, ...);
+void vtlogclose(char *name);
+void vtlogremove(char *name);
+int vtlogdump(int fd, VtLog*);
+
+/* XXX begin actual venti.h */
typedef struct VtFcall VtFcall;
typedef struct VtConn VtConn;