00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #pragma once
00021
00022 #include <stddef.h>
00023
00024 namespace drizzled
00025 {
00026
00027
00028
00029
00030
00031
00032 typedef struct lex_string_t
00033 {
00034 char *str;
00035 size_t length;
00036 } LEX_STRING;
00037
00038 inline const LEX_STRING &null_lex_string()
00039 {
00040 static LEX_STRING tmp= { NULL, 0 };
00041 return tmp;
00042 }
00043
00044 #define NULL_LEX_STRING null_lex_string()
00045
00046 struct execute_string_t : public lex_string_t
00047 {
00048 private:
00049 bool is_variable;
00050 public:
00051
00052 bool isVariable() const
00053 {
00054 return is_variable;
00055 }
00056
00057 void set(const lex_string_t& ptr, bool is_variable_arg= false)
00058 {
00059 is_variable= is_variable_arg;
00060 str= ptr.str;
00061 length= ptr.length;
00062 }
00063
00064 };
00065
00066
00067 #define STRING_WITH_LEN(X) (X), (static_cast<size_t>((sizeof(X) - 1)))
00068 #define C_STRING_WITH_LEN(X) (const_cast<char *>((X))), (static_cast<size_t>((sizeof(X) - 1)))
00069
00070 }
00071