![]() |
netmsgs
1.2.2
RoadNarrows Robotics Network Messaging Package
|
Internal intra-library declarations. More...
#include <stdio.h>#include <ctype.h>#include "rnr/rnrconfig.h"#include "rnr/log.h"#include "rnr/netmsgs.h"Go to the source code of this file.
Classes | |
| struct | NMCtl_T |
| Internal Control Structure. More... | |
| struct | NMLookupTblEntry_T |
Macros | |
| #define | NMLIB_DEBUG(fmt, ...) |
| Print debugging info. Undef in release version. See Makefile. More... | |
| #define | NMLIB_WARNING(fmt, ...) LOGDIAG1("Warning: " fmt, ##__VA_ARGS__) |
| Log libnetmsgs warning. More... | |
| #define | NMLIB_FIELD_WARNING(p, fmt, ...) |
| Log libnetmsgs field warning. More... | |
| #define | NMLIB_ERROR(ecode, fmt, ...) |
| Log libnetmsgs error. More... | |
| #define | NMLIB_RAISE_ERROR(ecode, fmt, ...) |
| Raise libnetmsgs error (i.e. return from calling function). More... | |
| #define | NMLIB_FIELD_ERROR(ecode, p, fmt, ...) |
| Log libnetmsgs field error. More... | |
| #define | NMLIB_RAISE_FIELD_ERROR(ecode, p, fmt, ...) |
| Raise libnetmsgs field error (i.e. return from calling function). More... | |
| #define | NMLIB_ASCII_FTYPE(ftype) (isgraph((int)ftype)? ftype: ' ') |
| Printable ASCII Field Type. More... | |
| #define | NMCTL_INIT_DECL {false, false, false, 0} |
| Default Internal control declartion list. | |
| #define | NMLIB_TRACE_FIELD(p, buf, n, ctl, fmt, ...) |
| Trace field. More... | |
Typedefs | |
| typedef int(* | NMPackFunc_T) (const NMFieldDef_T *, void *, byte_t[], size_t, NMEndian_T, NMCtl_T *) |
| typedef int(* | NMUnpackFunc_T) (const NMFieldDef_T *, byte_t[], size_t, void *, NMEndian_T, NMCtl_T *) |
Functions | |
| INLINE_IN_H int | NMHashFType (NMFType_T eFType) |
| Field Type to Index hash function. More... | |
| int | nmSetU8 (const NMFieldDef_T *pFieldDef, void *pValIn, byte_t *pValOut) |
| Helper function to set an unsigned 8-bit integer. More... | |
| int | nmSetS8 (const NMFieldDef_T *pFieldDef, void *pValIn, signed char *pValOut) |
| Helper function to set a signed 8-bit integer. More... | |
| int | nmSetU16 (const NMFieldDef_T *pFieldDef, void *pValIn, ushort_t *pValOut) |
| Helper function to set an unsigned 16-bit integer. More... | |
| int | nmSetS16 (const NMFieldDef_T *pFieldDef, void *pValIn, short *pValOut) |
| Helper function to set a signed 16-bit integer. More... | |
| int | nmSetU32 (const NMFieldDef_T *pFieldDef, void *pValIn, uint_t *pValOut) |
| Helper function to set an unsigned 32-bit integer. More... | |
| int | nmSetS32 (const NMFieldDef_T *pFieldDef, void *pValIn, int *pValOut) |
| Helper function to set a signed 32-bit integer. More... | |
| int | nmSetU64 (const NMFieldDef_T *pFieldDef, void *pValIn, ulonglong_t *pValOut) |
| Helper function to set an unsigned 64-bit integer. More... | |
| int | nmSetS64 (const NMFieldDef_T *pFieldDef, void *pValIn, long long *pValOut) |
| Helper function to set a signed 64-bit integer. More... | |
| int | nmSetF32 (const NMFieldDef_T *pFieldDef, void *pValIn, float *pValOut) |
| Helper function to set a 32-bit floating point number. More... | |
| int | nmSetF64 (const NMFieldDef_T *pFieldDef, void *pValIn, double *pValOut) |
| Helper function to set a 64-bit floating point number. More... | |
Variables | |
| const int | NMHashOffset |
| hash base offset | |
| const int | NMHashNoIdx |
| hash no index value | |
| const byte_t | NMHashTbl [] |
| const size_t | NMHashNumEntries |
Internal intra-library declarations.
Definition in file nmLibInternal.h.
| #define NMLIB_ASCII_FTYPE | ( | ftype | ) | (isgraph((int)ftype)? ftype: ' ') |
Printable ASCII Field Type.
| ftype | Field Id |
Definition at line 166 of file nmLibInternal.h.
Referenced by NMHashFType(), nmLookupFlatPacker(), nmLookupFlatUnpacker(), nmLookupITVPacker(), nmLookupITVUnpacker(), nmPackFlatStream(), nmPackFlatVector(), nmPackITVStream(), nmPackITVVector(), nmUnpackFlatStream(), nmUnpackFlatVector(), nmUnpackITVStream(), and nmUnpackITVVector().
| #define NMLIB_DEBUG | ( | fmt, | |
| ... | |||
| ) |
Print debugging info. Undef in release version. See Makefile.
| fmt | Output format string. |
| ... | Variable arguments. |
Definition at line 71 of file nmLibInternal.h.
| #define NMLIB_ERROR | ( | ecode, | |
| fmt, | |||
| ... | |||
| ) |
Log libnetmsgs error.
| ecode | NetMsgs error code. |
| fmt | Output format string. |
| ... | Variable arguments. |
Definition at line 102 of file nmLibInternal.h.
Referenced by nmLookupFlatPacker(), nmLookupFlatUnpacker(), nmLookupITVPacker(), and nmLookupITVUnpacker().
| #define NMLIB_FIELD_ERROR | ( | ecode, | |
| p, | |||
| fmt, | |||
| ... | |||
| ) |
Log libnetmsgs field error.
Error is logged prior to return.
| ecode | NetMsgs error code. |
| p | Pointer to field definition (may be NULL). |
| fmt | Output format string. |
| ... | Variable arguments. |
Definition at line 130 of file nmLibInternal.h.
| #define NMLIB_FIELD_WARNING | ( | p, | |
| fmt, | |||
| ... | |||
| ) |
Log libnetmsgs field warning.
| p | Pointer to field definition (may be NULL). |
| fmt | Output format string. |
| ... | Variable arguments. |
Definition at line 90 of file nmLibInternal.h.
| #define NMLIB_RAISE_ERROR | ( | ecode, | |
| fmt, | |||
| ... | |||
| ) |
Raise libnetmsgs error (i.e. return from calling function).
| ecode | NetMsgs error code. |
| fmt | Output format string. |
| ... | Variable arguments. |
Definition at line 113 of file nmLibInternal.h.
Referenced by nmPackFlatStream(), nmPackITVMsg(), nmPackITVMsgDebug(), nmPackITVStream(), nmUnpackFlatStream(), nmUnpackITVMsg(), nmUnpackITVMsgDebug(), and nmUnpackITVStream().
| #define NMLIB_RAISE_FIELD_ERROR | ( | ecode, | |
| p, | |||
| fmt, | |||
| ... | |||
| ) |
Raise libnetmsgs field error (i.e. return from calling function).
Error is logged prior to return.
| ecode | NetMsgs error code. |
| p | Pointer to field definition (may be NULL). |
| fmt | Output format string. |
| ... | Variable arguments. |
Definition at line 154 of file nmLibInternal.h.
Referenced by nmPackFlatPad(), nmPackFlatStream(), nmPackFlatString(), nmPackFlatVector(), nmPackITVHdrSimple(), nmPackITVHdrString(), nmPackITVHdrStruct(), nmPackITVHdrVector(), nmPackITVPad(), nmPackITVStream(), nmPackITVString(), nmPackITVVector(), nmUnpackFlatPad(), nmUnpackFlatStream(), nmUnpackFlatString(), nmUnpackFlatVector(), nmUnpackITVBool(), nmUnpackITVF32(), nmUnpackITVF64(), nmUnpackITVNoExec(), nmUnpackITVP32(), nmUnpackITVP64(), nmUnpackITVS16(), nmUnpackITVS32(), nmUnpackITVS64(), nmUnpackITVS8(), nmUnpackITVStream(), nmUnpackITVString(), nmUnpackITVStruct(), nmUnpackITVU16(), nmUnpackITVU32(), nmUnpackITVU64(), nmUnpackITVU8(), and nmUnpackITVVector().
| #define NMLIB_TRACE_FIELD | ( | p, | |
| buf, | |||
| n, | |||
| ctl, | |||
| fmt, | |||
| ... | |||
| ) |
Trace field.
| p | Pointer to field definition (may be NULL). |
| buf | Input/output buffer. |
| n | Number of bytes in buffer to trace. |
| ctl | Internal Control. |
| fmt | Field representation format string. |
| ... | Field representation variable arguments. |
Definition at line 207 of file nmLibInternal.h.
Referenced by nmPackFlatBool(), nmPackFlatF32(), nmPackFlatF64(), nmPackFlatP32(), nmPackFlatP64(), nmPackFlatPad(), nmPackFlatS16(), nmPackFlatS32(), nmPackFlatS64(), nmPackFlatS8(), nmPackFlatString(), nmPackFlatStruct(), nmPackFlatU16(), nmPackFlatU32(), nmPackFlatU64(), nmPackFlatU8(), nmPackFlatVector(), nmPackITVBool(), nmPackITVF32(), nmPackITVF64(), nmPackITVP32(), nmPackITVP64(), nmPackITVPad(), nmPackITVS16(), nmPackITVS32(), nmPackITVS64(), nmPackITVS8(), nmPackITVString(), nmPackITVStruct(), nmPackITVU16(), nmPackITVU32(), nmPackITVU64(), nmPackITVU8(), nmPackITVVector(), nmUnpackFlatBool(), nmUnpackFlatF32(), nmUnpackFlatF64(), nmUnpackFlatP32(), nmUnpackFlatP64(), nmUnpackFlatPad(), nmUnpackFlatS16(), nmUnpackFlatS32(), nmUnpackFlatS64(), nmUnpackFlatS8(), nmUnpackFlatString(), nmUnpackFlatStruct(), nmUnpackFlatU16(), nmUnpackFlatU32(), nmUnpackFlatU64(), nmUnpackFlatU8(), nmUnpackFlatVector(), nmUnpackITVBool(), nmUnpackITVF32(), nmUnpackITVF64(), nmUnpackITVNoExec(), nmUnpackITVP32(), nmUnpackITVP64(), nmUnpackITVPad(), nmUnpackITVS16(), nmUnpackITVS32(), nmUnpackITVS64(), nmUnpackITVS8(), nmUnpackITVString(), nmUnpackITVStruct(), nmUnpackITVU16(), nmUnpackITVU32(), nmUnpackITVU64(), nmUnpackITVU8(), and nmUnpackITVVector().
| #define NMLIB_WARNING | ( | fmt, | |
| ... | |||
| ) | LOGDIAG1("Warning: " fmt, ##__VA_ARGS__) |
Log libnetmsgs warning.
| fmt | Output format string. |
| ... | Variable arguments. |
Definition at line 80 of file nmLibInternal.h.
Referenced by nmPackP32(), nmUnpackF64(), nmUnpackITVStream(), nmUnpackP64(), nmUnpackS64(), and nmUnpackU64().
| typedef int(* NMPackFunc_T) (const NMFieldDef_T *, void *, byte_t[], size_t, NMEndian_T, NMCtl_T *) |
Message Field Packer Function Type
Definition at line 243 of file nmLibInternal.h.
| typedef int(* NMUnpackFunc_T) (const NMFieldDef_T *, byte_t[], size_t, void *, NMEndian_T, NMCtl_T *) |
Message Field Unpacker Function Type
Definition at line 251 of file nmLibInternal.h.
| INLINE_IN_H int NMHashFType | ( | NMFType_T | eFType | ) |
Field Type to Index hash function.
| eFType | Field type. |
Definition at line 225 of file nmLibInternal.h.
References NMHashNoIdx, NMHashNumEntries, NMHashOffset, NMHashTbl, and NMLIB_ASCII_FTYPE.
Referenced by nmGetFieldValSize(), nmLookupFlatPacker(), nmLookupFlatUnpacker(), nmLookupITVPacker(), and nmLookupITVUnpacker().
| int nmSetF32 | ( | const NMFieldDef_T * | pFieldDef, |
| void * | pValIn, | ||
| float * | pValOut | ||
| ) |
Helper function to set a 32-bit floating point number.
| pFieldDef | Pointer to message field definition. | |
| [in] | pValIn | Pointer to field value. |
| [out] | pValOut | Pointer to constrained, assigned field value. |
Definition at line 443 of file nmLibInternal.c.
References _NMCHK_MAX, _NMCHK_MIN, _NMSET_VAL, NMFieldThis_T::m_f32, _nm_field_def_struct::m_sFName, _nm_field_def_struct::m_this, and NM_OK.
Referenced by nmPackFlatF32(), and nmPackITVF32().
| int nmSetF64 | ( | const NMFieldDef_T * | pFieldDef, |
| void * | pValIn, | ||
| double * | pValOut | ||
| ) |
Helper function to set a 64-bit floating point number.
| pFieldDef | Pointer to message field definition. | |
| [in] | pValIn | Pointer to field value. |
| [out] | pValOut | Pointer to constrained, assigned field value. |
Definition at line 474 of file nmLibInternal.c.
References _NMCHK_MAX, _NMCHK_MIN, _NMSET_VAL, NMFieldThis_T::m_f64, _nm_field_def_struct::m_sFName, _nm_field_def_struct::m_this, and NM_OK.
Referenced by nmPackFlatF64(), and nmPackITVF64().
| int nmSetS16 | ( | const NMFieldDef_T * | pFieldDef, |
| void * | pValIn, | ||
| short * | pValOut | ||
| ) |
Helper function to set a signed 16-bit integer.
| pFieldDef | Pointer to message field definition. | |
| [in] | pValIn | Pointer to field value. |
| [out] | pValOut | Pointer to constrained, assigned field value. |
Definition at line 282 of file nmLibInternal.c.
References _NMCHK_MAX, _NMCHK_MIN, _NMSET_VAL, _nm_field_def_struct::m_sFName, _nm_field_def_struct::m_this, NMFieldThis_T::m_u16, and NM_OK.
Referenced by nmPackFlatS16(), and nmPackITVS16().
| int nmSetS32 | ( | const NMFieldDef_T * | pFieldDef, |
| void * | pValIn, | ||
| int * | pValOut | ||
| ) |
Helper function to set a signed 32-bit integer.
| pFieldDef | Pointer to message field definition. | |
| [in] | pValIn | Pointer to field value. |
| [out] | pValOut | Pointer to constrained, assigned field value. |
Definition at line 344 of file nmLibInternal.c.
References _NMCHK_MAX, _NMCHK_MIN, _NMSET_VAL, _nm_field_def_struct::m_sFName, _nm_field_def_struct::m_this, NMFieldThis_T::m_u32, and NM_OK.
Referenced by nmPackFlatS32(), and nmPackITVS32().
| int nmSetS64 | ( | const NMFieldDef_T * | pFieldDef, |
| void * | pValIn, | ||
| long long * | pValOut | ||
| ) |
Helper function to set a signed 64-bit integer.
| pFieldDef | Pointer to message field definition. | |
| [in] | pValIn | Pointer to field value. |
| [out] | pValOut | Pointer to constrained, assigned field value. |
Definition at line 410 of file nmLibInternal.c.
References _NMCHK_MAX, _NMCHK_MIN, _NMSET_VAL, _nm_field_def_struct::m_sFName, _nm_field_def_struct::m_this, NMFieldThis_T::m_u64, and NM_OK.
Referenced by nmPackFlatS64(), and nmPackITVS64().
| int nmSetS8 | ( | const NMFieldDef_T * | pFieldDef, |
| void * | pValIn, | ||
| signed char * | pValOut | ||
| ) |
Helper function to set a signed 8-bit integer.
| pFieldDef | Pointer to message field definition. | |
| [in] | pValIn | Pointer to field value. |
| [out] | pValOut | Pointer to constrained, assigned field value. |
Definition at line 216 of file nmLibInternal.c.
References _NMCHK_MAX, _NMCHK_MIN, _NMSET_VAL, _nm_field_def_struct::m_sFName, _nm_field_def_struct::m_this, NMFieldThis_T::m_u8, and NM_OK.
Referenced by nmPackFlatS8(), and nmPackITVS8().
| int nmSetU16 | ( | const NMFieldDef_T * | pFieldDef, |
| void * | pValIn, | ||
| ushort_t * | pValOut | ||
| ) |
Helper function to set an unsigned 16-bit integer.
| pFieldDef | Pointer to message field definition. | |
| [in] | pValIn | Pointer to field value. |
| [out] | pValOut | Pointer to constrained, assigned field value. |
Definition at line 249 of file nmLibInternal.c.
References _NMCHK_MAX, _NMCHK_MIN, _NMSET_VAL, _nm_field_def_struct::m_sFName, _nm_field_def_struct::m_this, NMFieldThis_T::m_u16, and NM_OK.
Referenced by nmPackFlatU16(), and nmPackITVU16().
| int nmSetU32 | ( | const NMFieldDef_T * | pFieldDef, |
| void * | pValIn, | ||
| uint_t * | pValOut | ||
| ) |
Helper function to set an unsigned 32-bit integer.
| pFieldDef | Pointer to message field definition. | |
| [in] | pValIn | Pointer to field value. |
| [out] | pValOut | Pointer to constrained, assigned field value. |
Definition at line 313 of file nmLibInternal.c.
References _NMCHK_MAX, _NMCHK_MIN, _NMSET_VAL, _nm_field_def_struct::m_sFName, _nm_field_def_struct::m_this, NMFieldThis_T::m_u32, and NM_OK.
Referenced by nmPackFlatU32(), and nmPackITVU32().
| int nmSetU64 | ( | const NMFieldDef_T * | pFieldDef, |
| void * | pValIn, | ||
| ulonglong_t * | pValOut | ||
| ) |
Helper function to set an unsigned 64-bit integer.
| pFieldDef | Pointer to message field definition. | |
| [in] | pValIn | Pointer to field value. |
| [out] | pValOut | Pointer to constrained, assigned field value. |
Definition at line 375 of file nmLibInternal.c.
References _NMCHK_MAX, _NMCHK_MIN, _NMSET_VAL, _nm_field_def_struct::m_sFName, _nm_field_def_struct::m_this, NMFieldThis_T::m_u64, and NM_OK.
Referenced by nmPackFlatU64(), and nmPackITVU64().
| int nmSetU8 | ( | const NMFieldDef_T * | pFieldDef, |
| void * | pValIn, | ||
| byte_t * | pValOut | ||
| ) |
Helper function to set an unsigned 8-bit integer.
| pFieldDef | Pointer to message field definition. | |
| [in] | pValIn | Pointer to field value. |
| [out] | pValOut | Pointer to constrained, assigned field value. |
Definition at line 182 of file nmLibInternal.c.
References _NMCHK_MAX, _NMCHK_MIN, _NMSET_VAL, _nm_field_def_struct::m_sFName, _nm_field_def_struct::m_this, NMFieldThis_T::m_u8, and NM_OK.
Referenced by nmPackFlatU8(), and nmPackITVU8().
| const size_t NMHashNumEntries |
| const byte_t NMHashTbl[] |
Field Type Hash Table.
Maps field type to zero base index.
Definition at line 140 of file nmLibInternal.c.
Referenced by NMHashFType().