My dmenu build
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 
 
 

47 Zeilen
744 B

  1. /*
  2. * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
  3. * See LICENSE file for license details.
  4. */
  5. #include "dmenu.h"
  6. #include <stdarg.h>
  7. #include <stdio.h>
  8. #include <stdlib.h>
  9. #include <string.h>
  10. #include <sys/wait.h>
  11. #include <unistd.h>
  12. /* static */
  13. static void
  14. badmalloc(unsigned int size) {
  15. eprint("fatal: could not malloc() %u bytes\n", size);
  16. }
  17. /* extern */
  18. void *
  19. emalloc(unsigned int size) {
  20. void *res = malloc(size);
  21. if(!res)
  22. badmalloc(size);
  23. return res;
  24. }
  25. void
  26. eprint(const char *errstr, ...) {
  27. va_list ap;
  28. va_start(ap, errstr);
  29. vfprintf(stderr, errstr, ap);
  30. va_end(ap);
  31. exit(EXIT_FAILURE);
  32. }
  33. char *
  34. estrdup(const char *str) {
  35. void *res = strdup(str);
  36. if(!res)
  37. badmalloc(strlen(str));
  38. return res;
  39. }