CUBRID Engine  latest
cas_common.h File Reference
#include <sys/types.h>
#include <sys/socket.h>
#include "porting.h"
Include dependency graph for cas_common.h:

Go to the source code of this file.

Macros

#define makestring1(x)   #x
 
#define makestring(x)   makestring1(x)
 
#define MAX_SERVER_H_ID   256
 
#define MAX_BIND_VALUE   10240
 
#define MAX_QUERY_LEN   100000
 
#define CAS_RUNNER_CONF   "cas_runner.conf"
 
#define CAS_RUNNER_CONF_ENV   "CAS_RUNNER_CONF"
 
#define CAS_USE_DEFAULT_DB_PARAM   -2
 
#define ON   1
 
#define OFF   0
 
#define TRUE   1
 
#define FALSE   0
 
#define INT_STR_LEN   16
 
#define MALLOC(SIZE)   malloc(SIZE)
 
#define REALLOC(PTR, SIZE)   ((PTR == NULL) ? malloc(SIZE) : realloc(PTR, SIZE))
 
#define FREE(PTR)   free(PTR)
 
#define FREE_MEM(PTR)
 
#define ALLOC_COPY(PTR, STR)
 
#define CLOSE_SOCKET(X)
 
#define ALLOC_N_COPY(PTR, STR, SIZE)
 
#define SLEEP_SEC(X)   sleep(X)
 
#define SLEEP_MILISEC(sec, msec)
 
#define THREAD_BEGIN(THR_ID, FUNC, ARG)
 
#define READ_FROM_SOCKET(fd, buf, size)   read(fd, buf, size)
 
#define WRITE_TO_SOCKET(fd, buf, size)   write(fd, buf, size)
 
#define THREAD_FUNC   void*
 
#define CAS_SCHEMA_DEFAULT_CHARSET   (lang_charset ())
 

Typedefs

typedef socklen_t T_SOCKLEN
 

Enumerations

enum  {
  FN_STATUS_NONE = -2, FN_STATUS_IDLE = -1, FN_STATUS_CONN = 0, FN_STATUS_BUSY = 1,
  FN_STATUS_DONE = 2
}
 

Functions

int uts_key_check_local_host (void)
 

Macro Definition Documentation

#define ALLOC_COPY (   PTR,
  STR 
)
Value:
do { \
if (STR == NULL) \
PTR = NULL; \
else { \
PTR = (char *) MALLOC(strlen(STR) + 1); \
if (PTR) { \
strcpy(PTR, STR); \
} \
} \
} while (0)
#define NULL
Definition: freelistheap.h:34
if(extra_options)
Definition: dynamic_load.c:958
#define MALLOC(SIZE)
Definition: cas_common.h:53
#define strlen(s1)
Definition: intl_support.c:43
else

Definition at line 66 of file cas_common.h.

Referenced by log_unformat_ahead_volumes(), logddl_set_err_msg(), logpb_delete(), net_buf_column_info_set(), net_buf_cp_post_send_file(), prepare_column_list_info_set(), str_like(), and ux_prepare().

#define ALLOC_N_COPY (   PTR,
  STR,
  SIZE 
)
Value:
do { \
if (STR == NULL) \
PTR = NULL; \
else { \
PTR = MALLOC(SIZE); \
if (PTR) { \
strncpy(PTR, STR, SIZE); \
PTR[SIZE - 1] = '\0'; \
} \
} \
} while (0)
#define NULL
Definition: freelistheap.h:34
if(extra_options)
Definition: dynamic_load.c:958
#define MALLOC(SIZE)
Definition: cas_common.h:53
else

Definition at line 92 of file cas_common.h.

#define CAS_RUNNER_CONF   "cas_runner.conf"

Definition at line 41 of file cas_common.h.

Referenced by read_conf().

#define CAS_RUNNER_CONF_ENV   "CAS_RUNNER_CONF"

Definition at line 42 of file cas_common.h.

Referenced by read_conf().

#define CAS_USE_DEFAULT_DB_PARAM   -2
#define FALSE   0

Definition at line 49 of file cas_common.h.

#define FREE (   PTR)    free(PTR)
#define FREE_MEM (   PTR)
Value:
do { \
if (PTR) { \
FREE(PTR); \
PTR = 0; \
} \
} while (0)
#define FREE(PTR)
Definition: cas_common.h:56
if(extra_options)
Definition: dynamic_load.c:958

Definition at line 58 of file cas_common.h.

Referenced by broker_delete_proxy_conn_by_fd(), broker_delete_proxy_conn_by_proxy_id(), broker_free_all_proxy_conn_ent(), cas_main(), cas_runner(), col_update_info_free(), conf_item_free(), dbval_to_net_buf(), delete_node(), fetch_attribute(), fn_collection(), fn_proxy_client_prepare(), free_br_tester_info(), free_env(), free_node(), get_attr_name_from_argv(), get_domain_str(), hm_qresult_end(), hm_srv_handle_free(), hm_srv_handle_free_all(), info_add(), init_default_conn_info(), link_list_add(), log_converter(), logddl_destroy(), logddl_free(), logddl_init(), logddl_set_err_msg(), logddl_set_sql_text(), main(), make_bind_value(), make_env(), make_node_info(), make_prepare_call_info(), make_sql_stmt(), net_buf_clear(), net_buf_column_info_set(), net_buf_cp_post_send_file(), net_buf_destroy(), net_decode_str(), prepare_column_list_info_set(), print_result(), print_result_set(), process_request(), proxy_client_check_waiter_and_wakeup(), proxy_client_execute_internal(), proxy_client_io_destroy(), proxy_context_add_stmt(), proxy_context_destroy(), proxy_context_free_stmt(), proxy_event_dup(), proxy_event_free(), proxy_handler_process_client_request(), proxy_io_buffer_clear(), proxy_io_destroy(), proxy_send_prepared_stmt_to_client(), proxy_shard_io_destroy(), proxy_socket_io_destroy(), proxy_waiter_free(), query_info_add(), query_info_add_ne(), query_info_clear(), release_all_fk_info_results(), sch_attr_priv(), sch_class_priv(), shard_cqueue_destroy(), shard_queue_dequeue(), shard_queue_destroy(), shard_stmt_check_waiter_and_wakeup(), shard_stmt_destroy(), shard_stmt_free(), shard_stmt_save_prepare_request(), sql_info_write(), srv_handle_content_free(), str_like(), t_string_free(), t_string_make(), uc_change_config(), uc_info_free(), uc_unicas_conf_free(), ut_get_line(), ux_cursor(), ux_cursor_update(), ux_execute(), ux_execute_all(), ux_execute_array(), ux_execute_call(), ux_get_attr_type_str(), ux_oid_get(), ux_oid_put(), ux_prepare(), ux_prepare_call_info_free(), and ux_use_sp_out().

#define INT_STR_LEN   16

Definition at line 51 of file cas_common.h.

#define makestring (   x)    makestring1(x)

Definition at line 36 of file cas_common.h.

#define makestring1 (   x)    #x

Definition at line 35 of file cas_common.h.

#define MAX_BIND_VALUE   10240

Definition at line 39 of file cas_common.h.

Referenced by cas_runner(), and process_bind().

#define MAX_QUERY_LEN   100000

Definition at line 40 of file cas_common.h.

#define MAX_SERVER_H_ID   256

Definition at line 38 of file cas_common.h.

#define OFF   0

Definition at line 46 of file cas_common.h.

#define ON   1

Definition at line 45 of file cas_common.h.

#define READ_FROM_SOCKET (   fd,
  buf,
  size 
)    read(fd, buf, size)

Definition at line 141 of file cas_common.h.

Referenced by check_cas_log(), and read_from_client_with_timeout().

#define SLEEP_MILISEC (   sec,
  msec 
)
Value:
do { \
struct timeval sleep_time_val; \
sleep_time_val.tv_sec = sec; \
sleep_time_val.tv_usec = (msec) * 1000; \
select(0, 0, 0, 0, &sleep_time_val); \
} while(0)

Definition at line 110 of file cas_common.h.

#define SLEEP_SEC (   X)    sleep(X)

Definition at line 109 of file cas_common.h.

Referenced by admin_restart_cmd(), and shard_cas_main().

#define THREAD_BEGIN (   THR_ID,
  FUNC,
  ARG 
)
Value:
do { \
pthread_attr_t thread_attr; \
pthread_attr_init(&thread_attr); \
pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_DETACHED); \
pthread_create(&(THR_ID), &thread_attr, FUNC, ARG); \
pthread_attr_destroy(&thread_attr); \
} while (0)

Definition at line 126 of file cas_common.h.

Referenced by log_top_query(), and main().

#define TRUE   1

Definition at line 48 of file cas_common.h.

#define WRITE_TO_SOCKET (   fd,
  buf,
  size 
)    write(fd, buf, size)

Definition at line 142 of file cas_common.h.

Referenced by write_to_client_with_timeout().

Typedef Documentation

typedef socklen_t T_SOCKLEN

Definition at line 156 of file cas_common.h.

Enumeration Type Documentation

anonymous enum
Enumerator
FN_STATUS_NONE 
FN_STATUS_IDLE 
FN_STATUS_CONN 
FN_STATUS_BUSY 
FN_STATUS_DONE 

Definition at line 159 of file cas_common.h.

Function Documentation

int uts_key_check_local_host ( void  )