From 1dfae51f30dfa140beeab71c0d0168a3360442ce Mon Sep 17 00:00:00 2001 From: Jon Shallow Date: Wed, 28 Jun 2023 10:14:38 +0100 Subject: [PATCH] man: Fix coap_attribute() example --- man/coap_attribute.txt.in | 24 ++++++++++++++++++++++-- man/examples-code-check.c | 6 ++++-- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/man/coap_attribute.txt.in b/man/coap_attribute.txt.in index 6511e70e..bc8c599c 100644 --- a/man/coap_attribute.txt.in +++ b/man/coap_attribute.txt.in @@ -102,9 +102,29 @@ EXAMPLE *Initialize Resources* [source, c] --- +---- #include +void hnd_get_index(coap_resource_t *resource, coap_session_t *session, + const coap_pdu_t *request, + const coap_string_t *query, + coap_pdu_t *response); + +void hnd_get_time(coap_resource_t *resource, coap_session_t *session, + const coap_pdu_t *request, + const coap_string_t *query, + coap_pdu_t *response); + +void hnd_put_time(coap_resource_t *resource, coap_session_t *session, + const coap_pdu_t *request, + const coap_string_t *query, + coap_pdu_t *response); + +void hnd_delete_time(coap_resource_t *resource, coap_session_t *session, + const coap_pdu_t *request, + const coap_string_t *query, + coap_pdu_t *response); + static void init_resources(coap_context_t *ctx) { @@ -141,7 +161,7 @@ init_resources(coap_context_t *ctx) { coap_add_resource(ctx, r); } --- +---- SEE ALSO -------- diff --git a/man/examples-code-check.c b/man/examples-code-check.c index 687f081f..1d2aed87 100644 --- a/man/examples-code-check.c +++ b/man/examples-code-check.c @@ -491,7 +491,8 @@ int main(int argc, char* argv[]) check_synopsis(pdir_ent->d_name); continue; } - if (strncmp(buffer, "RETURN VALUES", sizeof("RETURN VALUES")-1) == 0) { + if (strncmp(buffer, "RETURN VALUES", sizeof("RETURN VALUES")-1) == 0 || + strncmp(buffer, "RETURN VALUE", sizeof("RETURN VALUE")-1) == 0) { if (in_functions) { if (fpheader) fclose(fpheader); @@ -518,7 +519,8 @@ int main(int argc, char* argv[]) in_return = 0; continue; } - if (strncmp(buffer, "EXAMPLES", sizeof("EXAMPLES")-1) == 0) { + if (strncmp(buffer, "EXAMPLES", sizeof("EXAMPLES")-1) == 0 || + strncmp(buffer, "EXAMPLE", sizeof("EXAMPLE")-1) == 0) { if (in_functions) { if (fpheader) fclose(fpheader);