1
0

touch up C

This commit is contained in:
dtb 2023-12-03 18:07:40 -07:00
parent 7c95bfcc82
commit 0ddfc90487
3 changed files with 13 additions and 17 deletions

View File

@ -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";

View File

@ -1,5 +1,5 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdio.h> /* fprintf(3), fputs(3), getc(3), stdin, stdout */
#include <stdlib.h> /* 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;
}