ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/gvpe/src/util.h
(Generate patch)

Comparing gvpe/src/util.h (file contents):
Revision 1.32 by root, Wed Jul 17 05:34:17 2013 UTC vs.
Revision 1.33 by root, Wed Jul 17 16:40:58 2013 UTC

34#ifndef UTIL_H__ 34#ifndef UTIL_H__
35#define UTIL_H__ 35#define UTIL_H__
36 36
37#include <cstring> 37#include <cstring>
38#include <sys/types.h> 38#include <sys/types.h>
39
40#include <openssl/rsa.h>
41 39
42#include "gettext.h" 40#include "gettext.h"
43 41
44#include "slog.h" 42#include "slog.h"
45#include "ev_cpp.h" 43#include "ev_cpp.h"
133u8 *base64_encode (const u8 *data, unsigned int len); 131u8 *base64_encode (const u8 *data, unsigned int len);
134#endif 132#endif
135 133
136/*****************************************************************************/ 134/*****************************************************************************/
137 135
136void rand_fill (void *data, int len);
137
138template<class T>
139inline void rand_fill (T &t)
140{
141 rand_fill (&t, sizeof (T));
142}
143
144/*****************************************************************************/
145
138// run work_cb in another thread, call done_cb in main thread when finished 146// run work_cb in another thread, call done_cb in main thread when finished
139// only one work_cb will execute at any one time. 147// only one work_cb will execute at any one time.
140void async (callback<void ()> work_cb, callback<void ()> done_cb); 148void async (callback<void ()> work_cb, callback<void ()> done_cb);
141 149
142#endif 150#endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines