1 /* wxpaste.c- paste contents of cutbuffer to stdout
3 * Copyright (c) 1997 Alfredo K. Kojima
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 #define LINESIZE (4*1024)
31 printf("usage: %s [-cutbuffer number]\n", progn
);
35 main(int argc
, char **argv
)
42 for (i
=1; i
<argc
; i
++) {
43 if (argv
[i
][0]=='-') {
44 if (argv
[i
][1]=='h') {
47 } else if (strcmp(argv
[i
],"-cutbuffer")==0) {
50 if (sscanf(argv
[i
],"%i", &buffer
)!=1) {
51 printf("%s: could not convert \"%s\" to int\n",
55 if (buffer
<0 || buffer
> 7) {
56 printf("%s: invalid buffer number %i\n", argv
[0],
70 dpy
= XOpenDisplay("");
72 printf("%s: could not open display\n", argv
[0]);
75 buf
=XFetchBuffer(dpy
, &l
, buffer
);