|
|
1.1 root 1: #include "copyright.h"
2:
3: /* $Header: XHost.c,v 11.8 87/09/11 08:08:38 toddb Exp $ */
4: /* Copyright Massachusetts Institute of Technology 1986 */
5: /* this might be rightly reguarded an os dependent file */
6:
7: #include "Xlibint.h"
8:
9: XAddHost (dpy, host)
10: register Display *dpy;
11: XHostAddress *host;
12: {
13: register xChangeHostsReq *req;
14: register int length = (host->length + 3) & ~0x3; /* round up */
15:
16: LockDisplay(dpy);
17: GetReqExtra (ChangeHosts, length, req);
18: req->mode = HostInsert;
19: req->hostFamily = host->family;
20: req->hostLength = host->length;
21: bcopy (host->address, (char *) (req + 1), host->length);
22: UnlockDisplay(dpy);
23: SyncHandle();
24: }
25:
26: XRemoveHost (dpy, host)
27: register Display *dpy;
28: XHostAddress *host;
29: {
30: register xChangeHostsReq *req;
31: register int length = (host->length + 3) & ~0x3; /* round up */
32:
33: LockDisplay(dpy);
34: GetReqExtra (ChangeHosts, length, req);
35: req->mode = HostDelete;
36: req->hostFamily = host->family;
37: req->hostLength = host->length;
38: bcopy (host->address, (char *) (req + 1), host->length);
39: UnlockDisplay(dpy);
40: SyncHandle();
41: }
42:
43:
44: XAddHosts (dpy, hosts, n)
45: register Display *dpy;
46: XHostAddress *hosts;
47: int n;
48: {
49: register int i;
50: for (i = 0; i < n; i++) {
51: XAddHost(dpy, &hosts[i]);
52: }
53: }
54:
55: XRemoveHosts (dpy, hosts, n)
56: register Display *dpy;
57: XHostAddress *hosts;
58: int n;
59: {
60: register int i;
61: for (i = 0; i < n; i++) {
62: XRemoveHost(dpy, &hosts[i]);
63: }
64: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.