aboutsummaryrefslogtreecommitdiff
path: root/capture.h
AgeCommit message (Collapse)AuthorFiles
2024-03-14Allow to set environment for the command to be runSergey Poznyakoff1
* runcap: Update. * Capture.xs (capture_new): New argument: "env" (capture_set_env_ref, capture_env): New functions. * capture.c (free_argv): Change signature. All uses changed. (capture_new): Change signature. Optionally set rc_env. (capture_set_env_ref): New function. * capture.h (capture_new): Change signature. (capture_set_env_ref): New proto. * lib/POSIX/Run/Capture.pm: Document changes. * t/11env.t: New test.
2020-01-30Minor fixSergey Poznyakoff1
* capture.c: Make sure file handle is dereferenced when the object is destroyed.
2020-01-30Accept glob (file handle) or string (file name) with stderr and stdout ↵Sergey Poznyakoff1
keyword arguments * runcap: Upgrade. * Capture.xs: Pass stdout/stderr value without dereferencing it. * capture.h (line_closure): New member "fd". * capture.c (capture_set_output) (capture_close_output): New functions. (capture_new): Use capture_set_output. * lib/POSIX/Run/Capture.pm: Document changes. * Makefile.PL: Declare TEST_REQUIRES. * t/10file.t: New file.
2017-07-22Implement "input" key and set_input method.Sergey Poznyakoff1
* Capture.xs (capture_new): New keyword "input". (capture_set_input): New method. * MANIFEST: Update. * Makefile.PL: Add the 'check' goal (alias to 'test'). * capture.c (capture_new): Take input SV as 5th parameter. (capture_set_input): New function. (capture_DESTROY): Dereference input, if defined. * capture.h (capture) <input>: New method. (capture_new): Change signature. * t/08input.t: New file. * t/TestCapture.pm: Read content in BEGIN block, instead of hardcoding it. (TestCapture): $argv can be a hash or array ref. All uses changed.
2017-07-22Add new methods for manipulating argv and program pathnameSergey Poznyakoff1
* Capture.xs (capture_new): Use new ARGV typedef. Handle the new "program" keyword. (capture_set_argv_ref, capture_set_program) (capture_argv, capture_program): New methods. * capture.c: Handle out of memory errors. (XS_pack_ARGV, XS_unpack_ARGV): New functions. (capture_new): Change signature. Set the rc_program field. (capture_DESTROY): Destroy cp->program (capture_set_argv_ref): New function. * capture.h (capture) <program>: New member. (ARGV): New typedef. (capture_new): Change signature. (XS_unpack_ARGV, XS_pack_ARGV) (capture_set_argv_ref): New protos. * lib/POSIX/Run/Capture.pm (set_argv): New method. * typemap: Hande ARGV conversions. * runcap: Update.
2017-07-21Improve constructor calling convention; implement timeout and line monitoringSergey Poznyakoff1
* Capture.xs: Rewrite constructor to optionally take named arguments. * Makefile.PL: Remove 'subdirs-test_.*' rules. * capture.h (capture): New structure. All capture_ functions operate on it. * capture.c (capture_new): Change signature. Set line monitoring features if required. (capture_DESTROY): Free line buffers and dereference callback references. * lib/POSIX/Run/Capture.pm: Fix trivial error (get_lines): New method.
2017-07-20Initial commitSergey Poznyakoff1

Return to:

Send suggestions and report system problems to the System administrator.