xref: /libCEED/interface/ceed-qfunction-register.c (revision e15f9bd09af0280c89b79924fa9af7dd2e3e30be)
13d576824SJeremy L Thompson #include <ceed.h>
23d576824SJeremy L Thompson #include <ceed-backend.h>
33d576824SJeremy L Thompson #include <stdbool.h>
41d013790SJed Brown 
51d013790SJed Brown static bool register_all_called;
61d013790SJed Brown 
71d013790SJed Brown #define MACRO(name) CEED_INTERN int name(void);
81d013790SJed Brown #include "../gallery/ceed-gallery-list.h"
91d013790SJed Brown #undef MACRO
101d013790SJed Brown 
111d013790SJed Brown /**
121d013790SJed Brown   @brief Register the gallery of preconfigured QFunctions.
131d013790SJed Brown 
141d013790SJed Brown   This is called automatically by CeedQFunctionCreateInteriorByName() and thus normally need not be called by users.
151d013790SJed Brown   Users can call CeedQFunctionRegister() to register additional backends.
161d013790SJed Brown 
171d013790SJed Brown   @return An error code: 0 - success, otherwise - failure
181d013790SJed Brown 
191d013790SJed Brown   @sa CeedQFunctionRegister()
201d013790SJed Brown 
21ded9b81dSJeremy L Thompson   @ref User
221d013790SJed Brown **/
231d013790SJed Brown int CeedQFunctionRegisterAll() {
241d013790SJed Brown   if (register_all_called) return 0;
251d013790SJed Brown   register_all_called = true;
261d013790SJed Brown 
271d013790SJed Brown #define MACRO(name) CeedChk(name());
281d013790SJed Brown #include "../gallery/ceed-gallery-list.h"
291d013790SJed Brown #undef MACRO
30*e15f9bd0SJeremy L Thompson   return CEED_ERROR_SUCCESS;
311d013790SJed Brown }
32