aboutsummaryrefslogtreecommitdiff
path: root/src/common/util.h
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2003-10-04 03:29:09 +0000
committerRoger Dingledine <arma@torproject.org>2003-10-04 03:29:09 +0000
commitbe874358a4385d8d6bd7f82d3f372bb79055033c (patch)
tree72b615a6357820b49e9a66ab32c3554463a7834c /src/common/util.h
parentf563bbd2f988cd1f6ca292f89a47a86f98fe0e8d (diff)
downloadtor-be874358a4385d8d6bd7f82d3f372bb79055033c.tar
tor-be874358a4385d8d6bd7f82d3f372bb79055033c.tar.gz
wrap strdup; prefer time() to gettimeofday()
svn:r538
Diffstat (limited to 'src/common/util.h')
-rw-r--r--src/common/util.h16
1 files changed, 2 insertions, 14 deletions
diff --git a/src/common/util.h b/src/common/util.h
index d1127260c..40e35d962 100644
--- a/src/common/util.h
+++ b/src/common/util.h
@@ -33,11 +33,9 @@
#endif
void *tor_malloc(size_t size);
+char *tor_strdup(const char *s);
+void tor_gettimeofday(struct timeval *timeval);
-/* Same as gettimeofday, but no need to check exit value. */
-void my_gettimeofday(struct timeval *timeval);
-/* Returns the number of microseconds between start and end. Requires that
- * end >= start, and that the number of microseconds < LONG_MAX. */
long tv_udiff(struct timeval *start, struct timeval *end);
void tv_addms(struct timeval *a, long ms);
@@ -51,22 +49,12 @@ void set_socket_nonblocking(int socket);
typedef enum { FN_ERROR, FN_NOENT, FN_FILE, FN_DIR} file_status_t;
-/* Return FN_ERROR if filename can't be read, FN_NOENT if it doesn't
- * exist, FN_FILE if it is a regular file, or FN_DIR if it's a
- * directory. */
file_status_t file_status(const char *filename);
-/* Check whether dirname exists and is private. If yes returns
- * 0. Else returns -1.
- */
int check_private_dir(const char *dirname, int create);
int write_str_to_file(const char *fname, const char *str);
char *read_file_to_str(const char *filename);
int parse_line_from_file(char *line, int maxlen, FILE *f, char **key_out, char **value_out);
-/* Minimalist interface to run a void function in the background. On
- unix calls fork, on win32 calls beginthread. Returns -1 on failure.
- func should not return, but rather should call spawn_exit.
-*/
int spawn_func(int (*func)(void *), void *data);
void spawn_exit();