summaryrefslogtreecommitdiffstats
path: root/mbbsd/chc_net.c
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-03-07 23:13:44 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-03-07 23:13:44 +0800
commitae31e19f92e717919ac8e3db9039eb38d2b89aae (patch)
treec70164d6a1852344f44b04a653ae2815043512af /mbbsd/chc_net.c
downloadpttbbs-ae31e19f92e717919ac8e3db9039eb38d2b89aae.tar
pttbbs-ae31e19f92e717919ac8e3db9039eb38d2b89aae.tar.gz
pttbbs-ae31e19f92e717919ac8e3db9039eb38d2b89aae.tar.bz2
pttbbs-ae31e19f92e717919ac8e3db9039eb38d2b89aae.tar.lz
pttbbs-ae31e19f92e717919ac8e3db9039eb38d2b89aae.tar.xz
pttbbs-ae31e19f92e717919ac8e3db9039eb38d2b89aae.tar.zst
pttbbs-ae31e19f92e717919ac8e3db9039eb38d2b89aae.zip
Initial revision
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@1 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/chc_net.c')
-rw-r--r--mbbsd/chc_net.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/mbbsd/chc_net.c b/mbbsd/chc_net.c
new file mode 100644
index 00000000..d094d5f2
--- /dev/null
+++ b/mbbsd/chc_net.c
@@ -0,0 +1,28 @@
+/* $Id: chc_net.c,v 1.1 2002/03/07 15:13:48 in2 Exp $ */
+#include <stdio.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include "config.h"
+#include "pttstruct.h"
+
+extern rc_t chc_from, chc_to;
+
+typedef struct drc_t {
+ rc_t from, to;
+} drc_t;
+
+int chc_recvmove(int s) {
+ drc_t buf;
+
+ if(read(s, &buf, sizeof(buf)) != sizeof(buf))
+ return 1;
+ chc_from = buf.from, chc_to = buf.to;
+ return 0;
+}
+
+void chc_sendmove(int s) {
+ drc_t buf;
+
+ buf.from = chc_from, buf.to = chc_to;
+ write(s, &buf, sizeof(buf));
+}