示例#1
0
int main(int argc, char** argv)
{
	// Print welcome message...

	printf("========================================================================\n");
	printf("%s %s ", ThisProg, ThisVersion);
	printf("(using sfArkLib version: %d)\n", sfkl_GetVersion());
	printf("copyright (c) 1998-2002 melodymachine.com, distributed under the GNU GPL\n");
	printf("========================================================================\n");
        
	// Open input and output files...

	char *InFileName = argv[1];
	char *OutFileName = argv[2];
	// usage
	if (argc != 3)
	{
		printf("Specify input and output files on the command line, i.e:\n");
		printf("%s <InputFilename> <OutputFilename>\n", ThisProg);
		printf("Press ENTER."); //getc(stdin);
		return 1;
	}

	// Uncompress the file...
	printf("Uncompressing %s to %s...\n", InFileName, OutFileName);

	long StartTime = clock();
	int err = sfkl_Decode(InFileName, OutFileName);	//call decompression, report & return
        
	long TimeTaken = 1000 * (clock() - StartTime) / CLOCKS_PER_SEC;
	printf("cpu time taken %ld ms\n", TimeTaken);

	return ReportError(err);
}
示例#2
0
JNIEXPORT int JNICALL 
Java_com_xperia64_timidityae_JNIHandler_decompressSFArk(JNIEnv * env, jobject  obj, jstring jfrom, jstring jto)
{
	jboolean isCopy;
	const char* from = (*env)->GetStringUTFChars(env, jfrom, &isCopy); 
	const char* to = (*env)->GetStringUTFChars(env, jto, &isCopy); 
	int x = sfkl_Decode(from, to);
	(*env)->ReleaseStringUTFChars(env, jfrom, from);
	(*env)->ReleaseStringUTFChars(env, jto, to);
	return x;
}