pdp-10 / supdup Goto Github PK
View Code? Open in Web Editor NEWCommunity maintained SUPDUP client for Unix
License: Other
Community maintained SUPDUP client for Unix
License: Other
Some older devices only support 7 or 8-bit character codes, but have a programmable font store. (I'm thinking primarily VT220 and compatible terminals.)
These devices can enable %TOSAI but does not have to translate the extended ASCII characters to Unicode.
See RFC 746, The SUPDUP Graphics Extension.
make supdup
cc -g -o supdup -DTERMCAP supdup.c -ltermcap
supdup.c:185:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
putch (c)
^
supdup.c:190:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
supdup.c:193:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
put_newline ()
^
supdup.c:201:5: warning: implicit declaration of function 'tputs' is invalid in C99 [-Wimplicit-function-declaration]
tputs (fresh_line, 1, putch);
^
supdup.c:215:3: warning: implicit declaration of function 'ttyoflush' is invalid in C99 [-Wimplicit-function-declaration]
ttyoflush ();
^
supdup.c:216:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
supdup.c:248:30: warning: implicit declaration of function 'inet_addr' is invalid in C99 [-Wimplicit-function-declaration]
tsin.sin_addr.s_addr = inet_addr (name);
^
supdup.c:256:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
main (argc, argv)
^
supdup.c:264:7: warning: implicitly declaring library function 'exit' with type 'void (int) attribute((noreturn))' [-Wimplicit-function-declaration]
exit (1);
^
supdup.c:264:7: note: include the header <stdlib.h> or explicitly provide a declaration for 'exit'
supdup.c:326:14: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
if (cp = strchr(line, '\n'))
~~~^~~~~~~~~~~~~~~~~~~~
supdup.c:326:14: note: place parentheses around the assignment to silence this warning
if (cp = strchr(line, '\n'))
^
( )
supdup.c:326:14: note: use '==' to turn this assignment into an equality comparison
if (cp = strchr(line, '\n'))
^
==
supdup.c:338:7: error: non-void function 'main' should return a value [-Wreturn-type]
return;
^
supdup.c:353:23: warning: implicit declaration of function 'atoi' is invalid in C99 [-Wimplicit-function-declaration]
tsin.sin_port = atoi (argv[2]);
^
supdup.c:357:11: error: non-void function 'main' should return a value [-Wreturn-type]
return;
^
supdup.c:366:7: error: non-void function 'main' should return a value [-Wreturn-type]
return;
^
supdup.c:368:33: warning: implicitly declaring library function 'malloc' with type 'void *(unsigned long)' [-Wimplicit-function-declaration]
outstring = (unsigned char *) malloc (OUTSTRING_BUFSIZ);
^
supdup.c:368:33: note: include the header <stdlib.h> or explicitly provide a declaration for 'malloc'
supdup.c:374:3: warning: implicit declaration of function 'sup_term' is invalid in C99 [-Wimplicit-function-declaration]
sup_term ();
^
supdup.c:379:27: warning: implicit declaration of function 'inet_ntoa' is invalid in C99 [-Wimplicit-function-declaration]
printf("Trying %s ...", inet_ntoa (tsin.sin_addr));
^
supdup.c:379:27: warning: format specifies type 'char *' but the argument has type 'int' [-Wformat]
printf("Trying %s ...", inet_ntoa (tsin.sin_addr));
~~ ^~~~~~~~~~~~~~~~~~~~~~~~~
%d
supdup.c:386:7: error: non-void function 'main' should return a value [-Wreturn-type]
return;
^
supdup.c:397:5: warning: implicit declaration of function 'supdup' is invalid in C99 [-Wimplicit-function-declaration]
supdup (net);
^
supdup.c:428:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
sup_term ()
^
supdup.c:446:3: error: function declared in block scope cannot have 'static' storage class
static void zap();
^
supdup.c:449:11: warning: implicit declaration of function 'systgetent' is invalid in C99 [-Wimplicit-function-declaration]
switch (systgetent (bp))
^
supdup.c:488:5: warning: add explicit braces to avoid dangling else [-Wdangling-else]
else
^
supdup.c:526:13: error: static declaration of 'zap' follows non-static declaration
static void zap ()
^
supdup.c:446:15: note: previous declaration is here
static void zap();
^
supdup.c:545:20: warning: implicit declaration of function 'tgetnum' is invalid in C99 [-Wimplicit-function-declaration]
tc->tcval.num = tgetnum(tc->tcname);
^
supdup.c:551:20: warning: implicit declaration of function 'tgetflag' is invalid in C99 [-Wimplicit-function-declaration]
tc->tcval.flg = tgetflag(tc->tcname);
^
supdup.c:577:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
systgetent (bp)
^
supdup.c:582:12: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
if (term = getenv ("TERM"))
~~~~~^~~~~~~~~~~~~~~~~
supdup.c:582:12: note: place parentheses around the assignment to silence this warning
if (term = getenv ("TERM"))
^
( )
supdup.c:582:12: note: use '==' to turn this assignment into an equality comparison
if (term = getenv ("TERM"))
^
==
supdup.c:583:12: warning: implicit declaration of function 'tgetent' is invalid in C99 [-Wimplicit-function-declaration]
return tgetent (bp, term);
^
supdup.c:638:13: warning: implicit declaration of function 'read' is invalid in C99 [-Wimplicit-function-declaration]
tcc = read (fd, tibuf, 1);
^
supdup.c:649:4: warning: implicit declaration of function 'select' is invalid in C99 [-Wimplicit-function-declaration]
select(fd+1, &readfds, 0, 0, 0);
^
supdup.c:658:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
supdup ()
^
supdup.c:700:11: warning: implicit declaration of function 'sleep' is invalid in C99 [-Wimplicit-function-declaration]
sleep (5);
^
supdup.c:753:15: warning: implicit declaration of function 'command' is invalid in C99 [-Wimplicit-function-declaration]
command (c);
^
supdup.c:806:9: warning: implicit declaration of function 'netflush' is invalid in C99 [-Wimplicit-function-declaration]
netflush (0);
^
supdup.c:808:9: warning: implicit declaration of function 'suprcv' is invalid in C99 [-Wimplicit-function-declaration]
suprcv ();
^
supdup.c:815:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
command (chr)
^
supdup.c:826:7: error: non-void function 'command' should return a value [-Wreturn-type]
return;
^
supdup.c:854:7: error: non-void function 'command' should return a value [-Wreturn-type]
return;
^
supdup.c:859:3: error: non-void function 'command' should return a value [-Wreturn-type]
return;
^
supdup.c:862:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
status ()
^
supdup.c:882:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
suspend ()
^
supdup.c:914:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
help ()
^
supdup.c:954:7: error: non-void function 'help' should return a value [-Wreturn-type]
return;
^
supdup.c:956:7: error: non-void function 'help' should return a value [-Wreturn-type]
return;
^
supdup.c:960:3: error: non-void function 'help' should return a value [-Wreturn-type]
return;
^
supdup.c:963:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
punt (logout_p)
^
supdup.c:983:11: error: non-void function 'punt' should return a value [-Wreturn-type]
return;
^
supdup.c:1009:7: warning: implicit declaration of function 'close' is invalid in C99 [-Wimplicit-function-declaration]
close (net);
^
supdup.c:1014:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
quit ()
^
supdup.c:1019:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
rlogout ()
^
supdup.c:1039:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
suprcv ()
^
supdup.c:1301:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
ttyoflush ()
^
supdup.c:1315:11: warning: implicit declaration of function 'write' is invalid in C99 [-Wimplicit-function-declaration]
n = write (fileno (stdout), back, n);
^
supdup.c:1327:9: error: non-void function 'ttyoflush' should return a value [-Wreturn-type]
return;
^
supdup.c:1332:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
netflush (dont_die)
^
supdup.c:1344:13: error: non-void function 'netflush' should return a value [-Wreturn-type]
return;
^
supdup.c:1346:13: error: non-void function 'netflush' should return a value [-Wreturn-type]
return;
^
supdup.c:1437:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
top ()
^
supdup.c:1446:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
setescape ()
^
supdup.c:1540:7: warning: extra tokens at end of #endif directive [-Wextra-tokens]
#endif;
^
//
supdup.c:1651:3: error: "Unimplemented OS routine os_ttyinit()"
^
supdup.c:1666:3: error: "Unimplemented OS routine os_ttyin()"
^
supdup.c:1677:3: error: "Unimplemented OS routine os_ttyout()"
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
46 warnings and 20 errors generated.
make: *** [supdup] Error 1
This issue is partially for my own note.
For extra bonus, use the Knight TV font.
I noticed that both the Knight and Stanford keyboards has Ƶ rather than Z. And the Knight TV font also uses this form.
So in a way it would be more authentic to use Ƶ when Unicode output is enabled.
@aap pointed out that this would make copy-paste harder.
This supdup implementation could be enhanced to accept the SIGWINCH signal when the terminal size changes. But I'm not sure there's a way in the SUPDUP protocol to send this information to the host? And if there were, I'm even less confident ITS or the applications would care to handle the change.
[core.UndefinedBinaryOperatorResult]
count = -((-1 << 6) | temp[2]);
~~ ^
1 warning generated.
Make supdup talk over Chaosnet, tunneled in UDP. (In addition to existing TCP/IP.)
@bictorv is the leading expert.
@lokedhs Reports there are problems building supdup using terminfo.
@WestfW wrote to alt.sys.pdp10:
Spent most of my time on ITS via a tops10 (with local terminals at a whopping 2400bps!) running SUPDUP (had to write the SUPDUP program first, of course!) The SUPDUP client I wrote was SO much faster than the tops10 telnet client
I wonder if this SUPDUP can be found today?
Maybe an extension to send Unicode characters?
UTF-8 might not fit well with the SUPDUP protocol.
I have an actual application in mind: A Swedish adventure game. PDP-10/its#659
Now it's ±.
FWIW, this (#23 and #22) breaks on OpenBSD. Mostly due to the fact that -lresolv doesn't exist there (nor on some other BSDs), normally these days the libresolv stuff is provided directly by libc both on BSDs and GNU systems but OS X seems to not have followed suite? Dynamically adding -lresolv to the linker line is slightly tricky to do in some form of portable Make -- since everyone wants to be special.
Originally posted by @ams in #23 (comment)
Here's a mapping between the SAIL charset and Unicode:
http://www.saildart.org/allow/sail-charset-utf8.html
Hello everyone,
I have checked in branches for some of the C supdup versions. There's one for @bictorv, one branched off that for @wsgac. The KLH10 code is in a separate branch until I figure out how it relates to the others.
I'll take other versions if I can find them. I believe @ams has one.
Other supdup hackers out there? @MMcM, @leighklotz?
If the hostname doesn't have a period (".") in it, supdup adds the default Chaosnet domain name ".chaosnet.net" to it. This is passed along to the bridge NCP, which is a bit of a problem for the NCP looking up hostnames in a hosts file. @bictorv, ideas?
supdup.c:
1417: strcpy(myloc,loc); /* save */
#ifdef __OpenBSD__
strlcpy(myloc,loc, sizeof(myloc)); /* save */
#else
strcpy(myloc,loc); /* save */
#endif /* __OpenBSD__ */
strlcpy
is widely supported these days, including on Linux through libbsd
.
If all else fails, the standard implementation is portable and should be able to be conditionally compiled on most systems without modification.
Using $(pkg-config --libs libbsd)
to locate the library may be more correct, but adds a pkg-config
dependency, obviously, which might not exist on certain embedded systems (and probably not on stock BSD systems).
I've submitted PR #26 to address this (only tested on Linux).
Edit: Updated to just use the portable implementation, since we probably don't want to do autoconf
-ish tests.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.