commit 7822e61ba0ef35f7a78fb882d291de9dfc335c18
parent 12e9614a87e5c07b65a26522f0f88db8b87ed652
Author: z3bra <contactatz3bradotorg>
Date: Tue, 1 Nov 2016 00:22:46 +0100
Rename CLIENT_ID to ADDRESS in constants
Diffstat:
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/ratox.c b/ratox.c
@@ -144,8 +144,8 @@ struct call {
struct friend {
char name[TOX_MAX_NAME_LENGTH + 1];
int32_t num;
- uint8_t id[TOX_CLIENT_ID_SIZE];
- char idstr[2 * TOX_CLIENT_ID_SIZE + 1];
+ uint8_t id[TOX_ADDRESS_SIZE];
+ char idstr[2 * TOX_ADDRESS_SIZE + 1];
int dirfd;
int fd[LEN(ffiles)];
struct transfer tx;
@@ -155,8 +155,8 @@ struct friend {
};
struct request {
- uint8_t id[TOX_CLIENT_ID_SIZE];
- char idstr[2 * TOX_CLIENT_ID_SIZE + 1];
+ uint8_t id[TOX_ADDRESS_SIZE];
+ char idstr[2 * TOX_ADDRESS_SIZE + 1];
char *msg;
int fd;
TAILQ_ENTRY(request) entry;
@@ -588,7 +588,7 @@ cbconnstatus(Tox *m, int32_t frnum, uint8_t status, void *udata)
for (req = TAILQ_FIRST(&reqhead); req; req = rtmp) {
rtmp = TAILQ_NEXT(req, entry);
- if (memcmp(f->id, req->id, TOX_CLIENT_ID_SIZE))
+ if (memcmp(f->id, req->id, TOX_ADDRESS_SIZE))
continue;
unlinkat(gslots[REQUEST].fd[OUT], req->idstr, 0);
close(req->fd);
@@ -631,7 +631,7 @@ cbfriendrequest(Tox *m, const uint8_t *id, const uint8_t *data, uint16_t len, vo
eprintf("calloc:");
req->fd = -1;
- memcpy(req->id, id, TOX_CLIENT_ID_SIZE);
+ memcpy(req->id, id, TOX_ADDRESS_SIZE);
id2str(req->id, req->idstr);
if (len > 0) {
@@ -1249,7 +1249,7 @@ toxconnect(void)
struct node tmp;
size_t i, j;
int r;
- uint8_t id[TOX_CLIENT_ID_SIZE];
+ uint8_t id[TOX_ADDRESS_SIZE];
srand(time(NULL));
@@ -1280,7 +1280,7 @@ id2str(uint8_t *id, char *idstr)
int i;
char hex[] = "0123456789ABCDEF";
- for (i = 0; i < TOX_CLIENT_ID_SIZE; i++) {
+ for (i = 0; i < TOX_ADDRESS_SIZE; i++) {
*idstr++ = hex[(id[i] >> 4) & 0xf];
*idstr++ = hex[id[i] & 0xf];
}