about summary refs log tree commit diff stats
path: root/gridsel.c
diff options
context:
space:
mode:
Diffstat (limited to 'gridsel.c')
-rw-r--r--gridsel.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/gridsel.c b/gridsel.c
new file mode 100644
index 0000000..c76105e
--- /dev/null
+++ b/gridsel.c
@@ -0,0 +1,47 @@
+/*
+ * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
+ * See LICENSE file for license details.
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <util.h>
+
+static char version[] = "gridsel - " VERSION ", (C)opyright MMVI Anselm R. Garbe\n";
+
+static void
+usage()
+{
+	fprintf(stderr, "%s\n", "usage: gridsel [-v]\n");
+	exit(1);
+}
+
+int
+main(int argc, char **argv)
+{
+	unsigned char *data;
+	unsigned long i, offset, len, remain;
+
+	/* command line args */
+	if(argc > 1) {
+		if(!strncmp(argv[1], "-v", 3)) {
+			fprintf(stdout, "%s", version);
+			exit(0);
+		} else
+			usage();
+	}
+	len = offset = remain = 0;
+	do {
+		data = getselection(offset, &len, &remain);
+		for(i = 0; i < len; i++)
+			putchar(data[i]);
+		offset += len;
+		free(data);
+	}
+	while(remain);
+	if(offset)
+		putchar('\n');
+	return 0;
+}
e previous revision' href='/acidbong/suckless/dwm/blame/dwm.html?id=095f9e143eb1379631f6a0ffc6b923a6f7a687e2'>^
b2e98bf ^





eb184e0 ^



b2e98bf ^
605630c ^
650a1fb ^
eb184e0 ^
650a1fb ^

3791ec0 ^
f777d21 ^
eb184e0 ^


3791ec0 ^





eb184e0 ^



3791ec0 ^

0228dcd ^
eb184e0 ^


3791ec0 ^

eb184e0 ^





d8675f6 ^
eb184e0 ^




3791ec0 ^


eb184e0 ^

3791ec0 ^

eb184e0 ^


6458d72 ^

605630c ^
6649dcc ^
3791ec0 ^
f777d21 ^


650a1fb ^
605630c ^
1e7e57d ^
6649dcc ^
c3e5f5c ^

6649dcc ^

1e7e57d ^

d8675f6 ^

0680c76 ^

d8675f6 ^
3657eae ^
650a1fb ^
6649dcc ^
650a1fb ^

6649dcc ^
650a1fb ^
0dfe729 ^


3657eae ^
6458d72 ^

f60c597 ^
6458d72 ^
f1a34ae ^
650a1fb ^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127