1
/*******************************************************************************
2
* Copyright (c) 2002 - 2005 QNX Software Systems and others.
3
* All rights reserved. This program and the accompanying materials
4
* are made available under the terms of the Eclipse Public License v1.0
5
* which accompanies this distribution, and is available at
6
* http://www.eclipse.org/legal/epl-v10.html
9
* QNX Software Systems - initial API and implementation
10
*******************************************************************************/
15
* Class: org_eclipse_cdt_utils_pty_PTY
19
JNIEXPORT jstring JNICALL
20
Java_org_eclipse_cdt_utils_pty_PTY_openMaster (JNIEnv *env, jobject jobj) {
21
jfieldID fid; /* Store the field ID */
24
char line[1024]; /* FIXME: Should be enough */
29
master = ptym_open(line);
31
/* Get a reference to the obj's class */
32
cls = (*env)->GetObjectClass(env, jobj);
34
/* Set the master fd. */
35
fid = (*env)->GetFieldID(env, cls, "master", "I");
39
(*env)->SetIntField(env, jobj, fid, (jint)master);
41
/* Create a new String for the slave. */
42
jstr = (*env)->NewStringUTF(env, line);