root/opal/mca/pmix/pmix4x/pmix/src/mca/pcompress/zlib/compress_zlib_component.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. compress_zlib_open
  2. compress_zlib_close
  3. compress_zlib_query

   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
   2 /*
   3  * Copyright (c) 2004-2010 The Trustees of Indiana University.
   4  *                         All rights reserved.
   5  * Copyright (c) 2015      Los Alamos National Security, LLC. All rights
   6  *                         reserved.
   7  * Copyright (c) 2019      Intel, Inc.  All rights reserved.
   8  * $COPYRIGHT$
   9  *
  10  * Additional copyrights may follow
  11  *
  12  * $HEADER$
  13  */
  14 
  15 #include "pmix_config.h"
  16 
  17 #include "pmix_common.h"
  18 #include "src/mca/pcompress/base/base.h"
  19 #include "compress_zlib.h"
  20 
  21 /*
  22  * Public string for version number
  23  */
  24 const char *pmix_compress_zlib_component_version_string =
  25 "PMIX COMPRESS zlib MCA component version " PMIX_VERSION;
  26 
  27 /*
  28  * Local functionality
  29  */
  30 static int compress_zlib_open(void);
  31 static int compress_zlib_close(void);
  32 static int compress_zlib_query(pmix_mca_base_module_t **module, int *priority);
  33 
  34 /*
  35  * Instantiate the public struct with all of our public information
  36  * and pointer to our public functions in it
  37  */
  38 PMIX_EXPORT pmix_mca_base_component_t mca_pcompress_zlib_component = {
  39     /* Handle the general mca_component_t struct containing
  40      *  meta information about the component zlib
  41      */
  42     PMIX_COMPRESS_BASE_VERSION_2_0_0,
  43 
  44     /* Component name and version */
  45     .pmix_mca_component_name = "zlib",
  46     PMIX_MCA_BASE_MAKE_VERSION(component, PMIX_MAJOR_VERSION, PMIX_MINOR_VERSION,
  47                                PMIX_RELEASE_VERSION),
  48 
  49     /* Component open and close functions */
  50     .pmix_mca_open_component = compress_zlib_open,
  51     .pmix_mca_close_component = compress_zlib_close,
  52     .pmix_mca_query_component = compress_zlib_query
  53 };
  54 
  55 /*
  56  * Zlib module
  57  */
  58 static pmix_compress_base_module_t loc_module = {
  59     /** Initialization Function */
  60     .init = pmix_compress_zlib_module_init,
  61     /** Finalization Function */
  62     .finalize = pmix_compress_zlib_module_finalize,
  63 
  64     /** Compress Function */
  65     .compress_string = pmix_compress_zlib_compress_block,
  66 
  67     /** Decompress Function */
  68     .decompress_string = pmix_compress_zlib_uncompress_block,
  69 };
  70 
  71 static int compress_zlib_open(void)
  72 {
  73     return PMIX_SUCCESS;
  74 }
  75 
  76 static int compress_zlib_close(void)
  77 {
  78     return PMIX_SUCCESS;
  79 }
  80 
  81 static int compress_zlib_query(pmix_mca_base_module_t **module, int *priority)
  82 {
  83     *module   = (pmix_mca_base_module_t *)&loc_module;
  84     *priority = 50;
  85 
  86     return PMIX_SUCCESS;
  87 }
  88 

/* [<][>][^][v][top][bottom][index][help] */