home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0010 - 0019 / ibm0010-0019 / ibm0010.tar / ibm0010 / QC25-10.ZIP / SAMPLES / DEMO.H$ / DEMO.bin
Encoding:
Text File  |  1989-04-27  |  3.2 KB  |  91 lines

  1. /* Constants */
  2. #define CR 13                /* ASCII code for Return  */
  3. #define ESCAPE 27            /* ASCII code for Esc key */
  4. #define MDA 0                /* Adapter constants      */
  5. #define CGA 1
  6. #define MCGA 2
  7. #define EGA 3
  8. #define VGA 4
  9. #define MONO 0                /* Display constants      */
  10. #define COLOR 1
  11. #define clear_scrn( attr, row1, row2 ) ClearBox( attr, row1, 0, row2, 79 )
  12.  
  13. /* Structure members at 1-byte boundaries */
  14. #pragma pack( 1 )
  15.  
  16. /* Video configuration structure */
  17. struct vid_config
  18. {
  19.     unsigned char vmode;    /* Current mode           */
  20.     unsigned char dpage;    /* Current display page       */
  21.     unsigned char rows;     /* Number of display rows - 1      */
  22.     unsigned char display;    /* Either MONO or COLOR       */
  23.     unsigned char adapter;    /* Adapter code           */
  24.     unsigned char CGAvalue;    /* Enable value for CGA       */
  25.     unsigned sgmnt;        /* Video segment with page offset */
  26. };
  27. struct vid_config vconfig;    /* Structure for video configuration */
  28.  
  29. /* Disk statistics returned from GetDiskSize procedure */
  30. struct disk_stat
  31. {
  32.     unsigned total;        /* total clusters      */
  33.     unsigned avail;        /* available clusters  */
  34.     unsigned sects;        /* sectors per cluster */
  35.     unsigned bytes;        /* bytes per sector    */
  36. };
  37.  
  38. /* File information returned from FindFirst procedure  */
  39. struct file_info
  40. {
  41.     char pad[21];        /* pad to 43 bytes     */
  42.     char attrib;        /* file attribute      */
  43.     int time;            /* file time           */
  44.     int date;            /* file date           */
  45.     long size;            /* file size           */
  46.     char name[13];        /* file name           */
  47. };
  48.  
  49. /* Procedure prototypes from COMMON.ASM */
  50. void  GetVidConfig( void );
  51. void  StrWrite( int row, int col, char *str );
  52. void  ClearBox( int attr, int row1, int col1, int row2, int col2 );
  53. int   GetVer( void );
  54. int   SetCurPos( int row, int col );
  55.  
  56. /* Procedure prototypes from MATH.ASM */
  57. long  AddLong(    long long1, long long2 );
  58. long  SubLong(    long long1, long long2 );
  59. long  ImulLong( long long1, long long2 );
  60. long *MulLong(  long long1, long long2 );
  61. int   DivLong(    long long1, short short2, short *remn );
  62. int   IdivLong( long long1, short short2, short *remn );
  63. int   Quadratic( float a, float b, float c, float *r1, float *r2 );
  64.  
  65. /* Procedure prototypes from FILE.ASM */
  66. void  ChangeDrive( int drive );
  67. void  GetDiskSize( int drive, struct disk_stat *disk );
  68. void  GetVidConfig( void );
  69. int   ReadCharAttr( int *attr );
  70. int   GetCurDir( char *spec );
  71. int   GetCurDisk( void );
  72. int   CopyFile( int imode, char *fspec1, char *fspec2 );
  73. int   DelFile( char *fspec );
  74. int   MakeDir( char *pspec );
  75. int   RemoveDir( char *pspec );
  76. int   ChangeDir( char *pspec );
  77. int   GetAttribute( char *fspec );
  78. int   SetAttribute( int attr, char *fspec );
  79. int   RenameFile( char *fspec1, char *fspec2 );
  80. int   GetFileTime( int handle, char *str );
  81. int   FindFirst( int attr, char *fspec, struct file_info *finfo );
  82. int   FindNext( struct file_info *finfo );
  83. int   UniqueFile( int attr, char *fspec );
  84. int   OpenFile( int access, char *fspec );
  85. int   CloseFile( int handle );
  86. int   ReadFile( int handle, int len, char *pbuff );
  87. int   SetCurPos( int row, int col );
  88. int   GetStr( char *bufstr, int maxlen );
  89. char *StrCompare( char *str1, char *str2, int len );
  90. char *StrFindChar( char ichar, char *str, int direct );
  91.