diff options
Diffstat (limited to 'inc')
-rw-r--r-- | inc/libs3.h | 14 | ||||
-rw-r--r-- | inc/util.h | 20 |
2 files changed, 17 insertions, 17 deletions
diff --git a/inc/libs3.h b/inc/libs3.h index 5d2054b..8c222c6 100644 --- a/inc/libs3.h +++ b/inc/libs3.h @@ -189,11 +189,21 @@ **/ #define S3_INIT_WINSOCK 1 + +/** + * This constant is used by the S3_initialize() function, to specify that + * the gcrypt library should be initialized by libs3; should always be + * specified by the caller unless the caller specifically initializes the + * gcrypt library elsewhere. + **/ +#define S3_INIT_GCRYPT 2 + + /** * This convenience constant is used by the S3_initialize() function to - * indicate that alllibraries required by libs3 should be initialized. + * indicate that all libraries required by libs3 should be initialized. **/ -#define S3_INIT_ALL (S3_INIT_WINSOCK) +#define S3_INIT_ALL (S3_INIT_WINSOCK | S3_INIT_GCRYPT) /** ************************************************************************** @@ -56,21 +56,6 @@ (1 + 255 + 1 + MAX_URLENCODED_KEY_SIZE + (sizeof("?torrent") - 1) + 1) -// Mutex functions ----------------------------------------------------------- - -// Create a mutex. Returns 0 if none could be created. -struct S3Mutex *mutex_create(); - -// Lock a mutex -void mutex_lock(struct S3Mutex *mutex); - -// Unlock a mutex -void mutex_unlock(struct S3Mutex *mutex); - -// Destroy a mutex -void mutex_destroy(struct S3Mutex *mutex); - - // Utilities ----------------------------------------------------------------- // URL-encodes a string from [src] into [dest]. [dest] must have at least @@ -84,5 +69,10 @@ time_t parseIso8601Time(const char *str); uint64_t parseUnsignedInt(const char *str); +// base64 encode bytes. The output buffer must have at least +// ((4 * (inLen + 1)) / 3) bytes in it. Returns the number of bytes written +// to [out]. +int base64Encode(const unsigned char *in, int inLen, unsigned char *out); + #endif /* UTIL_H */ |