summaryrefslogtreecommitdiffstats
path: root/Ministro/jni
diff options
context:
space:
mode:
authorBogDan Vatra <bog_dan_ro@yahoo.com>2011-02-18 18:21:15 +0800
committerBogDan Vatra <bog_dan_ro@yahoo.com>2011-02-18 18:21:15 +0800
commit4b5bf0cbceebc4823c444617d19cd6dd9d6b2e02 (patch)
treeaebb02c65d7423d479d537822068abc42fecdb7f /Ministro/jni
Say hello, to Ministro !
Qt, system wide shared libraries provider.
Diffstat (limited to 'Ministro/jni')
-rw-r--r--Ministro/jni/Android.mk10
-rw-r--r--Ministro/jni/chmode.c27
2 files changed, 37 insertions, 0 deletions
diff --git a/Ministro/jni/Android.mk b/Ministro/jni/Android.mk
new file mode 100644
index 0000000..6e20fda
--- /dev/null
+++ b/Ministro/jni/Android.mk
@@ -0,0 +1,10 @@
+LOCAL_PATH:= $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := libchmode
+LOCAL_CFLAGS := -Werror
+LOCAL_SRC_FILES := chmode.c
+#LOCAL_LDLIBS := -llog
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/Ministro/jni/chmode.c b/Ministro/jni/chmode.c
new file mode 100644
index 0000000..9e175fb
--- /dev/null
+++ b/Ministro/jni/chmode.c
@@ -0,0 +1,27 @@
+/*
+ Copyright (c) 2011, BogDan Vatra <bog_dan_ro@yahoo.com>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include <jni.h>
+#include <sys/stat.h>
+
+jint Java_eu_licentia_necessitas_ministro_MinistroActivity_nativeChmode(JNIEnv * env, jobject obj, jstring filePath, jint mode)
+{
+ const char *file = (*env)->GetStringUTFChars(env, filePath, 0);
+ int res = chmod(file, mode);
+ (*env)->ReleaseStringUTFChars(env, filePath, file);
+ return res;
+}