~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/info_schema/info_schema_methods.cc

  • Committer: Brian Aker
  • Date: 2009-07-21 00:55:33 UTC
  • mfrom: (1093.1.21 captain)
  • Revision ID: brian@gaz-20090721005533-ran2v2otw7tbmiym
Merge Jay

Show diffs side-by-side

added added

removed removed

Lines of Context:
330
330
  return (0);
331
331
}
332
332
 
333
 
class ShowPlugins : public unary_function<st_plugin_int *, bool>
 
333
class ShowPlugins : public unary_function<drizzled::plugin::Handle *, bool>
334
334
{
335
335
  Session *session;
336
336
  Table *table;
340
340
 
341
341
  result_type operator() (argument_type plugin)
342
342
  {
343
 
    struct drizzled_plugin_manifest *plug= plugin_decl(plugin);
 
343
    const drizzled::plugin::Manifest &manifest= plugin->getManifest();
344
344
    const CHARSET_INFO * const cs= system_charset_info;
345
345
 
346
346
    table->restoreRecordAsDefault();
347
347
 
348
 
    table->field[0]->store(plugin_name(plugin)->str,
349
 
                           plugin_name(plugin)->length, cs);
 
348
    table->field[0]->store(plugin->getName().c_str(),
 
349
                           plugin->getName().size(), cs);
350
350
 
351
 
    if (plug->version)
 
351
    if (manifest.version)
352
352
    {
353
 
      table->field[1]->store(plug->version, strlen(plug->version), cs);
 
353
      table->field[1]->store(manifest.version, strlen(manifest.version), cs);
354
354
      table->field[1]->set_notnull();
355
355
    }
356
356
    else
365
365
      table->field[2]->store(STRING_WITH_LEN("INACTIVE"), cs);
366
366
    }
367
367
 
368
 
    if (plug->author)
 
368
    if (manifest.author)
369
369
    {
370
 
      table->field[3]->store(plug->author, strlen(plug->author), cs);
 
370
      table->field[3]->store(manifest.author, strlen(manifest.author), cs);
371
371
      table->field[3]->set_notnull();
372
372
    }
373
373
    else
375
375
      table->field[3]->set_null();
376
376
    }
377
377
 
378
 
    if (plug->descr)
 
378
    if (manifest.descr)
379
379
    {
380
 
      table->field[4]->store(plug->descr, strlen(plug->descr), cs);
 
380
      table->field[4]->store(manifest.descr, strlen(manifest.descr), cs);
381
381
      table->field[4]->set_notnull();
382
382
    }
383
383
    else
385
385
      table->field[4]->set_null();
386
386
    }
387
387
 
388
 
    switch (plug->license) {
 
388
    switch (manifest.license) {
389
389
    case PLUGIN_LICENSE_GPL:
390
 
      table->field[5]->store(PLUGIN_LICENSE_GPL_STRING,
391
 
                             strlen(PLUGIN_LICENSE_GPL_STRING), cs);
 
390
      table->field[5]->store(drizzled::plugin::LICENSE_GPL_STRING.c_str(),
 
391
                             drizzled::plugin::LICENSE_GPL_STRING.size(), cs);
392
392
      break;
393
393
    case PLUGIN_LICENSE_BSD:
394
 
      table->field[5]->store(PLUGIN_LICENSE_BSD_STRING,
395
 
                             strlen(PLUGIN_LICENSE_BSD_STRING), cs);
 
394
      table->field[5]->store(drizzled::plugin::LICENSE_BSD_STRING.c_str(),
 
395
                             drizzled::plugin::LICENSE_BSD_STRING.size(), cs);
396
396
      break;
397
397
    case PLUGIN_LICENSE_LGPL:
398
 
      table->field[5]->store(PLUGIN_LICENSE_LGPL_STRING,
399
 
                             strlen(PLUGIN_LICENSE_LGPL_STRING), cs);
 
398
      table->field[5]->store(drizzled::plugin::LICENSE_LGPL_STRING.c_str(),
 
399
                             drizzled::plugin::LICENSE_LGPL_STRING.size(), cs);
400
400
      break;
401
401
    default:
402
 
      table->field[5]->store(PLUGIN_LICENSE_PROPRIETARY_STRING,
403
 
                             strlen(PLUGIN_LICENSE_PROPRIETARY_STRING), cs);
 
402
      table->field[5]->store(drizzled::plugin::LICENSE_PROPRIETARY_STRING.c_str(),
 
403
                             drizzled::plugin::LICENSE_PROPRIETARY_STRING.size(),
 
404
                             cs);
404
405
      break;
405
406
    }
406
407
    table->field[5]->set_notnull();
414
415
  Table *table= tables->table;
415
416
 
416
417
  PluginRegistry &registry= PluginRegistry::getPluginRegistry();
417
 
  vector<st_plugin_int *> plugins= registry.get_list(true);
418
 
  vector<st_plugin_int *>::iterator iter=
 
418
  vector<drizzled::plugin::Handle *> plugins= registry.get_list(true);
 
419
  vector<drizzled::plugin::Handle *>::iterator iter=
419
420
    find_if(plugins.begin(), plugins.end(), ShowPlugins(session, table));
420
421
  if (iter != plugins.end())
421
422
  {