File: dl_base_fns.c

package info (click to toggle)
openmpi 5.0.7-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 202,312 kB
  • sloc: ansic: 612,441; makefile: 42,495; sh: 11,230; javascript: 9,244; f90: 7,052; java: 6,404; perl: 5,154; python: 1,856; lex: 740; fortran: 61; cpp: 20; tcl: 12
file content (62 lines) | stat: -rw-r--r-- 1,628 bytes parent folder | download | duplicates (2)
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
/*
 * 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;
}