#ifndef PMIX_COMPRESS_BASE_H
#define PMIX_COMPRESS_BASE_H
#include "pmix_config.h"
#include "src/mca/pcompress/pcompress.h"
#include "src/util/pmix_environ.h"
#include "src/mca/base/pmix_base.h"
#if defined(c_plusplus) || defined(__cplusplus)
extern "C" {
#endif
#define PMIX_STRING_SIZE_CHECK(s) \
(PMIX_STRING == (s)->type && NULL != (s)->data.string \
&& pmix_compress_base.compress_limit < strlen((s)->data.string))
#define PMIX_VALUE_COMPRESSED_STRING_UNPACK(s) \
do { \
char *tmp; \
\
if (PMIX_COMPRESSED_STRING == (s)->type) { \
pmix_compress.decompress_string(&tmp, (uint8_t *) (s)->data.bo.bytes, \
(s)->data.bo.size); \
if (NULL == tmp) { \
PMIX_ERROR_LOG(PMIX_ERR_NOMEM); \
rc = PMIX_ERR_NOMEM; \
PMIX_VALUE_RELEASE(s); \
val = NULL; \
} else { \
PMIX_VALUE_DESTRUCT(s); \
(s)->data.string = tmp; \
(s)->type = PMIX_STRING; \
} \
} \
} while (0)
typedef struct {
size_t compress_limit;
bool selected;
bool silent;
} pmix_compress_base_t;
PMIX_EXPORT extern pmix_compress_base_t pmix_compress_base;
PMIX_EXPORT int pmix_compress_base_select(void);
PMIX_EXPORT extern pmix_mca_base_framework_t pmix_pcompress_base_framework;
PMIX_EXPORT extern pmix_compress_base_module_t pmix_compress;
#if defined(c_plusplus) || defined(__cplusplus)
}
#endif
#endif