使用 chsrc_framework_prelude()

This commit is contained in:
Aoran Zeng 2025-08-20 17:01:01 +08:00
parent 1773745b76
commit 6496ff0b9e
No known key found for this signature in database
GPG Key ID: 8F8BA8488E10ED98
2 changed files with 18 additions and 1 deletions

View File

@ -688,10 +688,13 @@ get_target (const char *input, TargetOp code, char *option)
} }
int int
main (int argc, char const *argv[]) main (int argc, char const *argv[])
{ {
xy_useutf8 (); argc -= 1; chsrc_framework_prelude ();
argc -= 1;
if (0==argc) if (0==argc)
{ {

View File

@ -122,6 +122,8 @@ typedef enum ChgType_t
/* Global Program Status */ /* Global Program Status */
struct struct
{ {
XyMap_t *contributors; /* 所有贡献者 */
int leader_selected_index; /* leader target 选中的索引 */ int leader_selected_index; /* leader target 选中的索引 */
ChgType_t chgtype; /* 换源实现的类型 */ ChgType_t chgtype; /* 换源实现的类型 */
@ -130,6 +132,7 @@ struct
} }
ProgStatus = ProgStatus =
{ {
.contributors = NULL,
.leader_selected_index = -1, .leader_selected_index = -1,
.chgtype = ChgType_Auto, .chgtype = ChgType_Auto,
.chsrc_run_faas = false .chsrc_run_faas = false
@ -205,6 +208,17 @@ chsrc_alert2 (const char *str)
} }
void
chsrc_framework_prelude ()
{
xy_useutf8 ();
ProgStatus.contributors = xy_map_new ();
}
void void
chsrc_log_write (const char *filename) chsrc_log_write (const char *filename)
{ {