~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to libdrizzleclient/drizzle_data.c

  • Committer: Monty Taylor
  • Date: 2009-03-04 02:16:28 UTC
  • mto: (917.1.2 mordred)
  • mto: This revision was merged to the branch mainline in revision 912.
  • Revision ID: mordred@inaugust.com-20090304021628-rfq0b16uoi09g8tx
Fix to make VPATH builds work again.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
#include <config.h>
 
20
#include <drizzled/global.h>
21
21
 
22
22
#include "libdrizzle_priv.h"
23
23
 
24
 
#include <libdrizzle/drizzle_data.h>
25
 
#include <libdrizzle/drizzle_rows.h>
26
 
#include <libdrizzle/drizzle_field.h>
 
24
#include "drizzle_data.h"
 
25
#include "drizzle_rows.h"
 
26
#include "drizzle_field.h"
27
27
 
28
28
#include <assert.h>
29
29
#include <stdint.h>
36
36
***************************************************************************/
37
37
 
38
38
DRIZZLE_FIELD *
39
 
unpack_fields(DRIZZLE_DATA *data, unsigned int fields,
 
39
drizzleclient_unpack_fields(DRIZZLE_DATA *data, unsigned int fields,
40
40
              bool default_value)
41
41
{
42
42
  DRIZZLE_ROWS  *row;
46
46
  field= result= (DRIZZLE_FIELD*) malloc((unsigned int) sizeof(*field)*fields);
47
47
  if (!result)
48
48
  {
49
 
    free_rows(data);        /* Free old data */
 
49
    drizzleclient_free_rows(data);        /* Free old data */
50
50
    return(0);
51
51
  }
52
52
  memset((char*) field, 0, (unsigned int) sizeof(DRIZZLE_FIELD)*fields);
56
56
    unsigned char *pos;
57
57
    /* fields count may be wrong */
58
58
    assert((unsigned int) (field - result) < fields);
59
 
    cli_fetch_lengths(&lengths[0], row->data, default_value ? 8 : 7);
 
59
    drizzleclient_cli_fetch_lengths(&lengths[0], row->data, default_value ? 8 : 7);
60
60
    field->catalog=   strdup((char*) row->data[0]);
61
61
    field->db=        strdup((char*) row->data[1]);
62
62
    field->table=     strdup((char*) row->data[2]);
96
96
    field->max_length= 0;
97
97
  }
98
98
 
99
 
  free_rows(data);        /* Free old data */
 
99
  drizzleclient_free_rows(data);        /* Free old data */
100
100
  return(result);
101
101
}
102
102
 
103
 
void free_rows(DRIZZLE_DATA *cur)
 
103
void drizzleclient_free_rows(DRIZZLE_DATA *cur)
104
104
{
105
105
  if (cur)
106
106
  {