Sticky Problems with C on IBM-compatibles

Alex Matulich alex at bilver.UUCP
Fri Feb 16 04:59:19 AEST 1990


For the past couple of years I have been writing C programs for IBM
compatibles using either Microsoft C or Turbo C.  I try to make my software
look and feel as professional as possible, but during my endeavors I have
run into some programming problems that I can't figure out, and none of
the IBM-specific C programming books I have read are any help.  Commercial
programs do these things, so why can't I?

Specifically:

1) Is there a faster way to display character strings than using puts()
   or printf() without resorting to assembly language?

2) If I have a text screen set up like I want it, is it possible to save
   it away somehow so I can display it anytime later by dumping it back
   into the video memory?  If so, how do I find the address and length 
   of a video text display?

3) How do I display inverse, boldface, or multicolored text without
   resorting to using ANSI.SYS?

4) The critical error handler gets invoked when the printer needs more
   paper.  How do I tell if the printer is offline?  The computer hung up
   last time I tried using fopen() to get a file handle to a printer that
   was powered off.

5) If a user of my software has a serial printer, how do I set up the
   serial port parameters (baud rate, xon/xoff, databits, stopbits, etc)?

6) I expected to find a function somewhere in the standard library that
   would read the contents of a disk directory into a string array.  Did
   I miss it?  I have heard the Lattice compiler has such a function, but
   I don't have that compiler.  If no such function exists, how is it done?

7) If my PATH environment variable is set up so that I can run one of my
   programs from a directory different than the one containing my program,
   how it possible for my program to determine the directory IT started
   from?  Or does that information have to be hard-coded in my program?

If you know the answers to at least one of the above questions, or if you
know the title of a helpful book I can look up, PLEASE e-mail me a reply.
Especially if you have examples of code that you use, I'd like to hear from
you.  I'll summarize the replies I receive.  Thanks...

-- 
     ///  Alex Matulich
    ///  Unicorn Research Corp, 4621 N Landmark Dr, Orlando, FL 32817
\\\///  alex at bilver.UUCP    ...uunet!tarpit!bilver!alex
 \XX/  From BitNet use: bilver!alex at uunet.uu.net



More information about the Comp.lang.c mailing list