~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to vio/vio.c

  • Committer: Monty Taylor
  • Date: 2008-10-08 01:10:45 UTC
  • mto: This revision was merged to the branch mainline in revision 491.
  • Revision ID: monty@inaugust.com-20081008011045-zqozbc81f8qhmxok
Get rid of pragma interface/pragma implementation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 */
28
28
 
29
29
static void vio_init(Vio* vio, enum enum_vio_type type,
30
 
                     my_socket sd, uint32_t flags)
 
30
                     int sd, uint32_t flags)
31
31
{
32
32
#ifndef HAVE_VIO_READ_BUFF
33
33
  flags&= ~VIO_BUFFERED_READ;
34
34
#endif
35
 
  bzero((char*) vio, sizeof(*vio));
 
35
  memset(vio, 0, sizeof(*vio));
36
36
  vio->type     = type;
37
37
  vio->sd       = sd;
38
38
  if ((flags & VIO_BUFFERED_READ) &&
59
59
/* Reset initialized VIO to use with another transport type */
60
60
 
61
61
void vio_reset(Vio* vio, enum enum_vio_type type,
62
 
               my_socket sd, uint flags)
 
62
               int sd, uint32_t flags)
63
63
{
64
 
  my_free(vio->read_buffer, MYF(MY_ALLOW_ZERO_PTR));
 
64
  free(vio->read_buffer);
65
65
  vio_init(vio, type, sd, flags);
66
66
}
67
67
 
68
68
 
69
69
/* Open the socket or TCP/IP connection and read the fnctl() status */
70
70
 
71
 
Vio *vio_new(my_socket sd, enum enum_vio_type type, uint flags)
 
71
Vio *vio_new(int sd, enum enum_vio_type type, uint32_t flags)
72
72
{
73
73
  Vio *vio;
74
74
 
100
100
 
101
101
  if (vio->type != VIO_CLOSED)
102
102
    vio->vioclose(vio);
103
 
  my_free((uchar*) vio->read_buffer, MYF(MY_ALLOW_ZERO_PTR));
104
 
  my_free((uchar*) vio, MYF(0));
 
103
  free((unsigned char*) vio->read_buffer);
 
104
  free((unsigned char*) vio);
105
105
}
106
106
 
107
107