/*-------------------------------------------------------------------+
|                                                                    |
|                Copyright (c) 1996, SAS Institute Inc.              |
|                  Unpublished - All Rights Reserved                 |
|                      S A S / C   S A M P L E                       |
|         Name: PDSMEMH                                              |
|     Language: C                                                    |
|      Purpose: Maps node structure used to maintiain a skiplist of  |
|               directory entries.                                   |
|                                                                    |
|   For Sample: prefix.SAMPLE.C(P2UREAD,P2UPM,UPDBLD,P2UPSK)         |
|                                                                    |
+-------------------------------------------------------------------*/
#ifndef __P2UPNODE__
#define __P2UPNODE__

/*--------------------------------------------------------------------+
| Alias Entry Data Node                                               |
+--------------------------------------------------------------------*/
typedef struct ALIAS_DATA
      {
       char member(|8+1|);  /* member name in PDS, padded with       */
                            /* blanks on the right                   */
       struct ALIAS_DATA  *
           next_alias;      /* pointer to next alias member name     */
      }ALIAS_DATA;

 union TTR
      {
                             /* Pointer to first block of member as  */
       char ttrpds[4];       /* - a string                           */
       unsigned ttrz;        /* - an unsigned ini, used by ospoint() */
      };

/*--------------------------------------------------------------------+
| Partioned Data Set Member Information - extracted and reformatted   |
| from the PDS directory                                              |
+--------------------------------------------------------------------*/
typedef struct PDS_MBR
      {
       char member[8+1];     /* member name in PDS, padded with      */
                             /* blanks on the right                  */
       int  alias;           /* TRUE if alias, FALSE otherwise       */
       union TTR ttr_data;   /* ttr info                             */
       ALIAS_DATA * alias_list;
                             /* Linklist of alias entrires for this  */
                             /* this real member, if they exist      */
       ALIAS_DATA * alias_last;
                            /* pointer to last alias member name     */
      }PDS_MBR;

/*--------------------------------------------------------------------+
| Skiplist node struct                                                |
|                                                                     |
| Note: element pointers[] must be the last element as it's size will |
|       vary depending on the number of skip levels in which it       |
|       appears.                                                      |
|                                                                     |
+--------------------------------------------------------------------*/
struct node
{
  int level;                   /* Max skip level at which this node  */
                               /* appears.                           */
  PDS_MBR data;                /* PDS member data, name, ttr, alias  */
  struct node * pointers[1];   /* Ptr to next node, there will be    */
                               /* be one for each level at which this*/
                               /* node appears.                      */
 };
#define NIL (NODE *)NULL
#define NODE struct node
#endif  /* __P2UPNODE__ */