File indexing completed on 2025-02-23 10:12:53
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef PMIX_COMPRESS_BASE_H
0015 #define PMIX_COMPRESS_BASE_H
0016
0017 #include "pmix_config.h"
0018 #include "src/mca/pcompress/pcompress.h"
0019 #include "src/util/pmix_environ.h"
0020
0021 #include "src/mca/base/pmix_base.h"
0022
0023
0024
0025
0026
0027 #if defined(c_plusplus) || defined(__cplusplus)
0028 extern "C" {
0029 #endif
0030
0031
0032
0033 #define PMIX_STRING_SIZE_CHECK(s) \
0034 (PMIX_STRING == (s)->type && NULL != (s)->data.string \
0035 && pmix_compress_base.compress_limit < strlen((s)->data.string))
0036
0037 #define PMIX_VALUE_COMPRESSED_STRING_UNPACK(s) \
0038 do { \
0039 char *tmp; \
0040 \
0041 if (PMIX_COMPRESSED_STRING == (s)->type) { \
0042 pmix_compress.decompress_string(&tmp, (uint8_t *) (s)->data.bo.bytes, \
0043 (s)->data.bo.size); \
0044 if (NULL == tmp) { \
0045 PMIX_ERROR_LOG(PMIX_ERR_NOMEM); \
0046 rc = PMIX_ERR_NOMEM; \
0047 PMIX_VALUE_RELEASE(s); \
0048 val = NULL; \
0049 } else { \
0050 PMIX_VALUE_DESTRUCT(s); \
0051 (s)->data.string = tmp; \
0052 (s)->type = PMIX_STRING; \
0053 } \
0054 } \
0055 } while (0)
0056
0057 typedef struct {
0058 size_t compress_limit;
0059 bool selected;
0060 bool silent;
0061 } pmix_compress_base_t;
0062
0063 PMIX_EXPORT extern pmix_compress_base_t pmix_compress_base;
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073 PMIX_EXPORT int pmix_compress_base_select(void);
0074
0075
0076
0077
0078 PMIX_EXPORT extern pmix_mca_base_framework_t pmix_pcompress_base_framework;
0079 PMIX_EXPORT extern pmix_compress_base_module_t pmix_compress;
0080
0081 #if defined(c_plusplus) || defined(__cplusplus)
0082 }
0083 #endif
0084
0085 #endif