home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / TELECOM / xyz.lzh / ftdisk.h < prev    next >
Text File  |  1995-08-18  |  4KB  |  112 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 DISK_H_INCLUDED
  52. #define DISK_H_INCLUDED
  53. #include <time.h>
  54. #include "ftdebug.h"
  55. typedef void *DISKFILE;
  56. enum {
  57.    diskFileUnknown = 0,
  58.    diskFileBinary,
  59.    diskFileText = 100,
  60.    diskFileAscii,
  61.    diskFileLatin1
  62. };
  63. enum {
  64.    diskOK = 0,
  65.    diskError,
  66.    diskFatal,
  67.    diskNoSuchFile,
  68.    diskCantRead,
  69.    diskEOF
  70. };
  71. int     DiskWriteInit
  72.         (DISKFILE *pF, DEBUG debug);
  73. int     DiskWriteName
  74.         (DISKFILE f, const char *preferredName);
  75. int     DiskWriteSize
  76.         (DISKFILE f, long fileSize);
  77. int     DiskWriteDate
  78.         (DISKFILE f, struct tm *pFileDate);
  79. int     DiskWriteMode
  80.         (DISKFILE f, long fileMode);
  81. int     DiskWriteType
  82.         (DISKFILE f, int fileType);
  83. int     DiskWriteOpen
  84.         (DISKFILE f);
  85. int     DiskAppendOpen
  86.         (DISKFILE f);
  87. int     DiskReplaceOpen
  88.         (DISKFILE f);
  89. int     DiskWrite
  90.         (DISKFILE f, const void *buff, unsigned long size);
  91. int     DiskWriteClose
  92.         (DISKFILE f);
  93. int     DiskReadOpen
  94.         (DISKFILE *pF, const char *name, int fileType);
  95. int     DiskRead
  96.         (DISKFILE f, void *buff, unsigned long requestedSize,
  97.          unsigned long *pSizeRead);
  98. int     DiskReadClose
  99.         (DISKFILE f);
  100. int     DiskFileType
  101.         (DISKFILE f, int *pType);
  102. int     DiskFileMode
  103.         (DISKFILE f, long *pMode);
  104. int     DiskFileDate
  105.         (DISKFILE f, struct tm *pTm);
  106. int     DiskFileSize
  107.         (DISKFILE f, long *pSize);
  108. int     DiskFileName
  109.         (DISKFILE f, const char **pName);
  110.  
  111. #endif
  112.