created mirror
This commit is contained in:
commit
6764738d92
600 files changed
+87187
No files matched your search
@@ -0,0 +1,19 @@
|
||||
|
||||
|
||||
JNI_INCLUDE = /usr/include/kaffe/
|
||||
|
||||
all : arch/syslog/libgzigzag-syslog.so
|
||||
|
||||
%.o : %.c
|
||||
$(CC) $(CFLAGS) -I $(JNI_INCLUDE) -fPIC -c -o $@ $<
|
||||
|
||||
arch/syslog/org_gzigzag_SysLogger.o : arch/syslog/org_gzigzag_SysLogger.c arch/syslog/org_gzigzag_SysLogger.h
|
||||
|
||||
arch/syslog/org_gzigzag_SysLogger.h : org/gzigzag/SysLogger.class
|
||||
javah -jni -d arch/syslog org.gzigzag.SysLogger
|
||||
|
||||
arch/syslog/libgzigzag-syslog.so : arch/syslog/org_gzigzag_SysLogger.o
|
||||
$(CC) -shared -o $@ $^
|
||||
|
||||
clean :
|
||||
rm -f arch/syslog/libgzigzag-syslog.so arch/syslog/org_gzigzag_SysLogger.o arch/syslog/org_gzigzag_SysLogger.h
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
org_gzigzag_SysLogger.c
|
||||
*
|
||||
* You may use and distribute under the terms of either the GNU Lesser
|
||||
* General Public License, either version 2 of the license or,
|
||||
* at your choice, any later version. Alternatively, you may use and
|
||||
* distribute under the terms of the XPL.
|
||||
*
|
||||
* See the LICENSE.lgpl and LICENSE.xpl files for the specific terms of
|
||||
* the licenses.
|
||||
*
|
||||
* This software 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 README
|
||||
* file for more details.
|
||||
*
|
||||
*/
|
||||
/*
|
||||
* Written by Antti-Juhani Kaijanaho
|
||||
*/
|
||||
|
||||
#include "org_gzigzag_SysLogger.h"
|
||||
#include <syslog.h>
|
||||
|
||||
/*
|
||||
* Class: org_gzigzag_SysLogger
|
||||
* Method: openlog
|
||||
* Signature: ()V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_org_gzigzag_SysLogger_openlog(JNIEnv * env, jclass class) {
|
||||
openlog("gzigzag", LOG_CONS, LOG_DAEMON);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_gzigzag_SysLogger
|
||||
* Method: syslog
|
||||
* Signature: (Ljava/lang/String;Z)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_org_gzigzag_SysLogger_syslog(JNIEnv * env, jclass class, jstring msg, jboolean verb) {
|
||||
const char * s;
|
||||
|
||||
jboolean isCopy = JNI_FALSE;
|
||||
s = (*env)->GetStringUTFChars(env, msg, &isCopy);
|
||||
syslog((verb == JNI_TRUE) ? LOG_NOTICE : LOG_INFO, s);
|
||||
(*env)->ReleaseStringUTFChars(env, msg, s);
|
||||
}
|
||||
Reference in new issue
Block a user