home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / telix / tlx3sort.zip / TLX30.H < prev    next >
C/C++ Source or Header  |  1988-07-13  |  4KB  |  108 lines

  1. /**
  2.  *
  3.  *  Module:       tlx30.h
  4.  *  Version:      2.0
  5.  *  Description:  Telix 3.0 fon file structures
  6.  *  Author:       Paul Roub - yeah,  right...
  7.  *
  8.  *  Revision History:
  9.  *     7-13-88 : hacked together,  added typedef's and pragma's
  10.  *
  11.  *      This program and its sources are Copyright (C) 1988 by Paul Roub
  12.  *      and may not be sold for profit without the express written
  13.  *      consent of the author.  Redistribute them (in their entirety) as
  14.  *      you wish,  provided no fee is charged and all materials are
  15.  *      present and unmodified.
  16.  *
  17. **/
  18.  
  19. /*<f>*/
  20. #pragma pack(1)
  21.  
  22.  
  23. /*
  24.  *  the following is copied directly from the TELIX format description
  25.  *  from PTel
  26.  */
  27.  
  28.  
  29. /*
  30.    TELIX communications program v3.0 dialing directory file format.
  31.    Copyright (c) 1988 PTel, Post Office Box 130, West Hill, Ont. M1E 4R4
  32.  
  33.    A Telix 3.0 dialing directory file is variable sized, and can hold from
  34.    1 to 1000 entries (1000 is an arbitrary limit which might be raised, so
  35.    do not get too dependent on it).  A dialing directory file consists of
  36.    one ddf_header structure followed by a dd_entry structure for each
  37.    entry iu the dialing directory.  All data is stored in Intel format. 
  38.    This means that when integers and longs are written to disk, they are
  39.    written in the order low byte to high byte.  Since all Intel chips
  40.    (like the 8088 and 80x86 used in PCs) store data in this fashion, this
  41.    is of concern only if you are trying to access a directory file from a
  42.    computer using another microprocessor, like the Mac's 68000.
  43.  
  44.    The 2 structures follow, in C format.
  45.    All structures are packed.  No padding should be used by the compiler
  46.    to align data on even addresses.  For example, if using the MS C
  47.    compiler, use the -Zp switch!
  48. */
  49.  
  50. struct ddf_header
  51. {
  52.  long id;                 /* should be hex 2e2b291a */
  53.  int  ddf_vers;           /* currently 1 */
  54.  int  num_entries;        /* # of entries in directory, from 1 to 1000 */
  55.  char pencrypted;         /* currently 0, will be used for encryption */
  56.  char spare[55];
  57. };
  58.  
  59. struct dd_entry
  60. {
  61.  char     name[25],       /* entry name */
  62.           number[17],     /* phone number */
  63.           baud,           /* baud rate, see below */
  64.           parity,         /* parity: 0 = none, 1 = even, 2 = odd */
  65.           data,           /* number of data bits, 7 or 8 */
  66.           stop,           /* number of stop bits, 1 or 2 */
  67.           script[12],     /* linked script file name */
  68.           lastcall[6];    /* last call date, stored in ASCII, w/o slashes */
  69.  unsigned totcalls;       /* total successful calls to this entry */
  70.  char     terminal,       /* terminal type to use, see below */
  71.           protocol,       /* default protocol; first letter */
  72.           toggles,        /* bit 0: local echo - 0 = off, 1 = on */
  73.                           /* bit 1: add LFs    - 0 = off, 1 = on */
  74.                           /* bit 2: BS trans   - 0 = destructive, 1 = not */
  75.                           /* bit 3: BS key     - 0 = sends BS, 1 = sends DEL */
  76.           filler1,
  77.           filler2,
  78.           dprefnum,       /* dialing prefix number to use when dialing */
  79.           password[14];   /* password for this entry */
  80. };
  81.  
  82.  
  83. /*
  84.    ASCII string fields like the name, number, password, etc. are stored in
  85.    C format, but include the terminating 0 only if there is room. For example,
  86.    if an entry name is 25 characters long it will completely fill up the field,
  87.    and no terminating zero will be added. This was done for space reasons, but
  88.    means that if you manipulate the directories you must take care. C program-
  89.    mers for example should use the strncpy function instead of the strcpy func-
  90.    tion to access these fields, and must make sure to add a terminating zero.
  91.  
  92.    baud field:     0 =  300, 1 =  1200, 2 =  2400, 3 =  4800,
  93.                    4 = 9600, 5 = 19200, 6 = 38400, 7 = 57600, 8 = 115200
  94.  
  95.    terminal field: integer number from 0 - n equivalent to that entry
  96.                    in menu shown when Alt-T function invoked
  97. */
  98.  
  99.  
  100.  
  101. /*
  102.  *  typedefs for TlxSort
  103.  */
  104. typedef struct ddf_header fon_header;
  105. typedef struct dd_entry   fon_entry;
  106.  
  107. #pragma pack()
  108.