xref: /unit/go/nxt_cgo_lib.h (revision 1713)
11316Smax.romanov@nginx.com 
21316Smax.romanov@nginx.com /*
31316Smax.romanov@nginx.com  * Copyright (C) Max Romanov
41316Smax.romanov@nginx.com  * Copyright (C) NGINX, Inc.
51316Smax.romanov@nginx.com  */
61316Smax.romanov@nginx.com 
71316Smax.romanov@nginx.com #ifndef _NXT_CGO_LIB_H_INCLUDED_
81316Smax.romanov@nginx.com #define _NXT_CGO_LIB_H_INCLUDED_
91316Smax.romanov@nginx.com 
101316Smax.romanov@nginx.com 
111316Smax.romanov@nginx.com #include <stdint.h>
121316Smax.romanov@nginx.com #include <stdlib.h>
131316Smax.romanov@nginx.com #include <sys/types.h>
14*1713Smax.romanov@nginx.com #include <nxt_unit.h>
15*1713Smax.romanov@nginx.com #include <nxt_unit_request.h>
161316Smax.romanov@nginx.com 
17*1713Smax.romanov@nginx.com enum {
18*1713Smax.romanov@nginx.com     NXT_FIELDS_OFFSET = offsetof(nxt_unit_request_t, fields)
19*1713Smax.romanov@nginx.com };
201316Smax.romanov@nginx.com 
211316Smax.romanov@nginx.com int nxt_cgo_run(uintptr_t handler);
221316Smax.romanov@nginx.com 
23*1713Smax.romanov@nginx.com ssize_t nxt_cgo_response_write(nxt_unit_request_info_t *req,
24*1713Smax.romanov@nginx.com     uintptr_t src, uint32_t len);
251316Smax.romanov@nginx.com 
26*1713Smax.romanov@nginx.com ssize_t nxt_cgo_request_read(nxt_unit_request_info_t *req,
27*1713Smax.romanov@nginx.com     uintptr_t dst, uint32_t dst_len);
281316Smax.romanov@nginx.com 
29*1713Smax.romanov@nginx.com void nxt_cgo_warn(const char *msg, uint32_t msg_len);
30*1713Smax.romanov@nginx.com void nxt_cgo_alert(const char *msg, uint32_t msg_len);
311316Smax.romanov@nginx.com 
321316Smax.romanov@nginx.com #endif /* _NXT_CGO_LIB_H_INCLUDED_ */
33