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 >
Wrap
Text File
|
1994-10-20
|
4KB
|
162 lines
/*****************************************************************************
** File: dsaccess.h
**
** Description:
** Provides necesary definitions and function prototypes for accessing
** DSSearchOpen, DSSearchSeek, DSRead, and DSClose.
** These functions provide a streams type interface with NDS x.500
** compliant calls, simplifying searches for information in the
** directory.
**
** Disclaimer:
**
** Novell, Inc. makes no representations or warranties with respect to
** any NetWare software, and specifically disclaims any express or
** implied warranties of merchantability, title, or fitness for a
** particular purpose.
**
** Distribution of any NetWare software is forbidden without the
** express written consent of Novell, Inc. Further, Novell reserves
** the right to discontinue distribution of any NetWare software.
**
** Novell is not responsible for lost profits or revenue, loss of use
** of the software, loss of data, costs of re-creating lost data, the
** cost of any substitute equipment or program, or claims by any party
** other than you. Novell strongly recommends a backup be made before
** any software is installed. Technical support for this software
** may be provided at the discretion of Novell.
**
** Programmers:
**
** Ini Who Firm
** ------------------------------------------------------------------------
** MDO Mark D. Oberg Novell Developer Support
**
**
** History:
**
** When Who What
** ------------------------------------------------------------------------
** 09-22-94 MDO Begin
** 10-03-94 MDO Tested
**
*/
/*****************************************************************************
** macro definitions.
*/
/* used for state tracking during iterative calls to DSRead */
#define NEW_READ 0x00
#define NEW_LIST 0x01
#define NEW_SEARCH 0x02
#define READ_OBJECT_COUNT 0x08
#define READ_OBJECT_NAME 0x09
#define READ_ATTR_NAME 0x0A
#define READ_ATTR_VALUE 0x0B
/* used to identify READ_DATA types */
#define OBJECT 0
#define ATTR 1
#define ATTR_VALUE 2
/* used to tell that all information has been read from a search. */
#ifndef EOF
#define EOF (-1)
#endif
/*****************************************************************************
** structure definitions.
*/
typedef struct DS_HANDLE
{
NWDSContextHandle context;
NWDS_ITERATION iteration;
char baseObjectName[MAX_DN_CHARS];
NWDS_OPERATION handleType;
NWDS_SEARCH_SCOPE scope;
NWFLAGS searchAliases;
NWDS_TYPE infoType;
NWCOUNT objectInfoSize;
NWCOUNT objectCount;
NWCOUNT attrCount;
NWSYNTAX_ID syntaxID; /* keep between read attrName and readAttrValue */
NWCOUNT attrValCount;
int readState; /* used to keep track of what read is doing */
NWDS_BUFFER *filter;
NWDS_BUFFER *attrNames;
NWDS_BUFFER *objectInfo;
NWDS_NUM_OBJ countObjectsToSearch; /* not used */
NWDS_NUM_OBJ countObjectsSearched;
} DS_HANDLE;
typedef struct TOKEN_ENTRY
{
NWDS_TOKEN tok;
void *val;
NWSYNTAX_ID syn;
}TOKEN_ENTRY;
typedef struct READ_DATA
{
int readType; /* OBJECT, ATTR, ATTR_VALUE */
union RETURN_TYPES
{
struct /* OBJECT */
{
char name[MAX_SCHEMA_NAME_CHARS+1];
NWOBJECT_INFO objectInfo;
}object;
struct /* ATTR */
{
char name[MAX_SCHEMA_NAME_CHARS+1];
NWSYNTAX_ID syntaxID;
}attr;
struct /* ATTR_VALUE */
{
void *value;
NWSYNTAX_ID syntaxID;
}attrVal;
}read;
}READ_DATA;
/*****************************************************************************
** function prototypes.
*/
DS_HANDLE *DSSearchOpen(
NWDSContextHandle cx,
char **attrNames,
TOKEN_ENTRY *tokent);
NWDSCCODE DSSearchSeek(
DS_HANDLE *searchHandle,
char *baseObjectName,
NWDS_SEARCH_SCOPE scope,
NWFLAGS searchAliases,
NWDS_TYPE infoType );
DS_HANDLE *DSReadOpen(NWDSContextHandle cx,
char **attrNames);
NWDSCCODE DSReadSeek(
DS_HANDLE *dsHandle,
char *objectName,
NWDS_TYPE infoType );
DS_HANDLE *DSListOpen(NWDSContextHandle cx);
NWDSCCODE DSListSeek(
DS_HANDLE *dsHandle,
char *objectName);
READ_DATA *DSRead(DS_HANDLE *searchHandle);
void DSClose( DS_HANDLE *searchHandle);