summaryrefslogtreecommitdiff
path: root/ext/mbstring/mbregex.c
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2002-08-02 10:22:31 +0000
committerMarcus Boerger <helly@php.net>2002-08-02 10:22:31 +0000
commitde8c36dcaa730e53265e6c2201c49c4ced3af68f (patch)
tree5cd20469f0fb4e80973e10e2ac3838e0f48a58cd /ext/mbstring/mbregex.c
parente5fa36eee4da397645498de55d957c4a438026e1 (diff)
downloadphp-git-de8c36dcaa730e53265e6c2201c49c4ced3af68f.tar.gz
-use const to clarify code
-fix tsrmls build (therefore rfc1867.c)
Diffstat (limited to 'ext/mbstring/mbregex.c')
-rw-r--r--ext/mbstring/mbregex.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/ext/mbstring/mbregex.c b/ext/mbstring/mbregex.c
index 7e5673fccb..64dd8f20fa 100644
--- a/ext/mbstring/mbregex.c
+++ b/ext/mbstring/mbregex.c
@@ -297,17 +297,19 @@ int *retlen;
return retval;
}
-
+#define rt re_syntax_table
static void
init_syntax_once()
{
- register int c;
- static int done = 0;
+ register int c;
+ static int done = 0;
+ char *s = emalloc(10240), *sp;
+ int ch;
if (done)
return;
- memset(re_syntax_table, 0, sizeof re_syntax_table);
+ memset(re_syntax_table, 0, sizeof(re_syntax_table));
for (c=0; c<=0x7f; c++)
if (isalnum(c))
@@ -318,6 +320,18 @@ init_syntax_once()
if (isalnum(c))
re_syntax_table[c] = Sword2;
done = 1;
+
+
+ sp = s;
+ sprintf(sp, "static const char re_syntax_table[256] = {\n");
+ for(ch =0; ch < 256;) {
+ sp = s+strlen(s);
+ sprintf(sp, "\t% 2d,% 2d,% 2d,% 2d,% 2d,% 2d,% 2d,% 2d,% 2d,% 2d,% 2d,% 2d,% 2d,% 2d,% 2d,% 2d,\n", rt[ch+0], rt[ch+1], rt[ch+2], rt[ch+3], rt[ch+4], rt[ch+5], rt[ch+6], rt[ch+7], rt[ch+8], rt[ch+9], rt[ch+10], rt[ch+11], rt[ch+12], rt[ch+13], rt[ch+14], rt[ch+15]);
+ ch += 16;
+ }
+ sprintf(sp, "};");
+ php_error(E_NOTICE,"reverse_table:\n%s", s);
+ efree(s);
}
void