diff options
author | Alexander Borisov <alexander.borisov@nginx.com> | 2018-01-31 15:47:00 +0300 |
---|---|---|
committer | Alexander Borisov <alexander.borisov@nginx.com> | 2018-01-31 15:47:00 +0300 |
commit | 960962ddce87f6b401523b4426e8b5c61544ec7b (patch) | |
tree | 3c6fa7d9871701bca291ea5899a98397dacc5a87 /src/perl/nxt_perl_psgi_layer.h | |
parent | 311db93f006153c309b975942c2415655e2ff417 (diff) | |
download | unit-960962ddce87f6b401523b4426e8b5c61544ec7b.tar.gz unit-960962ddce87f6b401523b4426e8b5c61544ec7b.tar.bz2 |
Added Perl support.
Diffstat (limited to 'src/perl/nxt_perl_psgi_layer.h')
-rw-r--r-- | src/perl/nxt_perl_psgi_layer.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/perl/nxt_perl_psgi_layer.h b/src/perl/nxt_perl_psgi_layer.h new file mode 100644 index 00000000..3fa349c0 --- /dev/null +++ b/src/perl/nxt_perl_psgi_layer.h @@ -0,0 +1,48 @@ + +/* + * Copyright (C) Alexander Borisov + * Copyright (C) NGINX, Inc. + */ + +#ifndef _NXT_PERL_PSGI_LAYER_H_INCLUDED_ +#define _NXT_PERL_PSGI_LAYER_H_INCLUDED_ + + +#include <EXTERN.h> +#include <XSUB.h> +#include <perl.h> +#include <perliol.h> + + +typedef struct nxt_perl_psgi_io_arg nxt_perl_psgi_io_arg_t; + +typedef long (*nxt_perl_psgi_io_read_f)(PerlInterpreter *my_perl, + nxt_perl_psgi_io_arg_t *arg, void *vbuf, size_t length); +typedef long (*nxt_perl_psgi_io_write_f)(PerlInterpreter *my_perl, + nxt_perl_psgi_io_arg_t *arg, const void *vbuf, size_t length); +typedef long (*nxt_perl_psgi_io_arg_f)(PerlInterpreter *my_perl, + nxt_perl_psgi_io_arg_t *arg); + + +struct nxt_perl_psgi_io_arg { + SV *io; + PerlIO *fp; + + nxt_perl_psgi_io_arg_f flush; + nxt_perl_psgi_io_read_f read; + nxt_perl_psgi_io_write_f write; + + void *ctx; +}; + + +void nxt_perl_psgi_layer_stream_init(pTHX); + +PerlIO *nxt_perl_psgi_layer_stream_fp_create(pTHX_ nxt_perl_psgi_io_arg_t *arg, + const char *mode); +void nxt_perl_psgi_layer_stream_fp_destroy(pTHX_ PerlIO *io); + +SV *nxt_perl_psgi_layer_stream_io_create(pTHX_ PerlIO *fp); +void nxt_perl_psgi_layer_stream_io_destroy(pTHX_ SV *rvio); + +#endif /* _NXT_PERL_PSGI_LAYER_H_INCLUDED_ */ |