aboutsummaryrefslogtreecommitdiffstats
path: root/docs/filescan-utils.md
blob: 4a4c2d221237099d39c6c4b9b09f9c71c2bf6c98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Filescan utils functions reference

## 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 *GetBindingDirPath_(afb_api_t api)

For binding with a version >= 3, get the root directory path.

* `api` : pointer to the AFB API.

Returns a string representing the path to binding root 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.