summaryrefslogtreecommitdiff
path: root/src/mesa/shader
diff options
context:
space:
mode:
authorMichal Krol <mjkrol@gmail.org>2004-10-20 15:19:58 +0000
committerMichal Krol <mjkrol@gmail.org>2004-10-20 15:19:58 +0000
commitcbef98c2eae6f4ec3874a226af65f25c5b8526e2 (patch)
treedeeb4aa406409611d31280d2d9416b944b94b9d7 /src/mesa/shader
parent904ef741de76b41825d9f18153e3535a89390d5b (diff)
add new grammar_check_fast entry for faster parsing
Diffstat (limited to 'src/mesa/shader')
-rw-r--r--src/mesa/shader/grammar.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/mesa/shader/grammar.h b/src/mesa/shader/grammar.h
index 41a484e69c..622cdb2398 100644
--- a/src/mesa/shader/grammar.h
+++ b/src/mesa/shader/grammar.h
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.1
+ * Version: 6.2
*
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*
@@ -61,6 +61,8 @@ grammar grammar_load_from_text (const byte *text);
int grammar_set_reg8 (grammar id, const byte *name, byte value);
/*
+ this function is obsolete, use only for debugging purposes
+
checks if a null-terminated <text> matches given grammar <id>
returns 0 on error (call grammar_get_last_error to retrieve the error text)
returns 1 on success, the <prod> points to newly allocated buffer with production and <size>
@@ -70,6 +72,15 @@ int grammar_set_reg8 (grammar id, const byte *name, byte value);
int grammar_check (grammar id, const byte *text, byte **prod, unsigned int *size);
/*
+ does the same what grammar_check does but much more (approx. 4 times) faster
+ use this function instead of grammar_check
+ <estimate_prod_size> is a hint - the initial production buffer size will be of this size,
+ but if more room is needed it will be safely resized; set it to 0x1000 or so
+*/
+int grammar_fast_check (grammar id, const byte *text, byte **prod, unsigned int *size,
+ unsigned int estimate_prod_size);
+
+/*
destroys grammar object identified by <id>
returns 0 on error (call grammar_get_last_error to retrieve the error text)
returns 1 on success