~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/drizzle_protocol/oldlibdrizzle.cc

Merge Monty

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
#include "oldlibdrizzle.h"
34
34
#include "options.h"
35
35
 
 
36
#define PROTOCOL_VERSION 10
 
37
 
 
38
namespace drizzled
 
39
{
 
40
extern uint32_t global_thread_id;
 
41
}
 
42
 
36
43
using namespace std;
37
44
using namespace drizzled;
38
45
 
39
 
#define PROTOCOL_VERSION 10
40
 
 
41
 
extern uint32_t global_thread_id;
42
 
 
43
46
static const uint32_t DRIZZLE_TCP_PORT= 4427;
44
47
static const unsigned int PACKET_BUFFER_EXTRA_ALLOC= 1024;
45
48
static uint32_t port;
573
576
{
574
577
  char buff[12];
575
578
  return netStoreData((unsigned char*) buff,
576
 
                      (size_t) (int10_to_str(from, buff, -10) - buff));
 
579
                      (size_t) (internal::int10_to_str(from, buff, -10) - buff));
577
580
}
578
581
 
579
582
bool ClientDrizzleProtocol::store(uint32_t from)
580
583
{
581
584
  char buff[11];
582
585
  return netStoreData((unsigned char*) buff,
583
 
                      (size_t) (int10_to_str(from, buff, 10) - buff));
 
586
                      (size_t) (internal::int10_to_str(from, buff, 10) - buff));
584
587
}
585
588
 
586
589
bool ClientDrizzleProtocol::store(int64_t from)
587
590
{
588
591
  char buff[22];
589
592
  return netStoreData((unsigned char*) buff,
590
 
                      (size_t) (int64_t10_to_str(from, buff, -10) - buff));
 
593
                      (size_t) (internal::int64_t10_to_str(from, buff, -10) - buff));
591
594
}
592
595
 
593
596
bool ClientDrizzleProtocol::store(uint64_t from)
594
597
{
595
598
  char buff[21];
596
599
  return netStoreData((unsigned char*) buff,
597
 
                      (size_t) (int64_t10_to_str(from, buff, 10) - buff));
 
600
                      (size_t) (internal::int64_t10_to_str(from, buff, 10) - buff));
598
601
}
599
602
 
600
603
bool ClientDrizzleProtocol::store(double from, uint32_t decimals, String *buffer)
808
811
 
809
812
static ListenDrizzleProtocol *listen_obj= NULL;
810
813
 
811
 
static int init(drizzled::plugin::Registry &registry)
 
814
static int init(plugin::Registry &registry)
812
815
{
813
816
  listen_obj= new ListenDrizzleProtocol("drizzle_protocol", false);
814
817
  registry.add(listen_obj); 
815
818
  return 0;
816
819
}
817
820
 
818
 
static int deinit(drizzled::plugin::Registry &registry)
 
821
static int deinit(plugin::Registry &registry)
819
822
{
820
823
  registry.remove(listen_obj);
821
824
  delete listen_obj;
843
846
static DRIZZLE_SYSVAR_STR(bind_address, bind_address, PLUGIN_VAR_READONLY,
844
847
                          N_("Address to bind to."), NULL, NULL, NULL);
845
848
 
846
 
static drizzle_sys_var* system_variables[]= {
 
849
static drizzle_sys_var* sys_variables[]= {
847
850
  DRIZZLE_SYSVAR(port),
848
851
  DRIZZLE_SYSVAR(connect_timeout),
849
852
  DRIZZLE_SYSVAR(read_timeout),
865
868
  init,             /* Plugin Init */
866
869
  deinit,           /* Plugin Deinit */
867
870
  NULL,             /* status variables */
868
 
  system_variables, /* system variables */
 
871
  sys_variables,    /* system variables */
869
872
  NULL              /* config options */
870
873
}
871
874
DRIZZLE_DECLARE_PLUGIN_END;