diff options
-rw-r--r-- | src/actionhelper.c | 6 | ||||
-rw-r--r-- | src/actionhelper.h | 3 | ||||
-rw-r--r-- | src/actionparser.c | 5 | ||||
-rw-r--r-- | src/actionparser.h | 4 | ||||
-rw-r--r-- | src/actions.h | 3 | ||||
-rw-r--r-- | src/ckerrlog.h | 27 | ||||
-rw-r--r-- | src/ckinfo.h.in | 23 | ||||
-rw-r--r-- | src/cklist.c | 3 | ||||
-rw-r--r-- | src/cklist.h | 5 | ||||
-rw-r--r-- | src/cksearch.h | 25 | ||||
-rw-r--r-- | src/confparser.h | 4 | ||||
-rw-r--r-- | src/dbhelper.h | 5 | ||||
-rw-r--r-- | src/dblayer.c | 4 |
13 files changed, 59 insertions, 58 deletions
diff --git a/src/actionhelper.c b/src/actionhelper.c index f0113bf..75cc03f 100644 --- a/src/actionhelper.c +++ b/src/actionhelper.c @@ -1,4 +1,4 @@ -/* actionhelper.c - helper functions for ck actions --------------------*- C -*- +/* actionhelper.c - helper routines for ck actions --------------------*- C -*- * * This file is part of ck, the config keeper * @@ -7,10 +7,6 @@ * Copyright (C) 2018 Anastasis Grammenos * GPLv3 (see LICENCE for the full notice) * - * ----------------------------------------------------------------------------- - * - * - * * -------------------------------------------------------------------------- */ #include <libgen.h> diff --git a/src/actionhelper.h b/src/actionhelper.h index 2db4eeb..d211df8 100644 --- a/src/actionhelper.h +++ b/src/actionhelper.h @@ -1,4 +1,4 @@ -/* actionhelper.h - helper functions for ck actions --------------------*- C -*- +/* actionhelper.h - helper routines for ck actions --------------------*- C -*- * * This file is part of ck, the config keeper * @@ -9,6 +9,7 @@ * * ----------------------------------------------------------------------------- * + * Here reside helper routines for the actions. * * -------------------------------------------------------------------------- */ #ifndef ACTIONHELPER_H diff --git a/src/actionparser.c b/src/actionparser.c index f348ff6..10882b3 100644 --- a/src/actionparser.c +++ b/src/actionparser.c @@ -7,11 +7,6 @@ * Copyright (C) 2018 Anastasis Grammenos * GPLv3 (see LICENCE for the full notice) * - * ----------------------------------------------------------------------------- - * - * The following code is resposinble for parsing the command line arguments - * and finding the correct ck action. - * * -------------------------------------------------------------------------- */ #include "actionparser.h" #include "ckutil.h" diff --git a/src/actionparser.h b/src/actionparser.h index 9e7209d..38b0896 100644 --- a/src/actionparser.h +++ b/src/actionparser.h @@ -14,10 +14,6 @@ * of the user's options ready to be handled by the rest of the * procedures. * - * Keeps track of what error occured where and provides - * print_parser_help() and print_parser_error() functions - * to notify the user - * * -------------------------------------------------------------------------- */ #ifndef ACTIONPARSER_H #define ACTIONPARSER_H diff --git a/src/actions.h b/src/actions.h index 624ae30..495984e 100644 --- a/src/actions.h +++ b/src/actions.h @@ -9,7 +9,8 @@ * * ----------------------------------------------------------------------------- * - * + * The various structs actions use to keep track of their + * specific options and the run_ACTION routines. * * -------------------------------------------------------------------------- */ #ifndef ACTIONS_H diff --git a/src/ckerrlog.h b/src/ckerrlog.h index 2506e99..a559764 100644 --- a/src/ckerrlog.h +++ b/src/ckerrlog.h @@ -7,6 +7,33 @@ * Copyright (C) 2018 Anastasis Grammenos * GPLv3 (see LICENCE for the full notice) * + * ----------------------------------------------------------------------------- + * + * The error reporting and logging infrastructure used across ck. + * This file defines the basic macros other functions should call to + * report problems or help the user. + * + * All macros use printf like syntax to format the resutling strings. + * There is no need for newline (`\n`) it is automatically appended to + * each string. + * + * ERRLOG(component-name) + * Should be called once in every .c file defining the component name + * to be used with error reporting and logging. + * + * LOG("format-string", ...) + * Add format-string to the log. The component name is prepended. + * The log can be saved to a logfile and/or printed at the end of + * the ck session provided the --verbose flag is active. + * + * ERR("format-string", ...) + * Reports the format-string at the moment of calling, prepended with + * Error and the component-name. Also adds the error to the log. + * + * HELP("format-string", ...) + * Print the format-string at the moment of calling, without adding + * any component name nor pushing the string to the log. + * * -------------------------------------------------------------------------- */ #ifndef CKERRLOG_H #define CKERRLOG_H diff --git a/src/ckinfo.h.in b/src/ckinfo.h.in index 3b7f843..0d101f4 100644 --- a/src/ckinfo.h.in +++ b/src/ckinfo.h.in @@ -1,3 +1,18 @@ +/* ckinfo.h - Compile time generated info for ck -----------------------*- C -*- + * + * This file is part of ck, the config keeper + * + * ----------------------------------------------------------------------------- + * + * Copyright (C) 2018 Anastasis Grammenos + * GPLv3 (see LICENCE for the full notice) + * + * ----------------------------------------------------------------------------- + * + * Version info, etc. + * Autogenerated by CMake @CMAKE_MAJOR_VERSION@.@CMAKE_MINOR_VERSION@ + * + * -------------------------------------------------------------------------- */ #ifndef CK_INFO_H #define CK_INFO_H @@ -9,10 +24,10 @@ extern void print_version() { printf("ck version %d.%d\n", CK_MAJOR_VERSION, CK_MINOR_VERSION); - printf("ck Copyright (C) 2018 gramanas\n\ -This program comes with ABSOLUTELY NO WARRANTY.\n\ -This is free software, and you are welcome to redistribute it under\n\ -certain condition. See the LICENCE file in the source tree for details.\n"); + printf("%s", "ck Copyright (C) 2018 gramanas\n" + "This program comes with ABSOLUTELY NO WARRANTY.\n" + "This is free software, and you are welcome to redistribute it under\n" + "certain condition. See the LICENCE file in the source tree for details.\n"); } #endif /* CK_INFO_H */ diff --git a/src/cklist.c b/src/cklist.c index e142feb..2fdfa07 100644 --- a/src/cklist.c +++ b/src/cklist.c @@ -1,4 +1,4 @@ -/* cklist.h - Custom list data structure for ck ------------------------*- C -*- +/* cklist.h - List data structure for ck -------------------------------*- C -*- * * This file is part of ck, the config keeper * @@ -8,7 +8,6 @@ * GPLv3 (see LICENCE for the full notice) * * -------------------------------------------------------------------------- */ - #include "cklist.h" #include "ckutil.h" diff --git a/src/cklist.h b/src/cklist.h index 95fd088..3cf0f7c 100644 --- a/src/cklist.h +++ b/src/cklist.h @@ -1,4 +1,4 @@ -/* cklist.h - Custom list data structure for ck ------------------------*- C -*- +/* cklist.h - List data structure for ck -------------------------------*- C -*- * * This file is part of ck, the config keeper * @@ -9,8 +9,7 @@ * * ----------------------------------------------------------------------------- * - * Ck needs a list of strings. Assists with finding the correct config file - * to edit when using ck edit and provides a backend to the ck list action. + * Data structure to hold a dynamic list of strings used accross ck. * * -------------------------------------------------------------------------- */ #ifndef CKLIST_H diff --git a/src/cksearch.h b/src/cksearch.h deleted file mode 100644 index ee06a15..0000000 --- a/src/cksearch.h +++ /dev/null @@ -1,25 +0,0 @@ -/* cksearch.h - search for stuff in ck ---------------------------------*- C -*- - * - * This file is part of ck, the config keeper - * - * ----------------------------------------------------------------------------- - * - * Copyright (C) 2018 Anastasis Grammenos - * GPLv3 (see LICENCE for the full notice) - * - * ----------------------------------------------------------------------------- - * - * Search the database and get results for programs and confing paths. - * Provides functions to match user's query to actual entries in the - * database. - * - * (TODO) Also implements the infile search, to match strings in the files - * contained in the database. - * - * -------------------------------------------------------------------------- */ -#ifndef CKSEARCH_H -#define CKSEARCH_H - - - -#endif /* CKSEARCH_H */ diff --git a/src/confparser.h b/src/confparser.h index 9587318..b121a59 100644 --- a/src/confparser.h +++ b/src/confparser.h @@ -9,8 +9,8 @@ * * ----------------------------------------------------------------------------- * - * The code here and in confparser.c is responsible parsing - * the configuration and get the values set there + * The code here and in confparser.c is responsible for parsing + * the configuration and getting the values set there in the Conf struct * * -------------------------------------------------------------------------- */ #ifndef CONFPARSER_H diff --git a/src/dbhelper.h b/src/dbhelper.h index a8d3292..8f664d0 100644 --- a/src/dbhelper.h +++ b/src/dbhelper.h @@ -1,4 +1,4 @@ -/* dbhelper.h - Database layer for ck -----------------------------------*- C -*- +/* dbhelper.h - Database layer for ck ----------------------------------*- C -*- * * This file is part of ck, the config keeper * @@ -9,7 +9,8 @@ * * ----------------------------------------------------------------------------- * - * Help other db functions. + * SQlite tables and columns. + * Form query functions. * * -------------------------------------------------------------------------- */ #ifndef DBHELPER_H diff --git a/src/dblayer.c b/src/dblayer.c index 4218ef6..c4bb27b 100644 --- a/src/dblayer.c +++ b/src/dblayer.c @@ -7,10 +7,6 @@ * Copyright (C) 2018 Anastasis Grammenos * GPLv3 (see LICENCE for the full notice) * - * ----------------------------------------------------------------------------- - * - * Give access to the database. - * * -------------------------------------------------------------------------- */ #include <libgen.h> |