diff options
author | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2012-04-01 17:07:56 -0400 |
---|---|---|
committer | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2012-04-01 17:07:56 -0400 |
commit | 920b87dfab2e0504c8a1eb26eb6f130bcb748218 (patch) | |
tree | 5f2bea9eff1decc2e2d51b642d2d6cf444de071a /eval.c | |
parent | ca6df261b71a738b4f0d0719f79cacee008a16c5 (diff) | |
download | egawk-920b87dfab2e0504c8a1eb26eb6f130bcb748218.tar.gz egawk-920b87dfab2e0504c8a1eb26eb6f130bcb748218.tar.bz2 egawk-920b87dfab2e0504c8a1eb26eb6f130bcb748218.zip |
Update ERRNO API.
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 22 |
1 files changed, 17 insertions, 5 deletions
@@ -988,10 +988,10 @@ set_TEXTDOMAIN() */ } -/* update_ERRNO_saved --- update the value of ERRNO based on argument */ +/* update_ERRNO_int --- update the value of ERRNO based on argument */ void -update_ERRNO_saved(int errcode) +update_ERRNO_int(int errcode) { char *cp; @@ -1004,12 +1004,24 @@ update_ERRNO_saved(int errcode) ERRNO_node->var_value = make_string(cp, strlen(cp)); } -/* update_ERRNO --- update the value of ERRNO based on errno */ +/* update_ERRNO_string --- update ERRNO with optionally translated string */ void -update_ERRNO() +update_ERRNO_string(const char *string, enum errno_translate translate) { - update_ERRNO_saved(errno); + if (translate == TRANSLATE) + string = gettext(string); + unref(ERRNO_node->var_value); + ERRNO_node->var_value = make_string(string, strlen(string)); +} + +/* unset_ERRNO --- eliminate the value of ERRNO */ + +void +unset_ERRNO(void) +{ + unref(ERRNO_node->var_value); + ERRNO_node->var_value = Nnull_string; } /* update_NR --- update the value of NR */ |