Mercurial > ~mikael > mcabber > hg
annotate mcabber/src/otr.h @ 1497:35020a2ed115
Do not use srand()/rand() if better alternatives exist (mirabilos)
arc4random(3) is a self-seeding PRNG available on a lot of OSes (all BSDs,
Darwin / Mac OSX, Interix / Microsoft® Services for Unix, Windows® 2003SR1,
Windows® Vista, Debian with the new libbsd package installed, ???) and much
better than srand(3)/rand(3).
Thanks to GNU autoconf, this can be made portable.
http://www.mirbsd.org/man/arc4random.3
//mirabilos
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Mon, 30 Jun 2008 23:13:50 +0200 |
parents | 37b41ed9ed35 |
children |
rev | line source |
---|---|
1299 | 1 #ifndef __OTR_H__ |
2 #define __OTR_H__ 1 | |
3 | |
4 #ifdef HAVE_LIBOTR | |
5 | |
6 #include <libotr/proto.h> | |
7 #include <libotr/message.h> | |
1301
37b41ed9ed35
Fixed compiler warnings
Frank Zschockelt <mcabber_otr[at]freakysoft.de>
parents:
1299
diff
changeset
|
8 #include <libotr/privkey.h> |
1299 | 9 |
10 enum otr_policy { | |
11 plain, | |
12 opportunistic, | |
13 manual, | |
14 always | |
15 }; | |
16 | |
1301
37b41ed9ed35
Fixed compiler warnings
Frank Zschockelt <mcabber_otr[at]freakysoft.de>
parents:
1299
diff
changeset
|
17 void otr_init(const char *jid); |
1299 | 18 void otr_terminate(void); |
19 | |
20 void otr_establish (const char * buddy); | |
21 void otr_disconnect (const char * buddy); | |
22 void otr_fingerprint(const char * buddy, const char * trust); | |
23 void otr_print_info (const char * buddy); | |
24 | |
25 void otr_smp_query (const char * buddy, const char * secret); | |
26 void otr_smp_respond(const char * buddy, const char * secret); | |
27 void otr_smp_abort (const char * buddy); | |
28 | |
29 void otr_key (void); | |
30 | |
31 int otr_receive (char **otr_data, const char * buddy, int * free_msg); | |
32 int otr_send (char **msg, const char *buddy); | |
33 | |
34 #endif /* HAVE_LIBOTR */ | |
35 | |
36 int otr_enabled (void); | |
37 | |
38 #endif /* __OTR_H__ */ | |
39 | |
40 /* vim: set expandtab cindent cinoptions=>2\:2(0: For Vim users... */ |