view release on metacpan or search on metacpan
lib/AnyEvent/CouchDB/Database.pm view on Meta::CPAN
sub create {
my ( $self, $options ) = @_;
my ( $cv, $cb ) = cvcb( $options, 201, $self->json_encoder );
http_request(
PUT => $self->uri,
headers => $self->_build_headers($options),
$cb
);
$cv;
}
lib/AnyEvent/CouchDB/Database.pm view on Meta::CPAN
if ( not defined $doc->{_id} ) {
$method = 'POST';
$uri = $self->uri;
}
else {
$method = 'PUT';
$uri = $self->uri . uri_escape_utf8( $doc->{_id} );
}
http_request(
$method => $uri . $query->($options),
headers => $self->_build_headers($options),
lib/AnyEvent/CouchDB/Database.pm view on Meta::CPAN
};
};
}
my ( $cv, $cb ) = cvcb( $options, 201, $self->json_encoder );
http_request(
PUT => $self->uri
. uri_escape_utf8( $doc->{_id} ) . "/"
. uri_escape_utf8($attachment)
. $query->( { rev => $doc->{_rev} } ),
headers => $self->_build_headers($options),
body => $body,
lib/AnyEvent/CouchDB/Database.pm view on Meta::CPAN
my ( $self, $path, $options ) = @_;
my ( $cv, $cb ) = cvcb( $options, undef, $self->json_encoder );
my $headers = $self->_build_headers($options);
my $uri = $self->uri . "$path";
http_request(
PUT => $uri,
headers => $headers,
body => $query->($options),
$cb
);
$cv;
view all matches for this distribution
view release on metacpan or search on metacpan
FastPing.xs view on Meta::CPAN
self->nextrecv = -1;
PUSHMARK (SP);
XPUSHs (sv_2mortal (newRV_noinc ((SV *)self->recvq)));
self->recvq = 0;
PUTBACK;
call_sv (self->recvcb, G_DISCARD | G_VOID);
}
while (firstrecv >= 0);
FREETMPS;
FastPing.xs view on Meta::CPAN
{
SV *cb = *av_fetch (cbs, i, 1);
PUSHMARK (SP);
XPUSHs (res);
PUTBACK;
call_sv (cb, G_DISCARD | G_VOID);
}
FREETMPS;
LEAVE;
FastPing.xs view on Meta::CPAN
IV
id (PINGER *self, ...)
CODE:
RETVAL = self->id;
OUTPUT:
RETVAL
void pinger_start (PINGER *self)
void pinger_stop (PINGER *self)
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/Finger.pm view on Meta::CPAN
Under Linux you can use C<iptables> to forward requests to port 79 to
an unprivileged port. I was able to use this incantation to forward port 79
to port 8079:
# iptables -t nat -A PREROUTING -p tcp --dport 79 -j REDIRECT --to-port 8079
# iptables -t nat -I OUTPUT -p tcp -d 127.0.0.1 --dport 79 -j REDIRECT --to-port 8079
The first rule is sufficient for external clients, the second rule was required
for clients connecting via the loopback interface (localhost).
=head1 SEE ALSO
view all matches for this distribution
view release on metacpan or search on metacpan
Handle array context properly. (getlines) Support paragraph mode.
(CLOSE) Return true when process completes successfully.
- test.pl: Added test for GnuPG::Tie paragraph mode.
- GnuPG.pm: (version) Updated to version 0.05 (run_gnupg) Removed file
descriptor leaks. Use CORE::die in case of errors. (read_from_status)
Make sure that we are using newlin as INPUT_RECORD_SEPARATOR.
0.04 1999-12-06 Francis J. Lacoste <francis.lacoste@iNsu.COM>
- Small bugfixes related to running under mod_perl.
- Tag: GNUPG_0_04
- NEWS: Added a news file.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/HTTP/LWP/UserAgent.pm view on Meta::CPAN
sub put_async {
require HTTP::Request::Common;
my($self, @parameters) = @_;
my @suff = $self->_process_colonic_headers(\@parameters, (ref($parameters[1]) ? 2 : 1));
return $self->request_async( HTTP::Request::Common::PUT( @parameters ), @suff );
}
sub delete_async {
require HTTP::Request::Common;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/HTTP/ScopedClient.pm view on Meta::CPAN
}
sub get { shift->request( 'GET', @_ ) }
sub post { shift->request( 'POST', @_ ) }
sub patch { shift->request( 'PATCH', @_ ) }
sub put { shift->request( 'PUT', @_ ) }
sub delete { shift->request( 'DELETE', @_ ) }
sub head { shift->request( 'HEAD', @_ ) }
__PACKAGE__->meta->make_immutable;
view all matches for this distribution
view release on metacpan or search on metacpan
our %IDEMPOTENT = (
DELETE => 1,
GET => 1,
HEAD => 1,
OPTIONS => 1,
PUT => 1,
TRACE => 1,
ACL => 1,
"BASELINE-CONTROL" => 1,
BIND => 1,
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/HTTPD/Router.pm view on Meta::CPAN
my $routes = delete $args{routes};
my $auto_respond_404 = delete $args{auto_respond_404};
my $dispatcher_class = delete $args{dispatcher_class}
|| 'AnyEvent::HTTPD::Router::DefaultDispatcher';
my $known_methods = delete $args{known_methods}
|| [ qw/GET HEAD POST PUT PATCH DELETE TRACE OPTIONS CONNECT/ ];
my $self = $class->SUPER::new(%args);
$self->{known_methods} = $known_methods;
$self->{dispatcher} = defined $dispatcher
lib/AnyEvent/HTTPD/Router.pm view on Meta::CPAN
=head1 SYNOPSIS
use AnyEvent::HTTPD::Router;
my $httpd = AnyEvent::HTTPD::Router->new( port => 1337 );
my $all_methods = [qw/GET DELETE HEAD POST PUT PATCH/];
$httpd->reg_routes(
GET => '/index.txt' => sub {
my ( $httpd, $req ) = @_;
$httpd->stop_request;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/I3.pm view on Meta::CPAN
use constant TYPE_RUN_COMMAND => 0;
use constant TYPE_COMMAND => 0;
use constant TYPE_GET_WORKSPACES => 1;
use constant TYPE_SUBSCRIBE => 2;
use constant TYPE_GET_OUTPUTS => 3;
use constant TYPE_GET_TREE => 4;
use constant TYPE_GET_MARKS => 5;
use constant TYPE_GET_BAR_CONFIG => 6;
use constant TYPE_GET_VERSION => 7;
use constant TYPE_GET_BINDING_MODES => 8;
lib/AnyEvent/I3.pm view on Meta::CPAN
use constant TYPE_SEND_TICK => 10;
use constant TYPE_SYNC => 11;
use constant TYPE_GET_BINDING_STATE => 12;
our %EXPORT_TAGS = ( 'all' => [
qw(i3 TYPE_RUN_COMMAND TYPE_COMMAND TYPE_GET_WORKSPACES TYPE_SUBSCRIBE TYPE_GET_OUTPUTS
TYPE_GET_TREE TYPE_GET_MARKS TYPE_GET_BAR_CONFIG TYPE_GET_VERSION
TYPE_GET_BINDING_MODES TYPE_GET_CONFIG TYPE_SEND_TICK TYPE_SYNC
TYPE_GET_BINDING_STATE)
] );
lib/AnyEvent/I3.pm view on Meta::CPAN
sub get_outputs {
my ($self) = @_;
$self->_ensure_connection;
$self->message(TYPE_GET_OUTPUTS)
}
=head2 get_tree
Gets the layout tree from i3 (>= v4.0).
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/IMAP.pm view on Meta::CPAN
=over 4
=item How can I decode UTF-7 folder names?
use L<Encode::IMAPUTF7>.
=back
=head1 AUTHOR
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/Ident.pm view on Meta::CPAN
Under Linux you can use C<iptables> to forward requests from port 113 to
an unprivileged port. I was able to use this incantation to forward port 113
to port 8113:
# iptables -t nat -A PREROUTING -p tcp --dport 113 -j REDIRECT --to-port 8113
# iptables -t nat -I OUTPUT -p tcp -d 127.0.0.1 --dport 113 -j REDIRECT --to-port 8113
The first rule is sufficient for external clients, the second rule was required
for clients connecting via the loopback interface (localhost).
=head1 SEE ALSO
view all matches for this distribution
view release on metacpan or search on metacpan
sub cmd_recv {
&cmd->recv
}
=item $mpv->bind_key ($INPUT => $string)
This is an extension implement by this module to make it easy to get key
events. The way this is implemented is to bind a C<client-message> witha
first argument of C<AnyEvent::MPV> and the C<$string> you passed. This
C<$string> is then passed to the C<on_key> handle when the key is
$mpv->cmd ("script-message", "osc-visibility", "auto", "dummy");
Handling events makes the main bulk of video playback code. For example,
various ways of ending playback:
if ($INPUT eq "mpv/quit") { # should not happen, but allows user to kill etc. without consequence
$status = 1;
mpv_init; # try reinit
last;
} elsif ($INPUT eq "mpv/idle") { # normal end-of-file
last;
} elsif ($INPUT eq "return") {
$status = 1;
last;
Or the code that actually starts playback, once the file is loaded:
...
my $oid = 100;
} elsif ($INPUT eq "mpv/file-loaded") { # start playing, configure video
$mpv->cmd ("seek", $playback_start, "absolute+exact") if $playback_start > 0;
my $target_fps = eval { $mpv->cmd_recv ("get_property", "container-fps") } || 60;
$target_fps *= play_video_speed_mult;
set_fps $target_fps;
ids 100+ to temporary/per-file observers.
Lastly, it sets some global (or per-youtube-uploader) parameters, such as
speed, and unpauses. Property changes are handled like other input events:
} elsif ($INPUT eq "mpv/property-change") {
my $prop = $INPUT_DATA->{name};
if ($prop eq "chapter-metadata") {
if ($INPUT_DATA->{data}{TITLE} =~ /^\[SponsorBlock\]: (.*)/) {
my $section = $1;
my $skip;
$skip ||= $SPONSOR_SKIP{$_}
for split /\s*,\s*/, $section;
# cancel a queued skip
undef $skip_delay;
}
} elsif (exists $SAVE_PROPERTY{$prop}) {
$PLAYING_STATE->{"mpv_$prop"} = $INPUT_DATA->{data};
::state_save;
}
This saves back the per-file properties, and also handles chapter changes
in a hacky way.
Most of the handlers are very simple, though. For example:
} elsif ($INPUT eq "pause") {
$mpv->cmd ("cycle", "pause");
$PLAYING_STATE->{curpos} = $mpv->cmd_recv ("get_property", "playback-time");
} elsif ($INPUT eq "right") {
$mpv->cmd ("osd-msg-bar", "seek", 30, "relative+exact");
} elsif ($INPUT eq "left") {
$mpv->cmd ("osd-msg-bar", "seek", -5, "relative+exact");
} elsif ($INPUT eq "up") {
$mpv->cmd ("osd-msg-bar", "seek", +600, "relative+exact");
} elsif ($INPUT eq "down") {
$mpv->cmd ("osd-msg-bar", "seek", -600, "relative+exact");
} elsif ($INPUT eq "select") {
$mpv->cmd ("osd-msg-bar", "add", "audio-delay", "-0.100");
} elsif ($INPUT eq "start") {
$mpv->cmd ("osd-msg-bar", "add", "audio-delay", "0.100");
} elsif ($INPUT eq "intfwd") {
$mpv->cmd ("no-osd", "frame-step");
} elsif ($INPUT eq "audio") {
$mpv->cmd ("osd-auto", "cycle", "audio");
} elsif ($INPUT eq "subtitle") {
$mpv->cmd ("osd-auto", "cycle", "sub");
} elsif ($INPUT eq "triangle") {
$mpv->cmd ("osd-auto", "cycle", "deinterlace");
Once a file has finished playing (or the user strops playback), it pauses,
unobserves the per-file observers, and saves the current position for to
be able to resume:
view all matches for this distribution
view release on metacpan or search on metacpan
examples/client.pl view on Meta::CPAN
}
when (/^circle (.+)$/) {
$msn->create_group_chat;
=fdas
PUT 35 260
Routing: 1.0
From: 1:testmsnpsharp@live.cn;epid={ad9d9247-9181-4c57-8388-248304e153d3}
To: 10:00000000-0000-0000-0000-000000000000@live.com
Reliability: 1.0
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/Net/Amazon/S3/HTTPRequest.pm view on Meta::CPAN
=head1 SYNOPSIS
my $http_request = AnyEvent::Net::Amazon::S3::HTTPRequest->new(
s3 => $self->s3,
method => 'PUT',
path => $self->bucket . '/',
headers => $headers,
content => $content,
)->http_request;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/Process.pm view on Meta::CPAN
0 => ['open', '<', '/dev/null']
=item decorate
Decorate every line written to the HANDLE by the child. The DIRECTION must be
C<E<gt>>. ARGS are in the form C<DECORATOR, OUTPUT>. OUTPUT is a glob reference
and specifies a file handle, into which decorated lines are written. Decorator is
a string or a code reference. If the decorator is a string, it is prepended to
every line written by the started process. If the DECORATOR is a code reference,
it is called for each line written to the HANDLE with that line as its argument
and its return value is written to the OUTPUT.
Example:
\*STDERR => ['decorate', '>', 'Child STDERR: ', \*STDERR]
=back
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/REST/Server.pm view on Meta::CPAN
sub read_http_command {
my ($self, $id) = @_;
$self->{connections}{$id}{handle}->push_read(
regex => qr<(GET|POST|PUT|DELETE)\s+([^ ]+)\s+HTTP/(\d.\d)\r?\n>,
sub {
my ($handle, $data) = @_;
$self->{connections}{$id}{command} = $1;
$self->{connections}{$id}{location} = $2;
$self->{connections}{$id}{version} = $3;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/Run.pm view on Meta::CPAN
# Only necessary for the exec, as Perl CODE subroutine goes
# through 0/1/2 which are correct. But of course that coderef
# might invoke exec, so better do it regardless.
# HACK: Using Win32::Console as nothing else exposes SetStdHandle
Win32::Console::_SetStdHandle(
STD_INPUT_HANDLE(),
FdGetOsFHandle(fileno($parent))
);
Win32::Console::_SetStdHandle(
STD_OUTPUT_HANDLE(),
FdGetOsFHandle(fileno($parent))
);
Win32::Console::_SetStdHandle(
STD_ERROR_HANDLE(),
FdGetOsFHandle(fileno($parent))
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/SSH2.pm view on Meta::CPAN
use Net::SSH::Perl::Kex;
use Net::SSH::Perl::ChannelMgr;
use Net::SSH::Perl::Packet;
use Net::SSH::Perl::Buffer;
use Net::SSH::Perl::Constants qw( :protocol :msg2 :compat :hosts :channels :proposal :kex
CHAN_INPUT_CLOSED CHAN_INPUT_WAIT_DRAIN );
use Net::SSH::Perl::Cipher;
use Net::SSH::Perl::AuthMgr;
use Net::SSH::Perl::Comp;
use Net::SSH::Perl::Util qw(:hosts);
use Scalar::Util qw(blessed weaken);
lib/AnyEvent/SSH2.pm view on Meta::CPAN
for my $c (@{ $cmgr->{channels} }) {
next unless defined $c;
if ($c->{wfd} &&
$c->{extended}->length == 0 &&
$c->{output}->length == 0 &&
$c->{ostate} == CHAN_OUTPUT_WAIT_DRAIN ) {
$c->obuf_empty;
}
# ä¸é¢ obuf_empty ä¼ç» ostate åæ CHAN_OUTPUT_CLOSED
# ä¸é¢è¿ä¸ªå°±ä¼åå
³éç»è¿ç¨
if ($c->delete_if_full_closed) {
defined $c->{cb} ? $c->{cb}->() : '';
$cmgr->remove($c->{id});
}
lib/AnyEvent/SSH2.pm view on Meta::CPAN
# è¿æ¯å¤çé¢éä¸çè¾åº, 客æ·ç«¯çè¾å
¥
for my $c (@{ $cmgr->{channels} }) {
next unless defined $c;
my $id = $c->{id};
if ($c->{rfd} && $c->{istate} == CHAN_INPUT_OPEN &&
$c->{remote_window} > 0 &&
$c->{input}->length < $c->{remote_window}) {
$ssh->{watcher}{$id}{rfd} = AE::io $c->{rfd}, 0, sub {
# 顺åºè®°å½ - é¢é - rfd
my $buf;
lib/AnyEvent/SSH2.pm view on Meta::CPAN
};
}
# ç»å
容è¾åº
if (defined $c->{wfd} &&
$c->{ostate} == CHAN_OUTPUT_OPEN ||
$c->{ostate} == CHAN_OUTPUT_WAIT_DRAIN) {
if ($c->{output} and $c->{output}->length > 0) {
$ssh->{watcher}{$id}{wfd} = AE::io $c->{wfd}, 1, sub {
if (my $r = $c->{handlers}{"_output_buffer"}) {
$r->{code}->( $c, $c->{output}, @{ $r->{extra} } );
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/HTTP/Spark.pm view on Meta::CPAN
my $uri=$self->api_url.$url;
my $json=eval {to_json($data)};
return $self->new_false("Failed to convert \$data to json, error was $@") if $@;
my $request=new HTTP::Request(PUT=>$uri,$self->default_headers,$json);
return $self->new_true($request);
}
=item * my $id=$self->que_put_json($cb,$url,$data);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/Sway.pm view on Meta::CPAN
use constant TYPE_RUN_COMMAND => 0;
use constant TYPE_COMMAND => 0;
use constant TYPE_GET_WORKSPACES => 1;
use constant TYPE_SUBSCRIBE => 2;
use constant TYPE_GET_OUTPUTS => 3;
use constant TYPE_GET_TREE => 4;
use constant TYPE_GET_MARKS => 5;
use constant TYPE_GET_BAR_CONFIG => 6;
use constant TYPE_GET_VERSION => 7;
use constant TYPE_GET_BINDING_MODES => 8;
lib/AnyEvent/Sway.pm view on Meta::CPAN
use constant TYPE_SEND_TICK => 10;
use constant TYPE_SYNC => 11;
use constant TYPE_GET_BINDING_STATE => 12;
our %EXPORT_TAGS = ( 'all' => [
qw(sway TYPE_RUN_COMMAND TYPE_COMMAND TYPE_GET_WORKSPACES TYPE_SUBSCRIBE TYPE_GET_OUTPUTS
TYPE_GET_TREE TYPE_GET_MARKS TYPE_GET_BAR_CONFIG TYPE_GET_VERSION
TYPE_GET_BINDING_MODES TYPE_GET_CONFIG TYPE_SEND_TICK TYPE_SYNC
TYPE_GET_BINDING_STATE)
] );
lib/AnyEvent/Sway.pm view on Meta::CPAN
{
my ($self) = @_;
$self->_ensure_connection;
$self->message(TYPE_GET_OUTPUTS)
}
=head2 get_tree
Gets the layout tree from Sway (>= v4.0).
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/UWSGI.pm view on Meta::CPAN
our %IDEMPOTENT = (
DELETE => 1,
GET => 1,
HEAD => 1,
OPTIONS => 1,
PUT => 1,
TRACE => 1,
ACL => 1,
"BASELINE-CONTROL" => 1,
BIND => 1,
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/UserAgent.pm view on Meta::CPAN
});
}
sub get { _do_request(\&HTTP::Request::Common::GET => @_) }
sub head { _do_request(\&HTTP::Request::Common::HEAD => @_) }
sub put { _do_request(\&HTTP::Request::Common::PUT => @_) }
sub delete { _do_request(\&HTTP::Request::Common::DELETE => @_) }
sub post { _do_request(\&HTTP::Request::Common::POST => @_) }
sub patch { _do_request(\&HTTP::Request::Common::PATCH => @_) }
sub options { _do_request(\&HTTP::Request::Common::OPTIONS => @_) }
lib/AnyEvent/UserAgent.pm view on Meta::CPAN
See L<C<get()>|/get>.
=head2 put
This method is a wrapper for the L<C<request()>|/request> method and the
L<C<HTTP::Request::Common::PUT()>|HTTP::Request::Common/PUT $url> function.
See L<C<get()>|/get>.
=head2 delete
This method is a wrapper for the L<C<request()>|/request> method and the
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/WebService/Tracks.pm view on Meta::CPAN
sub generate_xml {
my ( $self, $root, $attrs ) = @_;
my $xml = '';
my $w = XML::Writer->new(OUTPUT => \$xml);
my @keys = sort keys %$attrs;
$w->startTag($root);
foreach my $k (@keys) {
my $v = $attrs->{$k};
lib/AnyEvent/WebService/Tracks.pm view on Meta::CPAN
}
sub do_put {
my ( $self, $uri, $body, $method, $cb ) = @_;
$self->do_request(PUT => $uri, { body => $body }, $method, $cb);
}
sub parse_entities {
my ( $self, $xml, $type, $target_depth ) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/XMPP/Writer.pm view on Meta::CPAN
sub init {
my ($self) = @_;
$self->{write_buf} = "";
$self->{writer} =
XML::Writer->new (OUTPUT => \$self->{write_buf}, NAMESPACES => 1, UNSAFE => 1);
}
=item B<flush ()>
This method flushes the internal write buffer and will invoke the C<write_cb>
view all matches for this distribution
view release on metacpan or search on metacpan
XSPromises.xs view on Meta::CPAN
PUSHMARK(SP);
EXTEND(SP, input_count);
for (i = 0; i < input_count; i++) {
PUSHs(input[i]);
}
PUTBACK;
/* Clear $_ so that callbacks don't end up talking to each other by accident */
SAVE_DEFSV;
DEFSV_set(sv_newmortal());
XSPromises.xs view on Meta::CPAN
result = xspr_result_new(aTHX_ XSPR_RESULT_RESOLVED, count);
for (i = 0; i < count; i++) {
result->result[count-i-1] = SvREFCNT_inc(POPs);
}
}
PUTBACK;
FREETMPS;
LEAVE;
return result;
XSPromises.xs view on Meta::CPAN
deferred()
CODE:
Newxz(RETVAL, 1, AnyEvent__XSPromises__Deferred);
xspr_promise_t* promise = xspr_promise_new(aTHX);
RETVAL->promise = promise;
OUTPUT:
RETVAL
void
___flush()
CODE:
XSPromises.xs view on Meta::CPAN
AnyEvent::XSPromises::Deferred* self
CODE:
Newxz(RETVAL, 1, AnyEvent__XSPromises__Promise);
RETVAL->promise = self->promise;
xspr_promise_incref(aTHX_ RETVAL->promise);
OUTPUT:
RETVAL
void
resolve(self, ...)
AnyEvent::XSPromises::Deferred* self
XSPromises.xs view on Meta::CPAN
bool
is_in_progress(self)
AnyEvent::XSPromises::Deferred* self
CODE:
RETVAL = (self->promise->state == XSPR_STATE_PENDING);
OUTPUT:
RETVAL
void
DESTROY(self)
AnyEvent::XSPromises::Deferred* self
view all matches for this distribution
view release on metacpan or search on metacpan
PUSHMARK(SP);
EXTEND(SP, 3);
PUSHs((SV*)userp); /* XXX This is a weakened reference, will it ever be undef? */
PUSHs(sv_2mortal(newSViv(s)));
PUSHs(sv_2mortal(newSViv(what)));
PUTBACK;
call_sv(MY_CXT.watchset_fn, G_DISCARD | G_VOID);
FREETMPS;
LEAVE;
PUSHMARK(SP);
EXTEND(SP, 2);
PUSHs((SV*)userp); /* XXX This is a weakened reference, will it ever be undef? */
PUSHs(sv_2mortal(newSViv(timeout_ms)));
PUTBACK;
call_sv(MY_CXT.timerset_fn, G_DISCARD | G_VOID);
FREETMPS;
LEAVE;
SAVETMPS;
PUSHMARK(SP);
EXTEND(SP, 1);
PUSHs(sv_2mortal(newSVpvn(ptr, size*nmemb)));
PUTBACK;
call_sv((SV*)userdata, G_DISCARD | G_VOID | G_EVAL);
SPAGAIN;
maybe_warn_eval(aTHX);
PUTBACK;
FREETMPS;
LEAVE;
return size * nmemb;
SAVETMPS;
PUSHMARK(SP);
EXTEND(SP, 1);
PUSHs(sv_2mortal(newSViv(size * nitems)));
PUTBACK;
call_sv((SV*)userdata, G_SCALAR | G_EVAL);
SPAGAIN;
maybe_warn_eval(aTHX);
} else {
result = pvlen;
Copy(pv, buffer, pvlen, char);
}
}
PUTBACK;
FREETMPS;
LEAVE;
return result;
PUSHMARK(SP);
EXTEND(SP, 2);
PUSHs(sv_2mortal(newSViv(type)));
PUSHs(sv_2mortal(newSVpvn(data, size)));
PUTBACK;
call_sv((SV*)userdata, G_DISCARD | G_VOID | G_EVAL);
SPAGAIN;
maybe_warn_eval(aTHX);
PUTBACK;
FREETMPS;
LEAVE;
return 0;
} else {
/* This codepath: return [..trailers..]; */
*output = slist_from_av(aTHX_ *output, (AV*)SvRV(returned));
return_result = CURL_TRAILERFUNC_OK;
}
PUTBACK;
FREETMPS;
LEAVE;
return return_result;
} else {
PUSHs(sv_2mortal(newSVpv(curl_easy_strerror(code), 0)));
}
}
PUTBACK;
call_sv(response->callback, G_DISCARD | G_VOID | G_EVAL);
SPAGAIN;
maybe_warn_eval(aTHX);
PUTBACK;
FREETMPS;
LEAVE;
/* Clean some fields we don't need anymore. We do this now instead of via DESTROY, to break
_get_known_constants()
CODE:
RETVAL = newHV();
sv_2mortal((SV*)RETVAL); /* hehe, perl bugs! */
fill_hv_with_constants(aTHX_ RETVAL);
OUTPUT:
RETVAL
void
DESTROY(self)
SV* self
croak("Don't know what to do with curl's %d (%s)", opt, SvPV_nolen(option));
} else {
croak("Don't know what to do with curl's %d", opt);
}
OUTPUT:
RETVAL
void
DESTROY(self)
SV* self
view all matches for this distribution
view release on metacpan or search on metacpan
AnyMongo.xs view on Meta::CPAN
CODE:
CREATE_BUF(INITIAL_BUF_SIZE);
perl_mongo_sv_to_bson(&buf,sv,NO_PREP);
RETVAL = newSVpvn(buf.start, buf.pos-buf.start);
Safefree(buf.start);
OUTPUT:
RETVAL
SV *
bson_decode(char *bson)
INIT:
AnyMongo.xs view on Meta::CPAN
CODE:
buf.start = bson;
buf.end = bson+strlen(bson);
buf.pos = bson;
RETVAL = perl_mongo_bson_to_sv(&buf);
OUTPUT:
RETVAL
MODULE = AnyMongo PACKAGE = AnyMongo::BSON::OID
PROTOTYPES: DISABLE
AnyMongo.xs view on Meta::CPAN
else {
perl_mongo_make_id(id);
perl_mongo_make_oid(id, oid);
}
RETVAL = newSVpvn(oid, 24);
OUTPUT:
RETVAL
MODULE = AnyMongo PACKAGE = AnyMongo::MongoSupport
PROTOTYPES: DISABLE
AnyMongo.xs view on Meta::CPAN
perl_mongo_sv_to_bson(&buf, fields, NO_PREP);
}
perl_mongo_serialize_size(buf.start, &buf);
RETVAL = newSVpvn(buf.start, buf.pos-buf.start);
Safefree(buf.start);
OUTPUT:
RETVAL
void
build_insert_message(request_id,ns, a)
SV *request_id
AnyMongo.xs view on Meta::CPAN
perl_mongo_serialize_int(&buf, flags);
perl_mongo_sv_to_bson(&buf, criteria, NO_PREP);
perl_mongo_serialize_size(buf.start, &buf);
RETVAL = newSVpvn(buf.start, buf.pos-buf.start);
Safefree(buf.start);
OUTPUT:
RETVAL
SV*
build_update_message(request_id,ns, criteria, obj, flags)
SV *request_id;
AnyMongo.xs view on Meta::CPAN
perl_mongo_sv_to_bson(&buf, criteria, NO_PREP);
perl_mongo_sv_to_bson(&buf, obj, NO_PREP);
perl_mongo_serialize_size(buf.start, &buf);
RETVAL = newSVpvn(buf.start, buf.pos-buf.start);
Safefree(buf.start);
OUTPUT:
RETVAL
SV*
build_get_more_message(request_id,ns, cursor_id,size)
SV *request_id
AnyMongo.xs view on Meta::CPAN
// // cursor id
// perl_mongo_serialize_long(&buf, (int64_t) SvIV(cursor_id));
// perl_mongo_serialize_size(buf.start, &buf);
RETVAL = newSVpvn(buf.start, buf.pos-buf.start);
Safefree(buf.start);
OUTPUT:
RETVAL
SV*
build_kill_cursor_message(request_id_sv,cursor_id)
SV *request_id_sv
AnyMongo.xs view on Meta::CPAN
perl_mongo_serialize_int(&buf, 1);
// cursor ids
perl_mongo_serialize_long(&buf, (int64_t)SvIV(cursor_id));
perl_mongo_serialize_size(buf.start, &buf);
RETVAL = newSVpvn(buf.start, buf.pos-buf.start);
OUTPUT:
RETVAL
SV*
decode_bson_documents(SV *documents)
PREINIT:
AnyMongo.xs view on Meta::CPAN
av_push (ret, sv);
buf.start = buf.pos;
} while( buf.pos < buf.end);
RETVAL = newRV_noinc ((SV *)ret);
OUTPUT:
RETVAL
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AozoraBunko/Checkerkun.pm view on Meta::CPAN
my $YAML_FILE = File::ShareDir::dist_file('AozoraBunko-Checkerkun', 'hiden_no_tare.yml');
my $YAML = YAML::Tiny->read($YAML_FILE)->[0];
my $ENC = Encode::find_encoding("Shift_JIS");
my %VALID_OUTPUT_FORMAT;
@VALID_OUTPUT_FORMAT{qw/plaintext html/} = ();
# [78hosetsu_tekiyo] 78äºæå
æã®å¯¾è±¡ã¨ãªãä¸è¦ãªå¤å注è¨ããã§ãã¯ãã
our $KUTENMEN_78HOSETSU_TEKIYO = $YAML->{'kutenmen_78hosetsu_tekiyo'};
# [hosetsu_tekiyo] å
æã®å¯¾è±¡ã¨ãªãä¸è¦ãªå¤å注è¨ããã§ãã¯ãã
lib/AozoraBunko/Checkerkun.pm view on Meta::CPAN
if ( ! exists $options->{$key} ) { Carp::croak "Unknown option: '$key'"; }
else
{
if ($key eq 'output_format')
{
Carp::croak "Output format option must be 'plaintext' or 'html'" unless exists $VALID_OUTPUT_FORMAT{ $args{$key} };
}
$options->{$key} = $args{$key};
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
This example shows how one might take an arbitrary
URL path /$path/$file.asp, and turn that into a runtime
config for your site, so your scripts get executed
always in your sites DocumentRoot.
INPUT URL /SomeCategory/
OUTPUT
Script: index.asp
$Server->Config('PATH') eq '/SomeCategory'
INPUT URL /SomeCategory/index.asp
OUTPUT
Script: index.asp
$Server->Config('PATH') eq '/SomeCategory'
INPUT URI /index.asp
OUTPUT
Script: index.asp
$Server->Config('PATH') eq ''
# httpd.conf
PerlTransHandler My::Init
view all matches for this distribution
view release on metacpan or search on metacpan
&list_dirs($r, $album_dir, $_, "", $settings );
$r->print("\n</dl>\n");
}
if ($settings->{'EditMode'}) {
$r->print(qq!<FORM METHOD="POST">New Album:<INPUT TYPE="text" NAME="AlbumName"><INPUT TYPE="submit" NAME="New Album" VALUE="New Album"></FORM>!);
unless (@dirs) {
$r->print(&file_upload());
}
}
# places
sub file_upload {
my $ret = <<EOF
<FORM METHOD="POST" ENCTYPE="multipart/form-data">
<INPUT TYPE="submit" NAME="Upload" VALUE="Upload">
<INPUT TYPE="file" NAME="filename" SIZE=50 MAXLENGTH=200>
</FORM>
EOF
;
return $ret;
view all matches for this distribution