1: #include <X/mit-copyright.h>
   2: 
   3: /* $Header: XFetchBuffer.c,v 10.4 86/02/01 15:33:29 tony Rel $ */
   4: /* Copyright    Massachusetts Institute of Technology    1985	*/
   5: 
   6: #include "XlibInternal.h"
   7: 
   8: caddr_t XFetchBuffer (nbytes, buffer)
   9:         register int *nbytes;
  10:     int buffer;
  11: {
  12:     register Display *dpy;
  13:     register XReq *req;
  14:     XRep rep;
  15:     char *data;
  16: 
  17:     GetReq(X_FetchBytes, 0);
  18:     req->func = buffer;
  19:     if (!_XReply(dpy, &rep))
  20:         return(NULL);
  21:     if ((*nbytes = rep.param.s[0]) == 0)
  22:         return (NULL);  /* empty cut buffer */
  23:     if ((data = (char *) malloc(*nbytes)) == NULL) {
  24:         errno = ENOMEM;
  25:         _XIOError(dpy);
  26:         }
  27:     _XReadPad (dpy, data, *nbytes);
  28:     return(data);
  29: }

Defined functions

XFetchBuffer defined in line 8; used 1 times
Last modified: 1986-02-01
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 819
Valid CSS Valid XHTML 1.0 Strict