summaryrefslogtreecommitdiff
path: root/regcomp.h
diff options
context:
space:
mode:
authorIlya Zakharevich <ilya@math.berkeley.edu>1999-08-02 17:53:36 -0400
committerJarkko Hietaniemi <jhi@iki.fi>1999-08-03 09:29:22 +0000
commitcd439c502eb7c742eb6cf76c8359a4d3384ae0f5 (patch)
tree004c460476a9da35fe29b26b2e8d2d94438c4ba4 /regcomp.h
parent8d3f0e046561ce8c2415d2f9fb335f3ab8fa9d70 (diff)
downloadperl-cd439c502eb7c742eb6cf76c8359a4d3384ae0f5.tar.gz
Clarify RE engine code; inline a static function to a macro;
make exact string nodes smaller. To: perl5-porters@perl.org (Mailing list Perl5) Subject: [PATCH 5.005_60] Cosmetic change to REx engine Message-Id: <199908030153.VAA10542@monk.mps.ohio-state.edu> p4raw-id: //depot/cfgperl@3908
Diffstat (limited to 'regcomp.h')
-rw-r--r--regcomp.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/regcomp.h b/regcomp.h
index 7bddc1b051..e30c8e7ca5 100644
--- a/regcomp.h
+++ b/regcomp.h
@@ -66,10 +66,10 @@ typedef OP OP_4tree; /* Will be redefined later. */
*/
struct regnode_string {
- U8 flags;
+ U8 str_len;
U8 type;
U16 next_off;
- U8 string[1];
+ char string[1];
};
struct regnode_1 {
@@ -133,6 +133,12 @@ struct regnode_2 {
#define OP(p) ((p)->type)
#define OPERAND(p) (((struct regnode_string *)p)->string)
+#define MASK(p) ((char*)OPERAND(p))
+#define STR_LEN(p) (((struct regnode_string *)p)->str_len)
+#define STRING(p) (((struct regnode_string *)p)->string)
+#define STR_SZ(l) ((l + sizeof(regnode) - 1) / sizeof(regnode))
+#define NODE_SZ_STR(p) (STR_SZ(STR_LEN(p))+1)
+
#define NODE_ALIGN(node)
#define ARG_LOC(p) (((struct regnode_1 *)p)->arg1)
#define ARG1_LOC(p) (((struct regnode_2 *)p)->arg1)