Configuration file for DWM on MacBook Air
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
826 B

  1. /*
  2. * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
  3. * See LICENSE file for license details.
  4. */
  5. #include <stdlib.h>
  6. #include <stdio.h>
  7. #include <string.h>
  8. #include <util.h>
  9. static char version[] = "gridsel - " VERSION ", (C)opyright MMVI Anselm R. Garbe\n";
  10. static void
  11. usage()
  12. {
  13. fprintf(stderr, "%s\n", "usage: gridsel [-v]\n");
  14. exit(1);
  15. }
  16. int
  17. main(int argc, char **argv)
  18. {
  19. unsigned char *data;
  20. unsigned long i, offset, len, remain;
  21. /* command line args */
  22. if(argc > 1) {
  23. if(!strncmp(argv[1], "-v", 3)) {
  24. fprintf(stdout, "%s", version);
  25. exit(0);
  26. } else
  27. usage();
  28. }
  29. len = offset = remain = 0;
  30. do {
  31. data = getselection(offset, &len, &remain);
  32. for(i = 0; i < len; i++)
  33. putchar(data[i]);
  34. offset += len;
  35. free(data);
  36. }
  37. while(remain);
  38. if(offset)
  39. putchar('\n');
  40. return 0;
  41. }