OpenCoD2-Plus
Call of Duty 2 client & server, rebuilt
Loading...
Searching...
No Matches
check_bgame_names Namespace Reference

Functions

 load (path)
 strip_lexemes (text)
 named (text, names)
 plain_uses (preprocessed, names)
 source_text (path)
 preprocess_args (entry)
 source_root (build_dir)
 engine_entries (build_dir)
 check (path, entry, names)
 main ()

Variables

 ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
 LEXEMES = re.compile(r'//[^\n]*|/\*.*?\*/|"(?:\\.|[^"\\\n])*"|\'(?:\\.|[^\'\\\n])*\'', re.S)
 LINE_MARKER = re.compile(r'^# (\d+) "((?:\\.|[^"\\‍])*)"')

Detailed Description

Lists the engine sources that name a renamed bgame global under its plain name.

    python3 scripts/check_bgame_names.py <build_dir> [--names FILE]

In the client the engine's bgame globals that CoD2rev-Plus's code also defines
are renamed to eng_<name> by src/headers/engine_bgame_names.h, which
common_types.h includes (scripts/bgame_names.py). An engine source that names
one of them without that header in effect would link to CoD2rev-Plus's global
without an error. For each translation unit in <build_dir>/compile_commands.json
that is not CoD2rev-Plus's (the cod2_plus_* targets and test/vendored_files.txt)
and whose text names one of test/engine_bgame_names.txt, this runs the
preprocessor and looks for the plain name left in its output. Exits with 0
when there is none.

Function Documentation

◆ check()

check_bgame_names.check ( path,
entry,
names )

◆ engine_entries()

check_bgame_names.engine_entries ( build_dir)

◆ load()

check_bgame_names.load ( path)

◆ main()

check_bgame_names.main ( )

◆ named()

check_bgame_names.named ( text,
names )
The names text uses as identifiers (not in comments or literals).

◆ plain_uses()

check_bgame_names.plain_uses ( preprocessed,
names )
(file, line, name) for each plain name left in preprocessor output.

◆ preprocess_args()

check_bgame_names.preprocess_args ( entry)
The compile command of entry, made to write its preprocessed output.

◆ source_root()

check_bgame_names.source_root ( build_dir)

◆ source_text()

check_bgame_names.source_text ( path)
path's text and that of the files it includes by a quoted name next to
it or by an absolute one (as the C++ wrappers under cxx_wrap/ include
their C source), one level deep.

◆ strip_lexemes()

check_bgame_names.strip_lexemes ( text)
text without comments and literals; newlines kept, so lines still count.

Variable Documentation

◆ LEXEMES

check_bgame_names.LEXEMES = re.compile(r'//[^\n]*|/\*.*?\*/|"(?:\\.|[^"\\\n])*"|\'(?:\\.|[^\'\\\n])*\'', re.S)

◆ LINE_MARKER

check_bgame_names.LINE_MARKER = re.compile(r'^# (\d+) "((?:\\.|[^"\\‍])*)"')

◆ ROOT

check_bgame_names.ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))