代码拉取完成,页面将自动刷新
/*
main.c
Achieve the AllBookBuilder
BeginnerC
*/
#include <stdio.h>
#include <stdlib.h>
#include <dirent.h>
#include <unistd.h>
#include "./moudle/build_website/build_website.h"
#include "./moudle/build_single_book/build_single_book.h"
#include "./moudle/file/file.h"
#include "./moudle/config/config.h"
int main(int argc, char *argv[])
{
Config *config = NULL;
char *target_path = NULL;
char *mdbook_path = NULL;
char *temp = NULL;
char *proc_path = NULL;
char config_path[NAME_MAX] = {};
if (2 != argc)
{
printf("Usage: AllBookBuilder [path]\n");
return -1;
}
proc_path = GetProcPath();
chdir(proc_path);
free(proc_path);
sprintf(config_path, "%s", ToAbsolutePath(DEFAULT_CONFIG_NAME));
config = LoadConfig(config_path);
mdbook_path = GetConfigValue(config, MDBOOK_PATH);
temp = ToAbsolutePath(mdbook_path);
sprintf(mdbook_path, "%s", temp);
free(temp);
target_path = ToAbsolutePath(argv[1]);
BuildWebsite(target_path, config);
free(target_path);
FreeConfig(config);
return 0;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。