Skip to content

Commit 46083f0

Browse files
committed
添加 chef_debug_contributor()
1 parent 2156dba commit 46083f0

File tree

2 files changed

+23
-6
lines changed

2 files changed

+23
-6
lines changed

src/chsrc-main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,8 @@ typedef enum {
529529
bool
530530
get_target (const char *input, TargetOp code, char *option)
531531
{
532+
chsrc_register_contributors ();
533+
532534
Target_t *target = NULL;
533535

534536
bool matched = iterate_menu (chsrc_pl_menu, input, &target);
@@ -537,8 +539,6 @@ get_target (const char *input, TargetOp code, char *option)
537539

538540
if (!matched) return false;
539541

540-
chsrc_register_contributors ();
541-
542542
if (TargetOp_Set_Source==code)
543543
{
544544
if (target->setfn)

src/framework/chef.c

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -305,23 +305,40 @@ chef_debug_target (Target_t *target)
305305
#ifdef XY_DEBUG
306306
if (!target)
307307
{
308-
chsrc_debug2 ("t", "Target is NULL");
308+
chsrc_debug2 ("target", "Target is NULL");
309309
return;
310310
}
311311

312-
say ("Debug Target Information:");
312+
say ("DEBUG Target Information:");
313313
printf (" Get Function: %p\n", target->getfn);
314314
printf (" Set Function: %p\n", target->setfn);
315315
printf (" Reset Function: %p\n", target->resetfn);
316316
printf (" Sources: %p\n", target->sources);
317317
printf (" Sources Count: %lld\n", target->sources_n);
318318

319-
printf (" Authors: %p\n", target->authors);
320-
printf (" Authors Count: %lld\n", target->authors_n);
321319
printf (" Chef: %p\n", target->chef);
322320
printf (" Cooks: %p\n", target->cooks);
323321
printf (" Cooks Count: %lld\n", target->cooks_n);
324322
printf (" Contributors: %p\n", target->contributors);
325323
printf (" Contributors Count: %lld\n", target->contributors_n);
326324
#endif
327325
}
326+
327+
328+
void
329+
chef_debug_contributor (Contributor_t *contributor)
330+
{
331+
#ifdef XY_DEBUG
332+
if (!contributor)
333+
{
334+
chsrc_debug2 ("contrib", "Contributor is NULL");
335+
return;
336+
}
337+
338+
say ("DEBUG Contributor Information:");
339+
printf (" ID: %s\n", contributor->id);
340+
printf (" Name: %s\n", contributor->name);
341+
printf (" Email: %s\n", contributor->email);
342+
printf (" DisplayName: %s\n", contributor->display_name);
343+
#endif
344+
}

0 commit comments

Comments
 (0)