home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / seedump.zip / SAMPLES / T.C < prev    next >
Text File  |  1995-08-01  |  3KB  |  160 lines

  1. #define INCL_DOS
  2. #define INCL_EXCEPTION
  3.  
  4. #include <os2.h>
  5. #include <string.h>
  6. #include <stdlib.h>
  7. #include <stdio.h>
  8. #include <ctype.h>
  9. #include <process.h>
  10. #include <sys\\stat.h>
  11. #include "dumper.h"
  12.  
  13. static int iteststatic1 = 8;
  14. static int iteststatic2 = 8;
  15. static char * pteststatic1 = "pteststatic1 string";
  16.  
  17. enum tenum1 { eeins = 1, ezwei, edrei, evier };
  18. enum tenum1 tttttt1 = eeins;
  19.  
  20. typedef enum { e257 = 257, e258, e259, e267 = 267 } tenum2;
  21. tenum2 tttttt2 = e267;
  22. typedef enum { ex10000 = 0x10000, ex10001, ex10002, ex10010 = 0x10010 } tenum4;
  23. tenum4 tttttt4 = ex10002;
  24.  
  25. typedef struct
  26. {
  27.   int i;
  28. } testtypedef;
  29.  
  30. typedef testtypedef * ptesttypedef;
  31.  
  32. testtypedef aaaatypedef;
  33. ptesttypedef globalp = &aaaatypedef;
  34.  
  35.  
  36.   FILE * fp = 0;
  37.   PEAOP2 pEABuf = NULL;
  38.  
  39. struct ins
  40. {
  41.   int k,l,m;
  42.   int b1 : 2;
  43.   int b2 : 17;
  44.   int b3 : 5;
  45.   int o;
  46. };
  47.  
  48. struct dum
  49. {
  50.   int i;
  51.   char c;
  52.   struct dum * next;
  53.   char nn[10];
  54.   struct ins sins;
  55.   struct
  56.   {
  57.     int ii;
  58.     struct {
  59.     int jj;
  60.     } jjiiss;
  61.   } iis;
  62.   union u_uuu
  63.   {
  64.     int i;
  65.     char c;
  66.     void * n;
  67.   } iuu;
  68.   union
  69.   {
  70.     int i;
  71.     char c;
  72.     void * n;
  73.   } uu;
  74.   char  rest10;
  75.   char  rest11;
  76.   char  rest12;
  77.   char  rest13;
  78.   char  rest14;
  79.   char  rest15;
  80.   char  rest16;
  81.   char  rest17;
  82.   char  rest18;
  83.   char  rest19;
  84.   char  rest20;
  85.   char  rest21;
  86.   char  rest22;
  87.   char  rest23;
  88.   char  rest24;
  89.   char  rest25;
  90.   char  rest26;
  91.   char  rest27;
  92.   char  rest28;
  93.   char  rest29;
  94. };
  95.  
  96. struct dumdi
  97. {
  98.   int i;
  99.   char c;
  100.   struct dum * next;
  101.   char nn[10];
  102. };
  103.  
  104. struct dum s;
  105. struct dumdi sisi;
  106.  
  107. void dd( )
  108. {
  109.   ULONG newblock;
  110.   APIRET rc;
  111.   ULONG action;
  112.   HFILE hTrap;
  113.  
  114.   rc = DosOpen( "trapfile", &hTrap, &action
  115.                 ,0L
  116.                 ,FILE_NORMAL
  117.                 ,(FILE_CREATE | OPEN_ACTION_REPLACE_IF_EXISTS)
  118.                 ,(OPEN_ACCESS_WRITEONLY
  119.                   | OPEN_SHARE_DENYREADWRITE
  120.                   | OPEN_FLAGS_NOINHERIT
  121.                   | OPEN_FLAGS_FAIL_ON_ERROR
  122.                   | OPEN_FLAGS_WRITE_THROUGH
  123.                  )
  124.                 ,pEABuf
  125.               );
  126.   if (rc) return;
  127.   DosWrite( hTrap, &s, 0x30000, &newblock);
  128.   DosClose( hTrap );
  129. }
  130.  
  131. struct dum aaa10[10];
  132.  
  133. int main(int argc, char *argv[])
  134. {
  135.   int i;
  136.   struct dum sss;
  137.   struct dum * sp = &s;
  138.   static char * staticp = "das ist ein static text";
  139.   static char * staticp2 = "2das ist ein static text";
  140.   static char * staticp3 = "das ist ein static text";
  141.   SetXCPTHandler();
  142.  
  143.   { int rc = __LINE__; }
  144.   sp = &aaa10[0];
  145.   { int rc = __LINE__; }
  146.   for (i=0; i<9; i++)
  147.   {
  148.     aaa10[i].sins.k  = i;
  149.     aaa10[i].sins.b1 = 1;
  150.     aaa10[i].sins.b2 = 2*i;
  151.     aaa10[i].sins.b3 = 2;
  152.     aaa10[i].sins.o  = 3*i;
  153.     sprintf( aaa10[i].nn, "nntext%d", i );
  154.     aaa10[i].next = &aaa10[i+1];
  155.   }
  156.   fp = fopen( "t.c", "r" );
  157.   i /= (i-i);
  158.   return 0;
  159. }
  160.