| 1 |
/* |
| 2 |
################################################################################ |
| 3 |
# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # |
| 4 |
# Read the zproject/README.md for information about making permanent changes. # |
| 5 |
################################################################################ |
| 6 |
*/ |
| 7 |
#include <stdio.h> |
| 8 |
#include <stdlib.h> |
| 9 |
#include <jni.h> |
| 10 |
#include "czmq.h" |
| 11 |
#include "org_zeromq_czmq_ZhttpResponse.h" |
| 12 |
|
| 13 |
JNIEXPORT jlong JNICALL |
| 14 |
Java_org_zeromq_czmq_ZhttpResponse__1_1new (JNIEnv *env, jclass c) |
| 15 |
{ |
| 16 |
// Disable CZMQ signal handling; allow Java to deal with it |
| 17 |
zsys_handler_set (NULL); |
| 18 |
jlong new_ = (jlong) (intptr_t) zhttp_response_new (); |
| 19 |
return new_; |
| 20 |
} |
| 21 |
|
| 22 |
JNIEXPORT void JNICALL |
| 23 |
Java_org_zeromq_czmq_ZhttpResponse__1_1destroy (JNIEnv *env, jclass c, jlong self) |
| 24 |
{ |
| 25 |
zhttp_response_destroy ((zhttp_response_t **) &self); |
| 26 |
} |
| 27 |
|
| 28 |
JNIEXPORT jint JNICALL |
| 29 |
Java_org_zeromq_czmq_ZhttpResponse__1_1send (JNIEnv *env, jclass c, jlong self, jlong sock, jlong connection) |
| 30 |
{ |
| 31 |
jint send_ = (jint) zhttp_response_send ((zhttp_response_t *) (intptr_t) self, (zsock_t *) (intptr_t) sock, (void **) (intptr_t) &connection); |
| 32 |
return send_; |
| 33 |
} |
| 34 |
|
| 35 |
JNIEXPORT jint JNICALL |
| 36 |
Java_org_zeromq_czmq_ZhttpResponse__1_1recv (JNIEnv *env, jclass c, jlong self, jlong client, jlong arg, jlong arg2) |
| 37 |
{ |
| 38 |
jint recv_ = (jint) zhttp_response_recv ((zhttp_response_t *) (intptr_t) self, (zhttp_client_t *) (intptr_t) client, (void **) (intptr_t) &arg, (void **) (intptr_t) &arg2); |
| 39 |
return recv_; |
| 40 |
} |
| 41 |
|
| 42 |
JNIEXPORT jstring JNICALL |
| 43 |
Java_org_zeromq_czmq_ZhttpResponse__1_1contentType (JNIEnv *env, jclass c, jlong self) |
| 44 |
{ |
| 45 |
char *content_type_ = (char *) zhttp_response_content_type ((zhttp_response_t *) (intptr_t) self); |
| 46 |
jstring return_string_ = (*env)->NewStringUTF (env, content_type_); |
| 47 |
return return_string_; |
| 48 |
} |
| 49 |
|
| 50 |
JNIEXPORT void JNICALL |
| 51 |
Java_org_zeromq_czmq_ZhttpResponse__1_1setContentType (JNIEnv *env, jclass c, jlong self, jstring value) |
| 52 |
{ |
| 53 |
char *value_ = (char *) (*env)->GetStringUTFChars (env, value, NULL); |
| 54 |
zhttp_response_set_content_type ((zhttp_response_t *) (intptr_t) self, value_); |
| 55 |
(*env)->ReleaseStringUTFChars (env, value, value_); |
| 56 |
} |
| 57 |
|
| 58 |
JNIEXPORT jint JNICALL |
| 59 |
Java_org_zeromq_czmq_ZhttpResponse__1_1statusCode (JNIEnv *env, jclass c, jlong self) |
| 60 |
{ |
| 61 |
jint status_code_ = (jint) zhttp_response_status_code ((zhttp_response_t *) (intptr_t) self); |
| 62 |
return status_code_; |
| 63 |
} |
| 64 |
|
| 65 |
JNIEXPORT void JNICALL |
| 66 |
Java_org_zeromq_czmq_ZhttpResponse__1_1setStatusCode (JNIEnv *env, jclass c, jlong self, jint status_code) |
| 67 |
{ |
| 68 |
zhttp_response_set_status_code ((zhttp_response_t *) (intptr_t) self, (uint32_t) status_code); |
| 69 |
} |
| 70 |
|
| 71 |
JNIEXPORT jlong JNICALL |
| 72 |
Java_org_zeromq_czmq_ZhttpResponse__1_1headers (JNIEnv *env, jclass c, jlong self) |
| 73 |
{ |
| 74 |
jlong headers_ = (jlong) (intptr_t) zhttp_response_headers ((zhttp_response_t *) (intptr_t) self); |
| 75 |
return headers_; |
| 76 |
} |
| 77 |
|
| 78 |
JNIEXPORT jlong JNICALL |
| 79 |
Java_org_zeromq_czmq_ZhttpResponse__1_1contentLength (JNIEnv *env, jclass c, jlong self) |
| 80 |
{ |
| 81 |
jlong content_length_ = (jlong) zhttp_response_content_length ((zhttp_response_t *) (intptr_t) self); |
| 82 |
return content_length_; |
| 83 |
} |
| 84 |
|
| 85 |
JNIEXPORT jstring JNICALL |
| 86 |
Java_org_zeromq_czmq_ZhttpResponse__1_1content (JNIEnv *env, jclass c, jlong self) |
| 87 |
{ |
| 88 |
char *content_ = (char *) zhttp_response_content ((zhttp_response_t *) (intptr_t) self); |
| 89 |
jstring return_string_ = (*env)->NewStringUTF (env, content_); |
| 90 |
return return_string_; |
| 91 |
} |
| 92 |
|
| 93 |
JNIEXPORT jstring JNICALL |
| 94 |
Java_org_zeromq_czmq_ZhttpResponse__1_1getContent (JNIEnv *env, jclass c, jlong self) |
| 95 |
{ |
| 96 |
char *get_content_ = (char *) zhttp_response_get_content ((zhttp_response_t *) (intptr_t) self); |
| 97 |
jstring return_string_ = (*env)->NewStringUTF (env, get_content_); |
| 98 |
zstr_free (&get_content_); |
| 99 |
return return_string_; |
| 100 |
} |
| 101 |
|
| 102 |
JNIEXPORT void JNICALL |
| 103 |
Java_org_zeromq_czmq_ZhttpResponse__1_1setContentConst (JNIEnv *env, jclass c, jlong self, jstring content) |
| 104 |
{ |
| 105 |
char *content_ = (char *) (*env)->GetStringUTFChars (env, content, NULL); |
| 106 |
zhttp_response_set_content_const ((zhttp_response_t *) (intptr_t) self, content_); |
| 107 |
(*env)->ReleaseStringUTFChars (env, content, content_); |
| 108 |
} |
| 109 |
|
| 110 |
JNIEXPORT void JNICALL |
| 111 |
Java_org_zeromq_czmq_ZhttpResponse__1_1resetContent (JNIEnv *env, jclass c, jlong self) |
| 112 |
{ |
| 113 |
zhttp_response_reset_content ((zhttp_response_t *) (intptr_t) self); |
| 114 |
} |
| 115 |
|
| 116 |
JNIEXPORT void JNICALL |
| 117 |
Java_org_zeromq_czmq_ZhttpResponse__1_1test (JNIEnv *env, jclass c, jboolean verbose) |
| 118 |
{ |
| 119 |
zhttp_response_test ((bool) verbose); |
| 120 |
} |
| 121 |
|