🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.std
Article #17

Re: How to store video attributes in a t

#17
From: apratt
Date: Wed, 02 May 1984 02:45
36 lines
2103 bytes
It makes the code look a little worse, but in a C program, the "accepted"
modular-programming method would be:

#define ON 1
#define OFF 0

	printf("This is ");
	highlight(ON);
	underline(ON);
	printf("very");
	highlight(OFF);
	underline(OFF);
	printf("important\n");

That way, the functions could take care of sending the apropriate code.
Redefining putc will *not* work if you use printf, unless you redefine printf
as well. This is because the library version of printf would not use your
new and improved putc as a filter/translator/interpreter.

In text files, however, the ANSI standard is as good as any, but a little
verbose; writing an interpreter for it (to include cursor motion, screen
clearing, etc.) is not trivial. Also, you should keep in mind that not a lot
of terminals have such features as double height/double width lines.
Of course, these files would have to be run through a filter which interprets
the embedded ANSI codes and sends the appropriate termcap-supported codes.
This all is assuming, of course, that you want portability from UNIX to UNIX
as well as terminal to terminal.

I suppose there is nothing intrinsically wrong with embedding control 
characters in a file, but I would be wary of transmitting it over the net.
After all, *somewhere* there might be a mailer which gags on ASCII 27 (ESC).
For local use with your own package, of course, you can do whatever you want.
----
						-- Allan Pratt
					...ihnp4!inuxc!iuvax!apratt
Technical Details
Message-ID: <5900001@iuvax.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!mhuxl!ihnp4!inuxc!iuvax!apratt
References: <4103@utcsrgv.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: $Revision: 1.6.2.13 $; site iuvax.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!mhuxl!ihnp4!inuxc!iuvax!apratt
From: apratt@iuvax.UUCP
Newsgroups: net.std
Subject: Re: How to store video attributes in a t
Message-ID: <5900001@iuvax.UUCP>
Date: Tue, 1-May-84 22:45:00 EDT
Article-I.D.: iuvax.5900001
Posted: Tue May  1 22:45:00 1984
Date-Received: Thu, 3-May-84 19:34:36 EDT
References: <4103@utcsrgv.UUCP>
Lines: 36
Nf-ID: #R:utcsrgv:-410300:iuvax:5900001:000:1469
Nf-From: iuvax!apratt    May  1 21:45:00 1984