diff options
| author | David M. Syzdek <david@syzdek.net> | 2019-11-26 22:16:34 -0900 |
|---|---|---|
| committer | David M. Syzdek <david@syzdek.net> | 2019-11-26 22:16:34 -0900 |
| commit | 3cd6505030e32d8529cf0107d201954198c2a92b (patch) | |
| tree | bdc8ebae1f3cfee62070f4ce2fac10b89df928fb /lib | |
| parent | e7cafff74b65c6c7924bebff1d702fb982ecdfef (diff) | |
| download | ldap-utils-3cd6505030e32d8529cf0107d201954198c2a92b.tar.gz ldap-utils-3cd6505030e32d8529cf0107d201954198c2a92b.tar.bz2 ldap-utils-3cd6505030e32d8529cf0107d201954198c2a92b.tar.xz ldap-utils-3cd6505030e32d8529cf0107d201954198c2a92b.zip | |
libldapschema: printing object errors in output functions
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/libldapschema/loutput.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/libldapschema/loutput.c b/lib/libldapschema/loutput.c index c771251..5aa0132 100644 --- a/lib/libldapschema/loutput.c +++ b/lib/libldapschema/loutput.c | |||
| @@ -93,6 +93,11 @@ ldapschema_print_flags( | |||
| 93 | LDAPSchemaModel * model ); | 93 | LDAPSchemaModel * model ); |
| 94 | 94 | ||
| 95 | void | 95 | void |
| 96 | ldapschema_print_issues( | ||
| 97 | LDAPSchema * lsd, | ||
| 98 | LDAPSchemaModel * model ); | ||
| 99 | |||
| 100 | void | ||
| 96 | ldapschema_print_line( | 101 | ldapschema_print_line( |
| 97 | const char * field, | 102 | const char * field, |
| 98 | const char * input ); | 103 | const char * input ); |
| @@ -327,6 +332,19 @@ void ldapschema_print_flags(LDAPSchema * lsd, LDAPSchemaModel * model) | |||
| 327 | } | 332 | } |
| 328 | 333 | ||
| 329 | 334 | ||
| 335 | void ldapschema_print_issues(LDAPSchema * lsd, LDAPSchemaModel * model) | ||
| 336 | { | ||
| 337 | size_t idx; | ||
| 338 | assert(lsd != NULL); | ||
| 339 | assert(model != NULL); | ||
| 340 | if (!(model->errors)) | ||
| 341 | return; | ||
| 342 | for(idx = 0; ((model->errors[idx])); idx++) | ||
| 343 | ldapschema_print_line( ((!(idx))?"issues:":NULL), model->errors[idx]); | ||
| 344 | return; | ||
| 345 | } | ||
| 346 | |||
| 347 | |||
| 330 | void ldapschema_print_line(const char * field, const char * str) | 348 | void ldapschema_print_line(const char * field, const char * str) |
| 331 | { | 349 | { |
| 332 | const char * bol; | 350 | const char * bol; |
| @@ -503,6 +521,7 @@ void ldapschema_print_obj_attributetype( LDAPSchema * lsd, LDAPSchemaAttributeTy | |||
| 503 | ldapschema_print_list_models(lsd, "required by:", (LDAPSchemaModel **)attr->required_by, attr->required_by_len); | 521 | ldapschema_print_list_models(lsd, "required by:", (LDAPSchemaModel **)attr->required_by, attr->required_by_len); |
| 504 | ldapschema_print_list_models(lsd, "allowed by:", (LDAPSchemaModel **)attr->allowed_by, attr->allowed_by_len); | 522 | ldapschema_print_list_models(lsd, "allowed by:", (LDAPSchemaModel **)attr->allowed_by, attr->allowed_by_len); |
| 505 | ldapschema_print_definition(lsd, &attr->model); | 523 | ldapschema_print_definition(lsd, &attr->model); |
| 524 | ldapschema_print_issues(lsd, &attr->model); | ||
| 506 | 525 | ||
| 507 | return; | 526 | return; |
| 508 | } | 527 | } |
| @@ -531,6 +550,7 @@ void ldapschema_print_obj_matchingrule(LDAPSchema * lsd, LDAPSchemaMatchingRule | |||
| 531 | 550 | ||
| 532 | ldapschema_print_extensions(lsd, &mtchngrl->model); | 551 | ldapschema_print_extensions(lsd, &mtchngrl->model); |
| 533 | ldapschema_print_definition(lsd, &mtchngrl->model); | 552 | ldapschema_print_definition(lsd, &mtchngrl->model); |
| 553 | ldapschema_print_issues(lsd, &mtchngrl->model); | ||
| 534 | 554 | ||
| 535 | return; | 555 | return; |
| 536 | } | 556 | } |
| @@ -587,6 +607,7 @@ void ldapschema_print_obj_objectclass(LDAPSchema * lsd, LDAPSchemaObjectclass * | |||
| 587 | ldapschema_print_list_models(lsd, "inherited must:", (LDAPSchemaModel **)objcls->inherit_must, objcls->inherit_must_len); | 607 | ldapschema_print_list_models(lsd, "inherited must:", (LDAPSchemaModel **)objcls->inherit_must, objcls->inherit_must_len); |
| 588 | ldapschema_print_extensions(lsd, &objcls->model); | 608 | ldapschema_print_extensions(lsd, &objcls->model); |
| 589 | ldapschema_print_definition(lsd, &objcls->model); | 609 | ldapschema_print_definition(lsd, &objcls->model); |
| 610 | ldapschema_print_issues(lsd, &objcls->model); | ||
| 590 | 611 | ||
| 591 | return; | 612 | return; |
| 592 | } | 613 | } |
| @@ -604,6 +625,7 @@ void ldapschema_print_obj_syntax(LDAPSchema * lsd, LDAPSchemaSyntax * syntax) | |||
| 604 | ldapschema_print_extensions(lsd, &syntax->model); | 625 | ldapschema_print_extensions(lsd, &syntax->model); |
| 605 | ldapschema_print_spec(lsd, syntax->model.spec); | 626 | ldapschema_print_spec(lsd, syntax->model.spec); |
| 606 | ldapschema_print_definition(lsd, &syntax->model); | 627 | ldapschema_print_definition(lsd, &syntax->model); |
| 628 | ldapschema_print_issues(lsd, &syntax->model); | ||
| 607 | 629 | ||
| 608 | return; | 630 | return; |
| 609 | } | 631 | } |
