diff options
| author | Rusty Wagner <rusty@vector35.com> | 2015-08-19 23:49:04 -0400 |
|---|---|---|
| committer | Rusty Wagner <rusty@vector35.com> | 2015-08-19 23:49:04 -0400 |
| commit | 00369dcd62ea48a9174a6923498f4375968a94c3 (patch) | |
| tree | ef31b9f4e92d252bf23d8d687ba4f43dc2eb3378 /type.cpp | |
| parent | 59f9b193ac9da6c861965be153eb8c788388089a (diff) | |
Add C preprocessor in preparation for type parsing
Diffstat (limited to 'type.cpp')
| -rw-r--r-- | type.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -355,3 +355,26 @@ void Enumeration::AddMemberWithValue(const string& name, uint64_t value) { BNAddEnumerationMemberWithValue(m_enum, name.c_str(), value); } + + +bool BinaryNinja::PreprocessSource(const string& source, const string& fileName, string& output, string& errors, + const vector<string>& includeDirs) +{ + char* outStr; + char* errorStr; + const char** includeDirList = new const char*[includeDirs.size()]; + + for (size_t i = 0; i < includeDirs.size(); i++) + includeDirList[i] = includeDirs[i].c_str(); + + bool result = BNPreprocessSource(source.c_str(), fileName.c_str(), &outStr, &errorStr, + includeDirList, includeDirs.size()); + + output = outStr; + errors = errorStr; + + BNFreeString(outStr); + BNFreeString(errorStr); + delete[] includeDirList; + return result; +} |
