~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to libdrizzle/conn.c

  • Committer: Monty Taylor
  • Date: 2010-12-10 14:36:32 UTC
  • mto: (2023.3.15 innodb-cxx)
  • mto: This revision was merged to the branch mainline in revision 2014.
  • Revision ID: mordred@inaugust.com-20101210143632-6ucvr5sb4dnxwjv2
Fixed c++-compat warnings in libdrizzle.

Show diffs side-by-side

added added

removed removed

Lines of Context:
177
177
  return drizzle_sqlstate(con->drizzle);
178
178
}
179
179
 
180
 
drizzle_con_options_t drizzle_con_options(const drizzle_con_st *con)
 
180
int drizzle_con_options(const drizzle_con_st *con)
181
181
{
182
182
  return con->options;
183
183
}
184
184
 
185
185
void drizzle_con_set_options(drizzle_con_st *con,
186
 
                             drizzle_con_options_t options)
 
186
                             int options)
187
187
{
188
188
  con->options= options;
189
189
}
190
190
 
191
191
void drizzle_con_add_options(drizzle_con_st *con,
192
 
                             drizzle_con_options_t options)
 
192
                             int options)
193
193
{
194
194
  con->options|= options;
195
195
 
199
199
}
200
200
 
201
201
void drizzle_con_remove_options(drizzle_con_st *con,
202
 
                                drizzle_con_options_t options)
 
202
                                int options)
203
203
{
204
204
  con->options&= ~options;
205
205
}
352
352
  return con->scramble;
353
353
}
354
354
 
355
 
drizzle_capabilities_t drizzle_con_capabilities(const drizzle_con_st *con)
 
355
int drizzle_con_capabilities(const drizzle_con_st *con)
356
356
{
357
357
  return con->capabilities;
358
358
}
594
594
}
595
595
 
596
596
void drizzle_con_set_capabilities(drizzle_con_st *con,
597
 
                                  drizzle_capabilities_t capabilities)
 
597
                                  int capabilities)
598
598
{
599
599
  con->capabilities= capabilities;
600
600
}
666
666
  size_t offset= 0;
667
667
  size_t size= 0;
668
668
 
669
 
  command_data= drizzle_con_command_read(con, command, &offset, &size, total,
670
 
                                         ret_ptr);
 
669
  command_data= (uint8_t *)drizzle_con_command_read(con, command, &offset,
 
670
                                                    &size, total, ret_ptr);
671
671
  if (*ret_ptr != DRIZZLE_RETURN_OK)
672
672
    return NULL;
673
673
 
679
679
 
680
680
  if (con->command_buffer == NULL)
681
681
  {
682
 
    con->command_buffer= malloc((*total) + 1);
 
682
    con->command_buffer= (uint8_t *)malloc((*total) + 1);
683
683
    if (con->command_buffer == NULL)
684
684
    {
685
685
      drizzle_set_error(con->drizzle, "drizzle_command_buffer", "malloc");
692
692
 
693
693
  while ((offset + size) != (*total))
694
694
  {
695
 
    command_data= drizzle_con_command_read(con, command, &offset, &size, total,
696
 
                                           ret_ptr);
 
695
    command_data= (uint8_t *)drizzle_con_command_read(con, command, &offset,
 
696
                                                      &size, total, ret_ptr);
697
697
    if (*ret_ptr != DRIZZLE_RETURN_OK)
698
698
      return NULL;
699
699
 
983
983
      {
984
984
        ret= drizzle_con_set_events(con, POLLIN);
985
985
        if (ret != DRIZZLE_RETURN_OK)
986
 
          return 0;
 
986
          return DRIZZLE_RETURN_OK;
987
987
 
988
988
        if (con->drizzle->options & DRIZZLE_NON_BLOCKING)
989
989
          return DRIZZLE_RETURN_IO_WAIT;
1180
1180
    }
1181
1181
 
1182
1182
    /* Wait for read events on the listening socket. */
1183
 
    ret= drizzle_con_set_events(new_con, POLLIN);
 
1183
    drizzle_return_t driz_ret= drizzle_con_set_events(new_con, POLLIN);
1184
1184
    if (ret != DRIZZLE_RETURN_OK)
1185
1185
    {
1186
1186
      drizzle_con_free(new_con);
1187
 
      return ret;
 
1187
      return driz_ret;
1188
1188
    }
1189
1189
 
1190
1190
    drizzle_log_info(con->drizzle, "listening on %s:%s", host, port);