Category : C Source Code
Archive   : DMAKE38B.ZIP
Filename : SWITCHAR.C

 
Output of file : SWITCHAR.C contained in archive : DMAKE38B.ZIP
/*
** return switch char
*/
#if defined(OS2) || defined(_MSC_VER)
#include
#endif
#if !defined(OS2)
#include
#endif /* !OS2 */
#include
#include "stdmacs.h"

getswitchar()/*
===============
Try the environment first. If you don't find SWITCHAR there, then use
the DOS call. The call is undocumented, and doesn't work for DOS versions
4.0 and up, so the check of the environment will fix that. */
{
#if defined(__MSDOS__) || defined(M_I86)
#if !defined(OS2)
union REGS rg;
#endif /* ! OS2 */
static char *_env_switchar = NIL(char);

if( _env_switchar != NIL(char) ||
(_env_switchar = (char *)getenv("SWITCHAR")) != NIL(char) )
return(*_env_switchar);

#if !defined(OS2)
rg.h.ah = 0x37; /* switch char request */
rg.h.al = 0; /* get (not set) */

intdos(&rg, &rg);
return (rg.h.dl);
#endif /* ! OS2 */
#endif /* M_I86 */

return ('-');
}


  3 Responses to “Category : C Source Code
Archive   : DMAKE38B.ZIP
Filename : SWITCHAR.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/