188 lines
6.6 KiB
C
188 lines
6.6 KiB
C
/****************************************************************************
|
|
|
|
|
| (C) Copyright 1995-1997 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) Initialization module
|
|
|
|
|
|---------------------------------------------------------------------------
|
|
|
|
|
| $Author: ying $
|
|
| $Date: 2005-04-01 05:35:42 +0530 (Fri, 01 Apr 2005) $
|
|
|
|
|
| $RCSfile$
|
|
| $Revision: 898 $
|
|
|
|
|
|---------------------------------------------------------------------------
|
|
| This module is used to:
|
|
| Define all function prototypes for common layer interfaces visible
|
|
| to semantic agents.
|
|
|
|
|
| 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 _COMNVARIABLEDATA_H_
|
|
#define _COMNVARIABLEDATA_H_
|
|
|
|
#ifndef _COMNPARAMS_H_
|
|
# include <include/comnParams.h>
|
|
#endif
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/****************************************************************************
|
|
* Root Variable Data is data that is packed in the root beast under the
|
|
* variableData section. The rootBeast contains an optional pointer to
|
|
* an array of pointers to data. This array of pointers, if it exists,
|
|
* points to different types of "black box" data that needs to be
|
|
* packed and unpacked. Originally, this black box data will contain
|
|
* MAC meta data, Unix meta data, and suballocation data. In the future,
|
|
* it may be used to store other data as well.
|
|
*
|
|
* The types of "black box" data are defined in comnBeasts.h with
|
|
* a prefix of RVD_, and with RVD_MAX_ELEMENTS being the maximum number
|
|
* of elements in the variableData array.
|
|
*****************************************************************************/
|
|
|
|
|
|
/****************************************************************************
|
|
* These are four function prototypes for routines that must be provided
|
|
* by anyone who registers to support root variable data.
|
|
*****************************************************************************/
|
|
typedef NINT (*RVD_PackedSizeFunc_t)(
|
|
RootBeast_s *beast);
|
|
|
|
typedef BYTE *(*RVD_PackFunc_t)(
|
|
RootBeast_s *beast,
|
|
BYTE *storeBuffer);
|
|
|
|
typedef BYTE *(*RVD_UnpackFunc_t)(
|
|
GeneralMsg_s *genMsg,
|
|
RootBeast_s *beast,
|
|
BYTE *storeBuffer);
|
|
|
|
typedef BYTE *(*RVD_FreeFunc_t)(
|
|
RootBeast_s *beast);
|
|
|
|
/****************************************************************************
|
|
* These are two function prototypes for routines that might be provided
|
|
* by anyone who registers to support root variable data.
|
|
*****************************************************************************/
|
|
typedef STATUS (*RVD_GetXMLInfoFunc_t)(
|
|
GeneralMsg_s *genMsg,
|
|
RootBeast_s *beast,
|
|
NINT bufLen,
|
|
utf8_t *buf,
|
|
NINT *infoLen);
|
|
|
|
typedef STATUS (*RVD_SetXMLInfoFunc_t)(
|
|
GeneralMsg_s *genMsg,
|
|
RootBeast_s *beast,
|
|
NINT bufLen,
|
|
utf8_t *buf,
|
|
Xaction_s *xaction,
|
|
BOOL doChange);
|
|
|
|
/****************************************************************************
|
|
* These functions are used to register/unregister support functions for
|
|
* working with root variable data.
|
|
*****************************************************************************/
|
|
extern STATUS COMN_RegisterRootVariableDataType(
|
|
GeneralMsg_s *genMsg,
|
|
NINT rvdType,
|
|
RVD_PackedSizeFunc_t packedSizeFunc,
|
|
RVD_PackFunc_t packFunc,
|
|
RVD_UnpackFunc_t unpackFunc,
|
|
RVD_FreeFunc_t freeFunc,
|
|
RVD_GetXMLInfoFunc_t getXMLInfoFunc, /* can be NULL */
|
|
RVD_SetXMLInfoFunc_t setXMLInfoFunc); /* can be NULL */
|
|
|
|
|
|
extern void COMN_UnRegisterRootVariableDataType(
|
|
NINT rvdType);
|
|
|
|
extern STATUS COMN_GetRootVariableDataXMLInfo(
|
|
GeneralMsg_s *genMsg,
|
|
RootBeast_s *beast,
|
|
NINT bufLen,
|
|
utf8_t *buf,
|
|
NINT *infoLen);
|
|
|
|
extern STATUS COMN_SetRootVariableDataXMLInfo(
|
|
GeneralMsg_s *genMsg,
|
|
RootBeast_s *beast,
|
|
NINT bufLen,
|
|
utf8_t *buf,
|
|
Xaction_s *xaction,
|
|
BOOL doChange);
|
|
|
|
|
|
/****************************************************************************
|
|
* These are functions that may be called by the LSS root beast pack routines.
|
|
* The LSS should call these functions whenever a ROOT beast is being packed or
|
|
* unpacked, and it has a non-NULL variableData pointer in the rootBeast_s.
|
|
*
|
|
* These functions will call the individually registered functions for
|
|
* each registered RootVariableDataType that has a non-NULL pointer indexed
|
|
* in the variableData array pointed to by the root beast.
|
|
*****************************************************************************/
|
|
extern NINT COMN_PackedSizeRootVariableData(
|
|
RootBeast_s *beast);
|
|
|
|
extern BYTE *COMN_PackRootVariableData(
|
|
RootBeast_s *beast,
|
|
BYTE *storeBuffer);
|
|
|
|
extern BYTE *COMN_UnpackRootVariableData(
|
|
GeneralMsg_s *genMsg,
|
|
RootBeast_s *beast,
|
|
BYTE *storeBuffer,
|
|
NINT variableSize);
|
|
|
|
/****************************************************************************
|
|
* This function should be called from the root beast destructor if
|
|
* the variableData array pointer is non-NULL. It calls the individual
|
|
* RVD_FreeFunc for each registered RootVariableDataType that has a non-NULL
|
|
* pointer indexed in the variableData array pointed to by the root beast.
|
|
*****************************************************************************/
|
|
extern void COMN_FreeRootVariableData(
|
|
RootBeast_s *beast);
|
|
|
|
|
|
/****************************************************************************
|
|
* This function is called by any variable data provider to make sure that
|
|
* the main variable data array is in place before adding a sub-pointer in it.
|
|
*****************************************************************************/
|
|
extern STATUS COMN_InitRootVariableData(
|
|
GeneralMsg_s *genMsg,
|
|
RootBeast_s *beast);
|
|
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* _COMNVARIABLEDATA_H_ */
|