Skip to content

Commit 653d91c

Browse files
committed
fix imports
1 parent 4906878 commit 653d91c

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

src/call_java.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include <jni.h>
22
#include <sqlite3ext.h>
3-
SQLITE_EXTENSION_INIT1
3+
#include <string.h>
44

55
JavaVM* gJvm = NULL; // Stored from JNI_OnLoad
66

src/call_java.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// call_java.h
2+
#ifndef CALL_JAVA_H
3+
#define CALL_JAVA_H
4+
5+
#include <jni.h>
6+
7+
JNIEnv* getEnv();
8+
const char* call_https_java(JNIEnv* env);
9+
10+
#endif

src/network.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
// Created by Marco Bambini on 12/12/24.
66
//
77

8-
extern const char* call_https_java(JNIEnv* env); // Declare your JNI function
9-
extern JNIEnv* getEnv(); // Declare getEnv from call_java.c
10-
118
#ifndef CLOUDSYNC_OMIT_NETWORK
129

1310
#include <stdint.h>
@@ -17,6 +14,9 @@ extern JNIEnv* getEnv(); // Declare getEnv from call_ja
1714
#include "curl/curl.h"
1815
#include <stdio.h>
1916
#include <android/log.h>
17+
#include <jni.h>
18+
#include <stdlib.h>
19+
#include "call_java.h"
2020

2121
#define CLOUDSYNC_ENDPOINT_PREFIX "v1/cloudsync"
2222
#define CLOUDSYNC_ENDPOINT_UPLOAD "upload"
@@ -456,7 +456,7 @@ void cloudsync_network_init (sqlite3_context *context, int argc, sqlite3_value *
456456

457457
JNIEnv* env = getEnv();
458458
if (!env) {
459-
sqlite3_result_error(context, "Could not get JNIEnv");
459+
sqlite3_result_error(context, "Could not get JNIEnv", -1);
460460
return;
461461
}
462462

0 commit comments

Comments
 (0)