Annotation of 43BSDTahoe/new/X/Xlib/XFontWidths.c, revision 1.1.1.1

1.1       root        1: #include <X/mit-copyright.h>
                      2: 
                      3: /* $Header: XFontWidths.c,v 10.6 86/04/22 15:21:46 jg Rel $ */
                      4: /* Copyright    Massachusetts Institute of Technology    1985  */
                      5: 
                      6: #include "XlibInternal.h"
                      7: 
                      8: short *XFontWidths (font)
                      9:        Font font;
                     10: {
                     11:        register Display *dpy;
                     12:        register XReq *req;
                     13:        XRep rep;
                     14:        short *buf;
                     15:        int nbytes;
                     16: 
                     17:        GetReq(X_FontWidths, 0);
                     18:        req->param.l[0] = font;
                     19:        if (!_XReply(dpy, &rep))
                     20:            return(NULL);
                     21:        nbytes = rep.param.l[0];
                     22:        if ((buf = (short *) malloc(nbytes*sizeof(short)/psizeof(short))) == NULL) {
                     23:            errno = ENOMEM;
                     24:            _XIOError(dpy);
                     25:        }
                     26: #ifdef BIGSHORTS
                     27:        {
                     28:         ushort_p *proto_shorts = (ushort_p *) malloc (nbytes);
                     29:        _XReadPad (dpy, (char *)proto_shorts, nbytes);
                     30:        UnpackShorts(proto_shorts, buf, nbytes);
                     31:        free((char *)proto_shorts);
                     32:        }
                     33: #else
                     34:        _XReadPad(dpy, (char *)buf, nbytes);
                     35: #endif
                     36:        return (buf);
                     37: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.