|
|
1.1 ! root 1: .NH 2 ! 2: Cut Buffer Operations ! 3: .PP ! 4: .IN "Cut Buffers" ! 5: .IN "Paste Buffers" ! 6: X provides areas of memory in which bytes can be stored for implementing ! 7: cut and paste between windows. ! 8: It is up to applications to agree what the representation of the ! 9: data in the buffers are. ! 10: The data is most often ascii text. ! 11: Eight such buffers are provided, which can be accessed as a ring, ! 12: or as explicit buffers, numbered 0 through 7. ! 13: .FD ! 14: .IN "Definitions" "XStoreBytes" ! 15: .IN "XStoreBytes" ! 16: XStoreBytes (bytes, length) ! 17: char *bytes; /* NOT necessarily ascii or null-terminated */ ! 18: int length; /* number of bytes */ ! 19: .FN ! 20: \fIXStoreBytes\fP stores an arbitrary string of \fIbytes\fP ! 21: in cut buffer number 0. ! 22: The cut buffer's contents may be retrieved later by ! 23: .IN "XFetchBytes" ! 24: any client calling \fIXFetchBytes\fP. ! 25: .PP ! 26: The number of bytes to be stored is given in the parameter \fIlength\fP. ! 27: Note that the cut buffer's contents need not be text, so null bytes ! 28: are not special. ! 29: .FD ! 30: .IN "Definitions" "XFetchBytes" ! 31: .IN "XFetchBytes" ! 32: char *XFetchBytes (nbytes) ! 33: int *nbytes; /* RETURN */ ! 34: .FN ! 35: \fIXFetchBytes\fP retrieves the contents of cut buffer 0. ! 36: If the buffer contains data, ! 37: it returns the number of bytes in the \fInbytes\fP argument, ! 38: otherwise it returns NULL and sets \fInbytes\fP to 0. ! 39: The appropriate amount of storage is ``malloc'ed'' and the pointer returned; ! 40: the client must free this storage when finished with it. ! 41: .PP ! 42: Note that the cut buffer does not necessarily contain text, so it may ! 43: contain embedded null bytes and may not terminate with a null byte. ! 44: .FD ! 45: .IN "Definitions" "XRotateBuffers" ! 46: .IN "XRotateBuffers" ! 47: XRotateBuffers (n) ! 48: int n; ! 49: .FN ! 50: Rotates the cut buffers by n. ! 51: Buffer 0 becomes buffer n, buffer 1 becomes n+1 mod 8, and so on. ! 52: This cut buffer numbering is global to the display. ! 53: .FD ! 54: .IN "Definitions" "XStoreBuffer" ! 55: .IN "XStoreBuffer" ! 56: XStoreBuffer (bytes, nbytes, buffer) ! 57: char *bytes; /* NOT necessarily ascii or null-terminated */ ! 58: int nbytes; /* number of bytes */ ! 59: int buffer; ! 60: .FN ! 61: \fIXStoreBuffer\fP is just like \fIXStoreBytes\fP, ! 62: except that it stores in the ! 63: specified \fIbuffer\fP instead of in buffer 0. ! 64: .FD ! 65: .IN "Definitions" "XFetchBuffer" ! 66: .IN "XFetchBuffer" ! 67: char *XFetchBuffer (nbytes, buffer) ! 68: int *nbytes; /* RETURN */ ! 69: int buffer; ! 70: .FN ! 71: \fIXFetchBuffer\fP is just like \fIXFetchBytes\fP, ! 72: except that it fetches the contents ! 73: of the specified \fIbuffer\fP instead of buffer 0.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.