diff options
author | Shankho Boron Ghosh <shankhoghosh123@gmail.com> | 2020-11-30 03:44:47 +0530 |
---|---|---|
committer | Jan-Simon Moeller <jsmoeller@linuxfoundation.org> | 2020-12-07 19:59:08 +0000 |
commit | 247cf7e710f10627e5c7fff805d6eff72201ceb9 (patch) | |
tree | c90b38199346b4c6e4fe773d55471d7b67a26341 /docs/3_Developer_Guides/4_AFB_Helper_Guide/5_Filescan_Utils.md | |
parent | eebb44f347af3dbe8c741f7feb9ed3e718ade980 (diff) |
Added AFB Helper Guide in Developer Guides
Revised and added AFB Helper Guide as a part of Developer Guides.
v2 : Revised links to jellyfish branch.
Bug-AGL: [SPEC-3633]
Signed-off-by: Shankho Boron Ghosh <shankhoghosh123@gmail.com>
Change-Id: I3df9265ae0570e987d80bc4bd2d3d14e7743b26a
Reviewed-on: https://gerrit.automotivelinux.org/gerrit/c/AGL/documentation/+/25677
Reviewed-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
Tested-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
Diffstat (limited to 'docs/3_Developer_Guides/4_AFB_Helper_Guide/5_Filescan_Utils.md')
-rw-r--r-- | docs/3_Developer_Guides/4_AFB_Helper_Guide/5_Filescan_Utils.md | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/docs/3_Developer_Guides/4_AFB_Helper_Guide/5_Filescan_Utils.md b/docs/3_Developer_Guides/4_AFB_Helper_Guide/5_Filescan_Utils.md new file mode 100644 index 0000000..5b220e1 --- /dev/null +++ b/docs/3_Developer_Guides/4_AFB_Helper_Guide/5_Filescan_Utils.md @@ -0,0 +1,82 @@ +--- +title: Filescan Utils functions +--- + +## const char *GetMiddleName(const char *name) + +Get rid of the binder name prefix 'afbd-' + +* name will be typically the full binder name + +Returns the process middle name of the running binder. + +## const char *GetBinderName() + +Get the Binder Name without the prefix set by the AGL appfw 'afbd-' + +Returns the Binder name without the prefix. + +## json_object* ScanForConfig (const char* searchPath, CtlScanDirModeT mode, const char *prefix, const char *extension) + +Scan a directory searching all files matching pattern: 'prefix*extention'. + +* `searchPath`: directory where to begin the searching. +* `mode`: either or not the search will be recursive. +* `prefix`: file prefix that will be looking for. +* `extention`: file extention that will be looking for. + +Returns a json_object array of object with 2 parts a 'fullpath' describing the +fullpath to reach the file and 'filename' containing the matched files. + +## char *GetAFBRootDirPathUsingFd(int fd) + +Get the binder root directory path (the path specified with '--rootdir' option +at binder launch, if the option is not used, the path from where the binder +is launched) using binder root directory file descriptor. + +* `fd` : Binder root directory file descriptor. + +Returns a string representing the path to binder root directory. + +## char *GetAFBRootDirPath(afb_api_t apiHandle) + +For binding with a version >= 3, same as 'GetAFBRootDirPathUsingFd' function, +but use pointer to the AFB API as parameter instead of +binder root directory file descriptor. + +* `apiHandle` : pointer to the AFB API. + +Returns a string representing the path to binder root directory. + +## char* GetBindingDirPath() + +For binding with a version <= 2, same as 'GetAFBRootDirPath' function, +but the pointer to the AFB API is not needed. +Kept for compatibility issues. + +## char* GetBindingDirPath(afb_api_t api) + +For binding with a version >= 3, same as 'GetAFBRootDirPath' function. +Deprecated, please use 'GetAFBRootDirPath' function. +Kept for compatibility issues. + +## char *GetRunningBindingDirPath(afb_api_t api) + +For binding with a version >= 3, get the binding directory path +(the path to the directory that contains the binding). + +* `api` : pointer to the AFB API. + +Returns a string representing the path to the binding directory. + +## const char *getEnvDirList(const char *prefix, const char *suffix) + +Get the environment directory colon separated path list. This take the prefix +add the binder's name then the suffix as environment variable name and also +search for another variable without the binder's name (so only prefix+suffix). + +* `prefix`: Environment variable prefix +* `suffix`: Environment variable suffix + +Returns a string representing a colon separated path list or NULL is case of +error or none environment variables found.
\ No newline at end of file |