home *** CD-ROM | disk | FTP | other *** search
/ kermit.columbia.edu / kermit.columbia.edu.tar / kermit.columbia.edu / wkermit / lcktiodoc.txt < prev    next >
Text File  |  1985-11-10  |  4KB  |  167 lines

  1.  
  2.  
  3. /*  L C K T I O    module   */
  4.  
  5. C O N O C  --     Output a character to the console terminal
  6.  
  7.          conoc(c)
  8.          char c = character to print
  9.  
  10. C O N X O  --     Write x characters to the console terminal
  11.  
  12.          conxo(x,s)
  13.          char *s = string to print
  14.          int x = number of characters to print
  15.  
  16. C O N O L  --     Write a line to the console terminal
  17.  
  18.          conol(s)
  19.          char *s line to print
  20.  
  21. C O N O L A  --  Write an array of lines to the console terminal
  22.  
  23.          conola(s)
  24.          char *s[] = array to print
  25.  
  26. C O N O L L  --  Output a string followed by CRLF
  27.  
  28.          conoll(s)
  29.          char *s = string to print
  30.  
  31. C O N C H K  --  Check to see if user did hit keyboard
  32.          Return 1 if keyboard has been hit
  33.  
  34.          conchk()
  35.  
  36. C O N I N C  --  Get a character from the console, wait for timo seconds
  37.          returns -1 if no keyboard input
  38.  
  39.          coninc(timo)
  40.          int timo = timeout in seconds
  41.  
  42. T T O P E N  --  Open a Comport, returns 0 on success, -1 on failure.
  43.          sets ttyfd to 0 if COM1 or to 1 if COM2
  44.  
  45.          ttopen(ttname,lcl,modem)
  46.          char *ttname = name of comport ("COM1" or "COM2")
  47.          int lcl     ( not used , set to zero    )
  48.          int modem   ( not used , dummy argument)
  49.  
  50. T T C L O S  --  Close the TTY , set ttyfd to 0
  51.  
  52.          ttclos()
  53.  
  54. T T O L  --     Similar to "ttinl", but for writing.
  55.          returns number of characters writen to Com port
  56.  
  57.          ttol(s,n)
  58.          int n = number of characters to send
  59.          char *s = string to send
  60.  
  61. T T O C  --     Output a character to the communication line
  62.          Returns -1 if an error occured
  63.  
  64.          ttoc(c)
  65.          char c = character to write
  66.  
  67. T T I N C  --     Read a character from the communication line
  68.          return the character if possible otherwise -1
  69.          timout in timo seconds
  70.  
  71.          ttinc(timo)
  72.          int timo = timout period
  73.  
  74. T T I N L  --     Read a record (up to break character) from comm line.
  75.          If no break character encountered within "max", return "max"
  76.          characters, with disposition of any remaining characters
  77.          undefined.  Otherwise, return the characters that were read,
  78.          including the break character, in "dest" and the number of
  79.          characters read as the value of function, or 0 upon end of
  80.          file, or -1 if an error occurred.  Times out & returns error if
  81.          not completed    within "timo" sconds.
  82.  
  83.          ttinl(dest,maxnum,timo,eol)
  84.          int maxnum = maximum number of char to read
  85.          int timo = timout period
  86.          int eol  = break character
  87.          char *dest = destination string
  88.  
  89. TTPKT  --     Condition communication line for packect mode
  90.  
  91.          ttpkt (speed,flow)
  92.          int speed  = baud rate
  93.          int flow  = flow control used 0 = None, 1 = XON/XOFF
  94.  
  95.  
  96. TTVT  --     Condition communication line for use as virtual terminal
  97.          Returns -1 if Error */
  98.  
  99.          ttvt (speed,flow)
  100.          int speed = baud rate
  101.          int flow = flow control used
  102.          extern int parity = parity to be used (e, o, m, s, n)
  103.  
  104. T T S S P D --     check for valid baud rates
  105.          return the baud rate if valid otherwise -1
  106.  
  107.          ttsspd(speed)
  108.          int speed = baud rate
  109.  
  110. TTFLUI    --      Flush tty input buffer
  111.  
  112.           ttflui()
  113.  
  114. TTFLUO    --      Flush tty ouput buffer
  115.  
  116.           ttfluo()
  117.  
  118. T T I N --      read one character for tty input buffer
  119.           return the character if available otherwise -1
  120.  
  121.           ttin()
  122.  
  123. T T C H K  --      check if character available in receive buffer */
  124.  
  125.           ttchk() {
  126.  
  127.  
  128. T T S O M E  --   Return TRUE if receive buffer has character in it.
  129.  
  130.           int ttsome()
  131.  
  132. T T F L O W --      Checks for XOFF,if so waits for XON, timeout after 5 sec.
  133.  
  134.           ttflow()
  135.  
  136. C A R R I E R --  Check for existance of modem carrier signal
  137.           Returns: 1 if carrier present; else returns 0
  138.  
  139.           int carrier()
  140.           extern int cdetect = if set will return 1
  141.  
  142. S L E E P  --      Wait for m seconds
  143.  
  144.           sleep(m)
  145.           int m = number of seconds to sleep
  146.  
  147.  
  148. T I C K S  --      Returns total number of clock ticks since midnight */
  149.  
  150.           long int ticks()
  151.  
  152. T O T S E C  --   Returns time since midnight in seconds
  153.  
  154.           long int totsec()
  155.  
  156.  
  157. T O O L O N G --  Timeout for user input with tout in seconds */
  158.  
  159.           toolong(tout)
  160.           int tout = time out period
  161.           extern long int strtim  = starting time tor tout
  162.  
  163. Z T I M E  --      Return date/time string
  164.  
  165.           ztime(s)
  166.           char **s = pointer to string containing date and time
  167.