int main(int argc, char *argv[]) { NEOERR *err = STATUS_OK; HASH *dbh, *evth; mtc_init(TC_ROOT"prestat"); err = lerr_init(); DIE_NOK_MTL(err); err = mconfig_parse_file(SITE_CONFIG, &g_cfg); DIE_NOK_MTL(err); err = ldb_init(&dbh); DIE_NOK_MTL(err); err = levt_init(&evth); DIE_NOK_MTL(err); err = fill_trackarea(evth, dbh); TRACE_NOK(err); levt_destroy(evth); ldb_destroy(dbh); mconfig_cleanup(&g_cfg); return 0; }
int main(int argc, char **argv, char **envp) { char *bm = NULL; NEOERR *err; int cnt = 0; char *s = argv[1]; mtc_init("div", 7); #if 0 err = ediv_init_from_file(&bm, "/home/bigml/web/moon/eii/data/dict.txt", &cnt); DIE_NOK_MTL(err); mtc_foo("%u words seted\n", cnt); //mtc_foo("%u distinct word\n", ediv_word_distinct(bm)); ediv_word_split(bm, s, strlen(s), NULL, div_cbk, EDIV_SOPT_ONLY_MAXMATCH | EDIV_SOPT_SKIP_NUTF); free(bm); #endif return 0; }
int main(int argc, char *argv[]) { HASH *tplh = NULL, *dbh = NULL; NEOERR *err; int c, bid = 0, indexid = -1, pgtt; bool dorecurse = false; mtc_init(TC_ROOT"blg"); err = mconfig_parse_file(SITE_CONFIG, &g_cfg); DIE_NOK_MTL(err); while ( (c=getopt(argc, argv, "b:i:r")) != -1 ) { switch(c) { case 'b': bid = atoi(optarg); break; case 'i': indexid = atoi(optarg); break; case 'r': dorecurse = true; break; default: useage(argv[0]); } } err = ldb_init(&dbh); DIE_NOK_MTL(err); err = hash_init(&tplh, hash_str_hash, hash_str_comp); DIE_NOK_MTL(err); err = ltpl_parse_file(dbh, NULL, PATH_PAGER, "blog.hdf", tplh); DIE_NOK_MTL(err); if (indexid >= 0) { err = rend_blog_index(dbh, tplh, indexid, &pgtt); TRACE_NOK(err); if (indexid > 0 && pgtt > indexid) pgtt = indexid; if (dorecurse) { while (pgtt-- > 0) { err = rend_blog_index(dbh, tplh, pgtt, NULL); TRACE_NOK(err); } } } if (bid > 0) { if (bid > 1) rend_blog(dbh, tplh, bid-1); rend_blog(dbh, tplh, bid); rend_blog(dbh, tplh, bid+1); } ldb_destroy(dbh); ltpl_destroy(tplh); mconfig_cleanup(&g_cfg); return 0; }