Debian Codegraph @

bindings/jni/czmq-jni/src/main/c/org_zeromq_czmq_ZhttpRequest.c

raw
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_ZhttpRequest.h"
12
13 JNIEXPORT jlong JNICALL
14 Java_org_zeromq_czmq_ZhttpRequest__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_request_new ();
19 return new_;
20 }
21
22 JNIEXPORT void JNICALL
23 Java_org_zeromq_czmq_ZhttpRequest__1_1destroy (JNIEnv *env, jclass c, jlong self)
24 {
25 zhttp_request_destroy ((zhttp_request_t **) &self);
26 }
27
28 JNIEXPORT jlong JNICALL
29 Java_org_zeromq_czmq_ZhttpRequest__1_1recv (JNIEnv *env, jclass c, jlong self, jlong sock)
30 {
31 jlong recv_ = (jlong) (intptr_t) zhttp_request_recv ((zhttp_request_t *) (intptr_t) self, (zsock_t *) (intptr_t) sock);
32 return recv_;
33 }
34
35 JNIEXPORT jint JNICALL
36 Java_org_zeromq_czmq_ZhttpRequest__1_1send (JNIEnv *env, jclass c, jlong self, jlong client, jint timeout, jlong arg, jlong arg2)
37 {
38 jint send_ = (jint) zhttp_request_send ((zhttp_request_t *) (intptr_t) self, (zhttp_client_t *) (intptr_t) client, (int) timeout, (void *) (intptr_t) arg, (void *) (intptr_t) arg2);
39 return send_;
40 }
41
42 JNIEXPORT jstring JNICALL
43 Java_org_zeromq_czmq_ZhttpRequest__1_1method (JNIEnv *env, jclass c, jlong self)
44 {
45 char *method_ = (char *) zhttp_request_method ((zhttp_request_t *) (intptr_t) self);
46 jstring return_string_ = (*env)->NewStringUTF (env, method_);
47 return return_string_;
48 }
49
50 JNIEXPORT void JNICALL
51 Java_org_zeromq_czmq_ZhttpRequest__1_1setMethod (JNIEnv *env, jclass c, jlong self, jstring method)
52 {
53 char *method_ = (char *) (*env)->GetStringUTFChars (env, method, NULL);
54 zhttp_request_set_method ((zhttp_request_t *) (intptr_t) self, method_);
55 (*env)->ReleaseStringUTFChars (env, method, method_);
56 }
57
58 JNIEXPORT jstring JNICALL
59 Java_org_zeromq_czmq_ZhttpRequest__1_1url (JNIEnv *env, jclass c, jlong self)
60 {
61 char *url_ = (char *) zhttp_request_url ((zhttp_request_t *) (intptr_t) self);
62 jstring return_string_ = (*env)->NewStringUTF (env, url_);
63 return return_string_;
64 }
65
66 JNIEXPORT void JNICALL
67 Java_org_zeromq_czmq_ZhttpRequest__1_1setUrl (JNIEnv *env, jclass c, jlong self, jstring url)
68 {
69 char *url_ = (char *) (*env)->GetStringUTFChars (env, url, NULL);
70 zhttp_request_set_url ((zhttp_request_t *) (intptr_t) self, url_);
71 (*env)->ReleaseStringUTFChars (env, url, url_);
72 }
73
74 JNIEXPORT jstring JNICALL
75 Java_org_zeromq_czmq_ZhttpRequest__1_1contentType (JNIEnv *env, jclass c, jlong self)
76 {
77 char *content_type_ = (char *) zhttp_request_content_type ((zhttp_request_t *) (intptr_t) self);
78 jstring return_string_ = (*env)->NewStringUTF (env, content_type_);
79 return return_string_;
80 }
81
82 JNIEXPORT void JNICALL
83 Java_org_zeromq_czmq_ZhttpRequest__1_1setContentType (JNIEnv *env, jclass c, jlong self, jstring content_type)
84 {
85 char *content_type_ = (char *) (*env)->GetStringUTFChars (env, content_type, NULL);
86 zhttp_request_set_content_type ((zhttp_request_t *) (intptr_t) self, content_type_);
87 (*env)->ReleaseStringUTFChars (env, content_type, content_type_);
88 }
89
90 JNIEXPORT jlong JNICALL
91 Java_org_zeromq_czmq_ZhttpRequest__1_1contentLength (JNIEnv *env, jclass c, jlong self)
92 {
93 jlong content_length_ = (jlong) zhttp_request_content_length ((zhttp_request_t *) (intptr_t) self);
94 return content_length_;
95 }
96
97 JNIEXPORT jlong JNICALL
98 Java_org_zeromq_czmq_ZhttpRequest__1_1headers (JNIEnv *env, jclass c, jlong self)
99 {
100 jlong headers_ = (jlong) (intptr_t) zhttp_request_headers ((zhttp_request_t *) (intptr_t) self);
101 return headers_;
102 }
103
104 JNIEXPORT jstring JNICALL
105 Java_org_zeromq_czmq_ZhttpRequest__1_1content (JNIEnv *env, jclass c, jlong self)
106 {
107 char *content_ = (char *) zhttp_request_content ((zhttp_request_t *) (intptr_t) self);
108 jstring return_string_ = (*env)->NewStringUTF (env, content_);
109 return return_string_;
110 }
111
112 JNIEXPORT jstring JNICALL
113 Java_org_zeromq_czmq_ZhttpRequest__1_1getContent (JNIEnv *env, jclass c, jlong self)
114 {
115 char *get_content_ = (char *) zhttp_request_get_content ((zhttp_request_t *) (intptr_t) self);
116 jstring return_string_ = (*env)->NewStringUTF (env, get_content_);
117 zstr_free (&get_content_);
118 return return_string_;
119 }
120
121 JNIEXPORT void JNICALL
122 Java_org_zeromq_czmq_ZhttpRequest__1_1setContentConst (JNIEnv *env, jclass c, jlong self, jstring content)
123 {
124 char *content_ = (char *) (*env)->GetStringUTFChars (env, content, NULL);
125 zhttp_request_set_content_const ((zhttp_request_t *) (intptr_t) self, content_);
126 (*env)->ReleaseStringUTFChars (env, content, content_);
127 }
128
129 JNIEXPORT void JNICALL
130 Java_org_zeromq_czmq_ZhttpRequest__1_1resetContent (JNIEnv *env, jclass c, jlong self)
131 {
132 zhttp_request_reset_content ((zhttp_request_t *) (intptr_t) self);
133 }
134
135 JNIEXPORT jboolean JNICALL
136 Java_org_zeromq_czmq_ZhttpRequest__1_1match (JNIEnv *env, jclass c, jlong self, jstring method, jstring path)
137 {
138 char *method_ = (char *) (*env)->GetStringUTFChars (env, method, NULL);
139 char *path_ = (char *) (*env)->GetStringUTFChars (env, path, NULL);
140 jboolean match_ = (jboolean) zhttp_request_match ((zhttp_request_t *) (intptr_t) self, method_, path_, NULL);
141 (*env)->ReleaseStringUTFChars (env, method, method_);
142 (*env)->ReleaseStringUTFChars (env, path, path_);
143 return match_;
144 }
145
146 JNIEXPORT void JNICALL
147 Java_org_zeromq_czmq_ZhttpRequest__1_1test (JNIEnv *env, jclass c, jboolean verbose)
148 {
149 zhttp_request_test ((bool) verbose);
150 }
151