home *** CD-ROM | disk | FTP | other *** search
/ Network Support Encyclopedia 96-1 / novell-nsepro-1996-1-cd2.iso / download / netware / xdsa1.exe / DSACCESS.H < prev    next >
Text File  |  1994-10-20  |  4KB  |  162 lines

  1. /*****************************************************************************
  2. ** File: dsaccess.h
  3. **
  4. **    Description:
  5. **        Provides necesary definitions and function prototypes for accessing
  6. **         DSSearchOpen, DSSearchSeek, DSRead, and DSClose.
  7. **         These functions provide a streams type interface with NDS x.500 
  8. **         compliant calls, simplifying searches for information    in the 
  9. **         directory.  
  10. **
  11. **    Disclaimer:
  12. **
  13. **        Novell, Inc. makes no representations or warranties with respect to
  14. **        any NetWare software, and specifically disclaims any express or
  15. **        implied warranties of merchantability, title, or fitness for a
  16. **        particular purpose.  
  17. **
  18. **        Distribution of any NetWare software is forbidden without the
  19. **        express written consent of Novell, Inc.  Further, Novell reserves
  20. **        the right to discontinue distribution of any NetWare software.
  21. **
  22. **        Novell is not responsible for lost profits or revenue, loss of use
  23. **        of the software, loss of data, costs of re-creating lost data, the
  24. **        cost of any substitute equipment or program, or claims by any party
  25. **        other than you.  Novell strongly recommends a backup be made before
  26. **        any software is installed.   Technical support for this software
  27. **        may be provided at the discretion of Novell.
  28. **
  29. ** Programmers:
  30. **
  31. **    Ini   Who                  Firm
  32. **    ------------------------------------------------------------------------
  33. **    MDO   Mark D. Oberg            Novell Developer Support
  34. **
  35. **
  36. ** History:
  37. **
  38. **    When            Who   What
  39. **    ------------------------------------------------------------------------
  40. **     09-22-94     MDO    Begin
  41. **        10-03-94        MDO    Tested
  42. **
  43. */
  44.  
  45. /*****************************************************************************
  46. ** macro definitions.
  47. */
  48. /* used for state tracking during iterative calls to DSRead */
  49. #define    NEW_READ                0x00
  50. #define    NEW_LIST                0x01
  51. #define    NEW_SEARCH            0x02
  52.  
  53. #define    READ_OBJECT_COUNT    0x08
  54. #define    READ_OBJECT_NAME    0x09
  55. #define    READ_ATTR_NAME        0x0A
  56. #define    READ_ATTR_VALUE    0x0B
  57.  
  58. /* used to identify READ_DATA types */
  59. #define    OBJECT        0
  60. #define    ATTR            1
  61. #define    ATTR_VALUE    2
  62.  
  63. /* used to tell that all information has been read from a search. */ 
  64. #ifndef EOF
  65.     #define    EOF            (-1)
  66. #endif
  67.  
  68. /*****************************************************************************
  69. ** structure definitions.
  70. */
  71. typedef struct DS_HANDLE
  72.     {
  73.     NWDSContextHandle context;
  74.     NWDS_ITERATION iteration;
  75.     char baseObjectName[MAX_DN_CHARS];
  76.     NWDS_OPERATION    handleType;
  77.     NWDS_SEARCH_SCOPE scope;
  78.     NWFLAGS    searchAliases;
  79.     NWDS_TYPE    infoType;
  80.     NWCOUNT    objectInfoSize;
  81.     NWCOUNT    objectCount;
  82.     NWCOUNT    attrCount;
  83.     NWSYNTAX_ID    syntaxID;    /* keep between read attrName and readAttrValue */
  84.     NWCOUNT    attrValCount;
  85.     int    readState;            /* used to keep track of what read is doing */
  86.     NWDS_BUFFER *filter;
  87.     NWDS_BUFFER *attrNames;
  88.     NWDS_BUFFER *objectInfo;
  89.     NWDS_NUM_OBJ    countObjectsToSearch;    /* not used */
  90.     NWDS_NUM_OBJ    countObjectsSearched;
  91.     } DS_HANDLE;
  92.  
  93. typedef struct TOKEN_ENTRY
  94.     {
  95.     NWDS_TOKEN tok;
  96.     void *val;
  97.     NWSYNTAX_ID syn;
  98.     }TOKEN_ENTRY;
  99.  
  100. typedef struct READ_DATA
  101.     {
  102.     int    readType;            /* OBJECT, ATTR, ATTR_VALUE */
  103.     union RETURN_TYPES
  104.         {
  105.         struct    /* OBJECT */
  106.             {
  107.             char name[MAX_SCHEMA_NAME_CHARS+1];
  108.             NWOBJECT_INFO objectInfo;
  109.             }object;
  110.         struct     /* ATTR    */
  111.             {
  112.             char name[MAX_SCHEMA_NAME_CHARS+1];
  113.             NWSYNTAX_ID    syntaxID;
  114.             }attr;
  115.         struct     /* ATTR_VALUE */
  116.             {
  117.             void *value;
  118.             NWSYNTAX_ID syntaxID;
  119.             }attrVal;
  120.         }read;
  121.     }READ_DATA;
  122.  
  123. /*****************************************************************************
  124. ** function prototypes.
  125. */
  126. DS_HANDLE *DSSearchOpen(
  127.                                 NWDSContextHandle cx,
  128.                                 char **attrNames,
  129.                                 TOKEN_ENTRY *tokent);
  130.  
  131. NWDSCCODE    DSSearchSeek(
  132.                         DS_HANDLE *searchHandle,
  133.                         char *baseObjectName,
  134.                         NWDS_SEARCH_SCOPE scope,
  135.                         NWFLAGS    searchAliases,
  136.                         NWDS_TYPE    infoType    );
  137.  
  138. DS_HANDLE *DSReadOpen(NWDSContextHandle cx,
  139.                                 char **attrNames);
  140.  
  141. NWDSCCODE    DSReadSeek(
  142.                         DS_HANDLE *dsHandle,
  143.                         char *objectName,
  144.                         NWDS_TYPE    infoType    );
  145.  
  146. DS_HANDLE *DSListOpen(NWDSContextHandle cx);
  147.  
  148. NWDSCCODE    DSListSeek(
  149.                         DS_HANDLE *dsHandle,
  150.                         char *objectName);
  151.  
  152.  
  153.  
  154. READ_DATA *DSRead(DS_HANDLE *searchHandle);
  155.  
  156. void DSClose( DS_HANDLE *searchHandle);
  157.  
  158.  
  159.  
  160.  
  161.  
  162.