summaryrefslogtreecommitdiffstats
path: root/include/libssh/misc.h
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2011-05-24 23:26:18 +0200
committerAndreas Schneider <asn@cryptomilk.org>2011-05-25 21:59:51 +0200
commit09b0018b938bfbbe0d5b5363b8e011aa7bfbf2f2 (patch)
treedf73e66ffd908551b2f020a0c4c5b23a35152153 /include/libssh/misc.h
parent2624e603d4fc47d1bcf16cc1374628fe0b10f555 (diff)
downloadlibssh-09b0018b938bfbbe0d5b5363b8e011aa7bfbf2f2.tar.gz
libssh-09b0018b938bfbbe0d5b5363b8e011aa7bfbf2f2.tar.xz
libssh-09b0018b938bfbbe0d5b5363b8e011aa7bfbf2f2.zip
Introduced ssh_timeout_elapsed functions
Functions to mesure elapsed time before and after a serie of calls. Introduces a dependancy to clock_gettime() and librt, hope this doesn't break anything. Porting to gettimeofday() should not be too hard. (cherry picked from commit 59f7647cd97c62ab7a26725e5a166dcb54b27bc6)
Diffstat (limited to 'include/libssh/misc.h')
-rw-r--r--include/libssh/misc.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/libssh/misc.h b/include/libssh/misc.h
index 3ee26a3c..9897c4eb 100644
--- a/include/libssh/misc.h
+++ b/include/libssh/misc.h
@@ -50,6 +50,11 @@ struct ssh_iterator {
const void *data;
};
+struct ssh_timestamp {
+ long seconds;
+ long useconds;
+};
+
struct ssh_list *ssh_list_new(void);
void ssh_list_free(struct ssh_list *list);
struct ssh_iterator *ssh_list_get_iterator(const struct ssh_list *list);
@@ -72,4 +77,8 @@ const void *_ssh_list_pop_head(struct ssh_list *list);
#define ssh_list_pop_head(type, ssh_list)\
((type)_ssh_list_pop_head(ssh_list))
+void ssh_timestamp_init(struct ssh_timestamp *ts);
+int ssh_timeout_elapsed(struct ssh_timestamp *ts, int timeout);
+int ssh_timeout_update(struct ssh_timestamp *ts, int timeout);
+
#endif /* MISC_H_ */