xref: /libCEED/rust/libceed-sys/c-src/interface/ceed-qfunction-register.c (revision 2b730f8b5a9c809740a0b3b302db43a719c636b1)
1 // Copyright (c) 2017-2022, 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 #include <ceed/backend.h>
9 #include <ceed/ceed.h>
10 
11 static bool register_all_called;
12 
13 #define MACRO(name) CEED_INTERN int name(void);
14 #include "../gallery/ceed-gallery-list.h"
15 #undef MACRO
16 
17 /**
18   @brief Register the gallery of preconfigured QFunctions.
19 
20   This is called automatically by CeedQFunctionCreateInteriorByName() and thus normally need not be called by users.
21   Users can call CeedQFunctionRegister() to register additional backends.
22 
23   @return An error code: 0 - success, otherwise - failure
24 
25   @sa CeedQFunctionRegister()
26 
27   @ref User
28 **/
29 int CeedQFunctionRegisterAll() {
30   if (register_all_called) return 0;
31   register_all_called = true;
32   CeedDebugEnv256(1, "\n---------- Registering Gallery QFunctions ----------\n");
33 #define MACRO(name) CeedChk(name());
34 #include "../gallery/ceed-gallery-list.h"
35 #undef MACRO
36   return CEED_ERROR_SUCCESS;
37 }
38