@RobertBColton the windows-related code is ready for your review. Also I'd like some clarification on what fundies means exactly by it being disabled by default 'not effecting egm'.
EGM saves enabled extensions so you don't always have to toggle them.
UNMATCHED: Regression tests have indicated that graphical changes have been introduced. Carefully review the following image comparison for anomalies and adjust the changeset accordingly.
@@ Coverage Diff @@ ## master #2018 +/- ## ======================================= Coverage 30.95% 30.95% ======================================= Files 197 197 Lines 19115 19115 ======================================= Hits 5918 5918 Misses 13197 13197
@RobertBColton I removed all VLA's, reordered the headers to include the C++ headers before the C headers. I added two new functions, cmd_from_pid(pid) and env_from_pid(pid) to get the list of command line paramenters and environment variables from a given application instance's process id. I also got it everything MSVC compliant on Windows. Although, getting environment variables, due to how it was written, only supports 32-bit executables on Windows, which will be patched in the near future, hopefully, if all goes well. The next thing on my to do list is address the Cocoa helper function we talked about. :)
P.S. is using sizeof() as an array length considered technically a VLA? If so I need to find a different way to do this, and I still have a couple VLA's to get rid of, but other than that, the Windows bug with 64-bit executables, and the Cocoa helper, I don't have much else to do. Perhaps add a function to get a list of process id's associated with an executable name, or an executable path, and get the application name from a process id (not the file name, but the actual name of the application, which may not be the same as the title bar text either), and then all my goals for this are practically done other than the future maintenance it will need.
Oh and one last thing i want to document here - i need to probably also do a function for getting exact process id creation and kill times. This will cover everything I consider important for this extension to do, without adding too much to it.
I just read your comment that you just want an honest review, so ok I'll try to combine my recently acquired knowledge of processes and leave you some detailed feedback later. You may find the conversation on #2069 interesting as I now think you are relevant. I don't feel that there is a very good process library for C++ out there. There is only a proposal for a std::process API and the Qt/wxWidgets ones don't give good control over process groups. Perhaps this is something you could create Sam, and actually add CI for on your own repo and then submit to the MinGW/MSYS/Arch/Debian maintainers as a new package.
It would certainly make integration and use in ENIGMA as an extension much simpler.
That's a great idea, and I had actually thought about it. I might as well see if I can make it an official package for FreeBSD and Homebrew too for when Mac is fixed.
I think adding a homebrew package will be the easiest to get done because all it requires is the repository being made into a homebrew tap which means I won't have to go through any kind of review process by official package managers. All the hosting I can do on my own with mac. I'm going to start by contacting the MinGW team.
@RobertBColton feel free to contribute any features you would like to see in this pull request, or suggest ones and I'll do my best to add it. I just fixed the parsing logic for env_from_pid() and it now correctly handles environment variables with values containing an equals sign, in which case it wraps the value in quotes, making differentiation between the equals sign separating the name from the value and the equals signs inside the value easier for the end user to parse.
I also removed the duplicate functions from strings_util.h and moved them to their own source file that isn't included in the Makefile so it won't compile the duplicates because the macro that is needed to be defined isn't defined by enigma, but is defined in my GameMaker DLL's build scripts.
You mention process groups. What api function(s) did you need on that topic more specifically?
Just take a look at 8ecaaa2 how the Unix stop button was just implemented. It uses a process group to put all the processes that the ENIGMA compiler DLL starts during the build process into a group so that it can signal all of them without signaling itself.