home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 2 BBS
/
02-BBS.zip
/
OP2DEV.ZIP
/
CZAR.C
< prev
next >
Wrap
C/C++ Source or Header
|
1990-08-12
|
1KB
|
55 lines
//
// CZAR.C
//
// Launch program for the game CZARWARS
//
#define INCL_DOS
#define INCL_SUB
#include <os2.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "bbsexpan.h"
#define LENGTH 40
#define FLAGS 2
#define ENVS 0L
main(int argc, char *argv[])
{
struct _RESULTCODES ExResult, CwResult;
USHORT procID, childID;
USHORT rc;
char fbuf[LENGTH];
char id[20];
char args[120];
long now;
rc = UseChildAppInit(argv[1],argv[0],&anchor,&unhand,&semhand,&usernum,&instance);
if( rc != 0 ) {
printf("\nCould not initialize application (%d)\n",rc);
return(1);
}
if( USENUM == 0 || SerConnected(unhand) ) {
time(&now);
strcpy(id,unhand->p_user->u_handle);
strupr(id);
sprintf(args,"CZAR_PGM.EXE !%d %s %ld %s\0",unhand->comtok, unhand->recnum == 0 ? "LOCA" : itoa(unhand->linkrate,fbuf,10),
unhand->t_offby-now,id);
if( DosExecPgm(fbuf,LENGTH,FLAGS,args,ENVS,&ExResult,"CZAR_PGM.EXE") == 0 ) {
childID = ExResult.codeTerminate;
DosCwait(1,0,&CwResult,&procID,childID);
}
else
DosSleep(2000L);
}
exit(0);
}