From: Mathieu Baudier Date: Tue, 19 Dec 2023 05:54:54 +0000 (+0100) Subject: Merge tag 'v2.3.17' into testing X-Git-Tag: v2.1.35~1 X-Git-Url: http://git.argeo.org/?a=commitdiff_plain;h=8403f4c613b1be7c2248292248faaa37ab35cbf2;hp=cd3cf19aed7ddc000864cde9a1a6e2dc1cfdda5e;p=gpl%2Fargeo-tp.git Merge tag 'v2.3.17' into testing --- diff --git a/.gitmodules b/.gitmodules index 07b10ca..d728334 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,4 @@ [submodule "sdk/argeo-build"] path = sdk/argeo-build url = http://git.argeo.org/cc0/argeo-build.git - branch = unstable + branch = testing diff --git a/branch.mk b/branch.mk index afde0f8..dbecaaa 100644 --- a/branch.mk +++ b/branch.mk @@ -1 +1 @@ -BRANCH=unstable \ No newline at end of file +BRANCH=testing \ No newline at end of file diff --git a/rebuild/org.argeo.tp.utils/jni/com_sun_mail_mbox/UNIXFile.c b/rebuild/org.argeo.tp.utils/jni/com_sun_mail_mbox/UNIXFile.c new file mode 100644 index 0000000..e66a772 --- /dev/null +++ b/rebuild/org.argeo.tp.utils/jni/com_sun_mail_mbox/UNIXFile.c @@ -0,0 +1,100 @@ +/* + * Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0, which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the + * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + * version 2 with the GNU Classpath Exception, which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + */ + +#include +#include +#include +#include + +extern int _fcntl(); + +#include "com_sun_mail_mbox_UNIXFile.h" + +static jfieldID IO_fd_fdID; +static int fd_offset; + +/* + * Class: com_sun_mail_mbox_UNIXFile + * Method: initIDs + * Signature: (Ljava/lang/Class;Ljava/io/FileDescriptor;)V + */ +JNIEXPORT void JNICALL +Java_com_sun_mail_mbox_UNIXFile_initIDs(JNIEnv *env, jclass ufClass, + jclass fdClass, jobject stdin_obj) +{ + IO_fd_fdID = (*env)->GetFieldID(env, fdClass, "fd", "I"); + /* + * Because pre-JDK 1.2 stored the "fd" as one more than + * its actual value, we remember the value it stored for + * stdin, which should be zero, and use it as the offset + * for other fd's we extract. + */ + fd_offset = (*env)->GetIntField(env, stdin_obj, IO_fd_fdID); +} + +/* + * Class: com_sun_mail_mbox_UNIXFile + * Method: lock0 + * Signature: (Ljava/io/FileDescriptor;Ljava/lang/String;Z)Z + */ +JNIEXPORT jboolean JNICALL +Java_com_sun_mail_mbox_UNIXFile_lock0(JNIEnv *env, jclass clazz, + jobject fdobj, jstring umode, jboolean block) +{ + int fd; + const char *mode; + static struct flock flock0; + struct flock flock = flock0; + + fd = (*env)->GetIntField(env, fdobj, IO_fd_fdID); + fd -= fd_offset; + /* XXX - a lot of work to examine one character in a string */ + mode = (*env)->GetStringUTFChars(env, umode, 0); + flock.l_type = mode[1] == 'w' ? F_WRLCK : F_RDLCK; + (*env)->ReleaseStringUTFChars(env, umode, mode); + flock.l_whence = SEEK_SET; + flock.l_start = 0; + flock.l_len = 0; + return (_fcntl(fd, block ? F_SETLKW : F_SETLK, &flock) == 0 ? + JNI_TRUE : JNI_FALSE); +} + +/* + * Class: com_sun_mail_mbox_UNIXFile + * Method: lastAccessed0 + * Signature: (Ljava/lang/String;)J + */ +JNIEXPORT jlong JNICALL +Java_com_sun_mail_mbox_UNIXFile_lastAccessed0(JNIEnv *env, jclass clazz, + jstring uname) +{ + const char *name; + jlong ret = -1; + struct stat st; + + name = (*env)->GetStringUTFChars(env, uname, 0); + if (stat(name, &st) == 0) { + /* + * Should be... + ret = (jlong)st.st_atim.tv_sec * 1000 + + st.st_atim.tv_nsec / 1000000; + * but for compatibility with lastModified we use... + */ + ret = (jlong)st.st_atime * 1000; + } + (*env)->ReleaseStringUTFChars(env, uname, name); + return ret; +} diff --git a/rebuild/org.argeo.tp.utils/jni/com_sun_mail_mbox/UNIXInbox.c b/rebuild/org.argeo.tp.utils/jni/com_sun_mail_mbox/UNIXInbox.c new file mode 100644 index 0000000..274a44e --- /dev/null +++ b/rebuild/org.argeo.tp.utils/jni/com_sun_mail_mbox/UNIXInbox.c @@ -0,0 +1,60 @@ +/* + * Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0, which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the + * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + * version 2 with the GNU Classpath Exception, which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + */ + +#include +#include +extern void touchlock(); /* XXX - should be in maillock.h */ + +#include "com_sun_mail_mbox_UNIXInbox.h" + +/* + * Class: com_sun_mail_mbox_UNIXInbox + * Method: maillock + * Signature: (Ljava/lang/String;I)Z + */ +JNIEXPORT jboolean JNICALL +Java_com_sun_mail_mbox_UNIXInbox_maillock(JNIEnv *env, jobject obj, + jstring user, jint retry_count) +{ + jboolean ret; + const char *name = (*env)->GetStringUTFChars(env, user, 0); + ret = maillock((char *)name, retry_count) == L_SUCCESS ? + JNI_TRUE : JNI_FALSE; + (*env)->ReleaseStringUTFChars(env, user, name); + return (ret); +} + +/* + * Class: com_sun_mail_mbox_UNIXInbox + * Method: mailunlock + * Signature: ()V + */ +JNIEXPORT void JNICALL +Java_com_sun_mail_mbox_UNIXInbox_mailunlock(JNIEnv *env, jobject obj) +{ + (void) mailunlock(); +} + +/* + * Class: com_sun_mail_mbox_UNIXInbox + * Method: touchlock0 + * Signature: ()V + */ +JNIEXPORT void JNICALL +Java_com_sun_mail_mbox_UNIXInbox_touchlock0(JNIEnv *env, jobject obj) +{ + (void) touchlock(); +} diff --git a/rebuild/org.argeo.tp.utils/jni/com_sun_mail_mbox/com_sun_mail_mbox_UNIXFile.h b/rebuild/org.argeo.tp.utils/jni/com_sun_mail_mbox/com_sun_mail_mbox_UNIXFile.h new file mode 100644 index 0000000..c85274f --- /dev/null +++ b/rebuild/org.argeo.tp.utils/jni/com_sun_mail_mbox/com_sun_mail_mbox_UNIXFile.h @@ -0,0 +1,47 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class com_sun_mail_mbox_UNIXFile */ + +#ifndef _Included_com_sun_mail_mbox_UNIXFile +#define _Included_com_sun_mail_mbox_UNIXFile +#ifdef __cplusplus +extern "C" { +#endif +#undef com_sun_mail_mbox_UNIXFile_serialVersionUID +#define com_sun_mail_mbox_UNIXFile_serialVersionUID 301077366599181567LL +#undef com_sun_mail_mbox_UNIXFile_serialVersionUID +#define com_sun_mail_mbox_UNIXFile_serialVersionUID -7972156315284146651LL +#undef com_sun_mail_mbox_UNIXFile_NONE +#define com_sun_mail_mbox_UNIXFile_NONE 0L +#undef com_sun_mail_mbox_UNIXFile_NATIVE +#define com_sun_mail_mbox_UNIXFile_NATIVE 1L +#undef com_sun_mail_mbox_UNIXFile_JAVA +#define com_sun_mail_mbox_UNIXFile_JAVA 2L +/* + * Class: com_sun_mail_mbox_UNIXFile + * Method: initIDs + * Signature: (Ljava/lang/Class;Ljava/io/FileDescriptor;)V + */ +JNIEXPORT void JNICALL Java_com_sun_mail_mbox_UNIXFile_initIDs + (JNIEnv *, jclass, jclass, jobject); + +/* + * Class: com_sun_mail_mbox_UNIXFile + * Method: lock0 + * Signature: (Ljava/io/FileDescriptor;Ljava/lang/String;Z)Z + */ +JNIEXPORT jboolean JNICALL Java_com_sun_mail_mbox_UNIXFile_lock0 + (JNIEnv *, jclass, jobject, jstring, jboolean); + +/* + * Class: com_sun_mail_mbox_UNIXFile + * Method: lastAccessed0 + * Signature: (Ljava/lang/String;)J + */ +JNIEXPORT jlong JNICALL Java_com_sun_mail_mbox_UNIXFile_lastAccessed0 + (JNIEnv *, jclass, jstring); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/rebuild/org.argeo.tp.utils/jni/com_sun_mail_mbox/com_sun_mail_mbox_UNIXInbox.h b/rebuild/org.argeo.tp.utils/jni/com_sun_mail_mbox/com_sun_mail_mbox_UNIXInbox.h new file mode 100644 index 0000000..9f24cb9 --- /dev/null +++ b/rebuild/org.argeo.tp.utils/jni/com_sun_mail_mbox/com_sun_mail_mbox_UNIXInbox.h @@ -0,0 +1,51 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class com_sun_mail_mbox_UNIXInbox */ + +#ifndef _Included_com_sun_mail_mbox_UNIXInbox +#define _Included_com_sun_mail_mbox_UNIXInbox +#ifdef __cplusplus +extern "C" { +#endif +#undef com_sun_mail_mbox_UNIXInbox_serialVersionUID +#define com_sun_mail_mbox_UNIXInbox_serialVersionUID 301077366599181567LL +#undef com_sun_mail_mbox_UNIXInbox_serialVersionUID +#define com_sun_mail_mbox_UNIXInbox_serialVersionUID -7972156315284146651LL +#undef com_sun_mail_mbox_UNIXInbox_NONE +#define com_sun_mail_mbox_UNIXInbox_NONE 0L +#undef com_sun_mail_mbox_UNIXInbox_NATIVE +#define com_sun_mail_mbox_UNIXInbox_NATIVE 1L +#undef com_sun_mail_mbox_UNIXInbox_JAVA +#define com_sun_mail_mbox_UNIXInbox_JAVA 2L +#undef com_sun_mail_mbox_UNIXInbox_serialVersionUID +#define com_sun_mail_mbox_UNIXInbox_serialVersionUID -254578891263785591LL +#undef com_sun_mail_mbox_UNIXInbox_serialVersionUID +#define com_sun_mail_mbox_UNIXInbox_serialVersionUID 651261842162777620LL +/* + * Class: com_sun_mail_mbox_UNIXInbox + * Method: maillock + * Signature: (Ljava/lang/String;I)Z + */ +JNIEXPORT jboolean JNICALL Java_com_sun_mail_mbox_UNIXInbox_maillock + (JNIEnv *, jobject, jstring, jint); + +/* + * Class: com_sun_mail_mbox_UNIXInbox + * Method: mailunlock + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_com_sun_mail_mbox_UNIXInbox_mailunlock + (JNIEnv *, jobject); + +/* + * Class: com_sun_mail_mbox_UNIXInbox + * Method: touchlock0 + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_com_sun_mail_mbox_UNIXInbox_touchlock0 + (JNIEnv *, jobject); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/sdk/argeo-build b/sdk/argeo-build index 08bc9ba..cabcc34 160000 --- a/sdk/argeo-build +++ b/sdk/argeo-build @@ -1 +1 @@ -Subproject commit 08bc9ba6656515e235eb269c31bc2b1e93748055 +Subproject commit cabcc3462226b71849ca42301c21e05b63f150c2 diff --git a/sdk/branches/testing.bnd b/sdk/branches/testing.bnd new file mode 100644 index 0000000..d578661 --- /dev/null +++ b/sdk/branches/testing.bnd @@ -0,0 +1,4 @@ +major=2 +minor=1 +micro=34 +qualifier=.next