⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dos.h

📁 超级解霸源代码。纯c语言写的。适合有一定编程基础的开发人员用来学习提高
💻 H
📖 第 1 页 / 共 2 页
字号:
#ifdef __cplusplus
extern "C" {
#endif

#if !defined( _Windows )
int         _Cdecl AbsRead( int __drive, int __nsects, long __lsect,
			    void _FAR *__buffer );
int         _Cdecl AbsWrite( int __drive, int __nsects, long __lsect,
			     void _FAR *__buffer );
int         _Cdecl AllocMem( unsigned __size, unsigned _FAR *__segp );
#endif

int         _CType _FARFUNC bDOS( int __DOSfun, unsigned __DOSdx, unsigned __DOSal );
int         _CType bDOSptr( int __DOSfun, void _FAR *__argument,
		unsigned __DOSal );
struct COUNTRY _FAR *_Cdecl country( int __xcode, struct COUNTRY _FAR *__cp);
void        _Cdecl CtrlBrk( int _Cdecl( *handler )( void ));

#if !defined( _Windows )
void        _CType Delay( unsigned __milliseconds );
#endif

void        _Cdecl _FARFUNC disable( void );
int         _Cdecl _FARFUNC DOSexterr( struct DOSERROR _FAR *__eblkp );
long        _Cdecl _FARFUNC DOStounix( struct date _FAR *__d, struct time _FAR *__t );

unsigned    _Cdecl _DOS_AllocMem( unsigned __size, unsigned _FAR *__segp );
unsigned    _Cdecl _DOS_close ( int __fd );
unsigned    _Cdecl _DOS_commit( int __fd );
unsigned    _Cdecl _DOS_creat( const char _FAR *__pathP, unsigned __attr,
		int _FAR *__fd );
unsigned    _Cdecl _DOS_creatnew( const char _FAR *__pathP, unsigned __attr,
		   int _FAR *__fd );
unsigned    _Cdecl _DOS_findfirst( const char _FAR *__path,
		  unsigned __attrib,
		  struct find_t _FAR *__finfo );
unsigned    _Cdecl _DOS_findnext( struct find_t _FAR *__finfo );
unsigned    _Cdecl _DOS_FreeMem( unsigned __segx );
void        _Cdecl _DOS_Getdate( struct DOSdate_t _FAR *__datep );
unsigned    _Cdecl _DOS_Getdiskfree( unsigned __drive,
		      struct diskfree_t _FAR *__dtable);
void        _Cdecl _DOS_Getdrive( unsigned _FAR *__drive );
unsigned    _Cdecl _DOS_Getfileattr( const char _FAR *__filename,
		      unsigned _FAR *__attrib );
unsigned    _Cdecl _DOS_Getftime( int __fd, unsigned _FAR *__date,
		   unsigned _FAR *__time );
void        _Cdecl _DOS_Gettime( struct DOStime_t _FAR *__timep );
void        _Cdecl _DOS_keep(unsigned char __status, unsigned __size);
unsigned    _Cdecl _DOS_open( const char _FAR *__pathP, unsigned __oflag,
		   int _FAR *__fd );
unsigned    _Cdecl _DOS_read( int __fd, void far *__buf, unsigned __len,
		   unsigned _FAR *__nread );
unsigned    _Cdecl _DOS_Setblock( unsigned __size, unsigned __segx,
		   unsigned _FAR *__maxp );
unsigned    _Cdecl _DOS_Setdate( struct DOSdate_t _FAR *__datep );
void        _Cdecl _DOS_Setdrive( unsigned __drive, unsigned _FAR *__ndrives );
unsigned    _Cdecl _DOS_Setfileattr( const char _FAR *__filename,
		      unsigned _FAR __attrib);
unsigned    _Cdecl _DOS_Setftime( int __fd, unsigned __date, unsigned __time );
unsigned    _Cdecl _DOS_Settime( struct DOStime_t _FAR *__timep );
unsigned    _Cdecl _DOS_write( int __fd, const void far *__buf, unsigned __len,
		unsigned _FAR *__nread );

void        __emit__( unsigned char __byte, ...);
void        _Cdecl _FARFUNC enable( void );

#if !defined( _Windows )
int         _Cdecl FreeMem( unsigned __segx );
#endif

int         _Cdecl Getcbrk( void );
void        _CType Getdate( struct date _FAR *__datep );
void        _Cdecl Getdfree( unsigned char __drive,
		 struct dfree _FAR *__dtable );
int         _Cdecl _Getdrive( void );
void        _Cdecl Getfat( unsigned char __drive,
	       struct fatinfo _FAR *__dtable );
void        _Cdecl Getfatd( struct fatinfo _FAR *__dtable );
unsigned    _Cdecl Getpsp( void );
int         _Cdecl Getswitchar( void );
void        _CType Gettime( struct time _FAR *__timep );
int         _Cdecl Getverify( void );

#if !defined( _Windows )
#ifdef __cplusplus
void        _Cdecl _harderr( void _Cdecl (far *__fptr)( unsigned __deverr,
			     unsigned __DOSerr, unsigned far *__hdr) );
#else
void        _Cdecl _harderr( void _Cdecl (far *__fptr)( ) );
#endif
void        _Cdecl _hardresume( int __axret );
void        _Cdecl _hardretn( int __retn );

#ifdef __cplusplus
void        _CType harderr( int _Cdecl( *__handler )( int __errval, int __ax,
			    int __bp, int __si) );
#else
void        _CType harderr( int _Cdecl( *__handler )( ) );
#endif
void        _CType hardresume( int __axret );
void        _CType hardretn( int __retn );
#endif

#ifndef _PORT_DEFS
unsigned        _Cdecl inport ( unsigned __portid );
unsigned char   _Cdecl inportb( unsigned __portid );
unsigned        _Cdecl inpw   ( unsigned __portid );
int             _Cdecl inp    ( unsigned __portid );
#endif

int         _Cdecl int86( int __intno,
			  union REGS _FAR *__inregs,
			  union REGS _FAR *__outregs );
int         _Cdecl int86x( int __intno,
			   union REGS _FAR *__inregs,
			   union REGS _FAR *__outregs,
			   struct SREGS _FAR *__segregs );
int         _Cdecl intDOS( union REGS _FAR *__inregs,
			   union REGS _FAR *__outregs );
int         _Cdecl intDOSx( union REGS _FAR *__inregs,
				     union REGS _FAR *__outregs,
				     struct SREGS _FAR *__segregs );
void        _Cdecl intr( int __intno, struct REGPACK _FAR *__preg );

#if !defined( _Windows )
void        _Cdecl keep( unsigned char __status, unsigned __size );
void        _Cdecl nosound( void );
#endif

#ifndef _PORT_DEFS
void        _Cdecl outport ( unsigned __portid, unsigned __value );
void        _Cdecl outportb( unsigned __portid, unsigned char __value );
unsigned    _Cdecl outpw   ( unsigned __portid, unsigned __value );
int         _Cdecl outp    ( unsigned __portid, int __value );
#endif

char _FAR * _Cdecl parsfnm( const char _FAR *__cmdline,
		       struct fcb _FAR *__fcb, int __opt );
int         _Cdecl peek( unsigned __segment, unsigned __offSet );
char        _Cdecl peekb( unsigned __segment, unsigned __offSet );
void        _Cdecl poke( unsigned __segment, unsigned __offSet, int __value);
void        _Cdecl pokeb( unsigned __segment,
			  unsigned __offSet, char __value );

#if !defined( _Windows )
int         _Cdecl randbrd( struct fcb _FAR *__fcb, int __rcnt );
int         _Cdecl randbwr( struct fcb _FAR *__fcb, int __rcnt );
#endif

void        _Cdecl segread( struct SREGS _FAR *__segp );

#if !defined( _Windows )
int         _Cdecl Setblock( unsigned __segx, unsigned __newsize );
#endif

int         _Cdecl Setcbrk( int __cbrkvalue );
void        _Cdecl Setdate( struct date _FAR *__datep );
void        _Cdecl Setswitchar( char __ch );
void        _Cdecl Settime( struct time _FAR *__timep );
void        _Cdecl Setverify( int __value );

#if !defined( _Windows )
void        _Cdecl sleep( unsigned __seconds );
void        _Cdecl sound( unsigned __frequency );
#endif

void        _Cdecl _FARFUNC unixtoDOS( long __time, struct date _FAR *__d,
			      struct time _FAR *__t );
int         _CType unlink( const char _FAR *__path );

    /* These are in-line functions.  These prototypes just clean up
       some syntax checks and code generation.
     */

void        _Cdecl          __cli__( void );
void        _Cdecl          __sti__( void );
void        _Cdecl          __int__( int __interruptnum );

#define disable( ) __emit__( (char )( 0xfa ) )
#define _disable( ) __emit__( (char )( 0xfa ) ) /* MSC name */
#define enable( )  __emit__( (char )( 0xfb ) )
#define _enable( )  __emit__( (char )( 0xfb ) ) /* MSC name */

#define geninterrupt( i ) __int__( i )      /* Interrupt instruction */

#ifndef _PORT_DEFS
#define _PORT_DEFS

unsigned char   _Cdecl    __inportb__ ( unsigned __portid );
unsigned        _Cdecl    __inportw__ ( unsigned __portid );
unsigned char   _Cdecl    __outportb__( unsigned __portid, unsigned char __value );
unsigned        _Cdecl    __outportw__( unsigned __portid, unsigned __value );

#define inportb(__portid)           __inportb__(__portid)
#define outportb(__portid, __value) ((void) __outportb__(__portid, __value))
#define inport(__portid)            __inportw__(__portid)
#define outport(__portid, __value)  ((void) __outportw__(__portid, __value))

/* MSC-compatible macros for port I/O */
#define inp(__portid)               __inportb__ (__portid)
#define outp(__portid, __value)     __outportb__(__portid, (unsigned char)__value)
#define inpw(__portid)              __inportw__ (__portid)
#define outpw(__portid, __value)    __outportw__(__portid, __value)

#endif  /* _PORT_DEFS */

#if !__STDC__

extern  unsigned    _Cdecl  _ovrbuffer;
int cdecl far _OvrInitEms( unsigned __emsHandle, unsigned __emsFirst,
			   unsigned __emsPages );
int cdecl far _OvrInitExt( unsigned long __extStart,
			   unsigned long __extLength );

char far *cdecl Getdta( void );
void      cdecl Setdta( char far *__dta );

#define MK_FP( seg,ofs )( (void _seg * )( seg ) +( void near * )( ofs ))
#define FP_SEG( fp )( (unsigned )( void _seg * )( void far * )( fp ))
#define FP_OFF( fp )( (unsigned )( fp ))

#ifdef __cplusplus
void        _Cdecl _Chain_intr ( void interrupt (far *__tarGet)( ... ));
void interrupt( far * _Cdecl _DOS_GetVect( unsigned __interruptno ))( ... );
void interrupt( far * _CType GetVect( int __interruptno ))( ... );
void        _Cdecl _DOS_SetVect( unsigned __interruptno,
				 void interrupt( far *__isr )( ... ));
void        _CType SetVect( int __interruptno,
			    void interrupt( far *__isr )( ... ));
int  inline _Cdecl peek( unsigned __segment, unsigned __offSet )
		  { return( *( (int  far* )MK_FP( __segment, __offSet )) ); }
char inline _Cdecl peekb( unsigned __segment, unsigned __offSet )
		  { return( *( (char far* )MK_FP( __segment, __offSet )) ); }
void inline _Cdecl poke( unsigned __segment, unsigned __offSet, int __value )
	       {( *( (int  far* )MK_FP( __segment, __offSet )) = __value ); }
void inline _Cdecl pokeb( unsigned __segment, unsigned __offSet, char __value )
	       {( *( (char far* )MK_FP( __segment, __offSet )) = __value ); }
#else
void        _Cdecl _Chain_intr ( void interrupt (far *__tarGet)( ));
void interrupt( far * _Cdecl _DOS_GetVect( unsigned __interruptno ))( );
void interrupt( far * _CType GetVect( int __interruptno ))( );
void        _Cdecl _DOS_SetVect( unsigned __interruptno,
		void interrupt( far *__isr )( ));
void        _CType SetVect( int __interruptno,
		void interrupt( far *__isr )( ) );
#define peek( a,b )( *( (int  far* )MK_FP( (a ),( b )) ))
#define peekb( a,b )( *( (char far* )MK_FP( (a ),( b )) ))
#define poke( a,b,c )( *( (int  far* )MK_FP( (a ),( b )) ) =( int )( c ))
#define pokeb( a,b,c )( *( (char far* )MK_FP( (a ),( b )) ) =( char )( c ))
#endif  /* __cplusplus */

#endif  /* !__STDC__ */


#ifdef __cplusplus
}
#endif

#endif  /* __DOS_H */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -