/*
----------------------------------------------------------------------
variable length data - structures and defines
----------------------------------------------------------------------

         +----------------------------------------------------+
         |  Worldwide Copyright (c) Byte Designs Ltd (2001)   |    
         |                                                    |
         |               20568 - 32 Avenue                    |
         |               LANGLEY, BC                          |
         |               V3A 4P5 CANADA                       |
         |                                                    |
         |            Sales: sales@bytedesigns.com            |
         |          Support: support@bytedesigns.com          |
         | Phone: (604) 534 0722      Fax: (604) 534 2601     |
         +----------------------------------------------------+
                            Version 6.12
 
----------------------------------------------------------------------
*/

#define vlMAXIMUM       32511   /* system maximum bytes per record */
#define vlMAXOFF        59      /* index header - maxlen field */
#define vlHASHOFF       61      /* index header - hash table */

#if( ISVARIABLE > 1 )
#  define vlHASHVAL     4       /* hash table offset divisor */
#  define vlHASHLEN     249     /* hash table length */
#else
#  define vlHASHVAL     200     /* hash table offset divisor */
#  define vlHASHLEN     5       /* hash table length */
#endif

#define vlNODEMAX       994     /* max bytes per node */
#define vlDATAOFF       23      /* start of data store in rem node */


struct VLremhead                /* remainder node header details */
  {
  long  next;                   /* pointer to next in free list */
  long  prev;                   /* pointer to prev in free list */

  int free;                     /* space remaining in node */
  int foff;                     /* pointer to free space */

  long  cont;                   /* continuation node */
  int   slot;                   /* continuation slot */
  int   more;                   /* continuation flag */

  int   slots;                  /* number of slots allocated */
  unsigned char hash;           /* free list hash group */
  };


struct VLslotptr                /* slot pointer entry */
  {
  int off;                      /* offset in node */
  int len;                      /* length in node */
  };


struct VLvarinfo                /* record trailer */
  {
  int vlen;                     /* length of variable portion */
  int   slot;                   /* slot number in rem node */
  long  node;                   /* remainder node number */
  };
