X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=docs%2Fexamples%2Fcrypt_log_usage.c;h=d8364af333d5f2f1070344964bdabd14a0bde532;hb=322b430a2589cdc7985e98a14ec12322b91c9d5e;hp=e3e4a2afe4889e1054764aed54021e60788efebc;hpb=ad21d48762fa70838d4ab4fbe8fe2a2e8a4dcef1;p=platform%2Fupstream%2Fcryptsetup.git diff --git a/docs/examples/crypt_log_usage.c b/docs/examples/crypt_log_usage.c index e3e4a2a..d8364af 100644 --- a/docs/examples/crypt_log_usage.c +++ b/docs/examples/crypt_log_usage.c @@ -1,7 +1,7 @@ /* - * An example of using logging through libcryptsetup API + * libcryptsetup API log example * - * Copyright (C) 2011, Red Hat, Inc. All rights reserved. + * Copyright (C) 2011-2020 Red Hat, Inc. All rights reserved. * * This file is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,10 +25,8 @@ #include /* - * This is an example of function that can be registered using crypt_set_log_callback API. + * This is an example of crypt_set_log_callback API callback. * - * Its prototype is void (*log)(int level, const char *msg, void *usrptr) as defined - * in crypt_set_log_callback */ static void simple_syslog_wrapper(int level, const char *msg, void *usrptr) { @@ -71,7 +69,7 @@ int main(void) return 2; } - /* crypt_set_log_callback() - register a log function for crypt context */ + /* crypt_set_log_callback() - register a log callback for crypt context */ crypt_set_log_callback(cd, &simple_syslog_wrapper, (void *)usrprefix); /* send messages ithrough the crypt_log() interface */ @@ -83,7 +81,7 @@ int main(void) /* release crypt context */ crypt_free(cd); - /* Initialize default (global) log function */ + /* Initialize default (global) log callback */ crypt_set_log_callback(NULL, &simple_syslog_wrapper, NULL); crypt_log(NULL, CRYPT_LOG_NORMAL, "This is normal log message");