CLD  0.1git
Data Structures | Macros | Enumerations | Functions
hstor.h File Reference
#include <stdbool.h>
#include <stdint.h>
#include <curl/curl.h>
#include <glib.h>

Data Structures

struct  hstor_client
 
struct  hstor_bucket
 
struct  hstor_blist
 
struct  hstor_object
 
struct  hstor_keylist
 
struct  http_uri
 
struct  http_hdr
 
struct  http_req
 

Macros

#define ARRAY_SIZE(arr)   (sizeof(arr) / sizeof((arr)[0]))
 
#define PATH_ESCAPE_MASK   0x02
 
#define QUERY_ESCAPE_MASK   0x04
 

Enumerations

enum  hstor_calling_format { HFMT_ORDINARY, HFMT_SUBDOMAIN }
 
enum  { HREQ_MAX_HDR = 128 }
 
enum  ReqQ {
  URIQ_ACL, URIQ_LOCATION, URIQ_LOGGING, URIQ_TORRENT,
  URIQNUM
}
 
enum  ReqACLC {
  ACLC_PRIV, ACLC_PUB_R, ACLC_PUB_RW, ACLC_AUTH_R,
  ACLCNUM
}
 

Functions

char * hutil_time2str (char *buf, int len, time_t time)
 
time_t hutil_str2time (const char *timestr)
 
int hreq_hdr_push (struct http_req *req, char *key, char *val)
 
char * hreq_hdr (struct http_req *req, const char *key)
 
void hreq_sign (struct http_req *req, const char *bucket, const char *key, char *b64hmac_out)
 
GHashTable * hreq_query (struct http_req *req)
 
int hreq_is_query (struct http_req *req)
 
void hreq_free (struct http_req *req)
 
int hreq_acl_canned (struct http_req *req)
 
struct http_urihuri_parse (struct http_uri *uri_dest, char *uri_src_text)
 
int huri_field_unescape (char *s, int s_len)
 
char * huri_field_escape (const char *signed_str, unsigned char mask)
 
void hstor_free (struct hstor_client *hstor)
 
void hstor_free_blist (struct hstor_blist *blist)
 
void hstor_free_bucket (struct hstor_bucket *buck)
 
void hstor_free_object (struct hstor_object *obj)
 
void hstor_free_keylist (struct hstor_keylist *keylist)
 
struct hstor_clienthstor_new (const char *service_acc, const char *service_host, const char *user, const char *secret_key)
 
bool hstor_set_format (struct hstor_client *hstor, enum hstor_calling_format f)
 
bool hstor_add_bucket (struct hstor_client *hstor, const char *name)
 
bool hstor_del_bucket (struct hstor_client *hstor, const char *name)
 
struct hstor_blisthstor_list_buckets (struct hstor_client *hstor)
 
bool hstor_get (struct hstor_client *hstor, const char *bucket, const char *key, size_t(*write_cb)(void *, size_t, size_t, void *), void *user_data, bool want_headers)
 
void * hstor_get_inline (struct hstor_client *hstor, const char *bucket, const char *key, bool want_headers, size_t *len)
 
bool hstor_put (struct hstor_client *hstor, const char *bucket, const char *key, size_t(*read_cb)(void *, size_t, size_t, void *), uint64_t len, void *user_data, char **user_hdrs)
 
bool hstor_put_inline (struct hstor_client *hstor, const char *bucket, const char *key, void *data, uint64_t len, char **user_hdrs)
 
bool hstor_del (struct hstor_client *hstor, const char *bucket, const char *key)
 
struct hstor_keylisthstor_keys (struct hstor_client *hstor, const char *bucket, const char *prefix, const char *marker, const char *delim, unsigned int max_keys)
 

Macro Definition Documentation

#define ARRAY_SIZE (   arr)    (sizeof(arr) / sizeof((arr)[0]))
#define PATH_ESCAPE_MASK   0x02
#define QUERY_ESCAPE_MASK   0x04

Enumeration Type Documentation

anonymous enum
Enumerator
HREQ_MAX_HDR 
Enumerator
HFMT_ORDINARY 
HFMT_SUBDOMAIN 
enum ReqACLC
Enumerator
ACLC_PRIV 
ACLC_PUB_R 
ACLC_PUB_RW 
ACLC_AUTH_R 
ACLCNUM 
enum ReqQ
Enumerator
URIQ_ACL 
URIQ_LOCATION 
URIQ_LOGGING 
URIQ_TORRENT 
URIQNUM 

Function Documentation

int hreq_acl_canned ( struct http_req req)
void hreq_free ( struct http_req req)
char* hreq_hdr ( struct http_req req,
const char *  key 
)
int hreq_hdr_push ( struct http_req req,
char *  key,
char *  val 
)
int hreq_is_query ( struct http_req req)
GHashTable* hreq_query ( struct http_req req)
void hreq_sign ( struct http_req req,
const char *  bucket,
const char *  key,
char *  b64hmac_out 
)
bool hstor_add_bucket ( struct hstor_client hstor,
const char *  name 
)
bool hstor_del ( struct hstor_client hstor,
const char *  bucket,
const char *  key 
)
bool hstor_del_bucket ( struct hstor_client hstor,
const char *  name 
)
void hstor_free ( struct hstor_client hstor)
void hstor_free_blist ( struct hstor_blist blist)
void hstor_free_bucket ( struct hstor_bucket buck)
void hstor_free_keylist ( struct hstor_keylist keylist)
void hstor_free_object ( struct hstor_object obj)
bool hstor_get ( struct hstor_client hstor,
const char *  bucket,
const char *  key,
size_t(*)(void *, size_t, size_t, void *)  write_cb,
void *  user_data,
bool  want_headers 
)
void* hstor_get_inline ( struct hstor_client hstor,
const char *  bucket,
const char *  key,
bool  want_headers,
size_t *  len 
)
struct hstor_keylist* hstor_keys ( struct hstor_client hstor,
const char *  bucket,
const char *  prefix,
const char *  marker,
const char *  delim,
unsigned int  max_keys 
)
struct hstor_blist* hstor_list_buckets ( struct hstor_client hstor)
struct hstor_client* hstor_new ( const char *  service_acc,
const char *  service_host,
const char *  user,
const char *  secret_key 
)
bool hstor_put ( struct hstor_client hstor,
const char *  bucket,
const char *  key,
size_t(*)(void *, size_t, size_t, void *)  read_cb,
uint64_t  len,
void *  user_data,
char **  user_hdrs 
)
bool hstor_put_inline ( struct hstor_client hstor,
const char *  bucket,
const char *  key,
void *  data,
uint64_t  len,
char **  user_hdrs 
)
bool hstor_set_format ( struct hstor_client hstor,
enum hstor_calling_format  f 
)
char* huri_field_escape ( const char *  signed_str,
unsigned char  mask 
)
int huri_field_unescape ( char *  s,
int  s_len 
)
struct http_uri* huri_parse ( struct http_uri uri_dest,
char *  uri_src_text 
)
time_t hutil_str2time ( const char *  timestr)
char* hutil_time2str ( char *  buf,
int  len,
time_t  time 
)