jwt27 / djgpp-cvs

git mirror of cvs.delorie.com:/cvs/djgpp
http://www.delorie.com/djgpp/cvs.html
GNU General Public License v2.0
10 stars 7 forks source link

process: add dos_exec_flags #7

Closed stsp closed 1 year ago

stsp commented 1 year ago

They are written to AL when calling 4Bh. They define the mode of execution, and also has a special value 0x80 for loadhigh (at least on freedos).

jwt27 commented 1 year ago

Does this need to be a global var? Maybe it's nicer to add a parameter in _dos_exec()/__djgpp_spawn()?

Also please send this to the djgpp list too. If you don't get any response there we can see about merging it here.

stsp commented 1 year ago

It of course doesn't need to be a global var. But you can't just change the public function, so if only add a new ones. A few of them, for all wrappers of dos_exec. Do you think its worth a trouble, given how "often" this flag is used?

jwt27 commented 1 year ago

I was thinking you could add a default param to _dos_exec/__djgpp_spawn, so that wouldn't affect existing code. I see the latter already has a flags argument, so you could also add more SPAWN_... flags to use with that. Or similarly you could add more P_... mode flags for use with the spawn wrapper functions.

Just thinking out loud here. Please also ask on the djgpp list for feedback.

stsp commented 1 year ago

I was thinking you could add a default param to _dos_exec/__djgpp_spawn, so that wouldn't affect existing code. I see the latter already has

"latter" has, but the former? (_dos_exec) There is a very big list of funcs in process.h, each one may need loadhigh.

Or similarly you could add more P_... mode flags for use with the spawn wrapper functions.

So which of your proposals cover _dos_exec itself?

stsp commented 1 year ago

Maybe introduce _dos_exec2() with flags, and also a global var for others?

stsp commented 1 year ago

Or maybe just add _dos_exec2 and forget about the rest? Sounds good to me.

stsp commented 1 year ago

Added new fn instead of a var. Looks better?

stsp commented 1 year ago

Since not too many ppl write command.com with djgpp and this functionality is specific to command.com, I think this is really a better approach.

jwt27 commented 1 year ago

Why not just add a defaulted flags parameter in _dos_exec?

And again please try to start a discussion on the djgpp list. This is not the main repo and we are not the only users.

stsp commented 1 year ago

Defaulted parameter in c, not c++? Come on. :)

stsp commented 1 year ago

I can post to ml later, yes.

jwt27 commented 1 year ago

Defaulted parameter in c, not c++? Come on. :)

Aaaah I'm stupid, sorry :)