CUBRID Engine  latest
keyword.c File Reference
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include "csql_grammar.h"
#include "parser.h"
#include "dbtype.h"
#include "string_opfunc.h"
#include "chartype.h"
Include dependency graph for keyword.c:

Go to the source code of this file.

Macros

#define GET_KEYWORD_HASH_VALUE(h, s)
 
#define MAGIC_NUM_BI_SEQ   (5) /* Performance intersection between binary and sequential search */
 

Functions

static KEYWORD_RECORDpt_find_keyword (const char *text)
 
static int keyword_cmp (const void *k1, const void *k2)
 
bool pt_is_reserved_word (const char *text)
 
bool pt_is_keyword (const char *text)
 
KEYWORD_RECORDpt_get_keyword_rec (int *rec_count)
 

Variables

static KEYWORD_RECORD keywords []
 

Macro Definition Documentation

#define GET_KEYWORD_HASH_VALUE (   h,
 
)
Value:
do { \
unsigned char* p = (unsigned char*)(s); \
for((h) = 5381; *p; p++ ) \
{ \
(h) = (((h) << 5) + (h)) + *p; /* hash * 33 + c */ \
} \
} while(0)
for(p=libs;*p;p++)
Definition: dynamic_load.c:968
const char ** p
Definition: dynamic_load.c:945

Definition at line 533 of file keyword.c.

Referenced by pt_find_keyword().

#define MAGIC_NUM_BI_SEQ   (5) /* Performance intersection between binary and sequential search */

Referenced by pt_find_keyword().

Function Documentation

static int keyword_cmp ( const void *  k1,
const void *  k2 
)
static

Definition at line 543 of file keyword.c.

References cmp.

Referenced by pt_find_keyword().

Here is the caller graph for this function:

static KEYWORD_RECORD * pt_find_keyword ( const char *  text)
static

Definition at line 561 of file keyword.c.

References char_toupper(), cmp, for(), GET_KEYWORD_HASH_VALUE, keyword_record::hash_value, i, keyword_record::keyword, keyword_cmp(), keywords, MAGIC_NUM_BI_SEQ, MAX_KEYWORD_SIZE, NULL, p, and strlen.

Referenced by pt_is_keyword(), and pt_is_reserved_word().

Here is the caller graph for this function:

KEYWORD_RECORD* pt_get_keyword_rec ( int *  rec_count)

Definition at line 757 of file keyword.c.

References keywords.

Referenced by start_csql().

Here is the caller graph for this function:

bool pt_is_keyword ( const char *  text)

Definition at line 724 of file keyword.c.

References pt_find_keyword().

Referenced by pt_append_name().

Here is the caller graph for this function:

bool pt_is_reserved_word ( const char *  text)

Definition at line 697 of file keyword.c.

References pt_find_keyword(), and keyword_record::unreserved.

Referenced by db_create_vclass().

Here is the caller graph for this function:

Variable Documentation

KEYWORD_RECORD keywords[]
static