~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to examples/client.cc

  • Committer: Olaf van der Spek
  • Date: 2011-08-05 13:28:48 UTC
  • mto: This revision was merged to the branch mainline in revision 2395.
  • Revision ID: olafvdspek@gmail.com-20110805132848-vvwjg6pgwf56xnsd
Use const char* instead of str_ref

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
 */
36
36
 
37
37
 
38
 
#include "config.h"
 
38
#include <config.h>
39
39
 
40
40
#include <errno.h>
41
41
#include <stdbool.h>
256
256
 
257
257
  drizzle_free(&(client.drizzle));
258
258
 
259
 
  if (client.client_con_list != NULL)
260
 
    free(client.client_con_list);
 
259
  free(client.client_con_list);
261
260
 
262
261
  return 0;
263
262
}
345
344
            printf("     (NULL)\n");
346
345
          else
347
346
          {
348
 
            printf("     (%zd) %.*s\n", field_sizes[x], (int32_t)field_sizes[x],
 
347
            printf("     (%"PRIu64") %.*s\n", static_cast<uint64_t>(field_sizes[x]), (int32_t)field_sizes[x],
349
348
                   row[x]);
350
349
          }
351
350
        }
409
408
          else if (offset > 0)
410
409
            printf("%.*s", (int32_t)length, field);
411
410
          else
412
 
            printf("     (%zd) %.*s", total, (int32_t)length, field);
 
411
            printf("     (%" PRIu64 " %.*s", (uint64_t)total,
 
412
                            (int32_t)length, field);
413
413
 
414
414
          if (offset + length == total)
415
415
            printf("\n");
439
439
        field_sizes= drizzle_row_field_sizes(&(client_con->result));
440
440
 
441
441
        printf("Row: %" PRId64 "\n",
442
 
               drizzle_row_current(&(client_con->result)));
 
442
               static_cast<uint64_t>(drizzle_row_current(&(client_con->result))));
443
443
 
444
444
        for (x= 0; x < drizzle_result_column_count(&(client_con->result)); x++)
445
445
        {
447
447
            printf("     (NULL)\n");
448
448
          else
449
449
          {
450
 
            printf("     (%zd) %.*s\n", field_sizes[x], (int32_t)field_sizes[x],
 
450
            printf("     (%" PRIu64 " %.*s\n", static_cast<uint64_t>(field_sizes[x]), (int32_t)field_sizes[x],
451
451
                   row[x]);
452
452
          }
453
453
        }
505
505
         "        org_name=%s\n"
506
506
         "         charset=%u\n"
507
507
         "            size=%u\n"
508
 
         "        max_size=%zu\n"
 
508
         "        max_size=%" PRIu64 "\n"
509
509
         "            type=%u\n"
510
510
         "           flags=%u\n\n",
511
511
         drizzle_column_catalog(column), drizzle_column_db(column),
512
512
         drizzle_column_table(column), drizzle_column_orig_table(column),
513
513
         drizzle_column_name(column), drizzle_column_orig_name(column),
514
514
         drizzle_column_charset(column), drizzle_column_size(column),
515
 
         drizzle_column_max_size(column), drizzle_column_type(column),
 
515
         static_cast<uint64_t>(drizzle_column_max_size(column)), drizzle_column_type(column),
516
516
         drizzle_column_flags(column));
517
517
}