179 lines
5.3 KiB
C
179 lines
5.3 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: taysom $
|
|
| $Date: 2004-12-31 01:10:58 +0530 (Fri, 31 Dec 2004) $
|
|
|
|
|
| $RCSfile$
|
|
| $Revision: 465 $
|
|
|
|
|
|---------------------------------------------------------------------------
|
|
| This module is used to:
|
|
| This defines the interface into name spaces.
|
|
+-------------------------------------------------------------------------*/
|
|
#ifndef _DATASTREAMNSPACE_H_
|
|
#define _DATASTREAMNSPACE_H_
|
|
|
|
#ifndef _OMNI_H_
|
|
#include <library/omni.h>
|
|
#endif
|
|
|
|
/*---------------------------------------------------------------------------
|
|
* Name length restrictions
|
|
*---------------------------------------------------------------------------*/
|
|
#define DSNS_NAME_LIMIT 255
|
|
|
|
|
|
/*---------------------------------------------------------------------------
|
|
* Internal DATASTR support routines
|
|
*---------------------------------------------------------------------------*/
|
|
extern void DSNS_shutdown(
|
|
NameSpace_s *ns);
|
|
|
|
/*---------------------------------------------------------------------------
|
|
* This returns TRUE if this is a VALID DataStream filename character.
|
|
*---------------------------------------------------------------------------*/
|
|
#define DSNS_isValidUnicodeFileNameChar(_ch,_preValidated) \
|
|
( (!IS_UNICODE_AUG_WILDCARD_CHAR(_ch)) && \
|
|
( (_preValidated) || \
|
|
( (!IS_INVALID_UNICODE_CHAR(_ch)) && \
|
|
( ((_ch) >= 128) || \
|
|
(TST_BIT(DSNS_ValidCharBitMap,(_ch)))))))
|
|
|
|
/*---------------------------------------------------------------------------
|
|
* This returns TRUE if the given character is a UNICODE wildcard character
|
|
* else it returns FALSE.
|
|
*---------------------------------------------------------------------------*/
|
|
#define DSNS_isUnicodeWildcardChar(_ch) \
|
|
( ((_ch) == UNI_ASTERISK) || \
|
|
((_ch) == UNI_QMARK) || \
|
|
((_ch) == UNI_WILD_ASTERISK) || \
|
|
((_ch) == UNI_WILD_AUG_ASTERISK) || \
|
|
((_ch) == UNI_WILD_QMARK) || \
|
|
((_ch) == UNI_WILD_AUG_QMARK) )
|
|
|
|
/*---------------------------------------------------------------------------
|
|
* Function prototypes for name Space OPs
|
|
*---------------------------------------------------------------------------*/
|
|
extern STATUS DSNS_asciiScanNextComponent(
|
|
GeneralMsg_s *genMsg,
|
|
ScanComponentMsg_s *scanMsg);
|
|
|
|
extern STATUS DSNS_asciiLenScanNextComponent(
|
|
GeneralMsg_s *genMsg,
|
|
ScanComponentMsg_s *scanMsg);
|
|
|
|
extern STATUS DSNS_utf8ScanNextComponent(
|
|
GeneralMsg_s *genMsg,
|
|
ScanComponentMsg_s *scanMsg);
|
|
|
|
extern STATUS DSNS_utf8LenScanNextComponent(
|
|
GeneralMsg_s *genMsg,
|
|
ScanComponentMsg_s *scanMsg);
|
|
|
|
extern STATUS DSNS_unicodeScanNextComponent(
|
|
GeneralMsg_s *genMsg,
|
|
ScanComponentMsg_s *scanMsg);
|
|
|
|
extern STATUS DSNS_isLegalName(
|
|
GeneralMsg_s *genMsg,
|
|
unicode_t *srcName);
|
|
|
|
extern NINT DSNS_generateUniqueName(
|
|
GeneralMsg_s *genMsg,
|
|
NamedBeast_s *directory,
|
|
NameSpace_s *srcNameSpace,
|
|
NINT srcNameType,
|
|
unicode_t *srcName,
|
|
unicode_t *uniqueName);
|
|
|
|
extern STATUS DSNS_getSeparator(
|
|
GeneralMsg_s *genMsg,
|
|
NINT type,
|
|
unicode_t **retStr,
|
|
NINT *retLen);
|
|
|
|
extern SNINT DSNS_asciiCompareFileNames(
|
|
CONST char *storeName,
|
|
CONST char *lookupName,
|
|
NINT storeFlags);
|
|
|
|
extern SNINT DSNS_asciiLenCompareFileNames(
|
|
CONST char *storeName,
|
|
NINT storeNameLen,
|
|
CONST char *lookupName,
|
|
NINT lookupNameLen,
|
|
NINT storeFlags);
|
|
|
|
extern SNINT DSNS_unicodeCompareFileNames(
|
|
CONST unicode_t *storeName,
|
|
CONST unicode_t *lookupName,
|
|
NINT storeFlags);
|
|
|
|
extern STATUS DSNS_wildReplace(
|
|
GeneralMsg_s *genMsg,
|
|
unicode_t *srcPattern,
|
|
unicode_t *srcName,
|
|
unicode_t *replacePattern,
|
|
unicode_t *ret_newName);
|
|
|
|
extern BOOL DSNS_wildMatch(
|
|
unicode_t *pattern,
|
|
unicode_t *name,
|
|
NINT storeFlags);
|
|
|
|
extern STATUS DSNS_asciiToUnicode(
|
|
GeneralMsg_s *genMsg,
|
|
NINT conversionType,
|
|
char *asciiName,
|
|
unicode_t *destName,
|
|
NINT destNameSize);
|
|
|
|
extern STATUS DSNS_asciiLenToUnicode(
|
|
GeneralMsg_s *genMsg,
|
|
NINT conversionType,
|
|
char *asciiName,
|
|
NINT asciiNameLen,
|
|
unicode_t *destName,
|
|
NINT destNameSize);
|
|
|
|
extern STATUS DSNS_unicodeToAscii(
|
|
GeneralMsg_s *genMsg,
|
|
NINT conversionType,
|
|
unicode_t *unicodeName,
|
|
char *destName,
|
|
NINT destNameSize);
|
|
|
|
extern STATUS DSNS_unicodeToAsciiLen(
|
|
GeneralMsg_s *genMsg,
|
|
NINT conversionType,
|
|
unicode_t *unicodeName,
|
|
char *destName,
|
|
NINT destNameSize,
|
|
NINT *retDestLen);
|
|
|
|
#endif /* _DATASTREAMNSPACE_H_ */
|