Skip to content

File databases_file.c

FileList > base > databases_file.c

Go to the source code of this file

  • #include "config.h"
  • #include <stdlib.h>
  • #include <stdio.h>
  • #include <string.h>
  • #include <signal.h>
  • #include <sys/types.h>
  • #include <sys/stat.h>
  • #include <unistd.h>
  • #include <assert.h>
  • #include "porting.h"
  • #include "chartype.h"
  • #include "error_manager.h"
  • #include "databases_file.h"
  • #include "boot.h"
  • #include "connection_defs.h"
  • #include "memory_alloc.h"
  • #include "environment_variable.h"
  • #include "system_parameter.h"
  • #include "memory_wrapper.hpp"

Public Static Attributes

Type Name
const char CFG_HOST_SEPARATOR = ':'

Public Functions

Type Name
DB_INFO * cfg_add_db (DB_INFO ** dir, const char * name, const char * path, const char * logpath, const char * lobpath, const char * host)
char * cfg_create_host_list (const char * primary_host_name, bool include_local_host, int * count)
bool cfg_delete_db (DB_INFO ** dir_info_p, const char * name)
void cfg_dump_directory (const DB_INFO * databases)
DB_INFO * cfg_find_db (const char * db_name)
DB_INFO * cfg_find_db_list (DB_INFO * db_info_list_p, const char * name)
void cfg_free_directory (DB_INFO * databases)
void cfg_free_hosts (char ** host_array)
char ** cfg_get_hosts (const char * prim_host, int * count, bool include_local_host)
char * cfg_maycreate_get_directory_filename (char * buffer)
DB_INFO * cfg_new_db (const char * name, const char * path, const char * logpath, const char * lobpath, const char ** hosts)
char * cfg_os_working_directory (void)
int cfg_read_directory (DB_INFO ** info_p, bool write_flag)
int cfg_read_directory_ex (int vdes, DB_INFO ** info_p, bool write_flag)
void cfg_update_db (DB_INFO * db_info_p, const char * path, const char * logpath, const char * lobpath, const char * host)
void cfg_write_directory (const DB_INFO * databases)
void cfg_write_directory_ex (int vdes, const DB_INFO * databases)

Public Static Functions

Type Name
char ** cfg_copy_hosts (const char ** host_array, int * num_hosts)
int cfg_ensure_directory_write (void)
void cfg_get_directory_filename (char * buffer, int * local)
bool cfg_host_exists (char * host_list, char * hostname, int num_items)
char * cfg_next_char (char * str_p)
char * cfg_next_line (char * str_p)
FILE * cfg_open_directory_file (bool write_flag)
const char * cfg_pop_host (const char * host_list, char * buffer, int * length)
char * cfg_pop_linetoken (char * str_p, char ** token_p)
char * cfg_pop_token (char * str_p, char ** token_p)

Macros

Type Name
define CFG_MAX_LINE 4096

Public Static Attributes Documentation

variable CFG_HOST_SEPARATOR

const char CFG_HOST_SEPARATOR;

Public Functions Documentation

function cfg_add_db

DB_INFO * cfg_add_db (
    DB_INFO ** dir,
    const  char * name,
    const  char * path,
    const  char * logpath,
    const  char * lobpath,
    const  char * host
) 

function cfg_create_host_list

char * cfg_create_host_list (
    const  char * primary_host_name,
    bool include_local_host,
    int * count
) 

function cfg_delete_db

bool cfg_delete_db (
    DB_INFO ** dir_info_p,
    const  char * name
) 

function cfg_dump_directory

void cfg_dump_directory (
    const  DB_INFO * databases
) 

function cfg_find_db

DB_INFO * cfg_find_db (
    const  char * db_name
) 

function cfg_find_db_list

DB_INFO * cfg_find_db_list (
    DB_INFO * db_info_list_p,
    const  char * name
) 

function cfg_free_directory

void cfg_free_directory (
    DB_INFO * databases
) 

function cfg_free_hosts

void cfg_free_hosts (
    char ** host_array
) 

function cfg_get_hosts

char ** cfg_get_hosts (
    const  char * prim_host,
    int * count,
    bool include_local_host
) 

function cfg_maycreate_get_directory_filename

char * cfg_maycreate_get_directory_filename (
    char * buffer
) 

function cfg_new_db

DB_INFO * cfg_new_db (
    const  char * name,
    const  char * path,
    const  char * logpath,
    const  char * lobpath,
    const  char ** hosts
) 

function cfg_os_working_directory

char * cfg_os_working_directory (
    void
) 

function cfg_read_directory

int cfg_read_directory (
    DB_INFO ** info_p,
    bool write_flag
) 

function cfg_read_directory_ex

int cfg_read_directory_ex (
    int vdes,
    DB_INFO ** info_p,
    bool write_flag
) 

function cfg_update_db

void cfg_update_db (
    DB_INFO * db_info_p,
    const  char * path,
    const  char * logpath,
    const  char * lobpath,
    const  char * host
) 

function cfg_write_directory

void cfg_write_directory (
    const  DB_INFO * databases
) 

function cfg_write_directory_ex

void cfg_write_directory_ex (
    int vdes,
    const  DB_INFO * databases
) 

Public Static Functions Documentation

function cfg_copy_hosts

static char ** cfg_copy_hosts (
    const  char ** host_array,
    int * num_hosts
) 

function cfg_ensure_directory_write

static int cfg_ensure_directory_write (
    void
) 

function cfg_get_directory_filename

static void cfg_get_directory_filename (
    char * buffer,
    int * local
) 

function cfg_host_exists

static bool cfg_host_exists (
    char * host_list,
    char * hostname,
    int num_items
) 

function cfg_next_char

static char * cfg_next_char (
    char * str_p
) 

function cfg_next_line

static char * cfg_next_line (
    char * str_p
) 

function cfg_open_directory_file

static FILE * cfg_open_directory_file (
    bool write_flag
) 

function cfg_pop_host

static const  char * cfg_pop_host (
    const  char * host_list,
    char * buffer,
    int * length
) 

function cfg_pop_linetoken

static char * cfg_pop_linetoken (
    char * str_p,
    char ** token_p
) 

function cfg_pop_token

static char * cfg_pop_token (
    char * str_p,
    char ** token_p
) 

Macro Definition Documentation

define CFG_MAX_LINE

#define CFG_MAX_LINE `4096`


The documentation for this class was generated from the following file cubrid/src/base/databases_file.c