~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/base.h

  • Committer: LinuxJedi
  • Date: 2010-09-09 06:14:45 UTC
  • mto: (1750.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 1751.
  • Revision ID: linuxjedi@linuxjedi-laptop-20100909061445-1jz91d5eed932616
Fix another wrong header, grr...

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
 
194
192
  HA_KEYTYPE_ULONG_INT=9,
195
193
  HA_KEYTYPE_LONGLONG=10,
196
194
  HA_KEYTYPE_ULONGLONG=11,
 
195
  HA_KEYTYPE_UINT24=13,
197
196
  /* Varchar (0-255 bytes) with length packed with 1 byte */
198
197
  HA_KEYTYPE_VARTEXT1=15,               /* Key is sorted as letters */
199
198
  HA_KEYTYPE_VARBINARY1=16,             /* Key is sorted as unsigned chars */
475
474
*/
476
475
#define NULL_RANGE      64
477
476
 
478
 
class key_range
 
477
typedef struct st_key_range
479
478
{
480
 
public:
481
479
  const unsigned char *key;
482
480
  uint32_t length;
483
481
  enum ha_rkey_function flag;
484
482
  key_part_map keypart_map;
485
 
};
 
483
} key_range;
486
484
 
487
 
class KEY_MULTI_RANGE
 
485
typedef struct st_key_multi_range
488
486
{
489
 
public:
490
487
  key_range start_key;
491
488
  key_range end_key;
492
489
  char  *ptr;                 /* Free to use by caller (ptr to row etc) */
493
490
  uint32_t  range_flag;           /* key range flags see above */
494
 
};
 
491
} KEY_MULTI_RANGE;
495
492
 
496
493
 
497
494
/* For number of records */
498
495
typedef uint64_t        ha_rows;
499
 
inline static double rows2double(ha_rows rows)
500
 
{  
501
 
  return uint64_t2double(rows);
502
 
}
 
496
#define rows2double(A)  uint64_t2double(A)
503
497
 
504
498
#define HA_POS_ERROR    (~ (::drizzled::ha_rows) 0)
505
499
#define HA_OFFSET_ERROR (~ (::drizzled::internal::my_off_t) 0)
510
504
#define MAX_FILE_SIZE   INT64_MAX
511
505
#endif
512
506
 
513
 
inline static uint32_t ha_varchar_packlength(uint32_t field_length)
514
 
{
515
 
  return (field_length < 256 ? 1 :2);
516
 
}
 
507
#define HA_VARCHAR_PACKLENGTH(field_length) ((field_length) < 256 ? 1 :2)
517
508
 
518
509
 
519
510
} /* namespace drizzled */