open in text mode (O_TEXT) (Developers)
So you're probably already familiar with Cygwin
adding an O_TEXT extension for Unix programs
so that when run under Windows the CRLF can be generated.
I have done the same thing with the Linux executables
I produce (by linking with PDPCLIB):
/* reserve 8000 0000 as a flag to indicate extension */
/* make sure O_TEXT hasn't been set to 0 by undefining */
/* and next available bit counting down is thus 4000 0000 */
#undef O_TEXT
#define O_TEXT 0x40000000
static int open(const char *a, int b, int *c)
{
int ret = -1;
int oflag = 0;
if (myfile->textMode)
{
oflag = O_TEXT;
}
And now I wish to do something similar with MSDOS open (21H 3DH).
https://www.ctyme.com/intr/rb-2779.htm
And this:
https://www.ctyme.com/intr/rb-2779.htm#Table1402
3 reserved (0)
looks like the most likely candidate. But as with Linux above,
I want to allow for more flags to be added. And it looks to
me like they are all in use (table 1402).
So what I would suggest is that bit 3 doesn't mean "O_TEXT",
it instead means "check register cx for more flags", and
then bit 0 of CX can mean O_TEXT.
Note that this is a more general question than just MSDOS.
Because I have the Pos wrappers, I actually call PosOpenFile,
which looks like this:
int PosOpenFile(const char *name, /* func 3d */
int mode,
int *handle);
So it is probably best for me to create a mode2 parameter
for the extended flags.
Although another option is to use the top 8 bits of the
existing mode parameter as the first 8 bits of the CX
extension.
However the spirit of the Pos functions was to match
directly onto the MSDOS registers.
Any thoughts on a "BTTR standard"?
Microsoft obviously don't care so it may as well be
BTTR that is the defacto "steering committee".
Thanks. Paul.
Complete thread:
- open in text mode (O_TEXT) - kerravon, 24.02.2025, 04:19 (Developers)
- open in text mode (O_TEXT) - kerravon, 24.02.2025, 04:24
- open in text mode (O_TEXT) - tkchia, 26.02.2025, 16:30
- open in text mode (O_TEXT) - Rugxulo, 27.02.2025, 00:29
- open in text mode (O_TEXT) - kerravon, 02.03.2025, 01:30
- open in text mode (O_TEXT) - kerravon, 02.03.2025, 01:33
- open in text mode (O_TEXT) - tkchia, 03.03.2025, 15:09
- open in text mode (O_TEXT) - kerravon, 02.03.2025, 01:35
- open in text mode (O_TEXT) - tkchia, 26.02.2025, 16:30
- open in text mode (O_TEXT) - kerravon, 24.02.2025, 04:24