Rick Engebretson wrote:
An old book, "TurboPascal Programmers' Library (1987)" discusses the topic as "filters". Some compiler flags are set for this use (get and put buffers are created). Old Unix and newer Linux books cover the topic a little, too. With C.
I remember BP had a special call to set larger (than default) text file buffers, which was rather clumsy to use. Anyway, writing filters is, of course, also possible with default buffer sizes (which are larger in GPC than in BP). Any plain program that reads from `Input' (only) and writes to `Output', and does not use CRT, will work as a filter, both with BP and GPC, both under Dos and Unix, for all I know.
For non-text filters, it's possible (in BP and GPC) to assign typed or untyped files to '' (GPC also allows '-'), and access them instead of `Input' and `Output'. (Though mixing both `Input'/`Output' and your own file variables) can lead to unpredicatable results, as both do their own buffering.
Shell facilities like timers, pipes, forks, job control, buffers, process management, event signals are available.
Sure. For the shell calling the Pascal program they work as usual (unless the Pascal program itself captures some of them, which CRT does and probably some other libraries, but again those that wouldn't usually be used in batch programs). For Pascal programs, these facilities are also available, of course -- some have already interfaces in gpc.pas (timers, signals, etc.), others might require more interfaces (I've added them on an as-needed basis so far).
For example, a pascal framebuffer draw routine uses numeric input and outputs to /dev/fb0. None of this is text input or output. Perhaps it would be best, however, to convert to pure text.
I'm not sure what you mean here. /dev/fb0 is the interface to the graphics framebuffer. Writing text (i.e., ASCII values) to it os rather pointless. You'd have to use your own fonts os whatever in order to display characters. Or write to /dev/tty<n> (which is usually assigned to `Output') which is the text interface of the framebuffer.
Though mixing text and graphics might lead to strange results as the text framebuffer can overwrite your graphics, unless you restrict it via stty settings. So for a really mixed text/graphics output, I guess you'll have to use your own font routines, just as other graphics libraries do.
Frank