aboutsummaryrefslogtreecommitdiffstats
path: root/awk.h
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2017-03-20 21:26:06 +0200
committerArnold D. Robbins <arnold@skeeve.com>2017-03-20 21:26:06 +0200
commit34f44e49e257d48eb1db3bc4d78c2b9ceb331717 (patch)
treeb247bd82ba77ac5a6e5466b231fa97141ef6196d /awk.h
parentd3d3f38ef66954d54fa687d49872ed968c391a3b (diff)
parentefc7e96c876ccf3b83ab3249eca852a0292ff943 (diff)
downloadegawk-34f44e49e257d48eb1db3bc4d78c2b9ceb331717.tar.gz
egawk-34f44e49e257d48eb1db3bc4d78c2b9ceb331717.tar.bz2
egawk-34f44e49e257d48eb1db3bc4d78c2b9ceb331717.zip
Merge branch 'master' into feature/stringfix
Diffstat (limited to 'awk.h')
-rw-r--r--awk.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/awk.h b/awk.h
index 205bf1e1..a8255d96 100644
--- a/awk.h
+++ b/awk.h
@@ -1584,6 +1584,10 @@ extern bool inrec(IOBUF *iop, int *errcode);
extern int nextfile(IOBUF **curfile, bool skipping);
extern bool is_non_fatal_std(FILE *fp);
extern bool is_non_fatal_redirect(const char *str, size_t len);
+extern void ignore_sigpipe(void);
+extern void set_sigpipe_to_default(void);
+extern bool non_fatal_flush_std_file(FILE *fp);
+
/* main.c */
extern int arg_assign(char *arg, bool initing);
extern int is_std_var(const char *var);
@@ -1959,6 +1963,7 @@ erealloc_real(void *ptr, size_t count, const char *where, const char *var, const
return ret;
}
+
/*
* str_terminate_f, str_terminate, str_restore: function and macros to
* reduce chances of typos when terminating and restoring strings.
@@ -1974,3 +1979,11 @@ str_terminate_f(NODE *n, char *savep)
#define str_terminate(n, save) str_terminate_f((n), &save)
#define str_restore(n, save) (n)->stptr[(n)->stlen] = save
+
+#ifdef SIGPIPE
+#define ignore_sigpipe() signal(SIGPIPE, SIG_IGN)
+#define set_sigpipe_to_default() signal(SIGPIPE, SIG_DFL)
+#else
+#define ignore_sigpipe()
+#define set_sigpipe_to_default()
+#endif