Exemplo n.º 1
0
/* J calls for wd commands - 3 is EVDOMAIN
x    - 11!:x
w    - A* argument
p1   - result (if not 0)
p2   - result (if p1==0)

p2==0 - result is mtm

p2 -> int type, int element count, integer or char data

type==0 - char result
type==1 - char result (to be cut and boxed on 0)
type==2 - int result

return error code (3 EVDOMAIN)
*/
int _stdcall JwdS(J jt, int x, A w, A* p1, int** p2)
{
	int type;
	SOCKBUF* pb;
	/* binrep of user arg has 4 byte ints */
	int* pi=(int*)CAV(w);
	/* test for wd'q' - depends on 3!:1 format */
	if(x==0 && LIT&pi[1] && 1==pi[2] && 0==pi[3] && 'q'==*(16+(C*)pi))
	{
		int* pi=geteventdata();
		if(0==pi) return EVDOMAIN;
		*p2=pi;
		return 0;	/* wd'q' result is ready */
	}
	if(x==0)
	{
		char* pl=JGetLocale(jt);
		putdata(JCMDWD,x,AN(w),CAV(w),strlen(pl),pl);
	}
	else
		putdata(JCMDWD,x,AN(w),CAV(w),0,0);
	if(!(pb=getdata())) errorm("jwds getdata failed");
	if(pb->cmd!=JCMDWDZ) errorm("jwds not wdz");
	type = pb->type;
	if(type>CTERR) return type-CTERR;
	if(type==CTMTM) return 0;
	*p2=(int*)&pb->type;
	return 0;
}
Exemplo n.º 2
0
JNIEXPORT jstring JNICALL Java_com_jsoftware_j_JInterface_getLocaleNative
  (JNIEnv *env, jobject obj, jlong inst) {
	LOGD("getLocaleNative");
  return (*env)->NewStringUTF(env,inst?(C*)JGetLocale((J)inst):"base");
 }