/*
SWITCHAR.C -- uses undocumented DOS Function 3701h
switchar    changes DOS switch char to - and path char to /
switchar \  restores DOS switch char to / and path char to \
*/

#include <stdlib.h>
#include <stdio.h>
#include <dos.h>

main(int argc, char *argv[])
{
    int c = (argc > 1) ? argv[1][0] : '-';
#ifdef __TURBOC__
    _DL = c;
    _AX = 0x3701;
    geninterrupt(0x21);
	_AH = 0;			// retval in AX
#elif defined(_MSC_VER) && (_MSC_VER >= 600)
    _asm {
        mov dl, c
        mov ax, 3701h
        int 21h
        xor ah, ah		; retval in AX
        }
#else
	union REGS r;
	r.h.dl = c;
	r.x.ax = 0x3701;
	intdosx(&r, &r);
	return r.h.al;
#endif
}
