48 lines
906 B
C
48 lines
906 B
C
|
//
|
||
|
// Created by xajhu on 2021/6/29 0029.
|
||
|
//
|
||
|
#include <uv.h>
|
||
|
#include <stdlib.h>
|
||
|
#include <unistd.h>
|
||
|
#include <string.h>
|
||
|
#include "cmdline.h"
|
||
|
#include "task_manager.h"
|
||
|
#include "init.h"
|
||
|
#include "zlog_module.h"
|
||
|
|
||
|
#include "prj_config.h"
|
||
|
#include "user_errno.h"
|
||
|
|
||
|
#include "proto.h"
|
||
|
|
||
|
int main(int argc, char **argv) {
|
||
|
int ret;
|
||
|
|
||
|
uv_setup_args(argc, argv);
|
||
|
|
||
|
printf("Application %s version %s\n", PROJECT_PROJECT_NAME, PROJECT_PROJECT_VER);
|
||
|
|
||
|
setvbuf(stdout, NULL, _IONBF, 0);
|
||
|
|
||
|
ret = menu_run(argc, argv);
|
||
|
|
||
|
if (ret == ERR_MENU_EXIT) {
|
||
|
user_uninit();
|
||
|
exit(0);
|
||
|
} else if (ret != ERR_SUCCESS) {
|
||
|
printf("Application setup error(%d), please used --help to show usage, exited!!!\n", ret);
|
||
|
user_uninit();
|
||
|
exit(0);
|
||
|
}
|
||
|
|
||
|
task_manager_run();
|
||
|
|
||
|
while (!is_system_cleanup()) {
|
||
|
sleep(1);
|
||
|
}
|
||
|
|
||
|
user_uninit();
|
||
|
|
||
|
return ret;
|
||
|
}
|