~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to libdrizzleclient/libdrizzle.c

  • Committer: Monty Taylor
  • Date: 2009-02-08 11:11:30 UTC
  • mto: This revision was merged to the branch mainline in revision 852.
  • Revision ID: mordred@inaugust.com-20090208111130-futpwptxv5he3boe
Renamed non-prefixed things from libdrizzleclient to drizzleclient.

Show diffs side-by-side

added added

removed removed

Lines of Context:
116
116
  Change user and database
117
117
**************************************************************************/
118
118
 
119
 
int cli_read_change_user_result(DRIZZLE *drizzle)
 
119
int drizzleclient_cli_read_change_user_result(DRIZZLE *drizzle)
120
120
{
121
121
  uint32_t pkt_length;
122
122
 
123
 
  pkt_length= cli_safe_read(drizzle);
 
123
  pkt_length= drizzleclient_cli_safe_read(drizzle);
124
124
 
125
125
  if (pkt_length == packet_error)
126
126
    return 1;
278
278
}
279
279
 
280
280
 
281
 
DRIZZLE_FIELD *cli_list_fields(DRIZZLE *drizzle)
 
281
DRIZZLE_FIELD *drizzleclient_cli_list_fields(DRIZZLE *drizzle)
282
282
{
283
283
  DRIZZLE_DATA *query;
284
 
  if (!(query= cli_read_rows(drizzle,(DRIZZLE_FIELD*) 0, 8)))
 
284
  if (!(query= drizzleclient_cli_read_rows(drizzle,(DRIZZLE_FIELD*) 0, 8)))
285
285
    return NULL;
286
286
 
287
287
  drizzle->field_count= (uint32_t) query->rows;
306
306
  end= strncpy(buff, table, 128) + 128;
307
307
  end= strncpy(end+1, wild ? wild : "", 128) + 128;
308
308
 
309
 
  free_old_query(drizzle);
 
309
  drizzleclient_free_old_query(drizzle);
310
310
  if (simple_command(drizzle, COM_FIELD_LIST, (unsigned char*) buff,
311
311
                     (uint32_t) (end-buff), 1) ||
312
312
      !(fields= (*drizzle->methods->list_fields)(drizzle)))
336
336
 
337
337
  if (simple_command(drizzle,COM_PROCESS_INFO,0,0,0))
338
338
    return(0);
339
 
  free_old_query(drizzle);
 
339
  drizzleclient_free_old_query(drizzle);
340
340
  pos=(unsigned char*) drizzle->net.read_pos;
341
 
  field_count=(uint32_t) net_field_length(&pos);
 
341
  field_count=(uint32_t) drizzleclient_net_field_length(&pos);
342
342
  if (!(fields = (*drizzle->methods->read_rows)(drizzle,(DRIZZLE_FIELD*) 0, 7)))
343
343
    return(NULL);
344
344
  if (!(drizzle->fields=drizzleclient_unpack_fields(fields, field_count, 0)))
383
383
}
384
384
 
385
385
 
386
 
const char *cli_read_statistics(DRIZZLE *drizzle)
 
386
const char *drizzleclient_cli_read_statistics(DRIZZLE *drizzle)
387
387
{
388
388
  drizzle->net.read_pos[drizzle->packet_length]=0;  /* End of stat string */
389
389
  if (!drizzle->net.read_pos[0])
390
390
  {
391
 
    drizzle_set_error(drizzle, CR_WRONG_HOST_INFO, sqlstate_get_unknown());
 
391
    drizzle_set_error(drizzle, CR_WRONG_HOST_INFO, drizzleclient_sqlstate_get_unknown());
392
392
    return drizzle->net.last_error;
393
393
  }
394
394
  return (char*) drizzle->net.read_pos;
481
481
 
482
482
const char * drizzle_sqlstate(const DRIZZLE *drizzle)
483
483
{
484
 
  return drizzle ? drizzle->net.sqlstate : sqlstate_get_cant_connect();
 
484
  return drizzle ? drizzle->net.sqlstate : drizzleclient_sqlstate_get_cant_connect();
485
485
}
486
486
 
487
487
uint32_t drizzle_warning_count(const DRIZZLE *drizzle)
593
593
  return overflow ? (size_t) -1 : (size_t) (to - to_start);
594
594
}
595
595
 
596
 
int cli_unbuffered_fetch(DRIZZLE *drizzle, char **row)
 
596
int drizzleclient_cli_unbuffered_fetch(DRIZZLE *drizzle, char **row)
597
597
{
598
 
  if (packet_error == cli_safe_read(drizzle))
 
598
  if (packet_error == drizzleclient_cli_safe_read(drizzle))
599
599
    return 1;
600
600
 
601
601
  *row= ((drizzle->net.read_pos[0] == DRIZZLE_PROTOCOL_NO_MORE_DATA) ? NULL :
660
660
{
661
661
  if (drizzle->status != DRIZZLE_STATUS_READY)
662
662
  {
663
 
    drizzle_set_error(drizzle, CR_COMMANDS_OUT_OF_SYNC, sqlstate_get_unknown());
 
663
    drizzle_set_error(drizzle, CR_COMMANDS_OUT_OF_SYNC, drizzleclient_sqlstate_get_unknown());
664
664
    return(1);
665
665
  }
666
666
 
667
 
  net_clear_error(&drizzle->net);
 
667
  drizzleclient_drizzleclient_net_clear_error(&drizzle->net);
668
668
  drizzle->affected_rows= ~(uint64_t) 0;
669
669
 
670
670
  if (drizzle->server_status & SERVER_MORE_RESULTS_EXISTS)