Skip to content

feat: add Dmod_ModuleExists function - #340

Merged
JohnAmadis merged 2 commits into
developfrom
copilot/add-module-exists-function
Oct 24, 2026
Merged

JohnAmadis merged 2 commits into
developfrom
copilot/add-module-exists-function

Conversation

@JaxCalder

Copy link
Copy Markdown
Contributor

Summary

Add a simple boolean function to check if a module exists in known locations without loading it.

Changes

  • ****: Added API declaration
  • ****: Implemented using internally
  • ****: Added unit tests

API

// Check if module exists
if (Dmod_ModuleExists("dmsystem")) {
    // Module is available
}

// Returns true if module found in any search path, false otherwise
bool exists = Dmod_ModuleExists(moduleName);

Uses the same search path logic as module loading but does not attempt to load the module.

OpenCode added 2 commits October 24, 2026 17:38
Add a simple boolean function to check if a module exists in known
locations without loading it. Uses the same search path logic as
Dmod_FindModuleFile.

- Add Dmod_ModuleExists(const char* ModuleName) API declaration
- Implement using Dmod_FindModuleFile internally
- Add unit tests for NULL, empty, non-existent and existing modules
- Fix InvalidateModuleSearchPaths API - it returns void, not bool
- Update test to be environment-independent (verify Dmod_ModuleExists
  matches Dmod_FindModuleFile behavior rather than assuming dmsystem exists)

@JohnAmadis JohnAmadis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nie podoba mi sie te 256 bajtow na stosie, no ale juz kij, bo duzo by trzeba bylo przerabiac

@JohnAmadis
JohnAmadis merged commit fa3eea3 into develop Oct 24, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants