r45051 - in /branches/upstream/libhtml-template-pro-perl/current: ./ lib/HTML/Template/
jawnsy-guest at users.alioth.debian.org
jawnsy-guest at users.alioth.debian.org
Wed Sep 30 02:26:41 UTC 2009
Author: jawnsy-guest
Date: Wed Sep 30 02:26:33 2009
New Revision: 45051
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=45051
Log:
[svn-upgrade] Integrating new upstream version, libhtml-template-pro-perl (0.92)
Added:
branches/upstream/libhtml-template-pro-perl/current/pconst.h
Modified:
branches/upstream/libhtml-template-pro-perl/current/MANIFEST
branches/upstream/libhtml-template-pro-perl/current/META.yml
branches/upstream/libhtml-template-pro-perl/current/Makefile.PL
branches/upstream/libhtml-template-pro-perl/current/README
branches/upstream/libhtml-template-pro-perl/current/builtin_findfile.inc
branches/upstream/libhtml-template-pro-perl/current/getoptint.c
branches/upstream/libhtml-template-pro-perl/current/getoptint.re2c
branches/upstream/libhtml-template-pro-perl/current/getoptint.re2c.header
branches/upstream/libhtml-template-pro-perl/current/lib/HTML/Template/Pro.pm
branches/upstream/libhtml-template-pro-perl/current/perl-HTML-Template-Pro.spec
branches/upstream/libhtml-template-pro-perl/current/pmiscdef.h
branches/upstream/libhtml-template-pro-perl/current/procore.c
branches/upstream/libhtml-template-pro-perl/current/procore.h
branches/upstream/libhtml-template-pro-perl/current/pstrutils.inc
branches/upstream/libhtml-template-pro-perl/current/setoptint.c
branches/upstream/libhtml-template-pro-perl/current/setoptint.re2c
branches/upstream/libhtml-template-pro-perl/current/setoptint.re2c.header
branches/upstream/libhtml-template-pro-perl/current/tags.inc
Modified: branches/upstream/libhtml-template-pro-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-template-pro-perl/current/MANIFEST?rev=45051&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/MANIFEST (original)
+++ branches/upstream/libhtml-template-pro-perl/current/MANIFEST Wed Sep 30 02:26:33 2009
@@ -42,6 +42,7 @@
parse_expr.h
pbuffer.c
pbuffer.h
+pconst.h
perl-HTML-Template-Pro.spec
pmiscdef.h
pparam.h
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=45051&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/META.yml (original)
+++ branches/upstream/libhtml-template-pro-perl/current/META.yml Wed Sep 30 02:26:33 2009
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: HTML-Template-Pro
-version: 0.91
+version: 0.92
abstract: Perl/XS module to use HTML Templates from CGI scripts
license: perl or LGPL2+
author:
Modified: branches/upstream/libhtml-template-pro-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-template-pro-perl/current/Makefile.PL?rev=45051&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/Makefile.PL (original)
+++ branches/upstream/libhtml-template-pro-perl/current/Makefile.PL Wed Sep 30 02:26:33 2009
@@ -25,6 +25,7 @@
}
my %DEF=(
+ MAINTAINER => $^O eq 'linux' && -d '.git' ? 1 : 0,
PCRE => 1,
DEBUG => 0,
MMAP => 1,
@@ -78,6 +79,7 @@
);
sub MY::postamble {
+ return '' unless $DEF{MAINTAINER};
return <<'MAKE_FRAG';
expr.c: calc.inc exprtool.inc exprpstr.inc
procore\$(OBJ_EXT): loadfile.inc tagstack.inc
Modified: branches/upstream/libhtml-template-pro-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-template-pro-perl/current/README?rev=45051&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/README (original)
+++ branches/upstream/libhtml-template-pro-perl/current/README Wed Sep 30 02:26:33 2009
@@ -1,4 +1,4 @@
-HTML-Template-Pro version 0.91
+HTML-Template-Pro version 0.92
==============================
DESCRIPTION
Modified: branches/upstream/libhtml-template-pro-perl/current/builtin_findfile.inc
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-template-pro-perl/current/builtin_findfile.inc?rev=45051&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/builtin_findfile.inc (original)
+++ branches/upstream/libhtml-template-pro-perl/current/builtin_findfile.inc Wed Sep 30 02:26:33 2009
@@ -169,7 +169,7 @@
}
/* old prev_slash_next now current, so we need to recalculate it */
/* first find a 'slash' char */
- while (!IS_FILE_SEP(*prev_slash_next) && prev_slash_next>=slash_begin) prev_slash_next--;
+ while (prev_slash_next>=slash_begin && !IS_FILE_SEP(*prev_slash_next)) prev_slash_next--;
if (prev_slash_next>slash_begin) prev_slash_next++;/* step next to slash */
} else {
prev_slash_next=pos+1;
Modified: branches/upstream/libhtml-template-pro-perl/current/getoptint.c
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-template-pro-perl/current/getoptint.c?rev=45051&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/getoptint.c (original)
+++ branches/upstream/libhtml-template-pro-perl/current/getoptint.c Wed Sep 30 02:26:33 2009
@@ -3,7 +3,7 @@
#include "pabidecl.h"
#include "pabstract.h"
#include "pparam.h"
-#include "procore.h"
+#include "pconst.h"
API_IMPL
int
Modified: branches/upstream/libhtml-template-pro-perl/current/getoptint.re2c
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-template-pro-perl/current/getoptint.re2c?rev=45051&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/getoptint.re2c (original)
+++ branches/upstream/libhtml-template-pro-perl/current/getoptint.re2c Wed Sep 30 02:26:33 2009
@@ -1,7 +1,7 @@
#include "pabidecl.h"
#include "pabstract.h"
#include "pparam.h"
-#include "procore.h"
+#include "pconst.h"
API_IMPL
int
Modified: branches/upstream/libhtml-template-pro-perl/current/getoptint.re2c.header
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-template-pro-perl/current/getoptint.re2c.header?rev=45051&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/getoptint.re2c.header (original)
+++ branches/upstream/libhtml-template-pro-perl/current/getoptint.re2c.header Wed Sep 30 02:26:33 2009
@@ -1,7 +1,7 @@
#include "pabidecl.h"
#include "pabstract.h"
#include "pparam.h"
-#include "procore.h"
+#include "pconst.h"
API_IMPL
int
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=45051&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 Sep 30 02:26:33 2009
@@ -12,7 +12,7 @@
use vars qw($VERSION @ISA @EXPORT_OK %EXPORT_TAGS);
@ISA = qw(DynaLoader Exporter);
-$VERSION = '0.91';
+$VERSION = '0.92';
@EXPORT_OK = qw/ASK_NAME_DEFAULT ASK_NAME_AS_IS ASK_NAME_LOWERCASE ASK_NAME_UPPERCASE ASK_NAME_MASK/;
%EXPORT_TAGS = (const => [qw/ASK_NAME_DEFAULT ASK_NAME_AS_IS ASK_NAME_LOWERCASE ASK_NAME_UPPERCASE ASK_NAME_MASK/]);
Added: branches/upstream/libhtml-template-pro-perl/current/pconst.h
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-template-pro-perl/current/pconst.h?rev=45051&op=file
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/pconst.h (added)
+++ branches/upstream/libhtml-template-pro-perl/current/pconst.h Wed Sep 30 02:26:33 2009
@@ -1,0 +1,17 @@
+#ifndef _PCONST_H
+#define _PCONST_H 1
+
+/* internal constants */
+
+#define ERR_PRO_INVALID_ARGUMENT 1
+#define ERR_PRO_FILE_NOT_FOUND 2
+#define ERR_PRO_CANT_OPEN_FILE 3
+#define ERR_PRO_TEMPLATE_SYNTAX_ERROR 4
+
+#endif /* pconst.h */
+
+/*
+ * Local Variables:
+ * mode: c
+ * End:
+ */
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=45051&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 Sep 30 02:26:33 2009
@@ -6,7 +6,7 @@
%define module HTML-Template-Pro
Name: perl-%module
-Version: 0.91
+Version: 0.92
Release: alt1
Packager: Igor Yu. Vlasenko <viy at altlinux.org>
@@ -54,6 +54,9 @@
%perl_vendor_man3dir/*
%changelog
+* Tue Sep 29 2009 Igor Vlasenko <viy at altlinux.ru> 0.92-alt1
+- new version; see Changes
+
* Tue Sep 22 2009 Igor Vlasenko <viy at altlinux.ru> 0.91-alt1
- new version; see Changes
Modified: branches/upstream/libhtml-template-pro-perl/current/pmiscdef.h
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-template-pro-perl/current/pmiscdef.h?rev=45051&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/pmiscdef.h (original)
+++ branches/upstream/libhtml-template-pro-perl/current/pmiscdef.h Wed Sep 30 02:26:33 2009
@@ -22,8 +22,8 @@
# define MOD_TD "%ld"
#endif
-#if ! HAVE_STRDUP && ! defined strdup
-# if HAVE__STRDUP
+#if ! defined HAVE_STRDUP && ! defined strdup
+# if defined HAVE__STRDUP
# define strdup _strdup
# else
# define strdup(str) strcpy(malloc(strlen(str) + 1), str)
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=45051&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/procore.c (original)
+++ branches/upstream/libhtml-template-pro-perl/current/procore.c Wed Sep 30 02:26:33 2009
@@ -4,6 +4,7 @@
#include <ctype.h>
#include "tmplpro.h"
+#include "pconst.h"
#include "procore.h"
#include "prostate.h"
#include "provalue.h"
@@ -84,8 +85,30 @@
{ 0, 0, 0, 0, 0, 0 }, /**/
};
-/* max offset to ensure we are not out of file when try <!--/ */
-#define TAG_WIDTH_OFFSET 4
+typedef void (*tag_handler_func)(struct tmplpro_state *state, const PSTRING* const TagOptVal);
+
+static const tag_handler_func const output_closetag_handler[]={
+ tag_handler_unknown, /*Bad or unsupported tag*/
+ tag_handler_unknown, /*VAR*/
+ tag_handler_unknown, /*INCLUDE*/
+ tag_handler_closeloop, /*LOOP*/
+ tag_handler_closeif, /*IF*/
+ tag_handler_unknown, /*ELSE*/
+ tag_handler_closeunless, /*UNLESS*/
+ tag_handler_unknown, /*ELSIF*/
+ tag_handler_unknown, /**/
+};
+static const tag_handler_func const output_opentag_handler[]={
+ tag_handler_unknown, /*Bad or unsupported tag*/
+ tag_handler_var, /*VAR*/
+ tag_handler_include, /*INCLUDE*/
+ tag_handler_loop, /*LOOP*/
+ tag_handler_if, /*IF*/
+ tag_handler_else, /*ELSE*/
+ tag_handler_unless, /*UNLESS*/
+ tag_handler_elsif, /*ELSIF*/
+ tag_handler_unknown, /**/
+};
static
int
@@ -321,29 +344,16 @@
(state->param->WriterFuncPtr)(state->param->ext_writer_state,state->last_processed_pos,state->tag_start);
state->last_processed_pos=state->cur_pos;
}
- /* TODO: call tag_specific handler by array of handlers
- var_tag_handler(..) */
if (is_tag_closed) {
- switch (tag_type) {
- case HTML_TEMPLATE_TAG_IF: tag_handler_closeif(state);break;
- case HTML_TEMPLATE_TAG_UNLESS: tag_handler_closeunless(state);break;
- case HTML_TEMPLATE_TAG_LOOP: tag_handler_closeloop(state);break;
- default: tag_handler_unknown(state);break;
- }
+ output_closetag_handler[tag_type](state,TagOptVal);
} else {
- switch (tag_type) {
- case HTML_TEMPLATE_TAG_VAR: tag_handler_var(state,TagOptVal); break;
- case HTML_TEMPLATE_TAG_IF: tag_handler_if(state,TagOptVal); break;
- case HTML_TEMPLATE_TAG_UNLESS: tag_handler_unless(state,TagOptVal); break;
- case HTML_TEMPLATE_TAG_ELSE: tag_handler_else(state,TagOptVal); break;
- case HTML_TEMPLATE_TAG_ELSIF: tag_handler_elsif(state,TagOptVal); break;
- case HTML_TEMPLATE_TAG_LOOP: tag_handler_loop(state,TagOptVal); break;
- case HTML_TEMPLATE_TAG_INCLUDE: tag_handler_include(state,TagOptVal);break;
- default: tag_handler_unknown(state);break;
- }
- }
-}
-
+ output_opentag_handler[tag_type](state,TagOptVal);
+ }
+}
+
+
+/* max offset to ensure we are not out of file when try <!--/ */
+#define TAG_WIDTH_OFFSET 4
static
void
process_state (struct tmplpro_state * state)
Modified: branches/upstream/libhtml-template-pro-perl/current/procore.h
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-template-pro-perl/current/procore.h?rev=45051&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/procore.h (original)
+++ branches/upstream/libhtml-template-pro-perl/current/procore.h Wed Sep 30 02:26:33 2009
@@ -1,8 +1,3 @@
-#define ERR_PRO_INVALID_ARGUMENT 1
-#define ERR_PRO_FILE_NOT_FOUND 2
-#define ERR_PRO_CANT_OPEN_FILE 3
-#define ERR_PRO_TEMPLATE_SYNTAX_ERROR 4
-
#include "pstring.h"
#include "tmpllog.h"
#include "pabstract.h"
Modified: branches/upstream/libhtml-template-pro-perl/current/pstrutils.inc
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-template-pro-perl/current/pstrutils.inc?rev=45051&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/pstrutils.inc (original)
+++ branches/upstream/libhtml-template-pro-perl/current/pstrutils.inc Wed Sep 30 02:26:33 2009
@@ -71,10 +71,11 @@
} else return 1;
}
+#define MAX_ESCAPE_SEQ sizeof(""")
static
PSTRING
htmlencode_pstring (pbuffer* StrBuffer, PSTRING pstring) {
- char* buf=pbuffer_resize(StrBuffer, pstring.endnext-pstring.begin+1);
+ char* buf=pbuffer_resize(StrBuffer, pstring.endnext-pstring.begin+1+MAX_ESCAPE_SEQ);
const char* curpos=pstring.begin;
size_t offset=0;
size_t buflen=pbuffer_size(StrBuffer);
@@ -82,8 +83,8 @@
while (curpos<pstring.endnext) {
unsigned char curchar=*curpos++;
int bufdelta=1;
- if (offset>=buflen) {
- buf=pbuffer_resize(StrBuffer, 2*offset);
+ if (offset>=buflen-MAX_ESCAPE_SEQ) {
+ buf=pbuffer_resize(StrBuffer, 2*(offset+MAX_ESCAPE_SEQ));
buflen=pbuffer_size(StrBuffer);
}
switch (curchar) {
@@ -105,7 +106,7 @@
static
PSTRING
jsencode_pstring (pbuffer* StrBuffer, PSTRING pstring) {
- char* buf=pbuffer_resize(StrBuffer, pstring.endnext-pstring.begin+1);
+ char* buf=pbuffer_resize(StrBuffer, pstring.endnext-pstring.begin+1+MAX_ESCAPE_SEQ);
const char* curpos=pstring.begin;
size_t offset=0;
size_t buflen=pbuffer_size(StrBuffer);
@@ -113,8 +114,8 @@
while (curpos<pstring.endnext) {
unsigned char curchar=*curpos++;
int bufdelta=1;
- if (offset>=buflen) {
- buf=pbuffer_resize(StrBuffer, 2*offset);
+ if (offset>=buflen-MAX_ESCAPE_SEQ) {
+ buf=pbuffer_resize(StrBuffer, 2*(offset+MAX_ESCAPE_SEQ));
buflen=pbuffer_size(StrBuffer);
}
switch (curchar) {
@@ -135,7 +136,7 @@
static
PSTRING
urlencode_pstring (pbuffer* StrBuffer, PSTRING pstring) {
- char* buf=pbuffer_resize(StrBuffer, pstring.endnext-pstring.begin+1);
+ char* buf=pbuffer_resize(StrBuffer, pstring.endnext-pstring.begin+1+MAX_ESCAPE_SEQ);
const char* curpos=pstring.begin;
size_t offset=0;
size_t buflen=pbuffer_size(StrBuffer);
@@ -143,8 +144,8 @@
while (curpos<pstring.endnext) {
unsigned char curchar=*curpos++;
int bufdelta=1;
- if (offset>=buflen) {
- buf=pbuffer_resize(StrBuffer, 2*offset);
+ if (offset>=buflen-MAX_ESCAPE_SEQ) {
+ buf=pbuffer_resize(StrBuffer, 2*(offset+MAX_ESCAPE_SEQ));
buflen=pbuffer_size(StrBuffer);
}
/*
Modified: branches/upstream/libhtml-template-pro-perl/current/setoptint.c
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-template-pro-perl/current/setoptint.c?rev=45051&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/setoptint.c (original)
+++ branches/upstream/libhtml-template-pro-perl/current/setoptint.c Wed Sep 30 02:26:33 2009
@@ -3,7 +3,7 @@
#include "pabidecl.h"
#include "pabstract.h"
#include "pparam.h"
-#include "procore.h"
+#include "pconst.h"
API_IMPL
int
Modified: branches/upstream/libhtml-template-pro-perl/current/setoptint.re2c
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-template-pro-perl/current/setoptint.re2c?rev=45051&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/setoptint.re2c (original)
+++ branches/upstream/libhtml-template-pro-perl/current/setoptint.re2c Wed Sep 30 02:26:33 2009
@@ -1,7 +1,7 @@
#include "pabidecl.h"
#include "pabstract.h"
#include "pparam.h"
-#include "procore.h"
+#include "pconst.h"
API_IMPL
int
Modified: branches/upstream/libhtml-template-pro-perl/current/setoptint.re2c.header
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-template-pro-perl/current/setoptint.re2c.header?rev=45051&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/setoptint.re2c.header (original)
+++ branches/upstream/libhtml-template-pro-perl/current/setoptint.re2c.header Wed Sep 30 02:26:33 2009
@@ -1,7 +1,7 @@
#include "pabidecl.h"
#include "pabstract.h"
#include "pparam.h"
-#include "procore.h"
+#include "pconst.h"
API_IMPL
int
Modified: branches/upstream/libhtml-template-pro-perl/current/tags.inc
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-template-pro-perl/current/tags.inc?rev=45051&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/tags.inc (original)
+++ branches/upstream/libhtml-template-pro-perl/current/tags.inc Wed Sep 30 02:26:33 2009
@@ -318,7 +318,7 @@
static
void
-tag_handler_closeif (struct tmplpro_state *state)
+tag_handler_closeif (struct tmplpro_state *state, const PSTRING* const TagOptVal)
{
struct tagstack_entry iftag;
if (! test_stack(HTML_TEMPLATE_TAG_IF)) {
@@ -332,7 +332,7 @@
static
void
-tag_handler_closeunless (struct tmplpro_state *state)
+tag_handler_closeunless (struct tmplpro_state *state, const PSTRING* const TagOptVal)
{
struct tagstack_entry iftag;
if (! test_stack(HTML_TEMPLATE_TAG_UNLESS)) {
@@ -468,7 +468,7 @@
static
void
-tag_handler_closeloop (struct tmplpro_state *state)
+tag_handler_closeloop (struct tmplpro_state *state, const PSTRING* const TagOptVal)
{
struct tagstack_entry* iftag_ptr;
if (! test_stack(HTML_TEMPLATE_TAG_LOOP)) {
@@ -492,7 +492,7 @@
static
void
-tag_handler_unknown (struct tmplpro_state *state)
+tag_handler_unknown (struct tmplpro_state *state, const PSTRING* const TagOptVal)
{
log_state(state,TMPL_LOG_ERROR,"tag_handler_unknown: unknown tag\n");
}
More information about the Pkg-perl-cvs-commits
mailing list