Files
mars-nwe/include/nwfs/comn/namespace/dosNSpace.h

193 lines
5.8 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 _DOSNSPACE_H_
#define _DOSNSPACE_H_
#ifndef _OMNI_H_
#include <library/omni.h>
#endif
/*---------------------------------------------------------------------------
* Name length restrictions
*---------------------------------------------------------------------------*/
#define DOSNS_NAME_LIMIT 8
#define DOSNS_EXT_LIMIT 3
/*---------------------------------------------------------------------------
* Internal DOS NS support routines
*---------------------------------------------------------------------------*/
extern void DOSNS_shutdown(
NameSpace_s *ns);
/*---------------------------------------------------------------------------
* This returns TRUE if this is a VALID dos filename character.
*---------------------------------------------------------------------------*/
#define DOSNS_isValidUnicodeFileNameChar(_ch,_preValidated) \
( (!IS_UNICODE_AUG_WILDCARD_CHAR(_ch)) && \
( (_preValidated) || \
( (IS_UNICODE_MAPPABLE_TO_ASCII(_ch)) && \
( ((_ch) >= 128) || \
(TST_BIT(NW_LocaleTable->DOSValidCharBitMap,(_ch)))))))
#define DOSNS_isValid7BitUnicodeFileNameChar(_ch,_preValidated) \
( (!IS_UNICODE_AUG_WILDCARD_CHAR(_ch)) && \
( (_preValidated) || \
( ((_ch) < 128) && \
(TST_BIT(NW_LocaleTable->DOSValidCharBitMap,(_ch))))))
#define DOSNS_isValidUnicodeUpperFileNameChar(_ch,_preValidated) \
( (!IS_UNICODE_AUG_WILDCARD_CHAR(_ch)) && \
( (_preValidated) || \
( (IS_UNICODE_MAPPABLE_TO_ASCII(_ch)) && \
( ((_ch) >= 128) || \
(TST_BIT(NW_LocaleTable->DOSValidCharBitMapNoLower,(_ch)))))))
/*---------------------------------------------------------------------------
* This returns TRUE if the given character is a UNICODE wildcard character
* else it returns FALSE.
*---------------------------------------------------------------------------*/
#define DOSNS_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 DOSNS_asciiScanNextComponent(
GeneralMsg_s *genMsg,
ScanComponentMsg_s *scanMsg);
extern STATUS DOSNS_asciiLenScanNextComponent(
GeneralMsg_s *genMsg,
ScanComponentMsg_s *scanMsg);
extern STATUS DOSNS_utf8ScanNextComponent(
GeneralMsg_s *genMsg,
ScanComponentMsg_s *scanMsg);
extern STATUS DOSNS_utf8LenScanNextComponent(
GeneralMsg_s *genMsg,
ScanComponentMsg_s *scanMsg);
extern STATUS DOSNS_unicodeScanNextComponent(
GeneralMsg_s *genMsg,
ScanComponentMsg_s *scanMsg);
extern STATUS DOSNS_isLegalName(
GeneralMsg_s *genMsg,
unicode_t *srcName);
extern NINT DOSNS_generateUniqueName(
GeneralMsg_s *genMsg,
NamedBeast_s *directory,
NameSpace_s *srcNameSpace,
NINT srcNameType,
unicode_t *srcName,
unicode_t *uniqueName);
extern STATUS DOSNS_getSeparator(
GeneralMsg_s *genMsg,
NINT type,
unicode_t **retStr,
NINT *retLen);
extern SNINT DOSNS_asciiCompareFileNames(
CONST char *storeName,
CONST char *lookupName,
NINT storeFlags);
extern SNINT DOSNS_asciiLenCompareFileNames(
CONST char *storeName,
NINT storeNameLen,
CONST char *lookupName,
NINT lookupNameLen,
NINT storeFlags);
extern SNINT DOSNS_unicodeCompareFileNames(
CONST unicode_t *storeName,
CONST unicode_t *lookupName,
NINT storeFlags);
extern STATUS DOSNS_wildReplace(
GeneralMsg_s *genMsg,
unicode_t *srcPattern,
unicode_t *srcName,
unicode_t *replacePattern,
unicode_t *ret_newName);
extern BOOL DOSNS_wildMatch(
unicode_t *pattern,
unicode_t *name,
NINT storeFlags);
extern STATUS DOSNS_asciiToUnicode(
GeneralMsg_s *genMsg,
NINT conversionType,
char *asciiName,
unicode_t *destName,
NINT destNameSize);
extern STATUS DOSNS_asciiLenToUnicode(
GeneralMsg_s *genMsg,
NINT conversionType,
char *asciiName,
NINT asciiNameLen,
unicode_t *destName,
NINT destNameSize);
extern STATUS DOSNS_unicodeToAscii(
GeneralMsg_s *genMsg,
NINT conversionType,
unicode_t *unicodeName,
char *destName,
NINT destNameSize);
extern STATUS DOSNS_unicodeToAsciiLen(
GeneralMsg_s *genMsg,
NINT conversionType,
unicode_t *unicodeName,
char *destName,
NINT destNameSize,
NINT *retDestLen);
#endif /* _DOSNSPACE_H_ */