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

📄 tchkf.doc

📁 c语言函数库,包括大部分c语言函数的说明和代码,有利于想深入了解c编程的开发人员.
💻 DOC
📖 第 1 页 / 共 5 页
字号:
  Function             bitrevl - bit reverse a long
  
  Syntax              unsigned char bitrevl(unsigned long value);
  
  Prototype in        mathhk.h
  
  Remarks             bitrevl() will reverse the bits in the double word
                      (long) value.
  
  Return value        returns the reversed long.
  
  See also            bitrevb(), bitrevw()
  
  Example             #include <mathhk.h>
  
                      main()
                      {
                           printf("0x00000001 reversed => 0x%08X\n",
                                  bitrevb(0x00000001));
                      }
  
  Program output      0x00000001 reversed => 0x80000000
  
  
     TCHK 2.1                                                    Page 18
  
  Function             bitrevw - bit reverse a word
  
  Syntax              unsigned char bitrevw(unsigned int value);
  
  Prototype in        mathhk.h
  
  Remarks             bitrevw() will reverse the bits in the word value.
  
  Return value        returns the reversed word.
  
  See also            bitrevb(), bitrevl()
  
  Example             #include <mathhk.h>
  
                      main()
                      {
                           printf("0x0001 reversed => 0x%04X\n",
                                  bitrevb(0x0001));
                      }
  
  Program output      0x0001 reversed => 0x8000
  
  
     TCHK 2.1                                                    Page 19
  
  Function             box - draw a box
  
  Syntax              int box(int left, int top, int right, int bottom,
                              char frame[]);
  
  Prototype in        video.h
  
  Remarks             draws a box via gotohv(), horiz_line(), putk() and
                      vert_line() (all use INTerrupts). Also, frame must
                      be have at least 9 elements (char frame[9]). The
                      box characters are frame[0] (top left) to frame[7]
                      (left wall), going clockwise. If frame[8] != '\0'
                      the box is filled with it.
  
  Return value        returns zero upon succesful completion, -1 if the
                      coordinates given are not large enough for a box.
  
  See also            global variables
                      boxwindow(), gotohv(), horiz_line(), putk(),
                      vert_line()
  
  Example             #include <video.h>
  
                      main()
                      {
                           char framebox[9] = "abcdefghi";
  
                           box(1,1,7,4,framebox);
                      }
  
  Program output      abbbbbc
                      hiiiiid
                      hiiiiid
                      gfffffe
  
  
     TCHK 2.1                                                    Page 20
  
  Function             boxwindow - draw a 'window'
  
  Syntax              int boxwindow(int left, int top, int right, int
                                    bottom, char frame[], char *title,
                                    int titlejustify, char colborder,
                                    char coltitle, char colnorm, char
                                    *buffer);
  
  Prototype in        video.h
  
  Remarks             draws a 'window'-like box (similiar to box(), but
                      with a title) at the coordinates (left,top) to
                      (right,bottom). The characters in frame[] are used
                      to generate the frame, with frame[9] and frame[10] 
                      used as pre-/post-title separators if a title is
                      specified (title justification is not NONE). The
                      title is aligned as per titlejustify (LEFT, CENTER,
                      RIGHT or NONE. See HOWARD.H for more details). The
                      frame uses the colborder attribute, the title, if
                      any, uses the coltitle attribute and the inner
                      portions of the box are filled with spaces of
                      colnorm color. The box is stored in the memory
                      allocated by buffer and displayed with puttext().
  
                      If a title is specified (title justification is not
                      NONE) the title is separated from the pre-/post-
                      -title separators by a space.
  
                      Sufficient memory must be allocated for buffer to
                      contain the entire box, with attributes (see
                      scrbuff()).
  
                      Upon completion, buffer contains a copy of the
                      screen image of the box displayed (usable by
                      puttext()).
  
                      This routine is taken from an older version of the
                      popup...() and litebar...() creation functions.
                      This function does virtually no error checking.
  
  Return value        returns zero upon succesful completion, -1 if an
                      error occurs.
  
  See also            global variables
                      box(), horiz_line(), litebar...(), popup...(),
                      vert_line()
  
  
     TCHK 2.1                                                    Page 21
  Example             #include <video.h>
                      #include <howard.h>      /* for CENTER */
                      #include <color.h>       /* for colors */
  
                      main()
                      {
                           char vidbuff[scrbuff(1,1,15,4)],
                                framebox[] = "abcdefgh[]";
  
                           boxwindow(1,1,15,4,framebox,"Title",CENTER,
                                     CYAN,YELLOW,RED,vidbuff);
                      }
  
  Program output      abb[ Title ]bbc
                      h             d
                      h             d
                      gfffffffffffffe
  
  
     TCHK 2.1                                                    Page 22
  
  Function             Cal... - family of Calendar date conversions
  
  Syntax              char *CaltoGreg(double cal);
                      char *CaltoGregEuro(double cal);
                      char *CaltoGregJap(double cal);
                      double CaltoJul(double cal);
                      double CaltoJulA(double cal);
                      double CaltoJulB(double cal);
                      double CaltoCalCent(double cal);
                      double CalCenttoCal(double cal);
  
  Prototype in        datehk.h
  
  Remarks             CaltoGreg      converts Calendar date to Gregorian
                                     (US) date
                      CaltoGregEuro  converts Calendar date to Gregorian
                                     (European) date
                      CaltoGregJap   converts Calendar date to Gregorian
                                     (Japan) date
                      CaltoJul       converts Calendar date to Julian
                                     (Type E) date
                      CaltoJulA      converts Calendar date to Julian
                                     (Type A) date
                      CaltoJulB      converts Calendar date to Julian
                                     (Type B) date
                      CaltoCalCent   converts Calendar date to Calendar
                                     date (w/century)
                      CalCenttoCal   converts Calendar date (w/century)
                                     to Calendar date
  
  Return value        CaltoGreg... return the appropriate Gregorian date
                      CaltoJul... return the appropriate Julian date
                      CaltoCalCent returns a Calendar date (w/century)
                      CalCentotCal returns a Calendar date
  
  See also            Appendix A
                      date_convert(), ddatetofull(), ddatetoshort(),
                      ddatetostr(), fulltoddate(), Greg...(), Jul...(),
                      monthexpand(), shorttoddate(), strtoddate()
  
  Example             see demodate.c
  
     TCHK 2.1                                                    Page 23
  
  Function             CapsLock - set the Caps Lock key state
  
  Syntax              void InsLock(boolean on);
  
  Prototype in        ibm.h
  
  Remarks             sets the Caps Lock key state to the state selected
                      by the on parameter.
  
  Return value        nothing.
  
  See also            InsLock(), NumLock(), ScrollLock()
  
     TCHK 2.1                                                    Page 24
  
  Function             CEDadd - add a CED installable command
  
  Syntax              boolean CEDadd(char *command, unsigned char mode,
                                     unsigned segment, unsigned offset);
  
  Prototype in        doshk.h
  
  Remarks             adds a CED installable command. The mode parameter
                      is a bit mask with the following settings:
  
                           bit 0 = 1      callable from DOS prompt
                           bit 1 = 1      callable from application
  
                      command should be terminated by a CR.
  
                      The segment:offset parameters point to a FAR
                      routine entry point.
  
  Return value        returns TRUE if successful, FALSE otherwise. If
                      unsuccessful, _doserrno will contain the error
                      code:
  
                           0x01      invalid function
                           0x08      insufficient memory
                           0x0E      bad data
  
                      If CED is not installed, _doserrno & 0xFF00 will
                      return 0xFF00.
  
  See also            CEDremove(), isCEDavail()
  
     TCHK 2.1                                                    Page 25
  
  Function             CEDremove - remove a CED installable command
  
  Syntax              boolean CEDremove(char *command);
  

⌨️ 快捷键说明

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