extern void unlock_stream (FILE *);
+/* If the OS supports it, ensure that the standard I/O streams, stdin,
+ stdout and stderr are setup to avoid any multi-threaded locking.
+ Otherwise do nothing. */
+
+extern void unlock_std_streams (void);
+
/* Open and return a FILE pointer. If the OS supports it, ensure that
the stream is setup to avoid any multi-threaded locking. Otherwise
return the FILE pointer unchanged. */
@end deftypefn
+@deftypefn Extension void unlock_std_streams (void)
+
+If the OS supports it, ensure that the standard I/O streams,
+@code{stdin}, @code{stdout} and @code{stderr} are setup to avoid any
+multi-threaded locking. Otherwise do nothing.
+
+@end deftypefn
+
@deftypefn Extension FILE * fopen_unlocked (const char *@var{path}, const char * @var{mode})
Opens and returns a @code{FILE} pointer via @code{fopen}. If the
}
void
-unlock_stream(FILE *fp)
+unlock_stream (FILE *fp)
{
unlock_1 (fp);
}
+void
+unlock_std_streams (void)
+{
+ unlock_1 (stdin);
+ unlock_1 (stdout);
+ unlock_1 (stderr);
+}
+
FILE *
fopen_unlocked (const char *path, const char *mode)
{
@end deftypefn
-@c asprintf.c:29
+@c asprintf.c:32
@deftypefn Extension int asprintf (char **@var{resptr}, const char *@var{format}, ...)
Like @code{sprintf}, but instead of passing a pointer to a buffer, you
@end deftypefn
-@c argv.c:121
+@c argv.c:124
@deftypefn Extension char** buildargv (char *@var{sp})
Given a pointer to a string, parse the string extracting fields
@end deftypefn
-@c argv.c:49
+@c argv.c:52
@deftypefn Extension char** dupargv (char **@var{vector})
Duplicate an argument vector. Simply scans through @var{vector},
@end deftypefn
-@c fopen_unlocked.c:40
+@c fopen_unlocked.c:48
@deftypefn Extension FILE * fdopen_unlocked (int @var{fildes}, const char * @var{mode})
Opens and returns a @code{FILE} pointer via @code{fdopen}. If the
@end deftypefn
-@c fopen_unlocked.c:31
+@c fopen_unlocked.c:39
@deftypefn Extension FILE * fopen_unlocked (const char *@var{path}, const char * @var{mode})
Opens and returns a @code{FILE} pointer via @code{fopen}. If the
@end deftypefn
-@c argv.c:94
+@c argv.c:97
@deftypefn Extension void freeargv (char **@var{vector})
Free an argument vector that was built using @code{buildargv}. Simply
@end deftypefn
-@c fopen_unlocked.c:49
+@c fopen_unlocked.c:57
@deftypefn Extension FILE * freopen_unlocked (const char * @var{path}, const char * @var{mode}, FILE * @var{stream})
Opens and returns a @code{FILE} pointer via @code{freopen}. If the
@end deftypefn
-@c hex.c:30
+@c hex.c:33
@deftypefn Extension void hex_init (void)
Initializes the array mapping the current character set to
@end deftypefn
-@c hex.c:39
+@c hex.c:42
@deftypefn Extension int hex_p (int @var{c})
Evaluates to non-zero if the given character is a valid hex character,
@end deftypefn
-@c hex.c:47
+@c hex.c:50
@deftypefn Extension {unsigned int} hex_value (int @var{c})
Returns the numeric equivalent of the given character when interpreted
@end deftypefn
+@c fopen_unlocked.c:31
+@deftypefn Extension void unlock_std_streams (void)
+
+If the OS supports it, ensure that the standard I/O streams,
+@code{stdin}, @code{stdout} and @code{stderr} are setup to avoid any
+multi-threaded locking. Otherwise do nothing.
+
+@end deftypefn
+
@c fopen_unlocked.c:23
@deftypefn Extension void unlock_stream (FILE * @var{stream})