1 /* JORTEDomainInitEvents.c */
5 * This code provides conversion between JAVA a C environments.
6 * The C functions are calling here and results are send to JAVA
7 * native functions. It uses the header pregenerated by JAVA
8 * (by command 'javah -jni class_with_native_function')
10 * @author Lukas Pokorny (lukas_pokorny@centrum.cz)
11 * @author CTU FEE Prague - Department of Control Engineering (dce.felk.cvut.cz
13 * @author Project ORTE - OCERA Real Time Ethernet (www.ocera.org)
14 * @author dedication to Kj
18 * This program is free software; you can redistribute it and/or modify
19 * it under the terms of the GNU General Public License as published by
20 * the Free Software Foundation; either version 2 of the License, or
21 * (at your option) any later version.
23 * This program is distributed in the hope that it will be useful,
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 * GNU General Public License for more details.
31 // origin orte headers
33 // pregenerated header
34 #include "jorte/org_ocera_orte_types_DomainEvents.h"
35 #include "jorte/4all.h"
37 JNIEXPORT jlong JNICALL
38 Java_org_ocera_orte_types_DomainEvents_jORTEDomainInitEvents
39 (JNIEnv *env, jobject obj)
41 ORTEDomainAppEvents *evs;
44 evs = (ORTEDomainAppEvents *) malloc(sizeof(ORTEDomainAppEvents));
47 printf(":!c: evs = NULL [not enough memory] \n");
50 // call the liborte function
51 if (!ORTEDomainInitEvents(evs))
53 printf(":!c: events not initialized! \n");
58 printf(":c: events initialized.. \n");