aboutsummaryrefslogtreecommitdiffstats
path: root/gawkapi.h
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2012-07-12 21:09:14 +0300
committerArnold D. Robbins <arnold@skeeve.com>2012-07-12 21:09:14 +0300
commita49be44686e3d0707c43d643bfcad68d50a75b98 (patch)
tree8f7a27802f86336a3002d4dfa14c33362a37ad81 /gawkapi.h
parent33b647ef23daa8a310701c767098f11ee48cf4e8 (diff)
parentdda2495337929a86cc40017d8f1cd72a46876618 (diff)
downloadegawk-a49be44686e3d0707c43d643bfcad68d50a75b98.tar.gz
egawk-a49be44686e3d0707c43d643bfcad68d50a75b98.tar.bz2
egawk-a49be44686e3d0707c43d643bfcad68d50a75b98.zip
Merge branch 'extgawk' of ssh://git.sv.gnu.org/srv/git/gawk into extgawk
Diffstat (limited to 'gawkapi.h')
-rw-r--r--gawkapi.h21
1 files changed, 18 insertions, 3 deletions
diff --git a/gawkapi.h b/gawkapi.h
index 9f541cfc..50ca327a 100644
--- a/gawkapi.h
+++ b/gawkapi.h
@@ -34,7 +34,7 @@
/*
* General introduction:
*
- * This API purposely restricts itself to C90 features. In paticular, no
+ * This API purposely restricts itself to C90 features. In particular, no
* bool, no // comments, no use of the restrict keyword, or anything else,
* in order to provide maximal portability.
*
@@ -122,7 +122,7 @@ typedef struct {
awk_string_t s;
double d;
awk_array_t a;
- awk_array_t scl;
+ awk_scalar_t scl;
} u;
#define str_value u.s
#define num_value u.d
@@ -317,6 +317,18 @@ typedef struct gawk_api {
awk_value_t *result);
/*
+ * Retrieve the current value of a scalar cookie. Once
+ * you have obtained a saclar_cookie using sym_lookup, you can
+ * use this function to get its value more efficiently.
+ *
+ * Return will be false if the value cannot be retrieved.
+ */
+ awk_bool_t (*api_sym_lookup_scalar)(awk_ext_id_t id,
+ awk_scalar_t cookie,
+ awk_valtype_t wanted,
+ awk_value_t *result);
+
+ /*
* Update a value. Adds it to the symbol table if not there.
* Changing types (scalar <--> array) is not allowed.
* In fact, using this to update an array is not allowed, either.
@@ -427,7 +439,10 @@ typedef struct gawk_api {
#define add_ext_func(func, ns) (api->api_add_ext_func(ext_id, func, ns))
#define awk_atexit(funcp, arg0) (api->api_awk_atexit(ext_id, funcp, arg0))
-#define sym_lookup(name, wanted, result) (api->api_sym_lookup(ext_id, name, wanted, result))
+#define sym_lookup(name, wanted, result) \
+ (api->api_sym_lookup(ext_id, name, wanted, result))
+#define sym_lookup_scalar(scalar_cookie, wanted, result) \
+ (api->api_sym_lookup_scalar(ext_id, scalar_cookie, wanted, result))
#define sym_update(name, value) \
(api->api_sym_update(ext_id, name, value))
#define sym_update_scalar(scalar_cookie, value) \