diff options
Diffstat (limited to 'src/packet.c')
-rw-r--r-- | src/packet.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/packet.c b/src/packet.c index 0f966d9a..304545c5 100644 --- a/src/packet.c +++ b/src/packet.c @@ -3,44 +3,44 @@ #include "packet.h" -struct packet* packet_new(size_t length) { - struct packet *p; +struct pa_packet* pa_packet_new(size_t length) { + struct pa_packet *p; assert(length); - p = malloc(sizeof(struct packet)+length); + p = malloc(sizeof(struct pa_packet)+length); assert(p); p->ref = 1; p->length = length; p->data = (uint8_t*) (p+1); - p->type = PACKET_APPENDED; + p->type = PA_PACKET_APPENDED; return p; } -struct packet* packet_new_dynamic(uint8_t* data, size_t length) { - struct packet *p; +struct pa_packet* pa_packet_new_dynamic(uint8_t* data, size_t length) { + struct pa_packet *p; assert(data && length); - p = malloc(sizeof(struct packet)); + p = malloc(sizeof(struct pa_packet)); assert(p); p->ref = 1; p->length = length; p->data = data; - p->type = PACKET_DYNAMIC; + p->type = PA_PACKET_DYNAMIC; return p; } -struct packet* packet_ref(struct packet *p) { +struct pa_packet* pa_packet_ref(struct pa_packet *p) { assert(p && p->ref >= 1); p->ref++; return p; } -void packet_unref(struct packet *p) { +void pa_packet_unref(struct pa_packet *p) { assert(p && p->ref >= 1); p->ref--; if (p->ref == 0) { - if (p->type == PACKET_DYNAMIC) + if (p->type == PA_PACKET_DYNAMIC) free(p->data); free(p); } |