core: import NSS Macintosh codepage name helper into libnwcore
All checks were successful
Source release / source-package (push) Successful in 1m33s

This commit is contained in:
MARS-NWE Patch Bot
2026-06-12 16:24:31 +00:00
committed by Mario Fetka
parent 3c4359d096
commit d79b057424
4 changed files with 125 additions and 2 deletions

11
AI.md
View File

@@ -1,9 +1,9 @@
# AI working notes for mars-nwe
## Current handoff status after NSS low-level imports 0404-0416
## Current handoff status after NSS low-level imports 0404-0417
Current accepted MARS-NWE server line in this work session includes the NSS
low-level libnwcore imports through `0416`:
low-level libnwcore imports through `0417`:
- `0404` imports NSS `bitmap.c` directly as `src/core/bitmap.c`.
- `0405` moves the imported bitmap/NSS base headers directly into
@@ -63,6 +63,13 @@ low-level libnwcore imports through `0416`:
introduced; any future table data still belongs in the external
`mars-unicode-tables` submodule.
- `0417` imports NSS `getMacCodePageName.c` and fills out the remaining
lightweight Unicode init symbols (`LB_UnicodeStartup()`,
`LB_UnicodeShutdown()`, `MacintoshCodePageName`) needed by imported NSS
converter entry points. The Macintosh codepage name stays NULL until the
real codepage table/runtime layer is imported, so no new Unicode/codepage
tables are introduced in this patch.
Keep future NSS low-level imports directly under `src/core/<original>.c` and
`include/core/<original>.h`. Do not add a new `nwcore/nss/` or
`src/core/nss/` path for the active libnwcore imports.

View File

@@ -104,6 +104,7 @@ set(NWCORE_IMPORTED_NSS_SOURCES
bitmap.c
bit.c
crc.c
getMacCodePageName.c
getNssUnicodeVersion.c
hash.c
componentUnicpy.c

View File

@@ -0,0 +1,95 @@
/****************************************************************************
|
| (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:
| Routine to convert ascii to unicode_t
|
| 9/14/01: Instead of calling system routines for unicode conversion, NSS
| has created is own set of conversion functions that are MP safe and fast.
+-------------------------------------------------------------------------*/
#if zLINUX
#include "nssOSAPIs.h"
#endif
#include <unicodeInit.h>
#include <zOmni.h>
#include <xError.h>
#include <string.h>
#if zNETWARE
#include "nssOSAPIs.h"
#endif
/**************************************************************************
*
* This returns the ASCII name of the current Macintosh Code Page.
*
* Return Codes:
* zOK - The codepage name is returned in the buffer.
* zERR_NO_FILES_FOUND - The codepage name is empty or not initialized.
* zERR_BUFFER_TOO_SMALL - the buffer provided by the caller is not
* big enough to contain the code page name.
*
***************************************************************************/
STATUS LB_GetMacCodePageName(
BYTE *nameBuffer, /* Buffer into which the name will be put*/
NINT bufferLen) /* Length of the buffer */
{
NINT nameLen;
if (MacintoshCodePageName == NULL)
{
/* This is a silly error to return, but it implies that we did not
* fine a name for the Macintosh code page. That is all that is needed.
*/
return(zERR_NO_FILES_FOUND);
}
nameLen = strlen(MacintoshCodePageName);
if (nameLen == 0)
{
/* This is a silly error to return, but it implies that we did not
* fine a name for the Macintosh code page. That is all that is needed.
*/
return(zERR_NO_FILES_FOUND);
}
else if (nameLen > (bufferLen-1))
{
/* Not enough room in the caller's buffer to receive the name. */
return(zERR_BUFFER_TOO_SMALL);
}
else
{
strcpy(nameBuffer, MacintoshCodePageName);
}
return zOK;
}

View File

@@ -23,6 +23,7 @@
| MARS-NWE libnwcore Unicode case table bootstrap.
+-------------------------------------------------------------------------*/
#include <xUnicode.h>
#include <xError.h>
/*
* NSS stores the Unicode translation of byte 0xff in these globals for
@@ -34,6 +35,15 @@
unicode_t NSSUnicodeFF = ASCII_WILDCARD_BREAK;
unicode_t NSSUnicodeMacFF = ASCII_WILDCARD_BREAK;
/*
* Full NSS Unicode startup also tracks the active Macintosh codepage name.
* Keep the exported storage so LB_GetMacCodePageName() and future converter
* imports link; the value remains NULL until codepage tables/runtime are
* imported from the external unicode table source.
*/
BYTE *MacintoshCodePageName = NULL;
/*
* NSS normally fills NSSUniToLower[]/NSSUniToUpper[] during
* LB_UnicodeStartup() in public_core/library/unicode/unicodeInit.c via the
@@ -45,6 +55,16 @@ unicode_t NSSUnicodeMacFF = ASCII_WILDCARD_BREAK;
* statically initialized by TAB/unicodeTables.c and therefore need no runtime
* fill step here.
*/
STATUS LB_UnicodeStartup(void)
{
LB_UnicodeCaseStartup();
return zOK;
}
void LB_UnicodeShutdown(void)
{
}
void LB_UnicodeCaseStartup(void)
{
}