home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright (c) 1995-1997 Sun Microsystems, Inc. All Rights Reserved.
- *
- * Permission to use, copy, modify, and distribute this software
- * and its documentation for NON-COMMERCIAL purposes and without
- * fee is hereby granted provided that this copyright notice
- * appears in all copies. Please refer to the file "copyright.html"
- * for further important copyright and licensing information.
- *
- * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF
- * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
- * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
- */
- #include <stdio.h>
- #include <string.h>
- #include <stdlib.h>
- #include "MyTest.h"
-
- JNIEXPORT jint JNICALL Java_MyTest_createString(JNIEnv *env, jobject obj, jstring string, jint alen) {
- jstring jstr;
- jint ret;
- jsize slen;
- char *str;
-
- ret = 0;
- printf("Starting string create \n");
-
- jstr = (*env)->NewStringUTF(env, "newstring");
- if ((*env)->ExceptionOccurred(env)) return;
-
- str = (char *)(*env)->GetStringUTFChars(env, jstr, 0);
- (*env)->ReleaseStringUTFChars(env, jstr, str);
-
- return(ret);
- }
-
- int myCalc(int i, int j) {
- int k;
-
- for (k=1; k<13;k++) {
- i = i + (j*k);
- }
- return(i);
- }
-