summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-08-17 20:31:56 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-08-17 20:31:56 +0800
commit30ae3eb353c54ba06efab9b776efdec11983cb6b (patch)
treeca4a01c04e328c49f3932bf579785472487e21f0 /include
parent080973599028776d184e4526c58fab5dc1cec8bd (diff)
downloadpttbbs-30ae3eb353c54ba06efab9b776efdec11983cb6b.tar
pttbbs-30ae3eb353c54ba06efab9b776efdec11983cb6b.tar.gz
pttbbs-30ae3eb353c54ba06efab9b776efdec11983cb6b.tar.bz2
pttbbs-30ae3eb353c54ba06efab9b776efdec11983cb6b.tar.lz
pttbbs-30ae3eb353c54ba06efab9b776efdec11983cb6b.tar.xz
pttbbs-30ae3eb353c54ba06efab9b776efdec11983cb6b.tar.zst
pttbbs-30ae3eb353c54ba06efab9b776efdec11983cb6b.zip
outta cache
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@475 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'include')
-rw-r--r--include/bbs.h10
-rw-r--r--include/outtacache.h28
-rw-r--r--include/proto.h8
3 files changed, 39 insertions, 7 deletions
diff --git a/include/bbs.h b/include/bbs.h
index 1b2a0d38..a56ee944 100644
--- a/include/bbs.h
+++ b/include/bbs.h
@@ -32,6 +32,7 @@
#include <sys/ipc.h>
#include <sys/shm.h>
#include <sys/sem.h>
+#include <sys/msg.h>
#include "config.h"
#include "pttstruct.h"
@@ -42,11 +43,14 @@
#include "gomo.h"
#ifndef INCLUDE_VAR_H
- #include "var.h"
+ #include "var.h"
+#endif
+#ifdef OUTTA_CACHE
+ #include "outtacache.h"
#endif
#ifdef FreeBSD
- #include <machine/limits.h>
+ #include <machine/limits.h>
#else
- #include <limits.h>
+ #include <limits.h>
#endif
#endif /* INCLUDE_BBS_H */
diff --git a/include/outtacache.h b/include/outtacache.h
new file mode 100644
index 00000000..90756cde
--- /dev/null
+++ b/include/outtacache.h
@@ -0,0 +1,28 @@
+#ifndef INCLUDE_OUTTACACHE_H
+#define INCLUDE_OUTTACACHE_H
+
+#define CACHE_BUFSIZE (200*1024)
+#define OC_HEADERLEN (sizeof(OCkey_t) + sizeof(int))
+#define OC_KEYLEN (sizeof(OCkey_t))
+#define OC_pidadd 10000000
+#define OC_msto 5111
+#define OC_mtos 5112
+
+typedef struct {
+ pid_t pid;
+ char cacheid;
+} OCkey_t;
+
+typedef struct {
+ OCkey_t key;
+ int length;
+ char buf[CACHE_BUFSIZE];
+} OCbuf_t;
+
+
+typedef struct {
+ time_t mtime;
+ OCbuf_t data;
+} OCstore_t;
+
+#endif
diff --git a/include/proto.h b/include/proto.h
index 47f45517..858f0a8b 100644
--- a/include/proto.h
+++ b/include/proto.h
@@ -1,4 +1,4 @@
-/* $Id: proto.h,v 1.25 2002/08/06 09:02:59 in2 Exp $ */
+/* $Id: proto.h,v 1.26 2002/08/17 12:31:55 in2 Exp $ */
#ifndef INCLUDE_PROTO_H
#define INCLUDE_PROTO_H
@@ -118,11 +118,11 @@ int get_fileheader_cache(int bid, char *direct, fileheader_t *headers,
void *attach_shm(int shmkey, int shmsize);
void attach_SHM(void);
#ifdef OUTTA_CACHE
-void outta_swapout(void **ptr, int length, char cacheid);
-void outta_swapin(void **ptr, int length, char cacheid);
+void *outta_malloc(size_t size, char id);
+void outta_swapout(void **inptr);
+void *outta_swapin(void **inptr, char cacheid);
#endif
-
/* cal */
int give_tax(int money);
int vice(int money, char* item);