home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / TELECOM / xyz.lzh / ftserial.h < prev    next >
Text File  |  1995-08-18  |  4KB  |  90 lines

  1. /*
  2.    Printed form of this source is Copyright (C) 1995 Coriolis
  3.    Group, Inc.  All rights reserved.  Individual users may
  4.    make printed copies for their own personal use.
  5.  
  6.    All other forms are Copyright (C) 1995 Tim Kientzle. All
  7.    rights reserved.
  8.  
  9. Redistribution in source or binary form is permitted only under
  10. the following conditions:
  11. 1. If you own a copy of `The Working Programmer's Guide To Serial
  12.    Protocols,' then you may redistribute this code as part of
  13.    a complete application program under the conditions
  14.    described in that book.  (See pages xiv, xv.)  In any case,
  15.    you must abide by terms 4-7 below.
  16. 2. Otherwise, if you have received this code as a part of an
  17.    application program, it may only be redistributed with the
  18.    complete source of that program, under whatever conditions
  19.    apply to redistribution of that program as a whole.
  20. 3. If you have received this source code by some other means,
  21.    you may not redistribute it without explicit written
  22.    permission from Tim Kientzle.
  23. 4. All advertising materials mentioning features or use of this
  24.    software must prominently display the following acknowledgement:
  25.       This product is partially based on source code appearing in
  26.       `The Working Programmer's Guide to Serial Protocols,'
  27.       Copyright (C) 1995 Coriolis Group, Inc. and Tim Kientzle.
  28. 5. All programs using this source code must display the above
  29.    acknowledgement prominently in the program documentation
  30.    and user interface.
  31. 6. Neither the name of the Tim Kientzle nor the Coriolis Group, Inc.,
  32.    may be used to endorse or promote products derived from this
  33.    software without specific prior written permission.
  34. 7. Any redistribution in source form must retain the above copyright
  35.    notice, this list of conditions, and the disclaimer below.
  36.  
  37. THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  38. WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  39. OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  40. IN NO EVENT SHALL TIM KIENTZLE OR THE CORIOLIS GROUP BE LIABLE FOR
  41. ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  42. DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
  43. GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  44. INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
  45. IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  46. OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
  47. IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  48.  
  49. */
  50.  
  51. #ifndef SERIAL_H_INCLUDED
  52. #define SERIAL_H_INCLUDED
  53. typedef void *SERIAL_PORT;
  54. enum {
  55.    serialOK = 0, serialTimeout, serialUserCancel, serialFrame,
  56.    serialFatal
  57. };
  58.  
  59. #include <stddef.h>
  60. int     SerialOpen
  61.         (SERIAL_PORT *pPort, const char *name);
  62. int     SerialClose
  63.         (SERIAL_PORT port);
  64. int     SerialSaveState
  65.         (SERIAL_PORT port);
  66. int     SerialRestoreState
  67.         (SERIAL_PORT port);
  68. int     SerialSetWord
  69.         (SERIAL_PORT port, int wordLength);
  70. enum {
  71.    parityNone = 0, parityEven, parityOdd
  72. };
  73. int     SerialSetParity
  74.         (SERIAL_PORT port, int parity);
  75. int     SerialMakeTransparent
  76.         (SERIAL_PORT port);
  77. int     SerialReadWithTimeout
  78.         (SERIAL_PORT port, int timeoutSeconds,
  79.          void *pBuffer, unsigned long *pLength);
  80. int     SerialSend
  81.         (SERIAL_PORT port, const void *pBuffer, unsigned long length);
  82. int     SerialWaitForSentBytes
  83.         (SERIAL_PORT port);
  84. int     SerialSendBreak
  85.         (SERIAL_PORT port);
  86. int     SerialPause
  87.         (SERIAL_PORT port, int seconds);
  88.  
  89. #endif
  90.