root/opal/mca/pmix/pmix4x/pmix/src/mca/pcompress/pcompress.h

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

INCLUDED FROM


   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
   2 /*
   3  * Copyright (c) 2004-2010 The Trustees of Indiana University and Indiana
   4  *                         University Research and Technology
   5  *                         Corporation.  All rights reserved.
   6  * Copyright (c) 2015      Los Alamos National Security, LLC. All rights
   7  *                         reserved.
   8  *
   9  * Copyright (c) 2019      Intel, Inc.  All rights reserved.
  10  * $COPYRIGHT$
  11  *
  12  * Additional copyrights may follow
  13  *
  14  * $HEADER$
  15  */
  16 /**
  17  * @file
  18  *
  19  * Compression Framework
  20  *
  21  * General Description:
  22  *
  23  * The PMIX Compress framework has been created to provide an abstract interface
  24  * to the compression agent library on the host machine. This fromework is useful
  25  * when distributing files that can be compressed before sending to dimish the
  26  * load on the network.
  27  *
  28  */
  29 
  30 #ifndef PMIX_MCA_COMPRESS_H
  31 #define PMIX_MCA_COMPRESS_H
  32 
  33 #include "pmix_config.h"
  34 #include "src/mca/mca.h"
  35 #include "src/mca/base/base.h"
  36 #include "src/class/pmix_object.h"
  37 
  38 #if defined(c_plusplus) || defined(__cplusplus)
  39 extern "C" {
  40 #endif
  41 
  42 /**
  43  * Module initialization function.
  44  * Returns PMIX_SUCCESS
  45  */
  46 typedef int (*pmix_compress_base_module_init_fn_t)
  47      (void);
  48 
  49 /**
  50  * Module finalization function.
  51  * Returns PMIX_SUCCESS
  52  */
  53 typedef int (*pmix_compress_base_module_finalize_fn_t)
  54      (void);
  55 
  56 /**
  57  * Compress the file provided
  58  *
  59  * Arguments:
  60  *   fname   = Filename to compress
  61  *   cname   = Compressed filename
  62  *   postfix = postfix added to filename to create compressed filename
  63  * Returns:
  64  *   PMIX_SUCCESS on success, ow PMIX_ERROR
  65  */
  66 typedef int (*pmix_compress_base_module_compress_fn_t)
  67     (char * fname, char **cname, char **postfix);
  68 
  69 typedef int (*pmix_compress_base_module_compress_nb_fn_t)
  70     (char * fname, char **cname, char **postfix, pid_t *child_pid);
  71 
  72 /**
  73  * Decompress the file provided
  74  *
  75  * Arguments:
  76  *   fname = Filename to compress
  77  *   cname = Compressed filename
  78  * Returns:
  79  *   PMIX_SUCCESS on success, ow PMIX_ERROR
  80  */
  81 typedef int (*pmix_compress_base_module_decompress_fn_t)
  82     (char * cname, char **fname);
  83 typedef int (*pmix_compress_base_module_decompress_nb_fn_t)
  84     (char * cname, char **fname, pid_t *child_pid);
  85 
  86 /**
  87  * Compress a string
  88  *
  89  * Arguments:
  90  *
  91  */
  92 typedef bool (*pmix_compress_base_module_compress_string_fn_t)(char *instring,
  93                                                                uint8_t **outbytes,
  94                                                                size_t *nbytes);
  95 typedef bool (*pmix_compress_base_module_decompress_string_fn_t)(char **outstring,
  96                                                                  uint8_t *inbytes, size_t len);
  97 
  98 
  99 /**
 100  * Structure for COMPRESS components.
 101  */
 102 struct pmix_compress_base_component_2_0_0_t {
 103     /** PMIX_MCA base component */
 104     pmix_mca_base_component_t base_version;
 105     /** PMIX_MCA base data */
 106     pmix_mca_base_component_data_t base_data;
 107 
 108     /** Verbosity Level */
 109     int verbose;
 110     /** Output Handle for pmix_output */
 111     int output_handle;
 112     /** Default Priority */
 113     int priority;
 114 };
 115 typedef struct pmix_compress_base_component_2_0_0_t pmix_compress_base_component_2_0_0_t;
 116 typedef struct pmix_compress_base_component_2_0_0_t pmix_compress_base_component_t;
 117 
 118 /**
 119  * Structure for COMPRESS modules
 120  */
 121 struct pmix_compress_base_module_1_0_0_t {
 122     /** Initialization Function */
 123     pmix_compress_base_module_init_fn_t           init;
 124     /** Finalization Function */
 125     pmix_compress_base_module_finalize_fn_t       finalize;
 126 
 127     /** Compress interface */
 128     pmix_compress_base_module_compress_fn_t       compress;
 129     pmix_compress_base_module_compress_nb_fn_t    compress_nb;
 130 
 131     /** Decompress Interface */
 132     pmix_compress_base_module_decompress_fn_t     decompress;
 133     pmix_compress_base_module_decompress_nb_fn_t  decompress_nb;
 134 
 135     /* COMPRESS STRING */
 136     pmix_compress_base_module_compress_string_fn_t      compress_string;
 137     pmix_compress_base_module_decompress_string_fn_t    decompress_string;
 138 };
 139 typedef struct pmix_compress_base_module_1_0_0_t pmix_compress_base_module_1_0_0_t;
 140 typedef struct pmix_compress_base_module_1_0_0_t pmix_compress_base_module_t;
 141 
 142 PMIX_EXPORT extern pmix_compress_base_module_t pmix_compress;
 143 
 144 /**
 145  * Macro for use in components that are of type COMPRESS
 146  */
 147 #define PMIX_COMPRESS_BASE_VERSION_2_0_0 \
 148     PMIX_MCA_BASE_VERSION_1_0_0("pcompress", 2, 0, 0)
 149 
 150 #if defined(c_plusplus) || defined(__cplusplus)
 151 }
 152 #endif
 153 
 154 #endif /* PMIX_COMPRESS_H */
 155 

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