--- libelwix/inc/elwix/apack.h 2015/06/25 17:53:49 1.10 +++ libelwix/inc/elwix/apack.h 2025/08/21 15:40:07 1.11.28.1 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: apack.h,v 1.10 2015/06/25 17:53:49 misho Exp $ +* $Id: apack.h,v 1.11.28.1 2025/08/21 15:40:07 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -12,7 +12,7 @@ terms: All of the documentation and software included in the ELWIX and AITNET Releases is copyrighted by ELWIX - Sofia/Bulgaria -Copyright 2004 - 2015 +Copyright 2004 - 2024 by Michael Pounov . All rights reserved. Redistribution and use in source and binary forms, with or without @@ -68,6 +68,7 @@ typedef struct tagRawPacket { #define RPACK_OFF(x) (assert((x)), (x)->r_next - (x)->r_buf) #define RPACK_REMAIN(x) (assert((x)), (x)->r_len - ((x)->r_next - (x)->r_buf)) #define RPACK_ISEND(x) (assert((x)), (size_t) ((x)->r_next - (x)->r_buf) >= (x)->r_len) +#define RPACK_WHEREAMI(x, nx) (assert((x)), (size_t) (((uint8_t*)(nx)) - (x)->r_buf)) #define RPACK_SET_16(x, n) do { assert((x)); \ *((uint8_t *) (x) + 1) = *((const uint8_t *) (n) + 1); \ @@ -150,6 +151,10 @@ typedef struct tagRawPacket { )) +#ifdef __cplusplus +extern "C" { +#endif + /* * rpack_align_and_reserve() - Align & reserve space * @@ -316,5 +321,8 @@ void *rpack_data(rpack_t * __restrict rp, void * __res */ void *rpack_rdata(rpack_t * __restrict rp, void * __restrict dat, size_t datlen); +#ifdef __cplusplus +} +#endif #endif