sselp

simple X selection printer to stdout
git clone git://git.suckless.org/sselp
Log | Files | Refs | README | LICENSE

commit 6968ea0b2dd060ef26def8f9d269959f07e10e44
parent 90934448fe2991df6f95e5b07ef62eb4f260957f
Author: Anselm R Garbe <garbeam@gmail.com>
Date:   Tue, 29 Jul 2008 19:05:33 +0100

prepared new sselp release
Diffstat:
README | 6+++---
sselp.c | 13++++---------
2 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/README b/README @@ -10,11 +10,11 @@ In order to build sselp you need the Xlib header files. Installation ------------ -Edit config.mk to match your local setup (swarp is installed into +Edit config.mk to match your local setup (sselp is installed into the /usr/local namespace by default). -Afterwards enter the following command to build and install swarp (if -necessary as root): +Afterwards enter the following command to build and install sselp +(if necessary as root): make clean install diff --git a/sselp.c b/sselp.c @@ -1,5 +1,4 @@ -/* See LICENSE file for license details. - */ +/* See LICENSE file for license details. */ #include <stdlib.h> #include <stdio.h> #include <string.h> @@ -7,10 +6,8 @@ #include <X11/Xatom.h> #include <X11/Xutil.h> -/* static */ - static unsigned char * -getselection(unsigned long offset, unsigned long *len, unsigned long *remain) { +getsel(unsigned long offset, unsigned long *len, unsigned long *remain) { Display *dpy; Atom utf8_string; Atom xa_clip_string; @@ -46,20 +43,18 @@ getselection(unsigned long offset, unsigned long *len, unsigned long *remain) { return result; } -/* extern */ - int main(int argc, char **argv) { unsigned char *data; unsigned long i, offset, len, remain; if((argc > 1) && !strncmp(argv[1], "-v", 3)) { - fputs("sselp-"VERSION", © 2006-2008 Anselm R. Garbe\n", stdout); + fputs("sselp-"VERSION", © 2006-2008 Anselm R Garbe\n", stdout); exit(EXIT_SUCCESS); } len = offset = remain = 0; do { - data = getselection(offset, &len, &remain); + data = getsel(offset, &len, &remain); for(i = 0; i < len; i++) putchar(data[i]); offset += len;