home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / TELECOM / stg_v4.lzh / verify.c < prev   
C/C++ Source or Header  |  1994-11-11  |  640b  |  42 lines

  1. #include <stdio.h>
  2. #include <module.h>
  3.  
  4. #define ERR (-1)
  5. extern int errno;
  6.  
  7. mod_dev *psDesc;
  8.  
  9. mod_dev *modlink();
  10. mod_dev *modload();
  11.  
  12. typedef unsigned char B;
  13. typedef unsigned short W;
  14. typedef unsigned long L;
  15.  
  16. #define STG_DSC "StG"
  17.  
  18. #define CRC_CHK 0xFF3440CC
  19.  
  20. main(argc,argv)
  21. char **argv;
  22. {
  23.     int c;
  24.  
  25.     psDesc=(mod_dev*)modlink(STG_DSC,0);
  26.     if ((int)psDesc==ERR)
  27.     {
  28.         psDesc=(mod_dev*)modload(STG_DSC,0);
  29.         if ((int)psDesc==ERR)
  30.             exit(errno);
  31.     }
  32.  
  33.     c=CRC_CHK;
  34.     crc((char*)psDesc+psDesc->_mdevcon,31,&c);
  35.     if (c==CRC_CHK)
  36.         writeln(1,"OK\n",80);
  37.     else
  38.         writeln(1,"ERR\n",80);
  39.  
  40.     munlink(psDesc);
  41. }
  42.