Rename struct members, variables

Rename struct members, variables for better visual appeal
This commit is contained in:
XANTRONIX Development 2020-09-19 15:48:51 -05:00 committed by XANTRONIX Industrial
parent 70d112eb91
commit c98d07e876

View file

@ -22,7 +22,7 @@ struct _patty_ax25_aprs_is {
char rx_buf[PATTY_AX25_APRS_IS_PACKET_MAX], char rx_buf[PATTY_AX25_APRS_IS_PACKET_MAX],
tx_buf[PATTY_AX25_APRS_IS_FRAME_MAX], tx_buf[PATTY_AX25_APRS_IS_FRAME_MAX],
station[PATTY_AX25_ADDRSTRLEN+1], call[PATTY_AX25_ADDRSTRLEN+1],
info[PATTY_AX25_APRS_IS_PAYLOAD_MAX]; info[PATTY_AX25_APRS_IS_PAYLOAD_MAX];
patty_ax25_frame frame; patty_ax25_frame frame;
@ -34,7 +34,7 @@ struct _patty_ax25_aprs_is {
enum state state; enum state state;
size_t offset_i, size_t offset_i,
offset_station, offset_call,
offset_info; offset_info;
ssize_t readlen, ssize_t readlen,
@ -210,13 +210,13 @@ ssize_t patty_ax25_aprs_is_drain(patty_ax25_aprs_is *aprs,
aprs->state = APRS_IS_BODY; aprs->state = APRS_IS_BODY;
} }
} else if (PATTY_AX25_ADDR_CHAR_VALID(c)) { } else if (PATTY_AX25_ADDR_CHAR_VALID(c)) {
if (aprs->offset_station == PATTY_AX25_ADDRSTRLEN) { if (aprs->offset_call == PATTY_AX25_ADDRSTRLEN) {
errno = EOVERFLOW; errno = EOVERFLOW;
goto error; goto error;
} }
aprs->station[aprs->offset_station++] = c; aprs->call[aprs->offset_call++] = c;
} else { } else {
errno = EINVAL; errno = EINVAL;
@ -224,15 +224,15 @@ ssize_t patty_ax25_aprs_is_drain(patty_ax25_aprs_is *aprs,
} }
if (addr) { if (addr) {
aprs->station[aprs->offset_station] = '\0'; aprs->call[aprs->offset_call] = '\0';
if (patty_ax25_pton(aprs->station, addr) < 0) { if (patty_ax25_pton(aprs->call, addr) < 0) {
(void)patty_ax25_aprs_is_flush(aprs); (void)patty_ax25_aprs_is_flush(aprs);
goto done; goto done;
} }
aprs->offset_station = 0; aprs->offset_call = 0;
} }
break; break;
@ -301,7 +301,7 @@ ssize_t patty_ax25_aprs_is_flush(patty_ax25_aprs_is *aprs) {
aprs->state = APRS_IS_HEADER; aprs->state = APRS_IS_HEADER;
aprs->offset_i = aprs->readlen; aprs->offset_i = aprs->readlen;
aprs->offset_station = 0; aprs->offset_call = 0;
aprs->offset_info = 0; aprs->offset_info = 0;
aprs->encoded = 0; aprs->encoded = 0;
@ -321,7 +321,7 @@ ssize_t patty_ax25_aprs_is_send(patty_ax25_aprs_is *aprs,
int formatted, int formatted,
i; i;
char station[PATTY_AX25_ADDRSTRLEN+1]; char call[PATTY_AX25_ADDRSTRLEN+1];
if ((decoded = patty_ax25_frame_decode_address(&frame, buf, len)) < 0) { if ((decoded = patty_ax25_frame_decode_address(&frame, buf, len)) < 0) {
goto error; goto error;
@ -339,27 +339,27 @@ ssize_t patty_ax25_aprs_is_send(patty_ax25_aprs_is *aprs,
return 0; return 0;
} }
if (patty_ax25_ntop(&frame.src, station, sizeof(station)) < 0) { if (patty_ax25_ntop(&frame.src, call, sizeof(call)) < 0) {
goto error; goto error;
} }
if ((formatted = snprintf(aprs->tx_buf, if ((formatted = snprintf(aprs->tx_buf,
aprs->tx_bufsz, aprs->tx_bufsz,
"%s>", "%s>",
station)) < 0) { call)) < 0) {
goto error; goto error;
} else { } else {
offset += formatted; offset += formatted;
} }
if (patty_ax25_ntop(&frame.dest, station, sizeof(station)) < 0) { if (patty_ax25_ntop(&frame.dest, call, sizeof(call)) < 0) {
goto error; goto error;
} }
if ((formatted = snprintf(aprs->tx_buf + offset, if ((formatted = snprintf(aprs->tx_buf + offset,
aprs->tx_bufsz - offset, aprs->tx_bufsz - offset,
"%s", "%s",
station)) < 0) { call)) < 0) {
goto error; goto error;
} else { } else {
offset += formatted; offset += formatted;
@ -367,15 +367,15 @@ ssize_t patty_ax25_aprs_is_send(patty_ax25_aprs_is *aprs,
for (i=0; i<frame.hops; i++) { for (i=0; i<frame.hops; i++) {
if (patty_ax25_ntop(&frame.repeaters[i], if (patty_ax25_ntop(&frame.repeaters[i],
station, call,
sizeof(station)) < 0) { sizeof(call)) < 0) {
goto error; goto error;
} }
if ((formatted = snprintf(aprs->tx_buf + offset, if ((formatted = snprintf(aprs->tx_buf + offset,
aprs->tx_bufsz - offset, aprs->tx_bufsz - offset,
",%s", ",%s",
station)) < 0) { call)) < 0) {
goto error; goto error;
} else { } else {
offset += formatted; offset += formatted;