forked from gary/ems
2
0
Fork 0
sun_ems/ems_c/argparse.h

34 lines
1.2 KiB
C
Raw Normal View History

2025-05-13 17:49:49 +08:00
/*****************************************************************************
* @copyright 2024-2024, . POWER SUPPLY CO., LTD.
* @file argparse.h
* @brief
* @author Gary
* @date 2024/09/20
*****************************************************************************/
#ifndef ARGPARSE_H
#define ARGPARSE_H
#include <stdio.h>
#include <stdbool.h>
#include <stdint.h>
#define RESTART_NEVER 0
#define RESTART_ALWAYS ((size_t) -2)
#define RESTART_ONFAILURE ((size_t) -1)
// 命令行参数配置结构体
typedef struct {
bool daemonized; // 是否以守护进程方式运行
size_t restart; // 重启策略
bool stop; // 是否停止运行
} cli_args_t;
/*****************************************************************************
* @brief
* @param[in] argc
* @param[in] argv
* @param[out] args
*****************************************************************************/
void cliArgsInit(int argc, char *argv[], cli_args_t *args);
#endif // ARGPARSE_H