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

📄 tcxl.doc

📁 就一个字强.很不错,希望大家能喜欢.这是我朋友发给我的
💻 DOC
📖 第 1 页 / 共 5 页
字号:
Return:     a 0 if no error or else an EMS error code
Also see:   emsalloc
Example:
            if(emsdealloc(ems_handle)) {
                printf("EMS deallocation error\n");
                exit(1);
            }


Name:       emsexist
Purpose:    determines if the EMS device driver is loaded.  See the section on
            using TCXL's EMS functions for more information
Prototype:  int emsexist(void);
Header:     tcxlems.h
Inputs:     none
Return:     a 0 if EMS driver not loaded, or a 1 if EMS driver is loaded
Also see:   emsalloc emsfree emstotal expmem
Example:
            printf("EMS device driver is %sloaded\n",(emsexist())?"":"not ");


Name:       emsframe
Purpose:    returns the EMS page frame base address (segment)
Prototype:  unsigned emsframe(void);
Header:     tcxlems.h
Inputs:     none
Return:     the EMS page frame base address (segment) or a zero if an error
            occurred
Also see:   emsmap
Example:
            printf("EMS page frame address is at:  %X\n",emsframe());


Name:       emsfree
Purpose:    returns the number of free EMS pages (16K blocks)
Prototype:  unsigned emsfree(void);
Header:     tcxlems.h
Inputs:     none
Return:     the number of free EMS pages
Also see:   emsalloc emstotal
Example:
            printf("Free EMS pages:  %d\n",emsfree());


                                      20   


Name:       emsmap
Purpose:    maps a logical EMS page onto a physical page address, emsalloc()
            must be called prior to this function
Prototype:  int emsmap(int handle,int lpage,int ppage);
Header:     tcxlems.h
Inputs:     handle  - the EMS handle previosly assigned
            lpage   - the logical EMS page to map (0 - ?)
            ppage   - the physical DOS page to map to (0 - 3)
Return:     a zero if no error, or else an EMS error code
Also see:   emsalloc emsframe
Example:
            if(emsmap(ems_handle,0,0)) {
                printf("Error mapping logical page 0 to physical page 0\n");
                exit(1);
            }


Name:       emsread
Purpose:    reads bytes from an EMS page(s), emsalloc() and emsmap() must be
            called prior to this function.  The source segment used will be
            the current EMS page frame address and the destination segment will
            be the program's DATA segment.
Prototype:  int emsread(void *dest,unsigned emsofs,unsigned numbytes);
Header:     tcxlems.h
Inputs:     dest     - address to receive bytes read
            emsofs   - offset from the EMS page frame base address at which to
                       read the bytes from
            numbytes - the number of bytes to read
Return:     a zero if no error, otherwise an error
Also see:   emsmap emswrite
Example:
            if(!emsread(buf,0x100,64)) {
                printf("Failed to read 64 bytes from EMS memory\n");
                exit(1);
            }


Name:       emstotal
Purpose:    returns the total number of EMS pages (16K blocks) on the system
Prototype:  unsigned emstotal(void);
Header:     tcxlems.h
Inputs:     none
Return:     the total number of EMS pages on the system or a zero if an error
            occurred
Also see:   emsfree expmem
Example:
            printf("You have %d pages of EMS memory\n",emstotal());


Name:       emsver
Purpose:    returns the current EMS version
Prototype:  char *emsver(void);
Header:     tcxlems.h
Inputs:     none
Return:     the address of the static string containing the EMS version number


                                      21   
            or NULL if error
Example:
            printf("Your EMS version is %s\n",emsver());


Name:       emswrite
Purpose:    writes bytes to an EMS page(s), emsalloc() and emsmap() must be
            called prior to this function.  The source segment will be the
            program's DATA segment and the destination segment will be the
            EMS current EMS page frame address.
Prototype:  int emswrite(void *src,unsigned emsofs,unsigned numbytes);
Header:     tcxlems.h
Inputs:     src      - address of where to write bytes from
            emsofs   - offset from EMS page frame base address of where to write
                       bytes to
            numbytes - number of bytes to write
Return:     a zero if no error, otherwise an error
Also see:   emsframe emsmap emsread
Example:
            if(!emswrite(buf,0x100,64)) {
                printf("Failed to write 64 bytes to EMS memory\n");
                exit(1);
            }


Name:       expmem
Purpose:    determines the amount (if any) of expanded memory on the system
Prototype:  unsigned expmem(void);
Header:     tcxldef.h tcxlems.h
Inputs:     none
Return:     the amount of expanded memory in Kilobytes
Also see:   emsexist extmem
Example:
            printf("Amt of expanded memory = %dK\n",expmem());


Name:       extmem
Purpose:    determines the amount of extended memory on an AT machine
Prototype:  unsigned extmem(void);
Header:     tcxldef.h
Inputs:     none
Return:     the amount of extended memory in Kilobytes
Also see:   expmem
Example:
            printf("Amt of extended memory = %dK\n",extmem());


Name:       fcmpdatm
Purpose:    compares the dates and times of 2 files
Prototype:  int fcmpdatm(char *fname1,char *fname2);
Header:     tcxldsk.h
Inputs:     fname1  - address of string containing filename1
            fname2  - address of string containing filename2
Return:     -1 if less than or equal to, 0 if error, 1 if greater than
Also see:   fexist
Example:
            int i;


                                      22   
            i=fcmpdatm("C:FILE1.EXT","A:FILE1.EXT");
            if(i>0) printf("Backup copy of file needs refreshing\n");


Name:       fexist
Purpose:    determines if a disk file exists
Prototype:  int fexist(char *fname);
Header:     tcxldsk.h
Inputs:     fname   - the address of string containing file name to check,
                      wildcards are allowed in the file name
Return:     a 0 if file doesn't exist, a 1 if it does
Also see:   fcmpdatm
Example:
            int i;
            i=fexist("\\COMMAND.COM");
            printf("\\COMMAND.COM does %sexist\n",i?"":"not ");


Name:       fhide
Purpose:    hides a disk file
Prototype:  int fhide(char *filename);
Header:     tcxldsk.h
Inputs:     filename    - address of string containing file name
Return:     a zero if an error occurred
Example:
            if(!fhide("MYFILE.EXT")) {
                printf("Could not hide file\n");
                exit(1);
            }
 
 
Name:       fill
Purpose:    fills in a region of the screen with specified character/attribute
Prototype:  void fill(int srow,int scol,int erow,int ecol,int ch,int atr);
Header:     tcxlvid.h
Inputs:     srow    - starting row upper left corner
            scol    - starting column upper left corner
            erow    - ending row lower left corner
            ecol    - ending column lower left corner
            ch      - character to fill with
            atr     - attribute of character
Return:     none
Also see:   attrib filld
Example:
            box(1,1,10,10,3,LMAGENTA|_CYAN);
            fill(2,2,9,9,' ',WHITE|_RED);

 
Name:       filld
Purpose:    fills in a region of the screen with specified character/attribute
            by writing directly to the screen (no BIOS calls)
Prototype:  void filld(int srow,int scol,int erow,int ecol,int ch,int atr);
Header:     tcxlvid.h
Inputs:     srow    - starting row upper left corner
            scol    - starting column upper left corner
            erow    - ending row lower left corner
            ecol    - ending column lower left corner


                                      23   
            ch      - character to fill with
            atr     - attribute of character
Return:     none
Also see:   attrib fill videoinit
Example:
            boxd(1,1,10,10,3,LMAGENTA|_CYAN);
            filld(2,2,9,9,' ',WHITE|_RED);


Name:       gameport
Purpose:    determines if a game port is installed
Prototype:  int gameport(int equip);
Header:     tcxldef.h
Inputs:     equip   - the result from the biosequip() function
Return:     a 1 if a game port is installed
Also see:   mathchip numflop numpar numser
Example:
            int i;
            i=biosequip();
            printf("Game port is %sinstalled\n",gameport(i)?"":"not ");


Name:       getchf
Purpose:    gets a character from the keyboard from a list of valid
            characters, provides Escape checking
Prototype:  int getchf(char *valid);
Header:     tcxlkey.h
Inputs:     valid   - address of list of valid characters
Return:     the character pressed or 0 if the Escape key was pressed
Also see:   getxch waitkey
Example:
            char ch;
            printf("Are you sure?  ");
            ch=getchf("YyNn");
            if(ch!='Y'&&ch!='y') {
                exit(0);
            }

 
Name:       getktot
Purpose:    gets the total disk space in kilobytes
Prototype:  unsigned getktot(int drive);
Header:     tcxldsk.h
Inputs:     drive   - the drive to check (3 = C:, 4 = D:, etc.)
Return:     size of the specified disk in kilobytes, -1 if error
Also see:   getvol
Example:
            printf("drive C: contains %u kilobytes\n",getktot(3));


Name:       getns
Purpose:    inputs a string of specified length from the keyboard, provides
            Escape checking
Prototype:  int getns(char *str,int max);
Header:     tcxlkey.h
Inputs:     str     - address of allocated space to receive input string
            max     - maximum length of the input string


                                      24   
Return:     a 1 if the <Esc> key was pressed
Also see:   inputsf prompts
Example:
            char age[2];
            printf("Enter your age:  ");
            if(getns(age,2)) {
                printf("Escape was pressed\n");
                exit(0);
            }
            printf("Your age is:  %s\n",age);

 
Name:       getvol
Purpose:    gets the volume label from a disk drive
Prototype:  char *getvol(char drive);
Header:     tcxldsk.h
Inputs:     drive   - drive letter
Return:     address of a static string containing the volume label or a zero if
            the disk has no volume label
Also see:   getktot
Example:
            printf("The volume label on drive C is:  %s\n",getvol('C'));


Name:       getxch
Purpose:    gets a key (ASCII code/extended ASCII code) from the keyboard
Prototype:  void getxch(int *ch,int *xch);
Header:     tcxlkey.h
Inputs:     ch      - the address of where to store input key's ASCII code
            xch     - the address of where to store input key's extended ASCII
                      code
Return:     none
Also see:   getchf
Example:
            int ch,xch;
            printf("Press a key:  ");
            getxch(&ch,&xch);
            printf("\nch = %c, ASCII code = %d, extended  = %d\n",ch,ch,xch);


Name:       gotoxy_
Purpose:    sets cursor coordinates on the screen
Prototype:  void gotoxy_(int row,int col);
Header:     tcxlvid.h
Inputs:     row     - cursor row (Y coordinate)
            col     - cursor column (X coordinate)
Return:     none
Also see:   readcur
Example:
            gotoxy_(20,30);
            printf("We are at row 20, column 30\n");

 
Name:       home
Purpose:    homes the cursor
Prototype:  void home(void);
Header:     tcxlvid.h


                                      25   
Inputs:     none
Return:     none
Also see:   clrscrn gotoxy_
Example:
            home();
            printf("We are at row 0, column 0\n");


Name:       inputsf
Purpose:    inputs a formatted string from the keyboard
Prototype:  int inputsf(char *str,char *fmt);
Header:     tcxlkey.h
Inputs:     str     - address of the allocated space to receive string
            fmt     - address of the format string, see section on using format
                      strings
Return:     a 0 if no error, a 1 if Escape, a 2 if invalid format string
Also see:   getns prompts
Example:
            char str[255];
            inputsf(str,!RE!'Enter phone number:  ('###') '###'-'####");
            printf("\nYour phone number is:  %s\n",str);
            inputsf(str,!EM!'Enter your name:  'AAAAAAAAAAAAAAAA");
            printf("\nYour name is:  %s\n",str);


Name:       kbstat
Purpose:    returns the status of the keyboard control keys
Prototype:  int kbstat(void);
Header:     tcxlkey.h
Inputs:     none
Return:     status word of the keyboard flag
Also see:   capsoff capson numoff numon
Example:
            if(kbstat()&CTRL) printf("The <Ctrl> key is now being pressed\n");


Name:       lcrlf
Purpose:    prints a carriage return and line feed on the printer
Prototype:  void lcrlf(void);
Header:     tcxlprn.h

⌨️ 快捷键说明

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