Пример #1
0
static int wait_key(void)
{
	while (Cconis()) {
		Cconin();
	}
	Cconws("\r\n<press key>\r\n");
	return Cconin();
}
Пример #2
0
void do_exit(short ret)
{
	if ( (waitflag) && (getenv("SHELL")==NULL) )
		{
		printf("Press any key");
		Cconin();
		}
	exit(ret);
}
Пример #3
0
int
boot_kernel_p()
{
	extern int gl_lang;
	struct yn_message *msg;
	int y;

	msg = &boot_it[gl_lang];
	Cconws(msg->message);
	y = (int) Cconin();
	if (tolower(y) == msg->yes_let)
		return 1;
	else
		return 0;
}
Пример #4
0
/******************
* scan thru arg list, call check func for each arg
* default to *.fnt if no args
*/
int main( int argc, char *argv[] )
{

   dtap = (struct _dta*)Fgetdta();
   if( argc == 1 ) check_files( "*.fnt" );
   else {
      while( --argc>0 ) check_files(*++argv);
   } /* if */

   Cconws( "finished! press a key ..." );   
   while( Cconis() == 0 );
   (void)Cconin();

   return 0;
     
} /* main() */
Пример #5
0
int main(int argc, char *argv[])
{
	char str[1024];
	int i;

	for (i = 0; i < 10; i++)
	{
		sprintf(str, "this is test #%d\r\n", i);
		Cconws(str);
	}

	for (i = 0; i < 10; i++)
	{
		sprintf(str, "this is test #%f\r\n", (float) i);
		Cconws(str);
	}

	sprintf(str, "This %s %d complex %s%s", "is", 1, "test", "\r\n");
	Cconws(str);
	printf("little test: %x, %d, %f\r\n", 0xff, 12345, 3.1415926);
	
	char *endp;
	#define	_strtol(v) do{ printf("strtol(\"" v "\") => %x", strtol(v,&endp,0)); printf(*endp ? " Rest:%s\n\r":"\n\r", endp); } while(0)
	#define	_strtoul(v) do{ printf("strtoul(\"" v "\") => %x", strtoul(v,&endp,0)); printf(*endp ? " Rest:%s\n\r":"\n\r", endp); } while(0)
	_strtol("0x5050");
	_strtol("0b1010");
	_strtol("077");
	_strtol("-0x5050");
	_strtol("0xDEADBEEF");
	_strtol("10kg");

	_strtoul("0x5050");
	_strtoul("0b1010");
	_strtoul("077");
	_strtoul("-0x5050");
	_strtoul("0xDEADBEEF");
	_strtoul("10kg");
	
	
	Cconws("press a key to return to desktop\r\n");
	Cconin();
}
Пример #6
0
WORD main(void)
{{{

	printf("Demo-Programm f�r Benutzung der SCSI-Calls");
	printf("  � Steffen Engel 1995");

	if (init_scsiio() && init_scsi())
		search_drives();
	else
		printf("SCSI-Lib nicht benutzbar");

	printf("\n Taste dr�cken");
	do
	{
	} while (Cconis());
	Cconin();
/*
*/
	return (0);

}}}
Пример #7
0
int main (int argc, char **argv) {
	long fh;
	long i;
	struct objhead_struct *dst_adr=(struct objhead_struct *)&dst_buffer;
	
	if (argc<3) {
		printf("Usage: bdyconv.ttp <source.bdy> <dest.e3d>\n");
		Cconin();
		return 0;
	}
	printf("loading %s...\n",*(argv+1));
	
	fh=Fopen(*(argv+1),FO_READ);
	if (fh<0) return 0;
	
	Fread(fh,153600,&bdy_buffer);
	Fclose(fh);

	print_header_info((struct bdy_header *)&bdy_buffer);
	parse_bdy_data(&bdy_buffer,dst_adr);

	printf("saving %s...",*(argv+2));
	
	fh=Fcreate(*(argv+2),0);
	if (fh<0) return 0;
	Fwrite(fh,4,&dst_adr->num_of_points);
	Fwrite(fh,dst_adr->num_of_points*4,dst_adr->x_buf);
	Fwrite(fh,dst_adr->num_of_points*4,dst_adr->y_buf);
	Fwrite(fh,dst_adr->num_of_points*4,dst_adr->z_buf);
	Fwrite(fh,dst_adr->num_of_points*4,dst_adr->nx_buf);
	Fwrite(fh,dst_adr->num_of_points*4,dst_adr->ny_buf);
	Fwrite(fh,dst_adr->num_of_points*4,dst_adr->nz_buf);
	Fwrite(fh,4,&dst_adr->num_of_polys);
	Fwrite(fh,sizeof(struct bdy_poly)*dst_adr->num_of_polys,dst_adr->polygons);
	Fclose(fh);
	printf("done.\n");

	return 0;
}
Пример #8
0
void
main( int argc, char *argv[], char *envp[] )
{
	int 	i;
/* 	-----	evnt_multi return parameters */
	int		event, msg[8], key, nclicks;
	MRETS	mrets;
	int  	rez;
/*
 * Initialize global arguments
 */
	if( (nargs = argc) != 1)
		args = argv;
	env = envp;

/*
 * See if we were run from the AUTO folder...
 */
	if( (gl_apid = appl_init()) == -1 ) {
		Cconws("\r\nError initializing GEM, hit a key...");
		Cconin();
		exit( gl_apid );
	}
	rez = Getrez() + 2;
	if(( rez != 2 ) && ( rez != 6 ) )
	{
	   /* Ensure that we run ONLY in ST LOW or TT MED - 640x480 16 colors */
	   form_alert( 1, "[3][ | This program runs in| ST LOW or TT MED Only][ OK ]" );
	   appl_exit();
	   exit( -1 );
	}
/*
 * Set up work_in to initialize VDI functions to useful values,
 * Get the physical workstation handle from the AES, then
 * open a virtual workstation and get our AES work area's extent.
 */
	work_in[0] = Getrez()+2; /* let's not gag GDOS */
	for( i = 1; i < 10; work_in[i++] = 1 )
	;
	work_in[10] = 2; /* raster coordinates */
	vhandle = graf_handle( &gl_wchar, &gl_hchar, &gl_wbox, &gl_hbox );
	v_opnvwk( work_in, &vhandle, work_out );
	xres = work_out[0];
	yres = work_out[1];

/*
 * Call initialization hooks
 */
	Wind_get( 0, WF_WORKXYWH, ( WARGS *)&desk );
	if( !rsrc_init() ) {
		form_alert( 1, "[3][ RSC ERROR ][ OK ]" );
		v_clsvwk( vhandle );
		appl_exit();
		exit( -1 );
	}

	wind_init();
	evnt_init();

/*
 * Main event loop
 */
	do {

		event = Evnt_multi( ev_mask, ev_clicks, ev_bmask, ev_bstate,
							&ev_m1, &ev_m2, ( WORD *)msg, ev_time,
							&mrets, ( WORD *)&key, ( WORD *)&nclicks );
		wind_update( BEG_UPDATE );
	/*
	 * call pre-event-processing hook
	 */
		if( evnt_hook( event, msg, &mrets, &key, &nclicks ) )
			continue;

	/* Dispatch events.
	 * It is possible to get more than one event at a time, so if the
	 * order of event handling is important to you, change the order
	 * in which they're handled here.
	 */
		if( event & MU_TIMER )
			do_timer( &event );

		if( event & MU_KEYBD )
			do_key( mrets.kstate, key, &event );

		if( event & MU_BUTTON )
			do_button( &mrets, nclicks, &event );

		if( event & MU_M1 )
			do_m1( &mrets, &event );

		if( event & MU_M2 )
			do_m2( &mrets, &event );

		if( event & MU_MESAG )
			switch( msg[0] ) {

				case MN_SELECTED:
					do_menu( msg, &event );
				break;

				case WM_REDRAW:
				case WM_TOPPED:
				case WM_CLOSED:
				case WM_FULLED:
				case WM_ARROWED:
				case WM_HSLID:
				case WM_VSLID:
				case WM_SIZED:
				case WM_MOVED:
				case WM_NEWTOP:
					do_windows( msg, &event );
				break;

				case AC_OPEN:
					acc_open( msg );
				break;

				case AC_CLOSE:
					acc_close( msg );
				break;

				default:
					msg_hook( msg, &event );
			} /* switch */
		/* MU_MESAG */

		wind_update( END_UPDATE );

	/*
	 * Event handling routines zero out the event variable
	 * to exit the application.
	 */
	} while( event );

	gem_exit( 0 );
}