xref: /libCEED/interface/ceed-qfunction-register.c (revision 3d576824e8d990e1f48c6609089904bee9170514)
1*3d576824SJeremy L Thompson #include <ceed.h>
2*3d576824SJeremy L Thompson #include <ceed-backend.h>
3*3d576824SJeremy 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
301d013790SJed Brown   return 0;
311d013790SJed Brown }
32