Prefix all exported functions with Titan?

Issue #43 new
Carbon Monoxide created an issue

leads to better readable source code and prevents naming conflicts.

Comments (4)

  1. --

    hm at least for c++ projects its not necessary. I do

    #include "TitanEngine.hpp"
    using namespace TE;
    
    Realigner::IsPE32FileValidEx
    Dumper::GetPE32Data
    Debugger::InitDebug
    
    etc..
    

    so there will hardly be naming conflicts.

    For C however it could make sense. Instead of "GetPE32Data" sth like "TE_GetPE32Data" so its more clear this functions belongs to lib-code and not usercode. Especially when reading foreign code I really like to see at once whats coming from libs and what is usercode thats worth a step-in.

  2. Duncan

    I agree on this from one side (although, no _ in function names unless its required!!!), on the other side, this would require everyone to update all their TitanEngine code. I removed the GetProcessInformation, because there was a conflict with the windows 8 SDK (VS13).

    Greetings

  3. --

    so we could double define all functions in C header to keep legacy code working for a while until the (informed) users had enough time to refactor their codes.

    the C export names are crap anyway and need refactoring. but I never cared because I only use c++ TE

    some are named FindOverlay, ExtractSection etc while others include the "section" they are affiliated with like RelocaterExportRelocation, ResourcerEnumerateResource..

    IF we decide to use a prefix we should do it consistenly and fixup the exports that miss their section like InitDebug should become TEDebuggerInitDebug. its way longer but because we lack namespaces this would clear up alot when reading code.

    Also code-completion would be of better assitance when typing TE or TEDebugger because noone can recall every of TEs exports :P

  4. Carbon Monoxide reporter

    yes I agree, it is a must have for the C/ASM headers. Who is using TE after all? :P Only a few... but we should not change the names entirely, because of the offical documentation. It should be somehow possible to still use the official docu.

  5. Log in to comment