40 lines
1.2 KiB
C
40 lines
1.2 KiB
C
//
|
|
// Created by nicolas on 22/03/18.
|
|
//
|
|
|
|
#ifndef ESC_PROTO_HELPER_H
|
|
#define ESC_PROTO_HELPER_H
|
|
|
|
#include "utils/array.h"
|
|
#include "utils/buffer.h"
|
|
#include "utils/bool.h"
|
|
#include "utils/error.h"
|
|
#include "results.h"
|
|
|
|
typedef enum {
|
|
Operation_Decision_DoNothing,
|
|
Operation_Decision_EndOperation,
|
|
Operation_Decision_Retry,
|
|
Operation_Decision_Reconnect,
|
|
Operation_Decision_Subscribed
|
|
} operation_decision_t;
|
|
|
|
typedef struct {
|
|
operation_decision_t decision;
|
|
const char* description;
|
|
error_t* error;
|
|
} inspection_result_t;
|
|
void inspection_result_destroy(inspection_result_t*);
|
|
|
|
buffer_t* esc_identify_client_pack(const char* connection_name);
|
|
|
|
inspection_result_t* esc_all_events_slice_unpack(buffer_t* buffer, esc_all_events_slice_t** all_events_slice_p);
|
|
buffer_t* esc_read_all_forward_pack(esc_position_t* last_checkpoint, int32_t count, bool_t resolve_link_tos);
|
|
const char* get_string_for_all_events_result(int result);
|
|
|
|
inspection_result_t* esc_write_result_unpack(buffer_t* buffer, esc_write_result_t** write_result_p);
|
|
buffer_t* esc_append_to_stream_pack(const char* stream, int64_t expected_version, array_t* events);
|
|
const char* get_string_for_write_result(int result);
|
|
|
|
#endif //ESC_PROTO_HELPER_H
|