UM C API  6.12.1
lbmpdm.h
Go to the documentation of this file.
1 
373 #ifndef _LBMPDM_H_
374 #define _LBMPDM_H_
375 
376 #if defined(__cplusplus)
377 extern "C" {
378 #endif
379 
380 #if HAVE_STDINT_H
381  #include <stdint.h>
382 #endif
383 #include <stdlib.h>
384 
385 /* Directives to show how we treat exporting functions with Windows from the DLL */
386 #if defined(_WIN32)
387  #if defined(_DLL) && defined(LBM_EXPORT_SYMS)
388  #define LBMPDMExpDLL __declspec(dllexport)
389  #elif defined(LBM_STATIC_LIB)
390  #define LBMPDMExpDLL
391  #else
392  #define LBMPDMExpDLL __declspec(dllimport)
393  #endif
394 #elif defined(__TANDEM)
395  #if defined(LBM_EXPORT_SYMS)
396  #define LBMPDMExpDLL export$
397  #else
398  #define LBMPDMExpDLL import$
399  #endif
400 #else
401  #define LBMPDMExpDLL
402 #endif
403 
404 #if defined(_WIN32)
405 #if !defined(DONT_TYPEDEF_INT_T)
406  typedef __int8 int8_t;
407  typedef __int16 int16_t;
408  typedef __int32 int32_t;
409  typedef __int64 int64_t;
410 
411  typedef unsigned __int8 uint8_t;
412  typedef unsigned __int16 uint16_t;
413  typedef unsigned __int32 uint32_t;
414  typedef unsigned __int64 uint64_t;
415 #endif
416  /* C99 printf format macros missing from VC. */
417  #define PRId8 "d"
418  #define PRId16 "d"
419  #define PRId32 "d"
420  #define PRId64 "I64d"
421  #define PRIu8 "u"
422  #define PRIu16 "u"
423  #define PRIu32 "u"
424  #define PRIu64 "I64u"
425  #define PRIx8 "x"
426  #define PRIx16 "x"
427  #define PRIx32 "x"
428  #define PRIx64 "I64x"
429  #define PRIuSZ "Iu"
430  /* C99 scanf format macros missing from VC. */
431  #define SCNd8 "d"
432  #define SCNd16 "hd"
433  #define SCNd32 "ld"
434  #define SCNd64 "I64d"
435  #define SCNu8 "u"
436  #define SCNu16 "hu"
437  #define SCNu32 "lu"
438  #define SCNu64 "I64u"
439  #define SCNx64 "I64x"
440  #define SCNuSZ "Iu"
441 #elif defined(__VMS)
442  #include <inttypes.h>
443  /* C99 printf format macros missing from OpenVMS. */
444  #define PRId8 "d"
445  #define PRId16 "d"
446  #define PRId32 "d"
447  #define PRId64 "lld"
448  #define PRIu8 "u"
449  #define PRIu16 "u"
450  #define PRIu32 "u"
451  #define PRIu64 "llu"
452  #define PRIuSZ "zu"
453  /* C99 scanf format macros missing from OpenVMS. */
454  #define SCNd8 "hhd"
455  #define SCNd16 "hd"
456  #define SCNd32 "d"
457  #define SCNd64 "lld"
458  #define SCNu8 "hhu"
459  #define SCNu16 "hu"
460  #define SCNu32 "u"
461  #define SCNu64 "llu"
462  #define SCNuSZ "zu"
463 #else
464  #include <inttypes.h>
465  #ifndef PRIuSZ
466  #define PRIuSZ "zu"
467  #endif
468  #ifndef SCNuSZ
469  #define SCNuSZ "zu"
470  #endif
471 #endif
472 
479 typedef int32_t lbmpdm_field_handle_t;
480 
489 typedef struct {
491  int64_t mant;
493  int8_t exp;
495 
502 typedef struct {
504  int32_t tv_secs;
506  int32_t tv_usecs;
508 
509 struct lbmpdm_msg_strct_t;
512 typedef struct lbmpdm_msg_stct_t lbmpdm_msg_t;
513 
514 struct lbmpdm_defn_stct_t;
517 typedef struct lbmpdm_defn_stct_t lbmpdm_defn_t;
518 
523  int flags;
525  uint8_t req;
527  uint32_t fixed_str_len;
529  uint32_t num_arr_elem;
530  /* Fill for external pdm struct for future binary compatibility. */
531  char fill[256];
532 };
534 
540  uint16_t field_type;
542  uint8_t is_array;
544  uint8_t is_fixed;
546  size_t len;
548  char *value;
550  uint32_t num_arr_elem;
552  size_t *len_arr;
554  char **value_arr;
555  /* Fill for external pdm struct for future binary compatibility. */
556  char fill[256];
557 };
559 
560 struct lbmpdm_iter_stct_t;
563 typedef struct lbmpdm_iter_stct_t lbmpdm_iter_t;
564 
566 #define PDM_FALSE (uint8_t) 0
567 
569 #define PDM_TRUE (uint8_t) 1
570 
572 #define PDM_FIELD_INFO_FLAG_REQ 0x1
573 
575 #define PDM_FIELD_INFO_FLAG_FIXED_STR_LEN 0x2
576 
578 #define PDM_FIELD_INFO_FLAG_NUM_ARR_ELEM 0x4
579 
581 #define PDM_MSG_FLAG_VAR_OR_OPT_FLDS_SET 0x1
582 
584 #define PDM_MSG_FLAG_INCL_DEFN 0x2
585 
587 #define PDM_MSG_FLAG_USE_MSG_DEFN_IF_NEEDED 0x4
588 
590 #define PDM_MSG_FLAG_TRY_LOAD_DEFN_FROM_CACHE 0x8
591 
593 #define PDM_MSG_FLAG_NEED_BYTE_SWAP 0x10
594 
596 #define PDM_MSG_FLAG_DEL_DEFN_WHEN_REPLACED 0x20
597 
599 #define PDM_MSG_VER_POLICY_EXACT 0
600 
602 #define PDM_MSG_VER_POLICY_BEST 1
603 
605 #define PDM_SUCCESS 0
606 
608 #define PDM_FAILURE -1
609 
611 #define PDM_ERR_FIELD_IS_NULL 1
612 
614 #define PDM_ERR_NO_MORE_FIELDS 2
615 
617 #define PDM_ERR_INSUFFICIENT_BUFFER_LENGTH 3
618 
620 #define PDM_ERR_EINVAL 4
621 
623 #define PDM_ERR_FIELD_NOT_FOUND 5
624 
626 #define PDM_ERR_MSG_INVALID 6
627 
629 #define PDM_ERR_DEFN_INVALID 7
630 
632 #define PDM_ERR_NOMEM 8
633 
635 #define PDM_ERR_REQ_FIELD_NOT_SET 9
636 
638 #define PDM_ERR_CREATE_SECTION 10
639 
641 #define PDM_ERR_CREATE_BUFFER 11
642 
644 #define PDM_INTERNAL_TYPE_INVALID -1
645 
647 #define PDM_TYPE_BOOLEAN 0
648 
650 #define PDM_TYPE_INT8 1
651 
653 #define PDM_TYPE_UINT8 2
654 
656 #define PDM_TYPE_INT16 3
657 
659 #define PDM_TYPE_UINT16 4
660 
662 #define PDM_TYPE_INT32 5
663 
665 #define PDM_TYPE_UINT32 6
666 
668 #define PDM_TYPE_INT64 7
669 
671 #define PDM_TYPE_UINT64 8
672 
674 #define PDM_TYPE_FLOAT 9
675 
677 #define PDM_TYPE_DOUBLE 10
678 
680 #define PDM_TYPE_DECIMAL 11
681 
683 #define PDM_TYPE_TIMESTAMP 12
684 
686 #define PDM_TYPE_FIX_STRING 13
687 
689 #define PDM_TYPE_STRING 14
690 
692 #define PDM_TYPE_FIX_UNICODE 15
693 
695 #define PDM_TYPE_UNICODE 16
696 
698 #define PDM_TYPE_BLOB 17
699 
701 #define PDM_TYPE_MESSAGE 18
702 
704 #define PDM_TYPE_BOOLEAN_ARR 19
705 
707 #define PDM_TYPE_INT8_ARR 20
708 
710 #define PDM_TYPE_UINT8_ARR 21
711 
713 #define PDM_TYPE_INT16_ARR 22
714 
716 #define PDM_TYPE_UINT16_ARR 23
717 
719 #define PDM_TYPE_INT32_ARR 24
720 
722 #define PDM_TYPE_UINT32_ARR 25
723 
725 #define PDM_TYPE_INT64_ARR 26
726 
728 #define PDM_TYPE_UINT64_ARR 27
729 
731 #define PDM_TYPE_FLOAT_ARR 28
732 
734 #define PDM_TYPE_DOUBLE_ARR 29
735 
737 #define PDM_TYPE_DECIMAL_ARR 30
738 
740 #define PDM_TYPE_TIMESTAMP_ARR 31
741 
743 #define PDM_TYPE_FIX_STRING_ARR 32
744 
746 #define PDM_TYPE_STRING_ARR 33
747 
749 #define PDM_TYPE_FIX_UNICODE_ARR 34
750 
752 #define PDM_TYPE_UNICODE_ARR 35
753 
755 #define PDM_TYPE_BLOB_ARR 36
756 
758 #define PDM_TYPE_MESSAGE_ARR 37
759 
761 #define PDM_DEFN_STR_FIELD_NAMES 0
762 
764 #define PDM_DEFN_INT_FIELD_NAMES 1
765 
767 #define PDM_ITER_INVALID_FIELD_HANDLE -1
768 
773 
778 LBMPDMExpDLL const char *lbmpdm_errmsg();
779 
786 LBMPDMExpDLL int lbmpdm_cache_init(uint32_t cache_size);
787 
794 
801 
809 LBMPDMExpDLL int lbmpdm_cache_struct_remove_by_version(int32_t id, uint8_t vers_major, uint8_t vers_minor);
810 
819 LBMPDMExpDLL int lbmpdm_cache_struct_find(lbmpdm_defn_t **defn, int32_t id);
820 
831 LBMPDMExpDLL int lbmpdm_cache_struct_find_by_version(lbmpdm_defn_t **defn, int32_t id, uint8_t vers_major, uint8_t vers_minor);
832 
837 
838 
844 LBMPDMExpDLL lbmpdm_field_handle_t lbmpdm_defn_get_field_handle_by_str_name(lbmpdm_defn_t *defn, const char *str_name);
845 
851 LBMPDMExpDLL lbmpdm_field_handle_t lbmpdm_defn_get_field_handle_by_int_name(lbmpdm_defn_t *defn, int32_t int_name);
852 
877 LBMPDMExpDLL int lbmpdm_defn_create(lbmpdm_defn_t **defn, int32_t num_fields, int32_t id, int8_t vrs_mjr, int8_t vrs_mnr, uint8_t field_names_type);
878 
884 
891 
899 LBMPDMExpDLL lbmpdm_field_handle_t lbmpdm_defn_add_field_info_by_str_name(lbmpdm_defn_t *defn, const char *str_name, int16_t type, lbmpdm_field_info_attr_t *info_attr);
900 
908 LBMPDMExpDLL lbmpdm_field_handle_t lbmpdm_defn_add_field_info_by_int_name(lbmpdm_defn_t *defn, int32_t int_name, int16_t type, lbmpdm_field_info_attr_t *info_attr);
909 
917 
923 
929 
935 
941 
948 
954 
960 LBMPDMExpDLL const char *lbmpdm_defn_get_field_info_str_name(lbmpdm_defn_t *defn, lbmpdm_field_handle_t handle);
961 
967 LBMPDMExpDLL int32_t lbmpdm_defn_get_field_info_int_name(lbmpdm_defn_t *defn, lbmpdm_field_handle_t handle);
968 
974 LBMPDMExpDLL int16_t lbmpdm_defn_get_field_info_type(lbmpdm_defn_t *defn, lbmpdm_field_handle_t handle);
975 
984 LBMPDMExpDLL int lbmpdm_defn_serialize(lbmpdm_defn_t *defn, char *buffer, uint32_t *defn_len);
985 
1002 LBMPDMExpDLL int lbmpdm_defn_deserialize(lbmpdm_defn_t *defn, const char *bufptr, uint32_t buflen, uint8_t swap_bytes);
1003 
1010 LBMPDMExpDLL int lbmpdm_msg_create(lbmpdm_msg_t **message, lbmpdm_defn_t *defn, uint32_t flags);
1011 
1020 
1029 
1036 LBMPDMExpDLL uint32_t lbmpdm_msg_get_length(const lbmpdm_msg_t *message);
1037 
1043 
1049 LBMPDMExpDLL uint8_t lbmpdm_msg_is_field_set(lbmpdm_msg_t *message, lbmpdm_field_handle_t handle);
1050 
1057 LBMPDMExpDLL int lbmpdm_msg_get_field_value_stct(lbmpdm_msg_t *message, lbmpdm_field_handle_t handle, lbmpdm_field_value_t *field_value);
1058 
1067 LBMPDMExpDLL int lbmpdm_msg_get_field_value(lbmpdm_msg_t *message, lbmpdm_field_handle_t handle, void *value, size_t *len);
1068 
1079 LBMPDMExpDLL int lbmpdm_msg_get_field_value_vec(lbmpdm_msg_t *message, lbmpdm_field_handle_t handle, void *value, size_t len[], size_t *num_arr_elem);
1080 
1089 LBMPDMExpDLL int lbmpdm_msg_set_field_value(lbmpdm_msg_t *message, lbmpdm_field_handle_t handle, void *value, size_t len);
1090 
1100 LBMPDMExpDLL int lbmpdm_msg_set_field_value_vec(lbmpdm_msg_t *message, lbmpdm_field_handle_t handle, void *value, size_t len[], size_t num_arr_elem);
1101 
1107 LBMPDMExpDLL int lbmpdm_msg_remove_field_value(lbmpdm_msg_t *message, lbmpdm_field_handle_t handle);
1108 
1114 
1120 
1129 
1137 LBMPDMExpDLL int lbmpdm_msg_serialize(lbmpdm_msg_t *message, char *buffer);
1138 
1152 LBMPDMExpDLL int lbmpdm_msg_deserialize(lbmpdm_msg_t *message, const char *bufptr, uint32_t buflen);
1153 
1162 
1169 
1176 LBMPDMExpDLL int lbmpdm_iter_create_from_field_handle(lbmpdm_iter_t **iter, lbmpdm_msg_t *message, lbmpdm_field_handle_t field_handle);
1177 
1183 
1188 LBMPDMExpDLL lbmpdm_field_handle_t lbmpdm_iter_get_current(lbmpdm_iter_t *iter);
1189 
1195 
1201 
1207 
1213 
1220 
1227 LBMPDMExpDLL int lbmpdm_iter_set_current_field_value(lbmpdm_iter_t *iter, void *value, size_t len);
1228 
1237 LBMPDMExpDLL int lbmpdm_iter_set_current_field_value_vec(lbmpdm_iter_t *iter, void *value, size_t len[], size_t num_arr_elem);
1238 
1246 LBMPDMExpDLL int lbmpdm_iter_get_current_field_value(lbmpdm_iter_t *iter, void *value, size_t *len);
1247 
1256 LBMPDMExpDLL int lbmpdm_iter_get_current_field_value_vec(lbmpdm_iter_t *iter, void *value, size_t len[], size_t *num_arr_elem);
1257 
1258 #if defined(__cplusplus)
1259 }
1260 #endif /* __cplusplus */
1261 
1262 #endif /* _LBMPDM_H_ */
1263 
LBMPDMExpDLL int8_t lbmpdm_defn_get_msg_vers_major(lbmpdm_defn_t *defn)
Gets the message major version number from the definition.
LBMPDMExpDLL int32_t lbmpdm_defn_get_field_info_int_name(lbmpdm_defn_t *defn, lbmpdm_field_handle_t handle)
Gets the integer field name from a given definition&#39;s field handle.
uint32_t num_arr_elem
Definition: lbmpdm.h:529
LBMPDMExpDLL int lbmpdm_iter_create(lbmpdm_iter_t **iter, lbmpdm_msg_t *message)
Creates a pdm iterator to iterate through the fields in a message.
LBMPDMExpDLL int8_t lbmpdm_defn_get_msg_vers_minor(lbmpdm_defn_t *defn)
Gets the message minor version number from the definition.
LBMPDMExpDLL const char * lbmpdm_errmsg()
Return an ASCII string containing the error message last encountered by this thread.
LBMPDMExpDLL int lbmpdm_iter_get_current_field_value_vec(lbmpdm_iter_t *iter, void *value, size_t len[], size_t *num_arr_elem)
Gets an array of field values from the iterator&#39;s current field.
int32_t lbmpdm_field_handle_t
Type representing a handle to a message field. Field handles are returned when adding a field to a de...
Definition: lbmpdm.h:479
LBMPDMExpDLL int lbmpdm_iter_set_msg(lbmpdm_iter_t *iter, lbmpdm_msg_t *message)
Sets the message used to step through by this iterator.
LBMPDMExpDLL int lbmpdm_defn_create(lbmpdm_defn_t **defn, int32_t num_fields, int32_t id, int8_t vrs_mjr, int8_t vrs_mnr, uint8_t field_names_type)
Create a definition, with the passed number of fields. The num_fields is required to be at least 1...
uint32_t fixed_str_len
Definition: lbmpdm.h:527
LBMPDMExpDLL uint8_t lbmpdm_iter_is_current_set(lbmpdm_iter_t *iter)
Checks to see if the current field is set.
LBMPDMExpDLL int lbmpdm_msg_and_defn_delete(lbmpdm_msg_t *message)
Delete an lbmpdm_msg_t object and all associated resources (including the defn) This deletes a previo...
LBMPDMExpDLL int lbmpdm_msg_remove_field_value(lbmpdm_msg_t *message, lbmpdm_field_handle_t handle)
Removes a field value from a message (marking it unset)
LBMPDMExpDLL int32_t lbmpdm_defn_get_id(lbmpdm_defn_t *defn)
Gets the id of the definition.
LBMPDMExpDLL int lbmpdm_msg_delete(lbmpdm_msg_t *message)
Delete an lbmpdm_msg_t object and all associated resources (except the defn) This deletes a previousl...
uint32_t num_arr_elem
Definition: lbmpdm.h:550
LBMPDMExpDLL uint8_t lbmpdm_msg_is_field_set(lbmpdm_msg_t *message, lbmpdm_field_handle_t handle)
Gets whether or not the field value has been set.
LBMPDMExpDLL int lbmpdm_field_value_stct_delete(lbmpdm_field_value_t *field_value)
Deletes the allocated resources inside the field value struct. This does NOT free the actual field va...
LBMPDMExpDLL int lbmpdm_defn_deserialize(lbmpdm_defn_t *defn, const char *bufptr, uint32_t buflen, uint8_t swap_bytes)
Deserialize the associated buffer into a newly created defn.
LBMPDMExpDLL uint8_t lbmpdm_defn_get_field_names_type(lbmpdm_defn_t *defn)
Gets the field names type (either PDM_DEFN_STR_FIELD_NAMES or PDM_DEFN_INT_FIELD_NAMES) from the defi...
LBMPDMExpDLL int lbmpdm_iter_first(lbmpdm_iter_t *iter)
Sets the iterator back to the first field.
LBMPDMExpDLL int lbmpdm_msg_create(lbmpdm_msg_t **message, lbmpdm_defn_t *defn, uint32_t flags)
creates a message with the specified definition
LBMPDMExpDLL lbmpdm_defn_t * lbmpdm_msg_get_defn(const lbmpdm_msg_t *message)
Gets a pointer to the message definition.
Attribute struct to be passed along with the name when adding field info to a definition.
Definition: lbmpdm.h:522
struct lbmpdm_defn_stct_t lbmpdm_defn_t
Structure to hold a pdm definition.
Definition: lbmpdm.h:517
struct lbmpdm_msg_stct_t lbmpdm_msg_t
Structure to hold a pdm message.
Definition: lbmpdm.h:512
LBMPDMExpDLL int lbmpdm_msg_get_field_value_vec(lbmpdm_msg_t *message, lbmpdm_field_handle_t handle, void *value, size_t len[], size_t *num_arr_elem)
Gets an array of field values from the message.
LBMPDMExpDLL uint8_t lbmpdm_iter_has_next(lbmpdm_iter_t *iter)
Checks to see if the iterator has another field to step to.
LBMPDMExpDLL uint8_t lbmpdm_defn_is_finalized(lbmpdm_defn_t *defn)
Gets whether or not the definition has been finalized (either PDM_TRUE or PDM_FALSE).
LBMPDMExpDLL uint32_t lbmpdm_defn_get_length(lbmpdm_defn_t *defn)
Gets the exact length of the serialized defn. This can be used to allocate a buffer of the exact leng...
LBMPDMExpDLL lbmpdm_field_handle_t lbmpdm_defn_get_field_handle_by_int_name(lbmpdm_defn_t *defn, int32_t int_name)
Retrieve a field handle from a definition via name.
LBMPDMExpDLL int lbmpdm_msg_unset_incl_defn_flag(lbmpdm_msg_t *message)
Unsets the message include definition flag.
LBMPDMExpDLL char * lbmpdm_msg_get_data(lbmpdm_msg_t *message)
Serialize a message to a buffer and return the buffer. The message that is passed in is serialized in...
LBMPDMExpDLL int lbmpdm_cache_struct_find(lbmpdm_defn_t **defn, int32_t id)
find a given definition structure by id and return the structure for it. Returns PDM_FAILURE for noth...
LBMPDMExpDLL int lbmpdm_msg_serialize(lbmpdm_msg_t *message, char *buffer)
Serialize a message to a buffer. The message that is passed in is serialized into the caller&#39;s suppli...
int32_t tv_usecs
Definition: lbmpdm.h:506
LBMPDMExpDLL int lbmpdm_msg_deserialize(lbmpdm_msg_t *message, const char *bufptr, uint32_t buflen)
Deserialize the associated buffer into a newly created message.
LBMPDMExpDLL lbmpdm_field_handle_t lbmpdm_defn_add_field_info_by_str_name(lbmpdm_defn_t *defn, const char *str_name, int16_t type, lbmpdm_field_info_attr_t *info_attr)
adds field info to the definition by string name
LBMPDMExpDLL lbmpdm_field_handle_t lbmpdm_iter_get_current(lbmpdm_iter_t *iter)
Gets the current field handle from the iterator.
LBMPDMExpDLL int lbmpdm_defn_finalize(lbmpdm_defn_t *defn)
make this definition final. This needs to be done before using it in a message.
LBMPDMExpDLL int32_t lbmpdm_defn_get_num_fields(lbmpdm_defn_t *defn)
Gets the number of fields in the definition.
LBMPDMExpDLL int lbmpdm_msg_set_field_value_vec(lbmpdm_msg_t *message, lbmpdm_field_handle_t handle, void *value, size_t len[], size_t num_arr_elem)
Sets an array of field values in a message.
size_t len
Definition: lbmpdm.h:546
LBMPDMExpDLL uint32_t lbmpdm_msg_get_length(const lbmpdm_msg_t *message)
Gets the exact length of the serialized message. This can be used to allocate a buffer of the exact l...
LBMPDMExpDLL int lbmpdm_msg_get_field_value_stct(lbmpdm_msg_t *message, lbmpdm_field_handle_t handle, lbmpdm_field_value_t *field_value)
Populates a field value struct with the value from the message.
int8_t exp
Definition: lbmpdm.h:493
LBMPDMExpDLL int lbmpdm_cache_struct_remove_by_version(int32_t id, uint8_t vers_major, uint8_t vers_minor)
delete a definition structure from the cache by its id and version. Does not error if the structure d...
LBMPDMExpDLL const char * lbmpdm_defn_get_field_info_str_name(lbmpdm_defn_t *defn, lbmpdm_field_handle_t handle)
Gets the string field name from a given definition&#39;s field handle.
LBMPDMExpDLL int lbmpdm_msg_get_field_value(lbmpdm_msg_t *message, lbmpdm_field_handle_t handle, void *value, size_t *len)
Gets a field value from the message.
LBMPDMExpDLL lbmpdm_field_handle_t lbmpdm_defn_get_field_handle_by_str_name(lbmpdm_defn_t *defn, const char *str_name)
Retrieve a field handle from a definition via name.
char * value
Definition: lbmpdm.h:548
LBMPDMExpDLL int lbmpdm_iter_create_from_field_handle(lbmpdm_iter_t **iter, lbmpdm_msg_t *message, lbmpdm_field_handle_t field_handle)
Creates a pdm iterator to iterate through the fields in a message starting at a particular field...
Structure to hold a timestamp value.
Definition: lbmpdm.h:502
LBMPDMExpDLL int lbmpdm_iter_next(lbmpdm_iter_t *iter)
Steps the iterator to the next first field.
char ** value_arr
Definition: lbmpdm.h:554
LBMPDMExpDLL int lbmpdm_errnum()
Return the error number last encountered by this thread.
LBMPDMExpDLL int lbmpdm_defn_serialize(lbmpdm_defn_t *defn, char *buffer, uint32_t *defn_len)
Serialize a defn to a buffer. In normal usage this is not needed as the defn is either known in advan...
LBMPDMExpDLL int lbmpdm_cache_struct_add(lbmpdm_defn_t *defn)
add a definition structure to the cache. It is assumed that the structure has a unique id...
LBMPDMExpDLL int lbmpdm_cache_clear_all()
nuke the whole cache, this deletes all the structures within the cache as well.
LBMPDMExpDLL int lbmpdm_iter_set_current_field_value_vec(lbmpdm_iter_t *iter, void *value, size_t len[], size_t num_arr_elem)
Sets the current field values to the passed array of values.
LBMPDMExpDLL int lbmpdm_cache_struct_remove(int32_t id)
delete a definition structure from the cache. Does not error if the structure doesn&#39;t exist...
LBMPDMExpDLL int16_t lbmpdm_defn_get_field_info_type(lbmpdm_defn_t *defn, lbmpdm_field_handle_t handle)
Gets the PDM field type from a given definition&#39;s field handle.
LBMPDMExpDLL int lbmpdm_msg_set_field_value(lbmpdm_msg_t *message, lbmpdm_field_handle_t handle, void *value, size_t len)
Sets a field value in a message.
LBMPDMExpDLL lbmpdm_field_handle_t lbmpdm_defn_add_field_info_by_int_name(lbmpdm_defn_t *defn, int32_t int_name, int16_t type, lbmpdm_field_info_attr_t *info_attr)
adds field info to the definition by integer name
LBMPDMExpDLL int lbmpdm_iter_get_current_field_value(lbmpdm_iter_t *iter, void *value, size_t *len)
Gets a field value from the iterator&#39;s current field.
LBMPDMExpDLL int lbmpdm_defn_delete(lbmpdm_defn_t *defn)
delete a given definition.
int32_t tv_secs
Definition: lbmpdm.h:504
LBMPDMExpDLL int lbmpdm_msg_set_incl_defn_flag(lbmpdm_msg_t *message)
Sets the message include definition flag.
uint16_t field_type
Definition: lbmpdm.h:540
LBMPDMExpDLL int lbmpdm_iter_set_current_field_value(lbmpdm_iter_t *iter, void *value, size_t len)
Sets the current field value to the value passed in.
size_t * len_arr
Definition: lbmpdm.h:552
LBMPDMExpDLL int lbmpdm_cache_struct_find_by_version(lbmpdm_defn_t **defn, int32_t id, uint8_t vers_major, uint8_t vers_minor)
find a given definition structure by id, major version, and minor version and return the structure fo...
LBMPDMExpDLL int lbmpdm_cache_init(uint32_t cache_size)
initialize the cache for a given number of buckets. If 0 is given the the cache will default...
LBMPDMExpDLL int lbmpdm_iter_delete(lbmpdm_iter_t *iter)
Deletes the iterator.
uint8_t is_fixed
Definition: lbmpdm.h:544
int64_t mant
Definition: lbmpdm.h:491
uint8_t is_array
Definition: lbmpdm.h:542
Structure to hold a scaled decimal number. A scaled decimal number consists of a mantissa and an exp...
Definition: lbmpdm.h:489
struct lbmpdm_iter_stct_t lbmpdm_iter_t
Iterator structure that is used to traverse the fields of a message.
Definition: lbmpdm.h:563
#define LBMPDMExpDLL
PDM API function return codes.
Definition: lbmpdm.h:401
uint8_t req
Definition: lbmpdm.h:525
Field value struct that can be populated with a field value when passed to the lbmpdm_msg_get_field_v...
Definition: lbmpdm.h:538