File: dl_base_fns.c

package info (click to toggle)
openmpi 4.1.0-10
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 126,560 kB
  • sloc: ansic: 685,465; makefile: 42,952; f90: 19,220; sh: 7,002; java: 6,360; perl: 3,524; cpp: 2,227; python: 1,350; lex: 989; fortran: 61; tcl: 12
file content (68 lines) | stat: -rw-r--r-- 1,737 bytes parent folder | download | duplicates (4)
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*
 * Copyright (c) 2004-2010 The Trustees of Indiana University.
 *                         All rights reserved.
 * Copyright (c) 2015 Cisco Systems, Inc.  All rights reserved.
 * $COPYRIGHT$
 *
 * Additional copyrights may follow
 *
 * $HEADER$
 */

/**
 * This file is a simple set of wrappers around the selected OPAL DL
 * component (it's a compile-time framework with, at most, a single
 * component; see dl.h for details).
 */

#include "opal_config.h"

#include "opal/include/opal/constants.h"

#include "opal/mca/dl/base/base.h"


int opal_dl_open(const char *fname,
                 bool use_ext, bool private_namespace,
                 opal_dl_handle_t **handle, char **err_msg)
{
    *handle = NULL;

    if (NULL != opal_dl && NULL != opal_dl->open) {
        return opal_dl->open(fname, use_ext, private_namespace,
                             handle, err_msg);
    }

    return OPAL_ERR_NOT_SUPPORTED;
}

int opal_dl_lookup(opal_dl_handle_t *handle,
                   const char *symbol,
                   void **ptr, char **err_msg)
{
    if (NULL != opal_dl && NULL != opal_dl->lookup) {
        return opal_dl->lookup(handle, symbol, ptr, err_msg);
    }

    return OPAL_ERR_NOT_SUPPORTED;
}

int opal_dl_close(opal_dl_handle_t *handle)
{
    if (NULL != opal_dl && NULL != opal_dl->close) {
        return opal_dl->close(handle);
    }

    return OPAL_ERR_NOT_SUPPORTED;
}

int opal_dl_foreachfile(const char *search_path,
                        int (*cb_func)(const char *filename, void *context),
                        void *context)
{
    if (NULL != opal_dl && NULL != opal_dl->foreachfile) {
        return opal_dl->foreachfile(search_path, cb_func, context);
    }

    return OPAL_ERR_NOT_SUPPORTED;
}