/*static char *SCCSID = "@(#)tmpdos16.h	6.3 91/11/19";                                 */
/****************************************************************************/
/*									    */
/*			 IBM/Microsoft Confidential			    */
/*									    */
/*		   Copyright (c) IBM Corporation  1987, 1990		    */
/*		   Copyright (c) Microsoft Corp.  1987, 1990		    */
/*			     All Rights Reserved			    */
/*									    */
/****************************************************************************/

/********** START OF SPECIFICATIONS ****** IBM CONFIDENTIAL **********/
/*								     */
/* SOURCE FILE NAME: TMPDOS16.H 				     */
/*								     */
/* DESCRIPTIVE NAME: Define 16 bit doscalls			     */
/*								     */
/* FUNCTION:							     */
/*								     */
/*     This include file gives prototypes of 16 bit doscalls	     */
/*     used by the 32 bit common subroutines.  These use _far16      */
/*     directives to allow conversion from linear 32 bit ptrs	     */
/*     to 16 bit segmented ptrs.				     */
/*								     */
/* EXTERNAL REFERENCE:	none					     */
/*								     */
/* RELEASE:							     */
/*								     */
/*   VERSION	  DATE		 REASON 			     */
/*								     */
/*     1.00    09/25/1989      initial version			     */
/*								     */
/* B031 PB725014 11/17/91 CMM: Unresolved symbols in DBCS support fgw*/
/*			       delete definitions for- countrycode   */
/*						     - DOSGETDBCSEV  */
/*						     - DOSCASEMAP    */
/*********************************************************************/

/***from subcalls.h***/

struct KeyData {
	unsigned char char_code;	/* ASCII character code */
	unsigned char scan_code;	/* scan code */
	unsigned char status;		/* indicates state of the character */
	unsigned char nls_shift;	/* reserved */
	unsigned short shift_state;	      /* state of the shift keys */
	unsigned long time;		/* time stamp of the keystroke */
       };


/* csc 9/11/89 */

extern unsigned short _far16 pascal DOSOPEN (
	 char _far16 *, 		       /* file name	 */
	 unsigned short _far16 *,	       /* file handle	 */
	 unsigned short _far16 *,	       /* action taken	 */
	 unsigned long, 		       /* file size	 */
	 unsigned short,		       /* file attribute */
	 unsigned short,		       /* open flag	 */
	 unsigned short,		       /* open mode	 */
	 unsigned long );		       /* reserved	 */


/* csc 9/15/89 */

extern unsigned short _far16 pascal DOSCLOSE (
	 unsigned short );		/* file handle	  */


/* csc 9/11/89 */

extern unsigned short _far16 pascal DOSREAD (
	unsigned short, 		      /* File handle */
	char _far16 *,			   /* Address of user buffer */
	unsigned short, 		      /* Buffer length */
	unsigned short _far16 * );		 /* Bytes read */


/* csc 9/15/89 */

extern unsigned short _far16 pascal DOSDEVIOCTL(
	 char _far16 *,    /* data		*/
	 char _far16 *,    /* parameter list	*/
	 unsigned short,     /* function	  */
	 unsigned short,     /* category	  */
	 unsigned short );  /* device handle	 */


/* csc 9/15/89 */

extern unsigned short _far16 pascal DOSCHGFILEPTR(
	 unsigned short,	     /* handle		    */
	 long,			     /* distance to move    */
	 unsigned short,	     /* method of moving    */
	 unsigned long _far16 * );   /* NewPointer);	    */


/* csc 9/15/89 */

extern unsigned short _far16 pascal DOSQFSATTACH (
	     char _far16 *,		 /*  drive letter		   */
	     unsigned short,		 /*  Ordinal always starts at 1    */
	     unsigned short,		 /*  Level 1 returns data for the  */
					 /*  specific drive or device	   */
					 /*  name refered to by devicename */
	     char _far16 *,		 /*  the return info buffer	   */
	     unsigned short _far16 *,	 /* the return buffer len	   */
	     unsigned long );		 /* reserved (must be zero)	   */


/* csc 9/20/89 for cmexec.c */

extern unsigned short _far16 pascal DOSLOADMODULE (
	     char _far16 *,		 /*  object name buffer 	   */
	     unsigned short,		 /*  object name buffer length	   */
	     char _far16 *,		 /*  module name string 	   */
	     unsigned short _far16 * );  /*  module handle (returned)	   */


/* csc 9/20/89 for cmexec.c */

extern unsigned short _far16 pascal DOSFREEMODULE (
	     unsigned short );		 /*  handle			    */


/* csc 9/20/89 for cmexec.c */

extern unsigned short _far16 pascal DOSGETPROCADDR (
	     unsigned short,		 /*  module handle		    */
	     char _far16 *,		 /*  entry point in module	    */
	     unsigned long _far16 * );	 /*  procedure address		    */


extern unsigned short _far16 pascal DOSALLOCSEG (
	unsigned short, 		      /* Number of bytes requested */
	unsigned short _far16 *,	  /* Selector allocated (returned) */
	unsigned short );		      /* Indicator for sharing */


extern unsigned short _far16 pascal DOSQCURDISK (
	 unsigned short _far16 *,
	 unsigned long _far16 * );


extern unsigned short _far16 pascal DOSREALLOCSEG (
	unsigned short, 		      /* New size requested in bytes */
	unsigned short );		      /* Selector */


extern unsigned short _far16 pascal DOSFREESEG (
	unsigned short );		      /* Selector */


extern unsigned short _far16 pascal DOSGETVERSION (
	unsigned short _far16 * );	  /* Address to put version number */


extern unsigned short _far16 pascal DOSGETMESSAGE (
	char _far16 * _far16 *, 	   /* Table of variables to insert */
	unsigned short, 		   /* Number of variables */
	char _far16 *,			   /* Address of message buffer */
	unsigned short, 		      /* Length of buffer */
	unsigned short, 		      /* Number of the message */
	char _far16 *,			   /* Message file name */
	unsigned short _far16 * );	   /* Length of returned message */


extern unsigned short _far16 pascal DOSPUTMESSAGE (
	unsigned short, 		      /* Handle of output file/device */
	unsigned short, 		      /* Length of message buffer */
	char _far16 * );		   /* Message buffer */


extern unsigned  short _far16 pascal DOSGETMACHINEMODE (
	unsigned char _far16 * );	   /* Address to put mode number */


extern unsigned short _far16 pascal DOSQHANDTYPE (
	unsigned short, 		      /* File Handle */
	unsigned short	_far16 *,      /* HandleType(0=file,1=device,2=pipe)*/
	unsigned short	_far16 * );    /* Device Driver Attribute Word */


extern unsigned short _far16 pascal KBDFLUSHBUFFER (
	unsigned short);		     /* keyboard handle */


extern unsigned short _far16 pascal KBDCHARIN (
	struct KeyData _far16 *,	   /* Buffer for character code */
	unsigned short, 		      /* I/O wait - 0=wait for a */
					/* character, 1=no wait */
	unsigned short);		     /* keyboard handle */
