summaryrefslogtreecommitdiff
path: root/src/hos_hash.h
blob: 51e2a6b7e965ea329afbd0bdcbcea61bbc579c72 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*************************************************************************
    > File Name: hos_hash.h
    > Author: pxz
    > Created Time: Fri 18 Sep 2020 05:00:04 PM CST
 ************************************************************************/
#ifndef __HOS_HASH_H__
#define __HOS_HASH_H__

#include <aws/core/Aws.h>
#include "hos_client.h"
#include "uthash.h"

typedef struct hos_info_s
{
    size_t fd;
    int  mode;
    hos_client_handle handle; 
    const char *bucket;
    const char *object;
    void *callback;
    void *userdata;
    std::shared_ptr<Aws::IOStream> cache;
    //void *cache;
    size_t cache_times;
    size_t cache_rest;
    size_t position;
    UT_hash_handle hh;
}hos_info_t;

void add_hos_info(hos_info_t **handle, hos_info_t *input);
hos_info_t *find_info_by_fd(hos_info_t *handle, size_t fd);
void delete_info_by_fd(hos_info_t **handle, size_t fd);
void delete_all(hos_info_t **handle);
#endif