summaryrefslogtreecommitdiff
path: root/src/common/util.h
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2012-06-07 19:07:13 +0300
committerGeorge Kadianakis <desnacked@riseup.net>2012-09-05 18:02:27 +0300
commit03e89f0b72ede5ec37c76de840f04579b8d118c3 (patch)
treec4235543aae4034af4a0706d5fa45e95c5943970 /src/common/util.h
parente8be040016a279d5cbef38fa5328cc2eb0de2c46 (diff)
downloadtor-03e89f0b72ede5ec37c76de840f04579b8d118c3.tar.gz
tor-03e89f0b72ede5ec37c76de840f04579b8d118c3.zip
Introduce get_lines_from_handle().
get_lines_from_handle() is a multiplatform function which drains lines from a stream and stuffs it into a smartlist. It's useful for line-based protocols, like the one managed proxy and the tor-fw-helper protocols.
Diffstat (limited to 'src/common/util.h')
-rw-r--r--src/common/util.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/common/util.h b/src/common/util.h
index c059730db6..69335eddb2 100644
--- a/src/common/util.h
+++ b/src/common/util.h
@@ -464,6 +464,16 @@ HANDLE tor_process_get_stdout_pipe(process_handle_t *process_handle);
FILE *tor_process_get_stdout_pipe(process_handle_t *process_handle);
#endif
+#ifdef _WIN32
+struct smartlist_t *
+tor_get_lines_from_handle(HANDLE *handle,
+ enum stream_status *stream_status);
+#else
+struct smartlist_t *
+tor_get_lines_from_handle(FILE *handle,
+ enum stream_status *stream_status);
+#endif
+
int tor_terminate_process(process_handle_t *process_handle);
void tor_process_handle_destroy(process_handle_t *process_handle,
int also_terminate_process);