Files
mars-nwe/include/nwnss/internal/macNSpace.h
ChatGPT 799a494ada
All checks were successful
Source release / source-package (push) Successful in 2m48s
0553 nwnss: import COMN variable data and namespace headers
2026-06-15 18:08:20 +02:00

225 lines
6.6 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 (PSS) module
|
|---------------------------------------------------------------------------
|
| $Author: blarsen $
| $Date: 2005-01-06 03:19:58 +0530 (Thu, 06 Jan 2005) $
|
| $RCSfile$
| $Revision: 483 $
|
|---------------------------------------------------------------------------
| This module is used to:
| This defines the interface into name spaces.
+-------------------------------------------------------------------------*/
#ifndef _MACNSPACE_H_
#define _MACNSPACE_H_
#ifndef _OMNI_H_
#include <omni.h>
#endif
/*---------------------------------------------------------------------------
* Name length restrictions
*---------------------------------------------------------------------------*/
/***** fixfixfix@nextMediaFormatChange begin *******/
#define MACNS_NAME_LIMIT 255 // Changed from 31 to 255 to support AFP 3.1 9/04
#define MACNS_LEGACY_NAME_LIMIT 31
/***** fixfixfix@nextMediaFormatChange end *******/
/*---------------------------------------------------------------------------
* Definition of structure for packed MAC metadata
*---------------------------------------------------------------------------*/
#define MAC_METADATA_LAYOUT 1
typedef struct PackedMacInfo_s
{
WORD rvdID;
WORD rvdLayout;
zMacInfo_s macInfo;
} NSS_MEDIA_STRUCTURE(PackedMacInfo_s,macInfo.dirRightsMask) PackedMacInfo_s;
/*---------------------------------------------------------------------------
* Internal MAC NS support routines
*---------------------------------------------------------------------------*/
extern void MACNS_shutdown(
NameSpace_s *ns);
/*---------------------------------------------------------------------------
* This returns TRUE if this is a VALID MAC filename character.
*---------------------------------------------------------------------------*/
#define MACNS_isValidUnicodeFileNameChar(_ch) \
( (!IS_INVALID_UNICODE_CHAR(_ch)) && \
((_ch) != 0) && \
((_ch) != UNI_COLON) )
/*---------------------------------------------------------------------------
* This returns TRUE if this unicode character is valid and is mappable
* to ASCII in the current macintosh code page.
*---------------------------------------------------------------------------*/
/***** fixfixfix@nextMediaFormatChange begin *******/
BOOL MACNS_isValidAndMappableUnicodeFileNameChar (unicode_t ch, int nameLimitLen);
#define MACNS_isValidAndMappableLegacyUnicodeFileNameChar(_ch) \
( (!IS_INVALID_UNICODE_CHAR(_ch)) && \
(IS_UNICODE_MAPPABLE_TO_MAC_ASCII(_ch)) && \
((_ch) != 0) && \
((_ch) != UNI_COLON) )
#define MACNS_isValidUnicodeFileNameChar(_ch) \
( (!IS_INVALID_UNICODE_CHAR(_ch)) && \
((_ch) != 0) && \
((_ch) != UNI_COLON) )
/***** fixfixfix@nextMediaFormatChange end *******/
/*---------------------------------------------------------------------------
* Function prototypes for name Space OPs
*---------------------------------------------------------------------------*/
extern STATUS MACNS_asciiScanNextComponent(
GeneralMsg_s *genMsg,
ScanComponentMsg_s *scanMsg);
extern STATUS MACNS_asciiLenScanNextComponent(
GeneralMsg_s *genMsg,
ScanComponentMsg_s *scanMsg);
extern STATUS MACNS_utf8ScanNextComponent(
GeneralMsg_s *genMsg,
ScanComponentMsg_s *scanMsg);
extern STATUS MACNS_utf8LenScanNextComponent(
GeneralMsg_s *genMsg,
ScanComponentMsg_s *scanMsg);
extern STATUS MACNS_unicodeScanNextComponent(
GeneralMsg_s *genMsg,
ScanComponentMsg_s *scanMsg);
extern STATUS MACNS_isLegalName(
GeneralMsg_s *genMsg,
unicode_t *srcName);
extern NINT MACNS_generateUniqueName(
GeneralMsg_s *genMsg,
NamedBeast_s *directory,
NameSpace_s *srcNameSpace,
NINT srcNameType,
unicode_t *srcName,
unicode_t *uniqueName);
extern STATUS MACNS_getSeparator(
GeneralMsg_s *genMsg,
NINT type,
unicode_t **retStr,
NINT *retLen);
extern SNINT MACNS_asciiCompareFileNames(
CONST char *storeName,
CONST char *lookupName,
NINT storeFlags);
extern SNINT MACNS_asciiLenCompareFileNames(
CONST char *storeName,
NINT storeNameLen,
CONST char *lookupName,
NINT lookupNameLen,
NINT storeFlags);
extern SNINT MACNS_unicodeCompareFileNames(
CONST unicode_t *storeName,
CONST unicode_t *lookupName,
NINT storeFlags);
extern STATUS MACNS_wildReplace(
GeneralMsg_s *genMsg,
unicode_t *srcPattern,
unicode_t *srcName,
unicode_t *replacePattern,
unicode_t *ret_newName);
extern BOOL MACNS_wildMatch(
unicode_t *pattern,
unicode_t *name,
NINT storeFlags);
extern STATUS MACNS_asciiToUnicode(
GeneralMsg_s *genMsg,
NINT conversionType,
char *asciiName,
unicode_t *destName,
NINT destNameSize);
extern STATUS MACNS_asciiLenToUnicode(
GeneralMsg_s *genMsg,
NINT conversionType,
char *asciiName,
NINT asciiNameLen,
unicode_t *destName,
NINT destNameSize);
extern STATUS MACNS_unicodeToAscii(
GeneralMsg_s *genMsg,
NINT conversionType,
unicode_t *unicodeName,
char *destName,
NINT destNameSize);
extern STATUS MACNS_unicodeToAsciiLen(
GeneralMsg_s *genMsg,
NINT conversionType,
unicode_t *unicodeName,
char *destName,
NINT destNameSize,
NINT *retDestLen);
extern STATUS MACNS_getInfo(
GeneralMsg_s *genMsg,
NamedBeast_s *beast,
GetInfoMsg_s *info);
extern STATUS MACNS_modifyInfo(
GeneralMsg_s *genMsg,
NamedBeast_s *beast,
ModifyInfoMsg_s *info);
extern NINT MACNS_PackedSizeRootVariableData(
RootBeast_s *beast);
extern BYTE *MACNS_PackRootVariableData(
RootBeast_s *beast,
BYTE *storeBuffer);
extern BYTE *MACNS_UnpackRootVariableData(
GeneralMsg_s *genMsg,
RootBeast_s *beast,
BYTE *storeBuffer);
extern void MACNS_FreeRootVariableData(
RootBeast_s *beast);
#endif /* _MACNSPACE_H_ */