r33725 - in /branches/upstream/libhtml-template-pro-perl/current: Changes META.yml Pro.xs lib/HTML/Template/PerlInterface.pod lib/HTML/Template/Pro.pm lib/HTML/Template/SYNTAX.pod perl-HTML-Template-Pro.spec procore.c
gregoa at users.alioth.debian.org
gregoa at users.alioth.debian.org
Wed Apr 22 18:29:12 UTC 2009
Author: gregoa
Date: Wed Apr 22 18:29:07 2009
New Revision: 33725
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=33725
Log:
[svn-upgrade] Integrating new upstream version, libhtml-template-pro-perl (0.74)
Modified:
branches/upstream/libhtml-template-pro-perl/current/Changes
branches/upstream/libhtml-template-pro-perl/current/META.yml
branches/upstream/libhtml-template-pro-perl/current/Pro.xs
branches/upstream/libhtml-template-pro-perl/current/lib/HTML/Template/PerlInterface.pod
branches/upstream/libhtml-template-pro-perl/current/lib/HTML/Template/Pro.pm
branches/upstream/libhtml-template-pro-perl/current/lib/HTML/Template/SYNTAX.pod
branches/upstream/libhtml-template-pro-perl/current/perl-HTML-Template-Pro.spec
branches/upstream/libhtml-template-pro-perl/current/procore.c
Modified: branches/upstream/libhtml-template-pro-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-template-pro-perl/current/Changes?rev=33725&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/Changes (original)
+++ branches/upstream/libhtml-template-pro-perl/current/Changes Wed Apr 22 18:29:07 2009
@@ -162,3 +162,9 @@
- multiple memory leaks fixed
(by Shigeki Morimoto <shigeki.morimoto at mixi.co.jp>)
+0.74 Fri Apr 3 20:19:32 EEST 2009
+ - merges from HTML::Template 2.9
+ - memory leaks fix
+ (by Shigeki Morimoto <shigeki.morimoto at mixi.co.jp>)
+
+
Modified: branches/upstream/libhtml-template-pro-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-template-pro-perl/current/META.yml?rev=33725&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/META.yml (original)
+++ branches/upstream/libhtml-template-pro-perl/current/META.yml Wed Apr 22 18:29:07 2009
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: HTML-Template-Pro
-version: 0.73
+version: 0.74
abstract: Perl/XS module to use HTML Templates from CGI scripts
license: ~
author:
Modified: branches/upstream/libhtml-template-pro-perl/current/Pro.xs
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-template-pro-perl/current/Pro.xs?rev=33725&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/Pro.xs (original)
+++ branches/upstream/libhtml-template-pro-perl/current/Pro.xs Wed Apr 22 18:29:07 2009
@@ -26,6 +26,8 @@
SV* OutputString;
static
AV* PerlFilteredTmpls=NULL;
+static
+AV* PoolForPerlVars=NULL;
static
SV* PerlSelfHTMLTemplatePro;
@@ -143,6 +145,7 @@
/* any memory leaks??? */
if (SvOK(perlretval)) {
filepath = SvPV(perlretval, len);
+ av_push(PoolForPerlVars,perlretval);
SvREFCNT_inc(perlretval);
} else {
filepath = NULL;
@@ -281,6 +284,7 @@
retval.type=EXPRPSTR;
strval =SvPV(svretval, len);
/* hack !!! */
+ av_push(PoolForPerlVars,svretval);
SvREFCNT_inc(svretval);
/* non-portable */
/* retval.val.strval=(PSTRING) {strval, strval +len}; */
@@ -361,6 +365,10 @@
PerlFilteredTmpls=newAV();
}
/* end setting perl globals */
+
+ /* setting pool for perl vars */
+ PoolForPerlVars = newAV();
+ /* end setting pool for perl vars */
if ((!SvROK(PerlSelfPtr)) || (SvTYPE(SvRV(PerlSelfPtr)) != SVt_PVHV))
{
@@ -419,7 +427,7 @@
case 'J': case 'j': /* JS */
default_escape = HTML_TEMPLATE_OPT_ESCAPE_JS;
break;
- case '0':
+ case '0': case 'N': case 'n': /* 0 or NONE */
default_escape = HTML_TEMPLATE_OPT_ESCAPE_NO;
break;
default:
@@ -429,6 +437,18 @@
}
return param;
}
+
+static void
+release_tmplpro_options(struct tmplpro_param* param)
+{
+ if(PoolForPerlVars != NULL){
+ SvREFCNT_dec(PoolForPerlVars);
+ PoolForPerlVars = NULL;
+ }
+ tmplpro_param_free(param);
+}
+
+
MODULE = HTML::Template::Pro PACKAGE = HTML::Template::Pro
@@ -459,12 +479,12 @@
proparam->WriterFuncPtr=&write_chars_to_file;
if (proparam->filename!=NULL) {
RETVAL = tmplpro_exec_tmpl(proparam->filename,proparam);
- tmplpro_param_free(proparam);
+ release_tmplpro_options(proparam);
} else if (proparam->scalarref.begin!=NULL) {
RETVAL = tmplpro_exec_tmpl_in_memory(proparam->scalarref,proparam);
- tmplpro_param_free(proparam);
+ release_tmplpro_options(proparam);
} else {
- tmplpro_param_free(proparam);
+ release_tmplpro_options(proparam);
die ("bad arguments: expected filename or scalarref");
}
OUTPUT:
@@ -487,12 +507,12 @@
proparam->WriterFuncPtr=&write_chars_to_string;
if (proparam->filename!=NULL) {
retstate = tmplpro_exec_tmpl(proparam->filename,proparam);
- tmplpro_param_free(proparam);
+ release_tmplpro_options(proparam);
} else if (proparam->scalarref.begin!=NULL) {
retstate = tmplpro_exec_tmpl_in_memory(proparam->scalarref,proparam);
- tmplpro_param_free(proparam);
+ release_tmplpro_options(proparam);
} else {
- tmplpro_param_free(proparam);
+ release_tmplpro_options(proparam);
die ("bad arguments: expected filename or scalarref");
}
RETVAL = OutputString;
Modified: branches/upstream/libhtml-template-pro-perl/current/lib/HTML/Template/PerlInterface.pod
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-template-pro-perl/current/lib/HTML/Template/PerlInterface.pod?rev=33725&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/lib/HTML/Template/PerlInterface.pod (original)
+++ branches/upstream/libhtml-template-pro-perl/current/lib/HTML/Template/PerlInterface.pod Wed Apr 22 18:29:07 2009
@@ -114,8 +114,8 @@
);
You must call new() with at least one name => value pair specifying how
-to access the template text. You can use "filename => 'file.tmpl'" to
-specify a filename to be opened as the template. Alternately you can
+to access the template text. You can use C<< filename => 'file.tmpl' >>
+to specify a filename to be opened as the template. Alternately you can
use:
my $t = HTML::Template->new( scalarref => $ref_to_template_text,
@@ -288,20 +288,20 @@
associate - this option allows you to inherit the parameter values
from other objects. The only requirement for the other object is that
-it have a param() method that works like HTML::Template's param(). A
+it have a C<param()> method that works like HTML::Template's C<param()>. A
good candidate would be a CGI.pm query object. Example:
my $query = new CGI;
my $template = HTML::Template->new(filename => 'template.tmpl',
associate => $query);
-Now, $template->output() will act as though
+Now, C<< $template->output() >> will act as though
$template->param('FormField', $cgi->param('FormField'));
had been specified for each key/value pair that would be provided by
-the $cgi->param() method. Parameters you set directly take precedence
-over associated parameters.
+the C<< $cgi->param() >> method. Parameters you set directly take
+precedence over associated parameters.
You can specify multiple objects to associate by passing an anonymous
array to the associate option. They are searched for parameters in
@@ -391,7 +391,7 @@
Apples, Oranges, Brains, Toes, and Kiwi.
-Given an appropriate param() call, of course. NOTE: A loop with only
+Given an appropriate C<param()> call, of course. NOTE: A loop with only
a single pass will get both __first__ and __last__ set to true, but
not __inner__.
@@ -470,7 +470,7 @@
template tags.
In the most simple usage, you simply assign a code reference to the
-filter parameter. This subroutine will recieve a single arguement - a
+filter parameter. This subroutine will recieve a single argument - a
reference to a string containing the template file text. Here is an
example that accepts templates with tags that look like "!!!ZAP_VAR
FOO!!!" and transforms them into HTML::Template tags:
@@ -487,9 +487,9 @@
More complicated usages are possible. You can request that your
filter receieve the template text as an array of lines rather than as
a single scalar. To do that you need to specify your filter using a
-hash-ref. In this form you specify the filter using the "sub" key and
-the desired argument format using the "format" key. The available
-formats are "scalar" and "array". Using the "array" format will incur
+hash-ref. In this form you specify the filter using the C<sub> key and
+the desired argument format using the C<format> key. The available
+formats are C<scalar> and C<array>. Using the C<array> format will incur
a performance penalty but may be more convenient in some situations.
my $template = HTML::Template->new(filename => 'zap.tmpl',
@@ -542,7 +542,7 @@
=head2 param()
-param() can be called in a number of ways
+C<param()> can be called in a number of ways
1) To return a list of parameters in the template :
( this features is distinct in HTML::Template::Pro:
@@ -636,7 +636,7 @@
print $template->output();
When output is called each occurrence of <TMPL_VAR NAME=name> is
-replaced with the value assigned to "name" via param(). If a named
+replaced with the value assigned to "name" via C<param()>. If a named
parameter is unset it is simply replaced with ''. <TMPL_LOOPS> are
evaluated once per parameter set, accumlating output on each pass.
@@ -650,7 +650,7 @@
$template->output(print_to => *STDOUT);
-The return value is undefined when using the "print_to" option.
+The return value is undefined when using the C<print_to> option.
=head2 query()
@@ -671,7 +671,7 @@
This same usage returns the type of the parameter. The type is the
same as the tag minus the leading 'TMPL_'. So, for example, a
-TMPL_VAR parameter returns 'VAR' from query().
+TMPL_VAR parameter returns 'VAR' from C<query()>.
if ($template->query(name => 'foo') eq 'VAR') {
# do something if FOO exists and is a TMPL_VAR
@@ -729,7 +729,7 @@
Note that all the names are returned in lowercase and the types are
uppercase.
-Just like C<param()>, C<query()> with no arguements returns all the
+Just like C<param()>, C<query()> with no arguments returns all the
parameter names in the template at the top level.
=end comment
@@ -801,8 +801,8 @@
=begin comment
If you're feeling really adventurous, HTML::Template has a publically
-available CVS server. See below for more information in the PUBLIC
-CVS SERVER section.
+available Subversion server. See below for more information in the PUBLIC
+SUBVERSION SERVER section.
=end comment
@@ -942,6 +942,9 @@
Paul Baker
Gabor Szabo
Craig Manley
+ Richard Fein
+ The Phalanx Project
+ Sven Neuhaus
Thanks!
@@ -968,11 +971,11 @@
=begin comment
-=head1 PUBLIC CVS SERVER
-
-HTML::Template now has a publicly accessible CVS server provided by
-SourceForge (www.sourceforge.net). You can access it by going to
-http://sourceforge.net/cvs/?group_id=1075. Give it a try!
+=head1 PUBLIC SUBVERSION SERVER
+
+HTML::Template now has a publicly accessible Subversion server
+provided by SourceForge (www.sourceforge.net). You can access it by
+going to http://sourceforge.net/svn/?group_id=1075. Give it a try!
=end comment
Modified: branches/upstream/libhtml-template-pro-perl/current/lib/HTML/Template/Pro.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-template-pro-perl/current/lib/HTML/Template/Pro.pm?rev=33725&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/lib/HTML/Template/Pro.pm (original)
+++ branches/upstream/libhtml-template-pro-perl/current/lib/HTML/Template/Pro.pm Wed Apr 22 18:29:07 2009
@@ -9,7 +9,7 @@
use vars qw($VERSION @ISA);
@ISA = qw(DynaLoader);
-$VERSION = '0.73';
+$VERSION = '0.74';
bootstrap HTML::Template::Pro $VERSION;
@@ -322,7 +322,7 @@
}
# try pre-prending HTML_Template_Root
- if (exists($ENV{HTML_TEMPLATE_ROOT}) and defined($ENV{HTML_TEMPLATE_ROOT})) {
+ if (defined($ENV{HTML_TEMPLATE_ROOT})) {
$filepath = File::Spec->catfile($ENV{HTML_TEMPLATE_ROOT}, $filename);
return File::Spec->canonpath($filepath) if -e $filepath;
}
@@ -337,7 +337,7 @@
return File::Spec->canonpath($filename) if -e $filename;
# try "path" option list with HTML_TEMPLATE_ROOT prepended...
- if (exists($ENV{HTML_TEMPLATE_ROOT})) {
+ if (defined($ENV{HTML_TEMPLATE_ROOT})) {
foreach my $path (@{$options->{path}}) {
$filepath = File::Spec->catfile($ENV{HTML_TEMPLATE_ROOT}, $path, $filename);
return File::Spec->canonpath($filepath) if -e $filepath;
Modified: branches/upstream/libhtml-template-pro-perl/current/lib/HTML/Template/SYNTAX.pod
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-template-pro-perl/current/lib/HTML/Template/SYNTAX.pod?rev=33725&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/lib/HTML/Template/SYNTAX.pod (original)
+++ branches/upstream/libhtml-template-pro-perl/current/lib/HTML/Template/SYNTAX.pod Wed Apr 22 18:29:07 2009
@@ -119,7 +119,7 @@
<input name=param type=text value="<TMPL_VAR NAME="PARAM">">
-If you called param() with a value like sam"my you'll get in trouble
+If you called C<param()> with a value like sam"my you'll get in trouble
with HTML's idea of a double-quote. On the other hand, if you use
ESCAPE=HTML, like this:
@@ -127,8 +127,9 @@
You'll get what you wanted no matter what value happens to be passed in for
param. You can also write ESCAPE="HTML", ESCAPE='HTML' and ESCAPE='1'.
-Substitute a 0 for the HTML and you turn off escaping, which is the default
-anyway.
+
+"ESCAPE=0" and "ESCAPE=NONE" turn off escaping, which is the default
+behavior.
There is also the "ESCAPE=URL" option which may be used for VARs that
populate a URL. It will do URL escaping, like replacing ' ' with '+'
@@ -151,7 +152,7 @@
The <TMPL_LOOP> tag is a bit more complicated than <TMPL_VAR>. The
<TMPL_LOOP> tag allows you to delimit a section of text and give it a
name. Inside this named loop you place <TMPL_VAR>s. Now you pass to
-param() a list (an array ref) of parameter assignments (hash refs) for
+C<param()> a list (an array ref) of parameter assignments (hash refs) for
this loop. The loop iterates over the list and produces output from
the text block for each pass. Unset parameters are skipped. Here's
an example:
@@ -229,7 +230,7 @@
Number: 3
<TMPL_LOOP>s within <TMPL_LOOP>s are fine and work as you would
-expect. If the syntax for the param() call has you stumped, here's an
+expect. If the syntax for the C<param()> call has you stumped, here's an
example of a param call with one nested loop:
$template->param(LOOP => [
@@ -686,8 +687,8 @@
);
You must call new() with at least one name => value pair specifying how
-to access the template text. You can use "filename => 'file.tmpl'" to
-specify a filename to be opened as the template. Alternately you can
+to access the template text. You can use C<< filename => 'file.tmpl' >>
+to specify a filename to be opened as the template. Alternately you can
use:
my $t = HTML::Template->new( scalarref => $ref_to_template_text,
@@ -855,20 +856,20 @@
associate - this option allows you to inherit the parameter values
from other objects. The only requirement for the other object is that
-it have a param() method that works like HTML::Template's param(). A
+it have a C<param()> method that works like HTML::Template's C<param()>. A
good candidate would be a CGI.pm query object. Example:
my $query = new CGI;
my $template = HTML::Template->new(filename => 'template.tmpl',
associate => $query);
-Now, $template->output() will act as though
+Now, C<< $template->output() >> will act as though
$template->param('FormField', $cgi->param('FormField'));
had been specified for each key/value pair that would be provided by
-the $cgi->param() method. Parameters you set directly take precedence
-over associated parameters.
+the C<< $cgi->param() >> method. Parameters you set directly take
+precedence over associated parameters.
You can specify multiple objects to associate by passing an anonymous
array to the associate option. They are searched for parameters in
@@ -952,7 +953,7 @@
Apples, Oranges, Brains, Toes, and Kiwi.
-Given an appropriate param() call, of course. NOTE: A loop with only
+Given an appropriate C<param()> call, of course. NOTE: A loop with only
a single pass will get both __first__ and __last__ set to true, but
not __inner__.
@@ -1012,7 +1013,7 @@
template tags.
In the most simple usage, you simply assign a code reference to the
-filter parameter. This subroutine will recieve a single arguement - a
+filter parameter. This subroutine will recieve a single argument - a
reference to a string containing the template file text. Here is an
example that accepts templates with tags that look like "!!!ZAP_VAR
FOO!!!" and transforms them into HTML::Template tags:
@@ -1029,9 +1030,9 @@
More complicated usages are possible. You can request that your
filter receieve the template text as an array of lines rather than as
a single scalar. To do that you need to specify your filter using a
-hash-ref. In this form you specify the filter using the "sub" key and
-the desired argument format using the "format" key. The available
-formats are "scalar" and "array". Using the "array" format will incur
+hash-ref. In this form you specify the filter using the C<sub> key and
+the desired argument format using the C<format> key. The available
+formats are C<scalar> and C<array>. Using the C<array> format will incur
a performance penalty but may be more convenient in some situations.
my $template = HTML::Template->new(filename => 'zap.tmpl',
@@ -1081,7 +1082,7 @@
=head2 param()
-param() can be called in a number of ways
+C<param()> can be called in a number of ways
1) To return a list of parameters in the template :
@@ -1175,7 +1176,7 @@
print $template->output();
When output is called each occurrence of <TMPL_VAR NAME=name> is
-replaced with the value assigned to "name" via param(). If a named
+replaced with the value assigned to "name" via C<param()>. If a named
parameter is unset it is simply replaced with ''. <TMPL_LOOPS> are
evaluated once per parameter set, accumlating output on each pass.
@@ -1189,7 +1190,7 @@
$template->output(print_to => *STDOUT);
-The return value is undefined when using the "print_to" option.
+The return value is undefined when using the C<print_to> option.
=head2 query()
@@ -1206,7 +1207,7 @@
This same usage returns the type of the parameter. The type is the
same as the tag minus the leading 'TMPL_'. So, for example, a
-TMPL_VAR parameter returns 'VAR' from query().
+TMPL_VAR parameter returns 'VAR' from C<query()>.
if ($template->query(name => 'foo') eq 'VAR') {
# do something if FOO exists and is a TMPL_VAR
@@ -1264,7 +1265,7 @@
Note that all the names are returned in lowercase and the types are
uppercase.
-Just like C<param()>, C<query()> with no arguements returns all the
+Just like C<param()>, C<query()> with no arguments returns all the
parameter names in the template at the top level.
@@ -1323,8 +1324,8 @@
script and a test template? If so, then almost certainly.
If you're feeling really adventurous, HTML::Template has a publically
-available CVS server. See below for more information in the PUBLIC
-CVS SERVER section.
+available Subversion server. See below for more information in the PUBLIC
+SUBVERSION SERVER section.
=item 5
@@ -1462,8 +1463,8 @@
demonstrating the problem!
If you're feeling really adventurous, HTML::Template has a publically
-available CVS server. See below for more information in the PUBLIC
-CVS SERVER section.
+available Subversion server. See below for more information in the
+PUBLIC SUBVERSION SERVER section.
=head1 CREDITS
@@ -1523,6 +1524,9 @@
Paul Baker
Gabor Szabo
Craig Manley
+ Richard Fein
+ The Phalanx Project
+ Sven Neuhaus
Thanks!
@@ -1532,11 +1536,11 @@
http://html-template.sourceforge.net
-=head1 PUBLIC CVS SERVER
-
-HTML::Template now has a publicly accessible CVS server provided by
-SourceForge (www.sourceforge.net). You can access it by going to
-http://sourceforge.net/cvs/?group_id=1075. Give it a try!
+=head1 PUBLIC SUBVERSION SERVER
+
+HTML::Template now has a publicly accessible Subversion server
+provided by SourceForge (www.sourceforge.net). You can access it by
+going to http://sourceforge.net/svn/?group_id=1075. Give it a try!
=end comment
Modified: branches/upstream/libhtml-template-pro-perl/current/perl-HTML-Template-Pro.spec
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-template-pro-perl/current/perl-HTML-Template-Pro.spec?rev=33725&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/perl-HTML-Template-Pro.spec (original)
+++ branches/upstream/libhtml-template-pro-perl/current/perl-HTML-Template-Pro.spec Wed Apr 22 18:29:07 2009
@@ -6,7 +6,7 @@
%define module HTML-Template-Pro
Name: perl-%module
-Version: 0.73
+Version: 0.74
Release: alt1
Packager: Igor Yu. Vlasenko <viy at altlinux.org>
@@ -54,6 +54,9 @@
%perl_vendor_man3dir/*
%changelog
+* Fri Apr 03 2009 Igor Vlasenko <viy at altlinux.ru> 0.74-alt1
+- new version; see Changes
+
* Thu Apr 02 2009 Igor Vlasenko <viy at altlinux.ru> 0.73-alt1
- new version; see Changes
Modified: branches/upstream/libhtml-template-pro-perl/current/procore.c
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-template-pro-perl/current/procore.c?rev=33725&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/procore.c (original)
+++ branches/upstream/libhtml-template-pro-perl/current/procore.c Wed Apr 22 18:29:07 2009
@@ -845,7 +845,7 @@
case 'J': case 'j': /* JS */
escape = HTML_TEMPLATE_OPT_ESCAPE_JS;
break;
- case '0':
+ case '0': case 'N': case 'n': /* 0 or NONE */
escape = HTML_TEMPLATE_OPT_ESCAPE_NO;
break;
default:
More information about the Pkg-perl-cvs-commits
mailing list