· KLDP.org · KLDP.net · KLDP Wiki · KLDP BBS ·
Asterisk Config

main/config.c 1.4.21

struct ast_config {
        struct ast_category *root;
        struct ast_category *last;
        struct ast_category *current;
        struct ast_category *last_browse;               /*!< used to cache the last category supplied via category_browse */
        int include_level;
        int max_include_level;
};

* struct ast_config *ast_config_load(const char *filename)
  • cfg = ast_config_new(); memory allocation
  • result = ast_config_internal_load(filename, cfg, 0);
  • return result;

static struct ast_config_engine text_file_engine = {
        .name = "text",
        .load_func = config_text_file_load,
};
* struct ast_config *ast_config_internal_load(const char *filename, struct ast_config *cfg, int withcomments)
  • struct ast_config_engine *loader = &text_file_engine;
  • result = loader->load_func(db, table, filename, cfg, withcomments);
  • return result;

* static struct ast_config *config_text_file_load(const char *database, const char *table, const char *filename, struct ast_config *cfg, int withcomments)
  • return cfg;
  • ast_config structure 인 cfg 에 ast_categoty structure 들을 linked list 로 넣는다.
  • 각 category 이름은 문자와 문자 사이의 문자열이다.
  • 각 ast_category structure 안에는 ast_variable structure 를 linked list 로 넣는다.

* char *ast_category_browse(struct ast_config *config, const char *prev)
  • 두번째 인수가 null 이면, linked list 의 맨 앞의 category structure 를 가져온다.
  • 두번째 인수가 category structure 의 pointer 이면, 이 다음의 category structure 를 가져온다.

conf file


ID
Password
Join
Try to value useful qualities in one who loves you.


sponsored by andamiro
sponsored by cdnetworks
sponsored by HP

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2009-07-06 10:55:21
Processing time 0.0035 sec