198 lines
5.9 KiB
C
198 lines
5.9 KiB
C
/****************************************************************************
|
|
|
|
|
| (C) Copyright 1985, 1991, 1993, 1996 Novell, Inc.
|
|
| All Rights Reserved.
|
|
|
|
|
| This program is free software; you can redistribute it and/or
|
|
| modify it under the terms of version 2 of the GNU General Public
|
|
| License as published by the Free Software Foundation.
|
|
|
|
|
| This program is distributed in the hope that it will be useful,
|
|
| but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
| GNU General Public License for more details.
|
|
|
|
|
| You should have received a copy of the GNU General Public License
|
|
| along with this program; if not, contact Novell, Inc.
|
|
|
|
|
| To contact Novell about this file by physical or electronic mail,
|
|
| you may find current contact information at www.novell.com
|
|
|
|
|
|***************************************************************************
|
|
|
|
|
| NetWare Advance File Services (NSS) module
|
|
|
|
|
|---------------------------------------------------------------------------
|
|
|
|
|
| $Author: vandana $
|
|
| $Date: 2005-04-20 23:03:15 +0530 (Wed, 20 Apr 2005) $
|
|
|
|
|
| $RCSfile$
|
|
| $Revision: 947 $
|
|
|
|
|
|---------------------------------------------------------------------------
|
|
| This module is used to:
|
|
| This defines all of the primitive BEASTS inside of PSS
|
|
|
|
|
| WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING!
|
|
|
|
|
| This header file should ONLY be used for NSS internal development.
|
|
| This includes Semantic Agents (SA) and Loadable Storage Services (LSS).
|
|
| Any other use may cause conflicts which NSS will NOT fix.
|
|
+-------------------------------------------------------------------------*/
|
|
#ifndef _COMNBEASTCLASS_H_
|
|
#define _COMNBEASTCLASS_H_
|
|
|
|
#ifndef _COMNBEASTS_H_
|
|
# include <comnBeasts.h>
|
|
#endif
|
|
|
|
#include <xUnicode.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/*---------------------------------------------------------------------------
|
|
* This structure is used when registering a list of beast classes
|
|
*---------------------------------------------------------------------------*/
|
|
typedef struct BeastClassRegisterInfo_s
|
|
{
|
|
unicode_t *className;
|
|
NINT classID;
|
|
NINT derivedFromClassID;
|
|
NINT beastSize;
|
|
CommonBeastOps_s *comnOps; /* general beast operations */
|
|
CommonVolumeOps_s *comnVolOps; /* operations for volumes, can only be
|
|
* defined by objects derived from
|
|
* "Volume_s". */
|
|
LSSSpecificPackUnpackOps_s (*lssOps)[]; /* array of LSS specific packing ops,
|
|
* this is usally defined by an LSS when
|
|
* it loads. */
|
|
void *(*beastSpecificOps)[]; /* pointer to list of beast specific ops */
|
|
/* to be defined in the future */
|
|
} BeastClassRegisterInfo_s;
|
|
|
|
/*---------------------------------------------------------------------------
|
|
* This defines structures used to map beast classIDs into array indexes.
|
|
*---------------------------------------------------------------------------*/
|
|
typedef struct BeastClassIDMapCtrl_s
|
|
{
|
|
NINT arraySize;
|
|
NINT nextIndex;
|
|
NINT (*classIDArray)[DEBUG_VISIBLE_IDX];
|
|
} BeastClassIDMapCtrl_s;
|
|
|
|
/*---------------------------------------------------------------------------
|
|
* BEAST CLASS prototypes
|
|
*---------------------------------------------------------------------------*/
|
|
extern NINT BST_ClassID2ArrayIndex(
|
|
struct GeneralMsg_s *genMsg,
|
|
BeastClassIDMapCtrl_s *idMapCtrl,
|
|
NINT classID);
|
|
|
|
extern NINT BST_ArrayIndex2ClassID(
|
|
BeastClassIDMapCtrl_s *idMapCtrl,
|
|
NINT arrayIndex);
|
|
|
|
#define BST_getPackedSize(_beast) \
|
|
BST_getPackedSizeIndex(_beast, \
|
|
(_beast)->ROOTvolume->VOLstorageIndex)
|
|
|
|
#define BST_doPack(_beast, _data, _packedLen) \
|
|
BST_doPackIndex(_beast, _data, _packedLen, \
|
|
(_beast)->ROOTvolume->VOLstorageIndex)
|
|
|
|
#define BST_noPackCleanup(_beast) \
|
|
BST_noPackCleanupIndex(_beast, \
|
|
(_beast)->ROOTvolume->VOLstorageIndex)
|
|
|
|
#define BST_doUnpack(_genMsg, _beast, _data, _packedLen) \
|
|
BST_doUnpackIndex(_genMsg, _beast, _data, _packedLen, \
|
|
(_beast)->ROOTvolume->VOLstorageIndex)
|
|
|
|
extern NINT BST_getPackedSizeIndex(
|
|
struct RootBeast_s *beast,
|
|
NINT storageIndex);
|
|
|
|
extern void BST_doPackIndex(
|
|
struct RootBeast_s *beast,
|
|
void *data,
|
|
NINT packedLen,
|
|
NINT storageIndex);
|
|
|
|
extern void BST_noPackCleanupIndex(
|
|
struct RootBeast_s *beast,
|
|
NINT storageIndex);
|
|
|
|
extern STATUS BST_doUnpackIndex(
|
|
struct GeneralMsg_s *genMsg,
|
|
struct RootBeast_s *beast,
|
|
void *data,
|
|
NINT packedLen,
|
|
NINT storageIndex);
|
|
|
|
/****************************************************************************
|
|
* Beast Hash globals
|
|
*****************************************************************************/
|
|
extern DQhead_t *RootBeastHash;
|
|
extern BeastClassIDMapCtrl_s LSSOpsIDMap;
|
|
extern NINT SimultaneousBeastReadCount;
|
|
|
|
extern void BEASTHASH_Remove(
|
|
RootBeast_s *beast);
|
|
|
|
extern void BEASTHASH_enqNotInUseBeasts(
|
|
RootBeast_s *beast,
|
|
BOOL checkLimit);
|
|
|
|
#ifdef DEBUG_BEAST_USE_COUNT
|
|
extern void BEASTHASH_InsertInternal(
|
|
RootBeast_s *beast);
|
|
|
|
#define BEASTHASH_Insert(_beast) \
|
|
{ \
|
|
RootBeast_s *rb = (RootBeast_s *)(_beast); \
|
|
if (rb->rb_whereCntPtr >= 255) rb->rb_whereCntPtr = 0; \
|
|
rb->rb_whereCnt[rb->rb_whereCntPtr++] = WHERE; \
|
|
rb->rb_whereTotalCnt++;\
|
|
BEASTHASH_InsertInternal((_beast)); \
|
|
}
|
|
|
|
extern void BEASTHASH_incrementUseCountInternal(
|
|
RootBeast_s *beast);
|
|
|
|
#define BEASTHASH_incrementUseCount(_beast) \
|
|
{ \
|
|
RootBeast_s *rb = (RootBeast_s *)(_beast); \
|
|
if (rb->rb_whereCntPtr >= 255) rb->rb_whereCntPtr = 0; \
|
|
rb->rb_whereCnt[rb->rb_whereCntPtr++] = WHERE; \
|
|
rb->rb_whereTotalCnt++;\
|
|
BEASTHASH_incrementUseCountInternal((_beast)); \
|
|
}
|
|
#else
|
|
|
|
extern void BEASTHASH_Insert(
|
|
RootBeast_s *beast);
|
|
|
|
extern void BEASTHASH_incrementUseCount(
|
|
RootBeast_s *beast);
|
|
|
|
#endif
|
|
|
|
extern void *BEASTHASH_LookupByZid(
|
|
struct GeneralMsg_s *genMsg,
|
|
void *voidVol,
|
|
Zid_t zid,
|
|
NINT latchType);
|
|
|
|
extern void BEASTHASH_freeNotInUseBeasts();
|
|
|
|
extern void BEASTHASH_InvalidateDOSTimes();
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|