From 73f8d93f0db5a960bf22e9d080283e967f6bbfb6 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Wed, 9 May 2018 12:57:09 +0200 Subject: Documentate, formating, linting. Change-Id: Id77b9de1b847ca26133abd87511de4e78c7d01f7 Signed-off-by: Romain Forlot --- filescan-utils.h | 46 ++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 42 insertions(+), 4 deletions(-) (limited to 'filescan-utils.h') diff --git a/filescan-utils.h b/filescan-utils.h index fb942e0..fc3a6a7 100644 --- a/filescan-utils.h +++ b/filescan-utils.h @@ -43,15 +43,53 @@ #define CONTROL_MAXPATH_LEN 255 #endif +/** + * @brief enum describing which mode to use in ScanForConfig function + * + */ typedef enum { - CTL_SCAN_FLAT=0, - CTL_SCAN_RECURSIVE=1, + CTL_SCAN_FLAT=0, /**< Simple flat search */ + CTL_SCAN_RECURSIVE=1, /**< Recursive search */ } CtlScanDirModeT; -const char *GetMidleName(const char*name); +/** + * @brief Get rid of the binder name prefix 'afbd-' + * + * @param name will be typically the full binder name + * + * @return const char* + */ +const char *GetMidleName(const char *name); + +/** + * @brief Get the Binder Name without the prefix set by the AGL appfw 'afbd-' + * + * @return const char* the Binder name without the prefix. + */ const char *GetBinderName(); -json_object* ScanForConfig (const char* searchPath, CtlScanDirModeT mode, const char *pre, const char *ext); +/** + * @brief Scan a directory searching all files matching pattern: + * 'prefix*extention'. + * + * @param searchPath directory where to begin the searching + * @param mode either or not the search will be recursive. + * @param prefix file prefix that will be looking for + * @param extention file extention that will be looking for + * + * @return json_object* a json_object array of object with 2 parts a 'fullpath' + * describing the fullpath to reach the file and 'filename' containing the + * matched files. + */ +json_object* ScanForConfig (const char* searchPath, CtlScanDirModeT mode, const char *prefix, const char *extension); + +/** + * @brief Get the Binding root directory file descriptor object + * + * @param dynapi : Could be NULL if you don't use dynamic api + * + * @return char* string representing the path to binding root directory. + */ char *GetBindingDirPath(struct afb_dynapi *dynapi); #ifdef __cplusplus -- cgit 1.2.3-korg