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.31 by root, Tue Jul 16 16:44:37 2013 UTC vs.
Revision 1.34 by root, Thu Jan 9 08:15:05 2014 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"
125typedef callback<const char *()> run_script_cb; 123typedef callback<const char *()> run_script_cb;
126 124
127// run a shell script (or actually an external program). 125// run a shell script (or actually an external program).
128pid_t run_script (const run_script_cb &cb, bool wait); 126pid_t run_script (const run_script_cb &cb, bool wait);
129 127
128void hexdump (const char *header, void *data, int len);
129
130#if ENABLE_HTTP_PROXY 130#if ENABLE_HTTP_PROXY
131u8 *base64_encode (const u8 *data, unsigned int len); 131u8 *base64_encode (const u8 *data, unsigned int len);
132#endif 132#endif
133
134/* always take more or less the same time to compare */
135bool slow_memeq (const void *a, const void *b, int len);
136
137/*****************************************************************************/
138
139void rand_fill (void *data, int len);
140
141template<class T>
142inline void rand_fill (T &t)
143{
144 rand_fill (&t, sizeof (T));
145}
133 146
134/*****************************************************************************/ 147/*****************************************************************************/
135 148
136// run work_cb in another thread, call done_cb in main thread when finished 149// run work_cb in another thread, call done_cb in main thread when finished
137// only one work_cb will execute at any one time. 150// only one work_cb will execute at any one time.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines