tentative implementation of liminality
This commit is contained in:
parent
787437106d
commit
4e14224a95
2
liminality/Makefile
Normal file
2
liminality/Makefile
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
liminality: libinality.h liminality.c
|
||||||
|
$(CC) -g -o liminality liminality.c
|
6
liminality/libinality.h
Normal file
6
liminality/libinality.h
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#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 */
|
7
liminality/liminal
Executable file
7
liminality/liminal
Executable file
@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
test -z "$2" || test -n "$3" \
|
||||||
|
&& printf "Usage: %s [server] [port]\n" "$0" >&2 \
|
||||||
|
&& exit 64 # sysexits(3) EX_USAGE
|
||||||
|
|
||||||
|
liminality | nc "$1" "$2"
|
32
liminality/liminality.c
Normal file
32
liminality/liminality.c
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include "libinality.h"
|
||||||
|
|
||||||
|
char *signoff = "";
|
||||||
|
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);
|
||||||
|
while((c = getc(stdin)) != '\n')
|
||||||
|
if(c != EOF)
|
||||||
|
putc(c, stdout);
|
||||||
|
else{
|
||||||
|
exiting = 1;
|
||||||
|
fputs(signoff, stdout);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
fputs(Liminality_suffix, stdout);
|
||||||
|
}while(!exiting);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user