summaryrefslogtreecommitdiff
path: root/stdscan.c
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2009-10-29 23:09:18 +0300
committerCyrill Gorcunov <gorcunov@gmail.com>2009-10-31 20:02:43 +0300
commit917117ff69271fe911e87a6f0e8dfc1f81c3f9b4 (patch)
tree7fa504459cecef908ceed5197bf8bab629dc11e9 /stdscan.c
parentbafd877d48b25e576a4c905a14f1301502cca69c (diff)
downloadnasm-917117ff69271fe911e87a6f0e8dfc1f81c3f9b4.tar.gz
stdscan: switch to stdscan_get/set routines
Instead of manipulating stdscan buffer pointer directly we switch to a routine interface. This allow us to unify stdscan access: ie caller should "talk" to stdscan via stdscan_get/set routines. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Diffstat (limited to 'stdscan.c')
-rw-r--r--stdscan.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/stdscan.c b/stdscan.c
index 0f7b3bd7..f50dd857 100644
--- a/stdscan.c
+++ b/stdscan.c
@@ -50,10 +50,21 @@
* formats. It keeps a succession of temporary-storage strings in
* stdscan_tempstorage, which can be cleared using stdscan_reset.
*/
+static char *stdscan_bufptr = NULL;
static char **stdscan_tempstorage = NULL;
static int stdscan_tempsize = 0, stdscan_templen = 0;
#define STDSCAN_TEMP_DELTA 256
+void stdscan_set(char *str)
+{
+ stdscan_bufptr = str;
+}
+
+char *stdscan_get(void)
+{
+ return stdscan_bufptr;
+}
+
static void stdscan_pop(void)
{
nasm_free(stdscan_tempstorage[--stdscan_templen]);
@@ -94,7 +105,6 @@ static char *stdscan_copy(char *p, int len)
return text;
}
-char *stdscan_bufptr = NULL;
int stdscan(void *private_data, struct tokenval *tv)
{
char ourcopy[MAX_KEYWORD + 1], *r, *s;