mturk 2005/05/29 23:17:14
Modified: jni/native/src jnilib.c
Log:
Rename tcn_dup_string to tcn_strdup and add tcn_pstrdup
Revision Changes Path
1.7 +19 -2 jakarta-tomcat-connectors/jni/native/src/jnilib.c
Index: jnilib.c
===================================================================
RCS file: /home/cvs/jakarta-tomcat-connectors/jni/native/src/jnilib.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- jnilib.c 28 May 2005 08:18:09 -0000 1.6
+++ jnilib.c 30 May 2005 06:17:14 -0000 1.7
@@ -26,6 +26,8 @@
#include "apr_network_io.h"
#include "apr_file_io.h"
#include "apr_mmap.h"
+#include "apr_atomic.h"
+#include "apr_strings.h"
#include "tcn.h"
#include "tcn_version.h"
@@ -67,6 +69,7 @@
return JNI_ERR;
apr_initialize();
+
return JNI_VERSION_1_4;
}
@@ -136,7 +139,7 @@
return result;
}
-char *tcn_dup_string(JNIEnv *env, jstring jstr)
+char *tcn_strdup(JNIEnv *env, jstring jstr)
{
char *result = NULL;
const char *cjstr;
@@ -149,6 +152,19 @@
return result;
}
+char *tcn_pstrdup(JNIEnv *env, jstring jstr, apr_pool_t *pool)
+{
+ char *result = NULL;
+ const char *cjstr;
+
+ cjstr = (const char *)((*env)->GetStringUTFChars(env, jstr, 0));
+ if (cjstr) {
+ result = apr_pstrdup(pool, cjstr);
+ (*env)->ReleaseStringUTFChars(env, jstr, cjstr);
+ }
+ return result;
+}
+
TCN_IMPLEMENT_CALL(jboolean, Library, initialize)(TCN_STDARGS)
{
@@ -157,6 +173,7 @@
if (apr_pool_create(&tcn_global_pool, NULL) != APR_SUCCESS) {
return JNI_FALSE;
}
+ apr_atomic_init(tcn_global_pool);
}
return JNI_TRUE;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]