home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / VIOREG.ZIP / TEST.C < prev    next >
Text File  |  1989-05-21  |  2KB  |  98 lines

  1. /*   this is a dynamic link library file to test VIOREGISTER call for
  2.      VIOPRTSC () .*/
  3.  
  4. #define ADDRESSING far
  5. #define CALLING pascal
  6. #define CONVENTION ADDRESSING CALLING
  7. #include "doscalls.h"
  8.  
  9. /*   user defined VIOPRTSC ()   */
  10.  
  11. unsigned CONVENTION VIOPRTSC (j)
  12. unsigned j ;
  13. {
  14. int i ;
  15.  
  16. /*   test message to verify the working of this function   */
  17.  
  18.    DOSWRITE (1, "This is from DLL", sizeof ("This is from DLL"), &i) ;
  19.    return 0  ;
  20.  
  21. }
  22.  
  23.  
  24. /*   compiler emits _acrtused as an external to pull in crt0.obj that
  25.      defines _astart and calls _main. Add a dummy so crt0 is not pulled
  26.      in.  */
  27.  
  28. struct route_information {
  29.  unsigned      last_parameter  ;
  30.  unsigned long return_address  ;
  31.  unsigned      function_number ;
  32.  unsigned      callers_ds      ;
  33.  unsigned long vio_router      ;
  34. } ;
  35.  
  36. #if defined( Use_viotty )
  37. unsigned CONVENTION VIOWRTTTY (
  38. char far * CharStr ,
  39. unsigned Length ,
  40. unsigned VioHandle
  41. )
  42. {
  43. int i ;
  44.  
  45. struct route_information far * route_information = & VioHandle ;
  46. /*   test message to verify the working of this function   */
  47.  
  48.    DOSWRITE (1, "This is from DLL", sizeof ("This is from DLL"), &i) ;
  49.    return -1 ;
  50.  
  51. }
  52. #endif
  53.  
  54. int far  VIDEOROUTER (unsigned temp2,
  55.                       unsigned temp1,
  56.                       unsigned index,
  57.                       unsigned long stuff,
  58. unsigned VioHandle ,
  59. unsigned Length ,
  60. char far * CharStr
  61. ) ;
  62.  
  63. int far  VIDEOROUTER (unsigned temp2,
  64.                       unsigned temp1,
  65.                       unsigned index,
  66.                       unsigned long stuff,
  67. unsigned VioHandle ,
  68. unsigned Length ,
  69. char far * CharStr
  70. )
  71. {
  72. int i ;
  73.  
  74. /*   test message to verify the working of this function   */
  75.  
  76.    //DOSWRITE (1, "This is from DLL", sizeof ("This is from DLL"), &i) ;
  77.    DOSWRITE (1, &index , sizeof ( index ), &i) ;
  78.    DOSWRITE (1, & VioHandle , sizeof ( VioHandle ), &i) ;
  79.    DOSWRITE (1, & Length , sizeof ( Length ), &i) ;
  80.    DOSBEEP ( 20000 , 1 ) ;
  81.    return -1 ;
  82.    return 0  ;
  83.  
  84. }
  85. #undef CALLING
  86. #define CALLING cdecl
  87.  
  88. int CONVENTION _acrtused(){} ;
  89.  
  90.  
  91. /*   the start up routine must be called _astart and it must return
  92.      success or failure. Return success.  */
  93.  
  94. int CONVENTION _astart() {
  95.     return 1 ;
  96.     }
  97.  
  98.