[go: up one dir, main page]

Skip to content

Reference "current" module via sourcefile_t (indirectly eliminate the need for CURRENTMODULE global variable)

Expression parsing, linking modules, linking libraries and ReportError() may refer to module ownership by establishing this link when sourcefile_t is established with NewFile() and SetFile(), by passing a pointer to module structure (which is know at the moment of when a new file structure is established.

Typically, a module is just one file (the source code itself); all included files may copy the module reference from "parent" sourcefile_t, also via NewFile().

NewFile() will be refactored to also include a module pointer argument, which is then assigned to the sourcefile_t via SetFile().

Generally, refactor the need for CURRENTMODULE by passing module_t argument in function calls (typically in modules.c)

Edited by Bits4fun