《Header头文件的原型C语言.doc》由会员分享,可在线阅读,更多相关《Header头文件的原型C语言.doc(60页珍藏版)》请在金锄头文库上搜索。
1、/*alloc.hmemory management functions and variables.*/#if _STDC_#define _Cdecl#else#define _Cdeclcdecl#endif#ifndef _STDDEF#define _STDDEF#ifndef _PTRDIFF_T#define _PTRDIFF_T#ifdefined(_LARGE_) | defined(_HUGE_) | defined(_COMPACT_)typedef longptrdiff_t;#elsetypedef intptrdiff_t;#endif#endif#ifndef _
2、SIZE_T#define _SIZE_Ttypedef unsigned size_t;#endif#endif#ifndef NULL#if defined(_TINY_) | defined(_SMALL_) | defined(_MEDIUM_)#define NULL0#else#define NULL0L#endif#endifint_Cdecl brk(void *addr);void*_Cdecl calloc(size_t nitems, size_t size);#if defined(_COMPACT_) | defined(_LARGE_) | defined(_HUG
3、E_)unsigned long _Cdecl coreleft(void);#elseunsigned _Cdecl coreleft(void);#endifvoid _Cdecl free(void *block);void*_Cdecl malloc(size_t size);void*_Cdecl realloc(void *block, size_t size);void*_Cdecl sbrk(int incr);#if !_STDC_void far * _Cdecl farcalloc(unsigned long nunits, unsigned long unitsz);u
4、nsigned long _Cdecl farcoreleft(void);void _Cdecl farfree(void far *block);void far *_Cdecl farmalloc(unsigned long nbytes);void far *_Cdecl farrealloc(void far *oldblock, unsigned long nbytes);#endif/*assert.hassert macro*/#include /* fprintf() prototype & stderr definition */#include /* abort() pr
5、ototype */#if!defined(NDEBUG)#define assert(p)if(!(p)fprintf(stderr,Assertion failed: %s, file %s, line %dn,#p, _FILE_, _LINE_);abort();#else#define assert(p)#endif/*bios.hAccess to bios services.*/#if _STDC_#define _Cdecl#else#define _Cdeclcdecl#endifint_Cdecl bioscom(int cmd, char abyte, int port)
6、;int_Cdecl biosdisk(int cmd, int drive, int head, int track, int sector,int nsects, void *buffer);int_Cdecl biosequip(void);int_Cdecl bioskey(int cmd);int_Cdecl biosmemory(void);int_Cdecl biosprint(int cmd, int abyte, int port);long_Cdecl biostime(int cmd, long newtime);/*conio.hDirect MSDOS console
7、 input/output.*/#if!defined(_VIDEO)#define _VIDEO#if _STDC_#define _Cdecl#else#define _Cdeclcdecl#endif#ifndef_OLDCONIO_struct text_info unsigned char winleft;unsigned char wintop;unsigned char winright;unsigned char winbottom;unsigned char attribute;unsigned char normattr;unsigned char currmode;uns
8、igned char screenheight;unsigned char screenwidth;unsigned char curx;unsigned char cury;enum text_modes LASTMODE=-1, BW40=0, C40, BW80, C80, MONO=7 ;#if!defined(_COLORS)#define _COLORSenum COLORS BLACK,/* dark colors */BLUE,GREEN,CYAN,RED,MAGENTA,BROWN,LIGHTGRAY,DARKGRAY,/* light colors */LIGHTBLUE,
9、LIGHTGREEN,LIGHTCYAN,LIGHTRED,LIGHTMAGENTA,YELLOW,WHITE;#endif#define BLINK128/* blink bit */extern int _Cdecl directvideo;void _Cdecl clreol(void);void _Cdecl clrscr(void);void _Cdecl delline(void);int _Cdecl gettext(int left, int top, int right, int bottom, void *destin);void _Cdecl gettextinfo(st
10、ruct text_info *r);void _Cdecl gotoxy(int x, int y);void _Cdecl highvideo(void);void _Cdecl insline(void);void _Cdecl lowvideo(void);int _Cdecl movetext(int left, int top, int right, int bottom, int destleft, int desttop);void _Cdecl normvideo(void);int _Cdecl puttext(int left, int top, int right, i
11、nt bottom, void *source);void _Cdecl textattr(int newattr);void _Cdecl textbackground(int newcolor);void _Cdecl textcolor(int newcolor);void _Cdecl textmode(int newmode);int _Cdecl wherex(void);int _Cdecl wherey(void);void _Cdecl window(int left, int top, int right, int bottom);#endifchar*_Cdecl cge
12、ts(char *str);int _Cdecl cprintf(const char *format, .);int _Cdecl cputs(const char *str);int _Cdecl cscanf(const char *format, .);int _Cdecl getch(void);int _Cdecl getche(void);char*_Cdecl getpass(const char *prompt);int _Cdecl kbhit(void);int _Cdecl putch(int c);int _Cdecl ungetch(int ch);#endif/*
13、ctype.hDefines the ctype macros.*/#if _STDC_#define _Cdecl#else#define _Cdeclcdecl#endif#define _IS_SP1/* is space */#define _IS_DIG2/* is digit indicator */#define _IS_UPP4/* is upper case */#define _IS_LOW8/* is lower case */#define _IS_HEX16/* A-F or a-f */#define _IS_CTL32/* Control */#define _I
14、S_PUN64/* punctuation */externchar _Cdecl _ctype; /* Character type array */#define isalnum(c)(_ctype(c) + 1 & (_IS_DIG | _IS_UPP | _IS_LOW)#define isalpha(c)(_ctype(c) + 1 & (_IS_UPP | _IS_LOW)#define isascii(c)(unsigned)(c) 128)#define iscntrl(c)(_ctype(c) + 1 & _IS_CTL)#define isdigit(c)(_ctype(c) + 1