Skip to content

Commit 567ea5b

Browse files
committed
interface - add deprecated warnings for old fn names
1 parent ba68461 commit 567ea5b

File tree

4 files changed

+39
-6
lines changed

4 files changed

+39
-6
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,7 @@ install : $(libceed) $(OBJDIR)/ceed.pc
876876
"$(includedir)/ceed/jit-source/gallery/" "$(includedir)/ceed/jit-source/magma/"\
877877
"$(includedir)/ceed/jit-source/sycl/" "$(libdir)" "$(pkgconfigdir)")
878878
$(INSTALL_DATA) include/ceed/ceed.h "$(DESTDIR)$(includedir)/ceed/"
879+
$(INSTALL_DATA) include/ceed/deprecated.h "$(DESTDIR)$(includedir)/ceed/"
879880
$(INSTALL_DATA) include/ceed/types.h "$(DESTDIR)$(includedir)/ceed/"
880881
$(INSTALL_DATA) include/ceed/ceed-f32.h "$(DESTDIR)$(includedir)/ceed/"
881882
$(INSTALL_DATA) include/ceed/ceed-f64.h "$(DESTDIR)$(includedir)/ceed/"

include/ceed/ceed.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -474,12 +474,7 @@ CEED_EXTERN int CeedOperatorAssemblyDataStrip(CeedOperator op);
474474
CEED_EXTERN int CeedOperatorDestroy(CeedOperator *op);
475475

476476
// Compatibility with previous composite CeedOperator naming
477-
#define CeedCompositeOperatorCreate(a, b) CeedOperatorCreateComposite(a, b)
478-
#define CeedCompositeOperatorAddSub(a, b) CeedOperatorCompositeAddSub(a, b)
479-
#define CeedCompositeOperatorGetNumSub(a, b) CeedOperatorCompositeGetNumSub(a, b)
480-
#define CeedCompositeOperatorGetSubList(a, b) CeedOperatorCompositeGetSubList(a, b)
481-
#define CeedCompositeOperatorGetSubByName(a, b) CeedOperatorCompositeGetSubByName(a, b, c)
482-
#define CeedCompositeOperatorGetMultiplicity(a, b, c, d) CeedOperatorCompositeGetMultiplicity(a, b, c, d)
477+
#include "deprecated.h"
483478

484479
CEED_EXTERN int CeedOperatorGetFieldByName(CeedOperator op, const char *field_name, CeedOperatorField *op_field);
485480
CEED_EXTERN int CeedOperatorFieldGetName(CeedOperatorField op_field, const char **field_name);

include/ceed/deprecated.h

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/// Copyright (c) 2017-2025, Lawrence Livermore National Security, LLC and other CEED contributors.
2+
/// All Rights Reserved. See the top-level LICENSE and NOTICE files for details.
3+
///
4+
/// SPDX-License-Identifier: BSD-2-Clause
5+
///
6+
/// This file is part of CEED: http://github.com/ceed
7+
8+
/// @file
9+
/// Public header for user and utility components of libCEED
10+
#pragma once
11+
12+
// Compatibility with previous composite CeedOperator naming
13+
[[deprecated("Use CeedOperatorCreateComposite()")]]
14+
static inline int CeedCompositeOperatorCreate(Ceed a, CeedOperator *b) {
15+
return CeedOperatorCreateComposite(a, b);
16+
}
17+
[[deprecated("Use CeedOperatorCompositeAddSub()")]]
18+
static inline int CeedCompositeOperatorAddSub(CeedOperator a, CeedOperator b) {
19+
return CeedOperatorCompositeAddSub(a, b);
20+
}
21+
[[deprecated("Use CeedOperatorCompositeGetNumSub()")]]
22+
static inline int CeedCompositeOperatorGetNumSub(CeedOperator a, CeedInt *b) {
23+
return CeedOperatorCompositeGetNumSub(a, b);
24+
}
25+
[[deprecated("Use CeedOperatorCompositeGetSubList()")]]
26+
static inline int CeedCompositeOperatorGetSubList(CeedOperator a, CeedOperator **b) {
27+
return CeedOperatorCompositeGetSubList(a, b);
28+
}
29+
[[deprecated("Use CeedCompositeOperatorGetSubByName()")]]
30+
static inline int CeedCompositeOperatorGetSubByName(CeedOperator a, const char *b, CeedOperator *c) {
31+
return CeedOperatorCompositeGetSubByName(a, b, c);
32+
}
33+
[[deprecated("Use CeedOperatorCompositeGetMultiplicity()")]]
34+
static inline int CeedCompositeOperatorGetMultiplicity(CeedOperator a, CeedInt b, CeedInt *c, CeedVector d) {
35+
return CeedOperatorCompositeGetMultiplicity(a, b, c, d);
36+
}

python/build_ceed_cffi.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def get_ceed_dirs():
3434
lines += [line.strip() for line in f if
3535
not (line.startswith("#") and not line.startswith("#include")) and
3636
not line.startswith(" static") and
37+
not line.startswith("#include \"deprecated.h\"") and
3738
not line.startswith(" CEED_QFUNCTION_ATTR") and
3839
"CeedErrorImpl" not in line and
3940
"const char *, ...);" not in line and

0 commit comments

Comments
 (0)