|
|
1.1 root 1: #include "copyright.h"
2:
3: /* $Header: XSetFPath.c,v 11.10 87/09/11 08:06:49 toddb Exp $ */
4: /* Copyright Massachusetts Institute of Technology 1986 */
5:
6: #include "Xlibint.h"
7:
8: XSetFontPath (dpy, directories, ndirs)
9: register Display *dpy;
10: char **directories;
11: int ndirs;
12: {
13: register int n = 0;
14: register int i;
15: register int nbytes;
16: char *p;
17: register xSetFontPathReq *req;
18:
19: LockDisplay(dpy);
20: GetReq (SetFontPath, req);
21: req->nFonts = ndirs;
22: for (i = 0; i < ndirs; i++) {
23: n += strlen (directories[i]) + 1;
24: }
25: nbytes = (n + 3) & ~3;
26: BufAlloc (char *, p, nbytes);
27: /*
28: * pack into counted strings.
29: */
30: for (i = 0; i < ndirs; i++) {
31: register int length = strlen (directories[i]);
32: *p = length;
33: bcopy (directories[i], p + 1, length);
34: p += length + 1;
35: }
36: req->length += nbytes >> 2;
37: UnlockDisplay(dpy);
38: SyncHandle();
39: }
40:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.