diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2018-05-09 12:57:09 +0200 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2018-12-13 14:12:02 +0100 |
commit | 3ac370d79120d166859c04bb2d5ab043bdba4c0a (patch) | |
tree | 1f59cba63700a71857044c69d3c34a3c881bf54a /filescan-utils.h | |
parent | 2fdc44f69750b44ab7b1a5fb5f3a447c3607038b (diff) |
Documentate, formating, linting.
Change-Id: Id77b9de1b847ca26133abd87511de4e78c7d01f7
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'filescan-utils.h')
-rw-r--r-- | filescan-utils.h | 46 |
1 files changed, 42 insertions, 4 deletions
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 |