~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/base.h

  • Committer: Monty Taylor
  • Date: 2010-09-28 07:50:05 UTC
  • mto: (1799.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 1800.
  • Revision ID: mordred@inaugust.com-20100928075005-jxyzcy76t0y6be9u
Made BSD files reference root BSD file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 * @TODO Convert HA_XXX defines into enums and/or bitmaps
26
26
 */
27
27
 
28
 
#include "definitions.h"
29
 
 
30
28
#ifndef DRIZZLED_BASE_H
31
29
#define DRIZZLED_BASE_H
32
30
 
475
473
*/
476
474
#define NULL_RANGE      64
477
475
 
478
 
class key_range
 
476
typedef struct st_key_range
479
477
{
480
 
public:
481
478
  const unsigned char *key;
482
479
  uint32_t length;
483
480
  enum ha_rkey_function flag;
484
481
  key_part_map keypart_map;
485
 
};
 
482
} key_range;
486
483
 
487
 
class KEY_MULTI_RANGE
 
484
typedef struct st_key_multi_range
488
485
{
489
 
public:
490
486
  key_range start_key;
491
487
  key_range end_key;
492
488
  char  *ptr;                 /* Free to use by caller (ptr to row etc) */
493
489
  uint32_t  range_flag;           /* key range flags see above */
494
 
};
 
490
} KEY_MULTI_RANGE;
495
491
 
496
492
 
497
493
/* For number of records */
498
494
typedef uint64_t        ha_rows;
499
 
inline static double rows2double(ha_rows rows)
500
 
{  
501
 
  return uint64_t2double(rows);
502
 
}
 
495
#define rows2double(A)  uint64_t2double(A)
503
496
 
504
497
#define HA_POS_ERROR    (~ (::drizzled::ha_rows) 0)
505
498
#define HA_OFFSET_ERROR (~ (::drizzled::internal::my_off_t) 0)
510
503
#define MAX_FILE_SIZE   INT64_MAX
511
504
#endif
512
505
 
513
 
inline static uint32_t ha_varchar_packlength(uint32_t field_length)
514
 
{
515
 
  return (field_length < 256 ? 1 :2);
516
 
}
 
506
#define HA_VARCHAR_PACKLENGTH(field_length) ((field_length) < 256 ? 1 :2)
517
507
 
518
508
 
519
509
} /* namespace drizzled */