Rename struct members, variables
Rename struct members, variables for better visual appeal
This commit is contained in:
parent
70d112eb91
commit
c98d07e876
1 changed files with 20 additions and 20 deletions
|
@ -22,7 +22,7 @@ struct _patty_ax25_aprs_is {
|
|||
|
||||
char rx_buf[PATTY_AX25_APRS_IS_PACKET_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];
|
||||
|
||||
patty_ax25_frame frame;
|
||||
|
@ -34,7 +34,7 @@ struct _patty_ax25_aprs_is {
|
|||
enum state state;
|
||||
|
||||
size_t offset_i,
|
||||
offset_station,
|
||||
offset_call,
|
||||
offset_info;
|
||||
|
||||
ssize_t readlen,
|
||||
|
@ -210,13 +210,13 @@ ssize_t patty_ax25_aprs_is_drain(patty_ax25_aprs_is *aprs,
|
|||
aprs->state = APRS_IS_BODY;
|
||||
}
|
||||
} else if (PATTY_AX25_ADDR_CHAR_VALID(c)) {
|
||||
if (aprs->offset_station == PATTY_AX25_ADDRSTRLEN) {
|
||||
if (aprs->offset_call == PATTY_AX25_ADDRSTRLEN) {
|
||||
errno = EOVERFLOW;
|
||||
|
||||
goto error;
|
||||
}
|
||||
|
||||
aprs->station[aprs->offset_station++] = c;
|
||||
aprs->call[aprs->offset_call++] = c;
|
||||
} else {
|
||||
errno = EINVAL;
|
||||
|
||||
|
@ -224,15 +224,15 @@ ssize_t patty_ax25_aprs_is_drain(patty_ax25_aprs_is *aprs,
|
|||
}
|
||||
|
||||
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);
|
||||
|
||||
goto done;
|
||||
}
|
||||
|
||||
aprs->offset_station = 0;
|
||||
aprs->offset_call = 0;
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -299,11 +299,11 @@ int patty_ax25_aprs_is_ready(patty_ax25_aprs_is *aprs) {
|
|||
ssize_t patty_ax25_aprs_is_flush(patty_ax25_aprs_is *aprs) {
|
||||
ssize_t ret = aprs->encoded;
|
||||
|
||||
aprs->state = APRS_IS_HEADER;
|
||||
aprs->offset_i = aprs->readlen;
|
||||
aprs->offset_station = 0;
|
||||
aprs->offset_info = 0;
|
||||
aprs->encoded = 0;
|
||||
aprs->state = APRS_IS_HEADER;
|
||||
aprs->offset_i = aprs->readlen;
|
||||
aprs->offset_call = 0;
|
||||
aprs->offset_info = 0;
|
||||
aprs->encoded = 0;
|
||||
|
||||
memset(&aprs->frame, '\0', sizeof(aprs->frame));
|
||||
|
||||
|
@ -321,7 +321,7 @@ ssize_t patty_ax25_aprs_is_send(patty_ax25_aprs_is *aprs,
|
|||
int formatted,
|
||||
i;
|
||||
|
||||
char station[PATTY_AX25_ADDRSTRLEN+1];
|
||||
char call[PATTY_AX25_ADDRSTRLEN+1];
|
||||
|
||||
if ((decoded = patty_ax25_frame_decode_address(&frame, buf, len)) < 0) {
|
||||
goto error;
|
||||
|
@ -339,27 +339,27 @@ ssize_t patty_ax25_aprs_is_send(patty_ax25_aprs_is *aprs,
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (patty_ax25_ntop(&frame.src, station, sizeof(station)) < 0) {
|
||||
if (patty_ax25_ntop(&frame.src, call, sizeof(call)) < 0) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
if ((formatted = snprintf(aprs->tx_buf,
|
||||
aprs->tx_bufsz,
|
||||
"%s>",
|
||||
station)) < 0) {
|
||||
call)) < 0) {
|
||||
goto error;
|
||||
} else {
|
||||
offset += formatted;
|
||||
}
|
||||
|
||||
if (patty_ax25_ntop(&frame.dest, station, sizeof(station)) < 0) {
|
||||
if (patty_ax25_ntop(&frame.dest, call, sizeof(call)) < 0) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
if ((formatted = snprintf(aprs->tx_buf + offset,
|
||||
aprs->tx_bufsz - offset,
|
||||
"%s",
|
||||
station)) < 0) {
|
||||
call)) < 0) {
|
||||
goto error;
|
||||
} else {
|
||||
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++) {
|
||||
if (patty_ax25_ntop(&frame.repeaters[i],
|
||||
station,
|
||||
sizeof(station)) < 0) {
|
||||
call,
|
||||
sizeof(call)) < 0) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
if ((formatted = snprintf(aprs->tx_buf + offset,
|
||||
aprs->tx_bufsz - offset,
|
||||
",%s",
|
||||
station)) < 0) {
|
||||
call)) < 0) {
|
||||
goto error;
|
||||
} else {
|
||||
offset += formatted;
|
||||
|
|
Loading…
Add table
Reference in a new issue