Couchbase-Client

 view release on metacpan or  search on metacpan

xs/perl-couchbase-async.h  view on Meta::CPAN

        |PLCBA_CMD_REPLACE|PLCBA_CMD_APPEND|PLCBA_CMD_PREPEND))

typedef enum {
    PLCBA_CMD_GET = 0x1,
    
    /*'clean' mutators*/
    PLCBA_CMD_SET = 0x2,
    PLCBA_CMD_ADD = 0x4,
    
    /*'dirty' mutators*/
    PLCBA_CMD_REPLACE = 0x8,
    PLCBA_CMD_APPEND = 0x10,
    PLCBA_CMD_PREPEND = 0x12,
    
    /*simple key operations*/
    PLCBA_CMD_REMOVE = 0x20,
    PLCBA_CMD_TOUCH = 0x30,
    
    /*arithmetic*/
    PLCBA_CMD_ARITHMETIC = 0x100,
    
    PLCBA_CMD_MISC,
    PLCBA_CMD_STATS,
    PLCBA_CMD_FLUSH,
} PLCBA_cmd_t;

/*Fields for the 'request' object*/
typedef enum {
    PLCBA_REQIDX_KEY,
    PLCBA_REQIDX_VALUE,
    PLCBA_REQIDX_EXP,
    PLCBA_REQIDX_CAS,
    PLCBA_REQIDX_ARITH_DELTA,
    PLCBA_REQIDX_ARITH_INITIAL,
    PLCBA_REQIDX_STAT_ARGS,
} PLCBA_reqidx_t;

/*C version of the 'request' object*/
typedef struct PLCBA_request_st {
    char *key;
    STRLEN nkey;
    
    SV *value;
    STRLEN nvalue;
    uint32_t store_flags;
    
    uint64_t cas;
    time_t exp;
        
    int has_conversion;
    
    struct {
        int64_t delta;
        uint64_t initial;
        int create;
    } arithmetic;
    
    
} PLCBA_request_t;

/*wire callbacks*/
void plcba_setup_callbacks(PLCBA_t *async);

/*wire io structure*/
plcba_cbcio *plcba_make_io_opts(PLCBA_t *async);


/*immediate error notification*/
void plcba_callback_notify_err(PLCBA_t *async,
                               PLCBA_cookie_t *cookie,
                               const char *key, size_t nkey,
                               libcouchbase_error_t err);


/*prototypes for perl-facing functions, for Async.xs*/
SV *PLCBA_construct(const char*, AV*);
void PLCBA_connect(SV*);
void PLCBA_HaveEvent(const char*, short, SV*);
void PLCBA_request(SV *, int, int, SV*, SV*, int, AV*);


#endif /* PERL_COUCHBASE_ASYNC_H_ */



( run in 0.911 second using v1.01-cache-2.11-cpan-140bd7fdf52 )