纳入固件源码、屏幕组件、nand_xfer 工具和文档。忽略本机构建产物、sdkconfig,以及含本机路径的依赖锁。 Co-authored-by: Cursor <cursoragent@cursor.com>
27 lines
758 B
C
27 lines
758 B
C
#ifndef ALMANAC_SERVICE_H
|
|
#define ALMANAC_SERVICE_H
|
|
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
|
|
typedef struct {
|
|
char lunar[24];
|
|
char dos[64];
|
|
char donts[64];
|
|
} almanac_entry_t;
|
|
|
|
typedef bool (*almanac_get_fn_t)(uint16_t year, uint8_t month, uint8_t day, almanac_entry_t *out, void *ctx);
|
|
|
|
typedef struct {
|
|
almanac_get_fn_t get;
|
|
void *ctx;
|
|
} almanac_provider_t;
|
|
|
|
/* 设置外部数据提供者(例如 JSON 查表);传 NULL 则回退内置实现 */
|
|
void almanac_service_set_provider(const almanac_provider_t *provider);
|
|
|
|
/* 按公历日期获取农历+宜忌;无外部 provider 时使用内置回退逻辑 */
|
|
bool almanac_service_get(uint16_t year, uint8_t month, uint8_t day, almanac_entry_t *out);
|
|
|
|
#endif /* ALMANAC_SERVICE_H */
|