diff --git a/liminality/libinality.h b/liminality/libinality.h index bae344b..1feb232 100644 --- a/liminality/libinality.h +++ b/liminality/libinality.h @@ -1,6 +1,3 @@ -#ifndef _LIMINALITY_H -# define _LIMINALITY_H -static char *Liminality_prefix = "FROM "; -static char *Liminality_infix = "\nBODY "; -static char *Liminality_suffix = "\n"; -#endif /* ifndef _LIMINALITY_H */ +const char *Liminality_prefix = "FROM "; +const char *Liminality_infix = "\nBODY "; +const char *Liminality_suffix = "\n"; diff --git a/liminality/liminality.c b/liminality/liminality.c index 90153ab..561172e 100644 --- a/liminality/liminality.c +++ b/liminality/liminality.c @@ -1,5 +1,5 @@ -#include -#include +#include /* fprintf(3), fputs(3), getc(3), stdin, stdout */ +#include /* getenv(3) */ #include "libinality.h" char *signoff = ""; @@ -7,26 +7,25 @@ char *user = "user"; int main(int argc, char *argv[]){ int c; - char exiting; char *s; if((s = getenv("USER")) != NULL) user = s; - do{ - fputs(Liminality_prefix, stdout); - fputs(user, stdout); - fputs(Liminality_infix, stdout); + exiting = 0; +#define ever (;;) + for ever{ + fprintf(stdout, "%s%s%s", + Liminality_prefix, user, Liminality_infix); while((c = getc(stdin)) != '\n') if(c != EOF) putc(c, stdout); else{ - exiting = 1; fputs(signoff, stdout); - break; + goto fin; } fputs(Liminality_suffix, stdout); - }while(!exiting); + } - return 0; +fin: return 0; } diff --git a/rotate/rotate b/niceties/rotate similarity index 100% rename from rotate/rotate rename to niceties/rotate