mirror of
https://github.com/obgm/libcoap.git
synced 2026-10-26 12:41:22 +03:00
man: Fix coap_attribute() example
This commit is contained in:
1 parent
295afa9f95
commit
1dfae51f30
2 files changed
+26
-4
No files matched your search
@@ -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
|
||||
--------
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user