gdb-server/include/response.h

26 lines
725 B
C

#ifndef RDBSERVER_RESPONSE_H_
#define RDBSERVER_RESPONSE_H_
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <sys/types.h>
typedef struct RdbResponse {
int connfd;
char *buf;
size_t buflen;
size_t len;
char chk;
bool should_ack;
} RdbResponse;
void rdbResponseInit(RdbResponse *self, int connfd, char *buf, size_t buflen);
void rdbResponseBeginPacket(RdbResponse *self);
bool rdbResponseWriteStr(RdbResponse *self, const char *str);
bool rdbResponseWriteStrHex(RdbResponse *self, const char *str);
bool rdbResponseWriteI8Hex(RdbResponse *self, uint8_t value);
bool rdbResponseWriteI32Hex(RdbResponse *self, uint32_t value);
int rdbResponseSendPacket(RdbResponse *self);
#endif