tag16.h File Reference
`#include <gwenhywfar/buffer.h>`
`#include <gwenhywfar/misc.h>`

Go to the source code of this file.

## Typedefs

typedef struct GWEN_TAG16 | GWEN_TAG16

## Functions

GWENHYWFAR_API void | GWEN_Tag16_DirectlyToBuffer (unsigned int tagType, const char *p, int size, GWEN_BUFFER *buf)
GWENHYWFAR_API int | GWEN_Tag16_EndTagInBuffer (int startPos, GWEN_BUFFER *buf)
GWENHYWFAR_API void | GWEN_Tag16_free (GWEN_TAG16 *tag)
GWENHYWFAR_API GWEN_TAG16 * | GWEN_Tag16_fromBuffer (GWEN_BUFFER *mbuf, int isBerTlv)
GWENHYWFAR_API GWEN_TAG16 * | GWEN_Tag16_fromBuffer2 (const uint8_t *p, uint32_t l, int doCopy)
GWENHYWFAR_API const void * | GWEN_Tag16_GetTagData (const GWEN_TAG16 *tag)
GWENHYWFAR_API double | GWEN_Tag16_GetTagDataAsDouble (const GWEN_TAG16 *tag, double defaultValue)
GWENHYWFAR_API char * | GWEN_Tag16_GetTagDataAsNewString (const GWEN_TAG16 *tag, const char *defaultValue)
GWENHYWFAR_API uint16_t | GWEN_Tag16_GetTagDataAsUint16 (const GWEN_TAG16 *tag, uint16_t defaultValue)
GWENHYWFAR_API uint32_t | GWEN_Tag16_GetTagDataAsUint32 (const GWEN_TAG16 *tag, uint32_t defaultValue)
GWENHYWFAR_API uint64_t | GWEN_Tag16_GetTagDataAsUint64 (const GWEN_TAG16 *tag, uint64_t defaultValue)
GWENHYWFAR_API uint8_t | GWEN_Tag16_GetTagDataAsUint8 (const GWEN_TAG16 *tag, uint8_t defaultValue)
GWENHYWFAR_API unsigned int | GWEN_Tag16_GetTagLength (const GWEN_TAG16 *tag)
GWENHYWFAR_API unsigned int | GWEN_Tag16_GetTagSize (const GWEN_TAG16 *tag)
GWENHYWFAR_API unsigned int | GWEN_Tag16_GetTagType (const GWEN_TAG16 *tag)
GWENHYWFAR_API const GWEN_TAG16 * | GWEN_Tag16_List_FindFirstByTagType (const GWEN_TAG16_LIST *tagList, unsigned int tagType)
GWENHYWFAR_API const GWEN_TAG16 * | GWEN_Tag16_List_FindNextByTagType (const GWEN_TAG16 *tag, unsigned int tagType)
GWENHYWFAR_API GWEN_TAG16_LIST * | GWEN_Tag16_List_fromBuffer (const uint8_t *p, uint32_t l, int doCopy)
GWENHYWFAR_API GWEN_TAG16 * | GWEN_Tag16_new (void)
GWENHYWFAR_API GWEN_TAG16 * | GWEN_Tag16_newCopy (unsigned int tagType, unsigned int tagLength, const uint8_t *tagData)
GWENHYWFAR_API GWEN_TAG16 * | GWEN_Tag16_newNoCopy (unsigned int tagType, unsigned int tagLength, const uint8_t *tagData)
GWENHYWFAR_API int | GWEN_Tag16_StartTagInBuffer (unsigned int tagType, GWEN_BUFFER *buf)
GWENHYWFAR_API void | GWEN_Tag16_WriteDoubleTagToBuffer (unsigned int tagType, double data, GWEN_BUFFER *buf)
GWENHYWFAR_API void | GWEN_Tag16_WriteStringTagToBuffer (unsigned int tagType, const char *s, GWEN_BUFFER *buf)
GWENHYWFAR_API void | GWEN_Tag16_WriteTagToBuffer (unsigned int tagType, const uint8_t *s, int size, GWEN_BUFFER *buf)
GWENHYWFAR_API void | GWEN_Tag16_WriteUint16TagToBuffer (unsigned int tagType, uint16_t data, GWEN_BUFFER *buf)
GWENHYWFAR_API void | GWEN_Tag16_WriteUint32TagToBuffer (unsigned int tagType, uint32_t data, GWEN_BUFFER *buf)
GWENHYWFAR_API void | GWEN_Tag16_WriteUint64TagToBuffer (unsigned int tagType, uint64_t data, GWEN_BUFFER *buf)
GWENHYWFAR_API void | GWEN_Tag16_WriteUint8TagToBuffer (unsigned int tagType, uint8_t data, GWEN_BUFFER *buf)

## Typedef Documentation

## GWEN_TAG16

typedef struct GWEN_TAG16 GWEN_TAG16

Definition at line 35 of file tag16.h.

## Function Documentation

## GWEN_Tag16_DirectlyToBuffer()

GWENHYWFAR_API void GWEN_Tag16_DirectlyToBuffer | ( | unsigned int | tagType,
|  | const char * | p,
|  | int | size,
|  | GWEN_BUFFER * | buf )

References GWEN_Tag16_DirectlyToBuffer(), and GWENHYWFAR_API.

Referenced by GWEN_Tag16_DirectlyToBuffer().

## GWEN_Tag16_EndTagInBuffer()

GWENHYWFAR_API int GWEN_Tag16_EndTagInBuffer | ( | int | startPos,
|  | GWEN_BUFFER * | buf )

Use this to finish a tag16 structure in buffer you started with GWEN_Tag16_StartTagInBuffer.

Internally this function adjusts the size element of the tag16 object in the buffer.

Returns
  0 if okay, <0 on error

Parameters

  startPos | value returned by GWEN_Tag16_StartTagInBuffer (i.e. start of the tag in buffer)
  buf | buffer to write into

References GWEN_Tag16_EndTagInBuffer(), and GWENHYWFAR_API.

Referenced by GWEN_Tag16_EndTagInBuffer().

## GWEN_Tag16_free()

GWENHYWFAR_API void GWEN_Tag16_free | ( | GWEN_TAG16 * | tag | ) |

References GWEN_Tag16_free(), and GWENHYWFAR_API.

Referenced by GWEN_Tag16_free().

## GWEN_Tag16_fromBuffer()

GWENHYWFAR_API GWEN_TAG16 * GWEN_Tag16_fromBuffer | ( | GWEN_BUFFER * | mbuf,
|  | int | isBerTlv )

References GWEN_Tag16_fromBuffer(), and GWENHYWFAR_API.

Referenced by GWEN_Tag16_fromBuffer().

## GWEN_Tag16_fromBuffer2()

GWENHYWFAR_API GWEN_TAG16 * GWEN_Tag16_fromBuffer2 | ( | const uint8_t * | p,
|  | uint32_t | l,
|  | int | doCopy )

References GWEN_Tag16_fromBuffer2(), and GWENHYWFAR_API.

Referenced by GWEN_Tag16_fromBuffer2().

## GWEN_Tag16_GetTagData()

GWENHYWFAR_API const void * GWEN_Tag16_GetTagData | ( | const GWEN_TAG16 * | tag | ) |

References GWEN_Tag16_GetTagData(), and GWENHYWFAR_API.

Referenced by GWEN_Tag16_GetTagData().

## GWEN_Tag16_GetTagDataAsDouble()

GWENHYWFAR_API double GWEN_Tag16_GetTagDataAsDouble | ( | const GWEN_TAG16 * | tag,
|  | double | defaultValue )

References GWEN_Tag16_GetTagDataAsDouble(), and GWENHYWFAR_API.

Referenced by GWEN_Tag16_GetTagDataAsDouble().

## GWEN_Tag16_GetTagDataAsNewString()

GWENHYWFAR_API char * GWEN_Tag16_GetTagDataAsNewString | ( | const GWEN_TAG16 * | tag,
|  | const char * | defaultValue )

References GWEN_Tag16_GetTagDataAsNewString(), and GWENHYWFAR_API.

Referenced by GWEN_Tag16_GetTagDataAsNewString().

## GWEN_Tag16_GetTagDataAsUint16()

GWENHYWFAR_API uint16_t GWEN_Tag16_GetTagDataAsUint16 | ( | const GWEN_TAG16 * | tag,
|  | uint16_t | defaultValue )

References GWEN_Tag16_GetTagDataAsUint16(), and GWENHYWFAR_API.

Referenced by GWEN_Tag16_GetTagDataAsUint16().

## GWEN_Tag16_GetTagDataAsUint32()

GWENHYWFAR_API uint32_t GWEN_Tag16_GetTagDataAsUint32 | ( | const GWEN_TAG16 * | tag,
|  | uint32_t | defaultValue )

References GWEN_Tag16_GetTagDataAsUint32(), and GWENHYWFAR_API.

Referenced by GWEN_Tag16_GetTagDataAsUint32().

## GWEN_Tag16_GetTagDataAsUint64()

GWENHYWFAR_API uint64_t GWEN_Tag16_GetTagDataAsUint64 | ( | const GWEN_TAG16 * | tag,
|  | uint64_t | defaultValue )

References GWEN_Tag16_GetTagDataAsUint64(), and GWENHYWFAR_API.

Referenced by GWEN_Tag16_GetTagDataAsUint64().

## GWEN_Tag16_GetTagDataAsUint8()

GWENHYWFAR_API uint8_t GWEN_Tag16_GetTagDataAsUint8 | ( | const GWEN_TAG16 * | tag,
|  | uint8_t | defaultValue )

References GWEN_Tag16_GetTagDataAsUint8(), and GWENHYWFAR_API.

Referenced by GWEN_Tag16_GetTagDataAsUint8().

## GWEN_Tag16_GetTagLength()

GWENHYWFAR_API unsigned int GWEN_Tag16_GetTagLength | ( | const GWEN_TAG16 * | tag | ) |

References GWEN_Tag16_GetTagLength(), and GWENHYWFAR_API.

Referenced by GWEN_Tag16_GetTagLength().

## GWEN_Tag16_GetTagSize()

GWENHYWFAR_API unsigned int GWEN_Tag16_GetTagSize | ( | const GWEN_TAG16 * | tag | ) |

Return the full size of the complete tag including type, length and data fields.

References GWEN_Tag16_GetTagSize(), and GWENHYWFAR_API.

Referenced by GWEN_Tag16_GetTagSize().

## GWEN_Tag16_GetTagType()

GWENHYWFAR_API unsigned int GWEN_Tag16_GetTagType | ( | const GWEN_TAG16 * | tag | ) |

References GWEN_Tag16_GetTagType(), and GWENHYWFAR_API.

Referenced by GWEN_Tag16_GetTagType().

## GWEN_Tag16_List_FindFirstByTagType()

GWENHYWFAR_API const GWEN_TAG16 * GWEN_Tag16_List_FindFirstByTagType | ( | const GWEN_TAG16_LIST * | tagList,
|  | unsigned int | tagType )

References GWEN_Tag16_List_FindFirstByTagType(), and GWENHYWFAR_API.

Referenced by GWEN_Tag16_List_FindFirstByTagType().

## GWEN_Tag16_List_FindNextByTagType()

GWENHYWFAR_API const GWEN_TAG16 * GWEN_Tag16_List_FindNextByTagType | ( | const GWEN_TAG16 * | tag,
|  | unsigned int | tagType )

References GWEN_Tag16_List_FindNextByTagType(), and GWENHYWFAR_API.

Referenced by GWEN_Tag16_List_FindNextByTagType().

## GWEN_Tag16_List_fromBuffer()

GWENHYWFAR_API GWEN_TAG16_LIST * GWEN_Tag16_List_fromBuffer | ( | const uint8_t * | p,
|  | uint32_t | l,
|  | int | doCopy )

References GWEN_Tag16_List_fromBuffer(), and GWENHYWFAR_API.

Referenced by GWEN_Tag16_List_fromBuffer().

## GWEN_Tag16_new()

GWENHYWFAR_API GWEN_TAG16 * GWEN_Tag16_new | ( | void |  | ) |

References GWEN_Tag16_new(), and GWENHYWFAR_API.

Referenced by GWEN_Tag16_new().

## GWEN_Tag16_newCopy()

GWENHYWFAR_API GWEN_TAG16 * GWEN_Tag16_newCopy | ( | unsigned int | tagType,
|  | unsigned int | tagLength,
|  | const uint8_t * | tagData )

References GWEN_Tag16_newCopy(), and GWENHYWFAR_API.

Referenced by GWEN_Tag16_newCopy().

## GWEN_Tag16_newNoCopy()

GWENHYWFAR_API GWEN_TAG16 * GWEN_Tag16_newNoCopy | ( | unsigned int | tagType,
|  | unsigned int | tagLength,
|  | const uint8_t * | tagData )

References GWEN_Tag16_newNoCopy(), and GWENHYWFAR_API.

Referenced by GWEN_Tag16_newNoCopy().

## GWEN_Tag16_StartTagInBuffer()

GWENHYWFAR_API int GWEN_Tag16_StartTagInBuffer | ( | unsigned int | tagType,
|  | GWEN_BUFFER * | buf )

Use this function together with GWEN_Tag16_EndTagInBuffer to create complex tags in a buffer. This can be used to cascade tags into a buffer.

Internally this function writes the begin of a TAG16 structure into buffer. After that you can add as many bytes as you like. Finally call GWEN_Tag16_EndTagInBuffer to finish the tag by correcting the size element of the tag16 in the buffer.

Returns
  start position of the newly created tag in buffer (<0 on error)

Parameters

  tagType | 8-bit type code/name/id of the tag (meaning of this code is up to the caller)
  buf | buffer to write into

References GWEN_Tag16_StartTagInBuffer(), and GWENHYWFAR_API.

Referenced by GWEN_Tag16_StartTagInBuffer().

## GWEN_Tag16_WriteDoubleTagToBuffer()

GWENHYWFAR_API void GWEN_Tag16_WriteDoubleTagToBuffer | ( | unsigned int | tagType,
|  | double | data,
|  | GWEN_BUFFER * | buf )

References GWEN_Tag16_WriteDoubleTagToBuffer(), and GWENHYWFAR_API.

Referenced by GWEN_Tag16_WriteDoubleTagToBuffer().

## GWEN_Tag16_WriteStringTagToBuffer()

GWENHYWFAR_API void GWEN_Tag16_WriteStringTagToBuffer | ( | unsigned int | tagType,
|  | const char * | s,
|  | GWEN_BUFFER * | buf )

References GWEN_Tag16_WriteStringTagToBuffer(), and GWENHYWFAR_API.

Referenced by GWEN_Tag16_WriteStringTagToBuffer().

## GWEN_Tag16_WriteTagToBuffer()

GWENHYWFAR_API void GWEN_Tag16_WriteTagToBuffer | ( | unsigned int | tagType,
|  | const uint8_t * | s,
|  | int | size,
|  | GWEN_BUFFER * | buf )

References GWEN_Tag16_WriteTagToBuffer(), and GWENHYWFAR_API.

Referenced by GWEN_Tag16_WriteTagToBuffer().

## GWEN_Tag16_WriteUint16TagToBuffer()

GWENHYWFAR_API void GWEN_Tag16_WriteUint16TagToBuffer | ( | unsigned int | tagType,
|  | uint16_t | data,
|  | GWEN_BUFFER * | buf )

References GWEN_Tag16_WriteUint16TagToBuffer(), and GWENHYWFAR_API.

Referenced by GWEN_Tag16_WriteUint16TagToBuffer().

## GWEN_Tag16_WriteUint32TagToBuffer()

GWENHYWFAR_API void GWEN_Tag16_WriteUint32TagToBuffer | ( | unsigned int | tagType,
|  | uint32_t | data,
|  | GWEN_BUFFER * | buf )

References GWEN_Tag16_WriteUint32TagToBuffer(), and GWENHYWFAR_API.

Referenced by GWEN_Tag16_WriteUint32TagToBuffer().

## GWEN_Tag16_WriteUint64TagToBuffer()

GWENHYWFAR_API void GWEN_Tag16_WriteUint64TagToBuffer | ( | unsigned int | tagType,
|  | uint64_t | data,
|  | GWEN_BUFFER * | buf )

References GWEN_Tag16_WriteUint64TagToBuffer(), and GWENHYWFAR_API.

Referenced by GWEN_Tag16_WriteUint64TagToBuffer().

## GWEN_Tag16_WriteUint8TagToBuffer()

GWENHYWFAR_API void GWEN_Tag16_WriteUint8TagToBuffer | ( | unsigned int | tagType,
|  | uint8_t | data,
|  | GWEN_BUFFER * | buf )

References GWEN_Tag16_WriteUint8TagToBuffer(), and GWENHYWFAR_API.

Referenced by GWEN_Tag16_WriteUint8TagToBuffer().