Пример #1
0
JNIEXPORT void JNICALL Java_com_axeldroid_Axel_newTask(JNIEnv *env,
		jobject obj, jint connections, jstring filename, jobjectArray urls) {
	int argc = 6 + env->GetArrayLength(urls);
	LOGV("args length:%d", argc);
char* *argvs = new char*[argc];
	argvs[0] = "hello";
	argvs[1] = "-o";
	const char* cfn = env->GetStringUTFChars(filename, 0);
	char fn[1024] = { 0 };
	strcpy(fn, cfn);
	LOGV("output filename:%s", fn);

argvs[2] = fn;
	argvs[3] = "-n";
	char conn[10] = { 0 };
	sprintf(conn, "%d", (int) connections);
	argvs[4] = conn;
	argvs[5] = "-v";
	int i = 6;
	for (; i < argc; i++) {
		jstring str = (jstring) env->GetObjectArrayElement(urls, i - 6);
		const char* u = env->GetStringUTFChars(str, 0);
		int len = strlen(u) + 1;
		argvs[i] = new char[len];
		memcpy(argvs[i], u, len);
		
	LOGV("url NO%d:%s", i-5, argvs[i]);
}

//char *argvs[] = {"hello", "-o", "/mnt/sdcard/CZPAD/aa.war", "-n", "2", "-a", "http://localhost/CZHDP.war"};

jobject jobj=env->NewGlobalRef(obj);

axel_t* axel=gmain(argc, argvs,env,jobj,setAxelJniInfo);

if(axel==NULL){
	notifyFinish(axel,env,jobj);
}
else{
	notifyFinish(axel,env,jobj);
	axel_close(axel);
}
env->DeleteGlobalRef(jobj);

for (i = 6; i < argc; i++) {
delete[] argvs[i];
}
delete[] argvs;

}
Пример #2
0
finalout()
{

INT c ;
INT bbtop, bbbottom, bbleft, bbright ;

/* dump the results of the placement to graphics file */
G( graphics_dump() ) ;
G( TWsetMode(1) ) ;
G( draw_the_data() ) ;
G( TWsetMode(0) ) ;


/* we known wire area at this point don't need to estimate */
turn_wireest_on(FALSE) ;

/* let the user know which pins we couldn't place */
set_pin_verbosity( TRUE ) ;

/* before channel graph generation and global routing let use tweak */
/* placement if desired */
if( doGraphicsG && wait_for_userG ){
    G( TWmessage( "TimberWolfMC waiting for your response" ) ) ;
    G( process_graphics() ) ;
} 

savewolf( TRUE ) ;  /* for debug purposes force save to occur */
if( scale_dataG > 1 ){
    /* end of the line for scaled case - 
	will return to parent to continue using saved placement. */
    closegraphics() ;
    YexitPgm( PGMOK ) ;
}
grid_cells() ;      /* force cells to grid locations */
compact(VIOLATIONSONLY); /* remove cell overlap */

/* if this is a partitioning run determine row placement */
if( doPartitionG && !(quickrouteG) ){
    set_determine_side( FALSE ) ;  /* allow SC to pick side */
    G( set_graphic_context( PARTITION_PLACEMENT ) ) ;
    config_rows() ;
    print_paths() ; /* print path information */
    Output( 0 ) ;
    return ;
}
/* do final placement of pads using virtual core to insure pads */
/* are outside of core */
setVirtualCore( TRUE ) ;
placepads() ;

/* before channel graph generation and global routing let use tweak */
/* placement if desired */
check_graphics() ;

if( !scale_dataG ){ 
    /* reload bins to get new overlap penalty */
    loadbins(FALSE) ; /* wireArea not known */
}
prnt_cost( "\nFINAL PLACEMENT RESULTS AFTER VIOLATION REMOVAL ARE:\n" ) ;

print_paths() ; /* print path information */
Output( 0 ) ;

if( doCompactionG > 0 || quickrouteG ) {
    gmain( CHANNELGRAPH ) ;
    rmain( NOCONSTRAINTS ) ;
    gmain( UPDATE_ROUTING ) ;
    adapt_wire_estimator() ;
    check_graphics() ;

    if( quickrouteG ){
	return ;
    }

    for( c = 1 ; c <= doCompactionG ; c++ ) {

	funccostG = findcost() ;
	sprintf(YmsgG,"\n\nCompactor Pass Number: %d begins with:\n", c ) ;
	prnt_cost( YmsgG ) ;

	wirecosts() ;


	grid_cells() ;      /* force cells to grid locations */
	compact(COMPACT);   /* remove white space */
	reorigin() ;
	check_graphics() ;

	sprintf(YmsgG,"\n\nCompactor Pass Number: %d after cost:\n", c ) ;
	prnt_cost( YmsgG ) ;

	Output( c ) ;

	gmain( CHANNELGRAPH ) ;

	if( c == doCompactionG ){
	    rmain( CONSTRAINTS ) ;
	} else {
	    rmain( NOCONSTRAINTS ) ;
	    gmain( UPDATE_ROUTING ) ;
	    adapt_wire_estimator() ;
	    check_graphics() ;
	}

    } /* end compaction - global route loop */

} else {
    if( doChannelGraphG ) {
	gmain( CHANNELGRAPH ) ;
    }
    if( doGlobalRouteG ) {
	rmain( CONSTRAINTS ) ;
    }
}


prnt_cost("\nTIMBERWOLFMC FINAL RESULTS ARE:\n" ) ;

return ;
} /* end finalout */