home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
seedump.zip
/
SAMPLES
/
T.C
< prev
next >
Wrap
Text File
|
1995-08-01
|
3KB
|
160 lines
#define INCL_DOS
#define INCL_EXCEPTION
#include <os2.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <process.h>
#include <sys\\stat.h>
#include "dumper.h"
static int iteststatic1 = 8;
static int iteststatic2 = 8;
static char * pteststatic1 = "pteststatic1 string";
enum tenum1 { eeins = 1, ezwei, edrei, evier };
enum tenum1 tttttt1 = eeins;
typedef enum { e257 = 257, e258, e259, e267 = 267 } tenum2;
tenum2 tttttt2 = e267;
typedef enum { ex10000 = 0x10000, ex10001, ex10002, ex10010 = 0x10010 } tenum4;
tenum4 tttttt4 = ex10002;
typedef struct
{
int i;
} testtypedef;
typedef testtypedef * ptesttypedef;
testtypedef aaaatypedef;
ptesttypedef globalp = &aaaatypedef;
FILE * fp = 0;
PEAOP2 pEABuf = NULL;
struct ins
{
int k,l,m;
int b1 : 2;
int b2 : 17;
int b3 : 5;
int o;
};
struct dum
{
int i;
char c;
struct dum * next;
char nn[10];
struct ins sins;
struct
{
int ii;
struct {
int jj;
} jjiiss;
} iis;
union u_uuu
{
int i;
char c;
void * n;
} iuu;
union
{
int i;
char c;
void * n;
} uu;
char rest10;
char rest11;
char rest12;
char rest13;
char rest14;
char rest15;
char rest16;
char rest17;
char rest18;
char rest19;
char rest20;
char rest21;
char rest22;
char rest23;
char rest24;
char rest25;
char rest26;
char rest27;
char rest28;
char rest29;
};
struct dumdi
{
int i;
char c;
struct dum * next;
char nn[10];
};
struct dum s;
struct dumdi sisi;
void dd( )
{
ULONG newblock;
APIRET rc;
ULONG action;
HFILE hTrap;
rc = DosOpen( "trapfile", &hTrap, &action
,0L
,FILE_NORMAL
,(FILE_CREATE | OPEN_ACTION_REPLACE_IF_EXISTS)
,(OPEN_ACCESS_WRITEONLY
| OPEN_SHARE_DENYREADWRITE
| OPEN_FLAGS_NOINHERIT
| OPEN_FLAGS_FAIL_ON_ERROR
| OPEN_FLAGS_WRITE_THROUGH
)
,pEABuf
);
if (rc) return;
DosWrite( hTrap, &s, 0x30000, &newblock);
DosClose( hTrap );
}
struct dum aaa10[10];
int main(int argc, char *argv[])
{
int i;
struct dum sss;
struct dum * sp = &s;
static char * staticp = "das ist ein static text";
static char * staticp2 = "2das ist ein static text";
static char * staticp3 = "das ist ein static text";
SetXCPTHandler();
{ int rc = __LINE__; }
sp = &aaa10[0];
{ int rc = __LINE__; }
for (i=0; i<9; i++)
{
aaa10[i].sins.k = i;
aaa10[i].sins.b1 = 1;
aaa10[i].sins.b2 = 2*i;
aaa10[i].sins.b3 = 2;
aaa10[i].sins.o = 3*i;
sprintf( aaa10[i].nn, "nntext%d", i );
aaa10[i].next = &aaa10[i+1];
}
fp = fopen( "t.c", "r" );
i /= (i-i);
return 0;
}