| 1 | /* |
| 2 | |
| 3 | Copyright (C) 2018,2019 Alois Schloegl <[email protected]> |
| 4 | This file is part of the "BioSig for C/C++" repository |
| 5 | (biosig4c++) at http://biosig.sf.net/ |
| 6 | |
| 7 | |
| 8 | BioSig is free software; you can redistribute it and/or |
| 9 | modify it under the terms of the GNU General Public License |
| 10 | as published by the Free Software Foundation; either version 3 |
| 11 | of the License, or (at your option) any later version. |
| 12 | |
| 13 | This program is distributed in the hope that it will be useful, |
| 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | GNU General Public License for more details. |
| 17 | |
| 18 | You should have received a copy of the GNU General Public License |
| 19 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 20 | |
| 21 | */ |
| 22 | |
| 23 | |
| 24 | #include <stdio.h> |
| 25 | #include <biosig.h> |
| 26 | #include "Biosig.h" |
| 27 | /* Header for class Biosig */ |
| 28 | |
| 29 | #ifndef _Included_biosig |
| 30 | #define _Included_biosig |
| 31 | #ifdef __cplusplus |
| 32 | extern "C" { |
| 33 | #endif |
| 34 | /* |
| 35 | * Class: Biosig |
| 36 | * Method: hdr2ascii |
| 37 | * Signature: ()V |
| 38 | */ |
| 39 | JNIEXPORT jstring JNICALL Java_Biosig_hdr2ascii (JNIEnv *env, jobject, jstring filename) { |
| 40 | HDR_STRUCT *hdr = sopen((const char*)env->GetStringUTFChars(filename, 0),"r", NULL); |
| 41 | char *json=NULL; |
| 42 | asprintf_hdr2json(&json,hdr); |
| 43 | sclose(hdr); |
| 44 | destructHDR(hdr); |
| 45 | printf("hdr2ascii: Hello World! \n%s\n", json); |
| 46 | return env->NewStringUTF(json); |
| 47 | } |
| 48 | |
| 49 | /* |
| 50 | * Class: Biosig |
| 51 | * Method: isTTY |
| 52 | * Signature: ()Z |
| 53 | */ |
| 54 | JNIEXPORT jboolean JNICALL Java_Biosig_isTTY (JNIEnv *env, jclass) { |
| 55 | printf("isTTY: Hello World!\n"); |
| 56 | |
| 57 | } |
| 58 | /* |
| 59 | * Class: Biosig |
| 60 | * Method: getTTYName |
| 61 | * Signature: ()Ljava/lang/String; |
| 62 | */ |
| 63 | JNIEXPORT jstring JNICALL Java_Biosig_getTTYName (JNIEnv *env, jclass) { |
| 64 | printf("getTTYName: Hello World!\n"); |
| 65 | } |
| 66 | |
| 67 | #ifdef __cplusplus |
| 68 | } |
| 69 | #endif |
| 70 | #endif |