xref: /unit/go/nxt_cgo_lib.h (revision 1713:f5ba5973a0a3)
1 
2 /*
3  * Copyright (C) Max Romanov
4  * Copyright (C) NGINX, Inc.
5  */
6 
7 #ifndef _NXT_CGO_LIB_H_INCLUDED_
8 #define _NXT_CGO_LIB_H_INCLUDED_
9 
10 
11 #include <stdint.h>
12 #include <stdlib.h>
13 #include <sys/types.h>
14 #include <nxt_unit.h>
15 #include <nxt_unit_request.h>
16 
17 enum {
18     NXT_FIELDS_OFFSET = offsetof(nxt_unit_request_t, fields)
19 };
20 
21 int nxt_cgo_run(uintptr_t handler);
22 
23 ssize_t nxt_cgo_response_write(nxt_unit_request_info_t *req,
24     uintptr_t src, uint32_t len);
25 
26 ssize_t nxt_cgo_request_read(nxt_unit_request_info_t *req,
27     uintptr_t dst, uint32_t dst_len);
28 
29 void nxt_cgo_warn(const char *msg, uint32_t msg_len);
30 void nxt_cgo_alert(const char *msg, uint32_t msg_len);
31 
32 #endif /* _NXT_CGO_LIB_H_INCLUDED_ */
33