X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=linux%2Futil.h;h=634b112d2b1a1d8817cd9641f46d6ca82f4f4a46;hb=54ebbac26078d68fd2dc7033504afca91040fbfd;hp=81751118eb1b836cfc815a49e1c9cb5d5f379683;hpb=d3af2be74b547be9a43c6c8c89ff2fa4ca5fb504;p=spectrwm.git diff --git a/linux/util.h b/linux/util.h index 8175111..634b112 100644 --- a/linux/util.h +++ b/linux/util.h @@ -1,5 +1,3 @@ -/* $scrotwm$ */ - #define FPARSELN_UNESCESC 0x01 #define FPARSELN_UNESCCONT 0x02 #define FPARSELN_UNESCCOMM 0x04 @@ -13,3 +11,20 @@ char *fgetln(FILE *, size_t *); char *fparseln(FILE *, size_t *, size_t *, const char [3], int); long long strtonum(const char *, long long, long long, const char **); + +#ifndef WAIT_ANY +#define WAIT_ANY (-1) +#endif + +/* there is no limit to ulrich drepper's crap */ +#ifndef TAILQ_END +#define TAILQ_END(head) NULL +#endif + +#ifndef TAILQ_FOREACH_SAFE +#define TAILQ_FOREACH_SAFE(var, head, field, tvar) \ + for ((var) = TAILQ_FIRST(head); \ + (var) != TAILQ_END(head) && \ + ((tvar) = TAILQ_NEXT(var, field), 1); \ + (var) = (tvar)) +#endif