This source file includes following definitions.
- pmix_preg_close
- pmix_preg_open
- rcon
- rvcon
- rvdes
   1 
   2 
   3 
   4 
   5 
   6 
   7 
   8 
   9 
  10 
  11 
  12 
  13 
  14 
  15 
  16 
  17 
  18 
  19 
  20 
  21 
  22 
  23 
  24 
  25 
  26 
  27 #include <src/include/pmix_config.h>
  28 
  29 #include <pmix_common.h>
  30 
  31 #ifdef HAVE_STRING_H
  32 #include <string.h>
  33 #endif
  34 
  35 #include "src/class/pmix_list.h"
  36 #include "src/mca/base/base.h"
  37 #include "src/mca/preg/base/base.h"
  38 
  39 
  40 
  41 
  42 
  43 
  44 
  45 #include "src/mca/preg/base/static-components.h"
  46 
  47 
  48 pmix_preg_globals_t pmix_preg_globals = {{{0}}};
  49 pmix_preg_module_t pmix_preg = {
  50     .generate_node_regex = pmix_preg_base_generate_node_regex,
  51     .generate_ppn = pmix_preg_base_generate_ppn,
  52     .parse_nodes = pmix_preg_base_parse_nodes,
  53     .parse_procs = pmix_preg_base_parse_procs,
  54     .resolve_peers = pmix_preg_base_resolve_peers,
  55     .resolve_nodes = pmix_preg_base_resolve_nodes
  56 };
  57 
  58 static pmix_status_t pmix_preg_close(void)
  59 {
  60     if (!pmix_preg_globals.initialized) {
  61         return PMIX_SUCCESS;
  62     }
  63     pmix_preg_globals.initialized = false;
  64 
  65     PMIX_LIST_DESTRUCT(&pmix_preg_globals.actives);
  66 
  67     return pmix_mca_base_framework_components_close(&pmix_preg_base_framework, NULL);
  68 }
  69 
  70 static pmix_status_t pmix_preg_open(pmix_mca_base_open_flag_t flags)
  71 {
  72     
  73     pmix_preg_globals.initialized = true;
  74     PMIX_CONSTRUCT(&pmix_preg_globals.actives, pmix_list_t);
  75 
  76     
  77     return pmix_mca_base_framework_components_open(&pmix_preg_base_framework, flags);
  78 }
  79 
  80 PMIX_MCA_BASE_FRAMEWORK_DECLARE(pmix, preg, "PMIx Regex Operations",
  81                                 NULL, pmix_preg_open, pmix_preg_close,
  82                                 mca_preg_base_static_components, 0);
  83 
  84 PMIX_CLASS_INSTANCE(pmix_preg_base_active_module_t,
  85                     pmix_list_item_t,
  86                     NULL, NULL);
  87 
  88 static void rcon(pmix_regex_range_t *p)
  89 {
  90     p->start = 0;
  91     p->cnt = 0;
  92 }
  93 PMIX_CLASS_INSTANCE(pmix_regex_range_t,
  94                     pmix_list_item_t,
  95                     rcon, NULL);
  96 
  97 static void rvcon(pmix_regex_value_t *p)
  98 {
  99     p->prefix = NULL;
 100     p->suffix = NULL;
 101     p->num_digits = 0;
 102     p->skip = false;
 103     PMIX_CONSTRUCT(&p->ranges, pmix_list_t);
 104 }
 105 static void rvdes(pmix_regex_value_t *p)
 106 {
 107     if (NULL != p->prefix) {
 108         free(p->prefix);
 109     }
 110     if (NULL != p->suffix) {
 111         free(p->suffix);
 112     }
 113     PMIX_LIST_DESTRUCT(&p->ranges);
 114 }
 115 PMIX_CLASS_INSTANCE(pmix_regex_value_t,
 116                     pmix_list_item_t,
 117                     rvcon, rvdes);