Skip to content

Commit 6496ff0

Browse files
committed
使用 chsrc_framework_prelude()
1 parent 1773745 commit 6496ff0

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

src/chsrc-main.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,10 +688,13 @@ get_target (const char *input, TargetOp code, char *option)
688688
}
689689

690690

691+
691692
int
692693
main (int argc, char const *argv[])
693694
{
694-
xy_useutf8 (); argc -= 1;
695+
chsrc_framework_prelude ();
696+
697+
argc -= 1;
695698

696699
if (0==argc)
697700
{

src/framework/core.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ typedef enum ChgType_t
122122
/* Global Program Status */
123123
struct
124124
{
125+
XyMap_t *contributors; /* 所有贡献者 */
126+
125127
int leader_selected_index; /* leader target 选中的索引 */
126128
ChgType_t chgtype; /* 换源实现的类型 */
127129

@@ -130,6 +132,7 @@ struct
130132
}
131133
ProgStatus =
132134
{
135+
.contributors = NULL,
133136
.leader_selected_index = -1,
134137
.chgtype = ChgType_Auto,
135138
.chsrc_run_faas = false
@@ -205,6 +208,17 @@ chsrc_alert2 (const char *str)
205208
}
206209

207210

211+
212+
void
213+
chsrc_framework_prelude ()
214+
{
215+
xy_useutf8 ();
216+
217+
ProgStatus.contributors = xy_map_new ();
218+
}
219+
220+
221+
208222
void
209223
chsrc_log_write (const char *filename)
210224
{

0 commit comments

Comments
 (0)