fax.c++

来自「tapi的java封装」· C++ 代码 · 共 33 行

C++
33
字号
/*
*	JTAPI library copyright 1998 by Web4Groups consortium (http://Web4Groups.at)
*/

#include <string.h>
#include <string.h>
#include <stdlib.h>
#include "ClientHandler.h"

void JNICALL Java_ClientHandler_sendToHyla(JNIEnv *env, jobject obj, jint cmd, jstring dest, jstring fileName) {
	char *buf = (char*)malloc(64);

	/* a value of 0 for cmd means to execute sendfax
	   otherwise execute faxmail
	*/
	if (cmd == 0)	
		buf = strcpy(buf, "sendfax -n -d ");
	else    buf = strcpy(buf, "faxmail -n -d ");
	const char *number = env->GetStringUTFChars(dest, 0);
	buf = strcat(buf, number);
	if (cmd == 0)
		buf = strcat(buf, " ");
	else
		buf = strcat(buf, " < ");
	const char *fName = env->GetStringUTFChars(fileName, 0);
	buf = strcat(buf, fName);
	env->ReleaseStringUTFChars(dest, number);
	env->ReleaseStringUTFChars(fileName, fName);
printf("cmd: %d, %s\n", cmd, buf);
	system(buf);
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?