man: Fix coap_attribute() example

This commit is contained in:
Jon Shallow authored and Jon Shallow committed 2023-06-28 10:25:51 +01:00
1 parent 295afa9f95
commit 1dfae51f30
2 files changed
+26 -4

No files matched your search

+22 -2
View File
@@ -102,9 +102,29 @@ EXAMPLE
*Initialize Resources*
[source, c]
--
----
#include <coap@LIBCOAP_API_VERSION@/coap.h>
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
--------
+4 -2
View File
@@ -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);