-/**
-Indicates whether an extension is supported. If this returns true, the
-functions of that extension are safe to use.
-*/
-bool is_supported(const std::string &);
+class Extension
+{
+public:
+ enum SupportLevel
+ {
+ UNSUPPORTED,
+ EXTENSION,
+ CORE
+ };
+
+ typedef SupportLevel (*InitFunc)();
+
+private:
+ const char *name;
+ InitFunc init_func;
+ mutable bool init_done;
+ mutable SupportLevel support;
+
+public:
+ Extension(const char *, InitFunc);
+
+ const char *get_name() const { return name; }
+ operator bool() const;
+};