Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-22 10:47:25

0001 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
0002 /*
0003  * Copyright (c) 2004-2010 The Trustees of Indiana University and Indiana
0004  *                         University Research and Technology
0005  *                         Corporation.  All rights reserved.
0006  * Copyright (c) 2015      Los Alamos National Security, LLC. All rights
0007  *                         reserved.
0008  *
0009  * Copyright (c) 2019-2020 Intel, Inc.  All rights reserved.
0010  * Copyright (c) 2021-2022 Nanook Consulting.  All rights reserved.
0011  * $COPYRIGHT$
0012  *
0013  * Additional copyrights may follow
0014  *
0015  * $HEADER$
0016  */
0017 /**
0018  * @file
0019  *
0020  * Compression Framework
0021  *
0022  * General Description:
0023  *
0024  * The PMIX Compress framework has been created to provide an abstract interface
0025  * to the compression agent library on the host machine. This framework is useful
0026  * when distributing files that can be compressed before sending to dimish the
0027  * load on the network.
0028  *
0029  */
0030 
0031 #ifndef PMIX_MCA_COMPRESS_H
0032 #define PMIX_MCA_COMPRESS_H
0033 
0034 #include "pmix_config.h"
0035 #include "src/class/pmix_object.h"
0036 #include "src/mca/base/pmix_base.h"
0037 #include "src/mca/mca.h"
0038 
0039 #if defined(c_plusplus) || defined(__cplusplus)
0040 extern "C" {
0041 #endif
0042 
0043 /**
0044  * Module initialization function.
0045  * Returns PMIX_SUCCESS
0046  */
0047 typedef int (*pmix_compress_base_module_init_fn_t)(void);
0048 
0049 /**
0050  * Module finalization function.
0051  * Returns PMIX_SUCCESS
0052  */
0053 typedef int (*pmix_compress_base_module_finalize_fn_t)(void);
0054 
0055 /**
0056  * Compress a string
0057  *
0058  * Arguments:
0059  *
0060  */
0061 typedef bool (*pmix_compress_base_module_compress_string_fn_t)(char *instring, uint8_t **outbytes,
0062                                                                size_t *nbytes);
0063 typedef bool (*pmix_compress_base_module_decompress_string_fn_t)(char **outstring, uint8_t *inbytes,
0064                                                                  size_t len);
0065 typedef size_t (*pmix_compress_base_module_get_decompressed_strlen_fn_t)(const pmix_byte_object_t *bo);
0066 
0067 /**
0068  * Compress a block
0069  *
0070  * Arguments:
0071  *
0072  */
0073 typedef bool (*pmix_compress_base_module_compress_fn_t)(const uint8_t *inbytes, size_t size,
0074                                                         uint8_t **outbytes, size_t *nbytes);
0075 
0076 typedef bool (*pmix_compress_base_module_decompress_fn_t)(uint8_t **outbytes, size_t *outlen,
0077                                                           const uint8_t *inbytes, size_t len);
0078 typedef size_t (*pmix_compress_base_module_get_decompressed_size_fn_t)(const pmix_byte_object_t *bo);
0079 
0080 /**
0081  * Structure for COMPRESS components.
0082  */
0083 typedef  pmix_mca_base_component_t pmix_compress_base_component_t;
0084 
0085 /**
0086  * Structure for COMPRESS modules
0087  */
0088 struct pmix_compress_base_module_1_0_0_t {
0089     /** Initialization Function */
0090     pmix_compress_base_module_init_fn_t                     init;
0091     /** Finalization Function */
0092     pmix_compress_base_module_finalize_fn_t                 finalize;
0093 
0094     /** Compress interface */
0095     pmix_compress_base_module_compress_fn_t                 compress;
0096 
0097     /** Decompress Interface */
0098     pmix_compress_base_module_decompress_fn_t               decompress;
0099     pmix_compress_base_module_get_decompressed_size_fn_t    get_decompressed_size;
0100     /* COMPRESS STRING */
0101     pmix_compress_base_module_compress_string_fn_t          compress_string;
0102     pmix_compress_base_module_decompress_string_fn_t        decompress_string;
0103     pmix_compress_base_module_get_decompressed_strlen_fn_t  get_decompressed_strlen;
0104 };
0105 typedef struct pmix_compress_base_module_1_0_0_t pmix_compress_base_module_1_0_0_t;
0106 typedef struct pmix_compress_base_module_1_0_0_t pmix_compress_base_module_t;
0107 
0108 PMIX_EXPORT extern pmix_compress_base_module_t pmix_compress;
0109 
0110 /**
0111  * Macro for use in components that are of type COMPRESS
0112  */
0113 #define PMIX_COMPRESS_BASE_VERSION_2_0_0 PMIX_MCA_BASE_VERSION_1_0_0("pcompress", 2, 0, 0)
0114 
0115 #if defined(c_plusplus) || defined(__cplusplus)
0116 }
0117 #endif
0118 
0119 #endif /* PMIX_COMPRESS_H */