Drizzled Public API Documentation

compressionudf.cc
00001 /* Copyright (C) 2006 MySQL AB
00002 
00003    This program is free software; you can redistribute it and/or modify
00004    it under the terms of the GNU General Public License as published by
00005    the Free Software Foundation; version 2 of the License.
00006 
00007    This program is distributed in the hope that it will be useful,
00008    but WITHOUT ANY WARRANTY; without even the implied warranty of
00009    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010    GNU General Public License for more details.
00011 
00012    You should have received a copy of the GNU General Public License
00013    along with this program; if not, write to the Free Software
00014    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
00015 
00016 #include <config.h>
00017 #include <drizzled/plugin/function.h>
00018 
00019 #include <plugin/compression/compress.h>
00020 #include <plugin/compression/uncompress.h>
00021 #include <plugin/compression/uncompressed_length.h>
00022 
00023 using namespace std;
00024 using namespace drizzled;
00025 
00026 plugin::Create_function<Item_func_compress> *compressudf= NULL;
00027 plugin::Create_function<Item_func_uncompress> *uncompressudf= NULL;
00028 plugin::Create_function<Item_func_uncompressed_length>
00029   *uncompressed_lengthudf= NULL;
00030 
00031 static int compressionudf_plugin_init(module::Context &context)
00032 {
00033   compressudf= new plugin::Create_function<Item_func_compress>("compress");
00034   uncompressudf=
00035     new plugin::Create_function<Item_func_uncompress>("uncompress");
00036   uncompressed_lengthudf=
00037     new plugin::Create_function<Item_func_uncompressed_length>("uncompressed_length");
00038   context.add(compressudf);
00039   context.add(uncompressudf);
00040   context.add(uncompressed_lengthudf);
00041   return 0;
00042 }
00043 
00044 DRIZZLE_DECLARE_PLUGIN
00045 {
00046   DRIZZLE_VERSION_ID,
00047   "compression",
00048   "1.1",
00049   "Stewart Smith",
00050   "UDFs for compression functions",
00051   PLUGIN_LICENSE_GPL,
00052   compressionudf_plugin_init, /* Plugin Init */
00053   NULL,   /* depends */
00054   NULL    /* config options */
00055 }
00056 DRIZZLE_DECLARE_PLUGIN_END;