foo.vala 352 B

123456789101112131415161718
  1. public extern const string FOO_PLUGIN_PATH;
  2. Foo.PluginModule plugin_module;
  3. public int main () {
  4. plugin_module = new Foo.PluginModule (FOO_PLUGIN_PATH, "bar");
  5. if (!plugin_module.load ()) {
  6. return 1;
  7. }
  8. var plugin = Object.new (plugin_module.plugin_type) as Foo.Plugin;
  9. assert ("bar" == plugin.bar ());
  10. return 0;
  11. }