summaryrefslogtreecommitdiffstats
path: root/mbbsd/chc_net.c
blob: b9f63d8f07e378ec1bbc376c5172e541be8c291f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* $Id: chc_net.c,v 1.2 2002/06/04 13:08:33 in2 Exp $ */
#include "bbs.h"
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));
}