Files
mars-nwe/doc/librarys/nwcore
Mario Fetka abfd381fbc
All checks were successful
Source release / source-package (push) Successful in 1m23s
0515 doc: fold internal bundled dependencies into owning libraries
2026-06-14 09:46:34 +02:00
..

nwcore

nwcore is the common runtime library for mars-nwe. It contains Mars-native helpers and the gradually imported Novell/NSS core runtime pieces.

Public include roots

Consumers should receive include/core as an include root and keep NSS subdirectories in include names. Examples:

#include <core.h>
#include <ini.h>
#include <include/fsm.h>
#include <include/latch.h>
#include <include/schedule.h>
#include <library/xString.h>
#include <public/zOmni.h>

Do not add include/core/include, include/core/library, or include/core/public as public compiler include roots. The subdirectory is part of the Novell-compatible include name.

Mars-native APIs

These APIs are Mars-owned and may be used directly by Mars code:

  • core.h
  • ini.h
  • spinlock.h

ini.h is the public Mars INI API. The bundled iniparser sources are an implementation detail below that wrapper and should not be called directly from new Mars code.

Imported NSS core runtime

The following NSS runtime groups are currently imported and built into nwcore:

  • library/stdio: LB_printf, LB_snprintf, LB_aprintf, and related NSS formatter entry points. Keep these for NSS code because they support NSS formatting extensions such as %Lu.
  • library/stdlib: allocation helpers such as LB_malloc, LB_free, LB_realloc, LB_StackAllocate, LB_StackFree, plus zalloc helpers.
  • library/os: MPK spinlock support, mailbox, delay and work-to-do helpers.
  • library/fsm: NSS finite-state-machine runtime.
  • library/latch: NSS latch runtime.
  • library/parse: NSS command-line parser support.
  • library/wio: NSS WIO output helpers.
  • library/debug: NSS production debug output base.
  • library/misc: registration, version display and histogram helpers.
  • library/guid, library/id, library/utc, library/unicode.
  • third_party/unicodeTables: table data used by the nwcore Unicode conversion runtime. New code should use the nwcore Unicode APIs, not the table generator or table data directly.
  • nss/lib: NSS bitmap, CRC and hash support.
  • sharedsrc: NSS shared source include fragments used by small translation units such as uni2utf.c and utf2uni.c.

API usage guidance

Prefer public or higher-level NSS APIs over low-level implementation helpers. For example, fillInWork() is imported because later NSS code depends on it, but new Mars code should not use it directly unless it is implementing the NSS work scheduler itself. When the higher-level WORK_*, alarm, control or xCache APIs are imported, Mars code should use those documented entry points instead.

The same rule applies to FSM/latch internals: use the exported header macros and functions from include/fsm.h, include/latch.h and include/schedule.h, not private structure manipulation unless porting original NSS code that already did so.

Porting rule

NSS imports should keep original filenames and directory shape where practical. Only minimal Linux-userspace fixes should be applied. Large fake wrappers should not be added when a real NSS implementation exists.

Internal bundled dependencies

The following bundled packages currently support nwcore but are not public Mars library APIs:

  • third_party/iniparser: backing implementation for the Mars ini.h wrapper.
  • third_party/unicodeTables: generated/imported table data for the NSS/Mars Unicode conversion layer.

Keep these dependencies hidden behind nwcore APIs. If another component needs configuration parsing or Unicode conversion, extend/document the nwcore API instead of reaching into the bundled package directly.