summaryrefslogtreecommitdiff
path: root/src/lib/eina/eina_vpath.h
blob: c279018cf1caccef78c810e9be43b418d55e4045 (plain) (blame)
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
48
#ifndef EINA_VPATH_H
#define EINA_VPATH_H

#include "eina_prefix.h"

/*
 * Eina_vpath
 * eina vpath is a path that can be prefixed with a virtual path.
 *
 * A virutla path can either start with (:XXXXXXXX:) that indicates a virtual path, OR normal with / or ./ or ../ or ~
 * The char sequence in between (: and :) are used as key to lookup the real value.
 * The key has to be set by a interface before, otherwise you will get a error.
 *
 * The symbol ~ is interpretated as the home directory of the running user, and will be replaced.
 * Additional infos: https://phab.enlightenment.org/w/eina_vpath/
 */

/**
 * This datatype is a vpath, this means you can use the syntax described above.
 */
typedef const char* Eina_Vpath;

/**
 * Make the app specific paths accessable as virtual path
 *
 * This will create :
 *   - app.dir
 *   - app.bin
 *   - app.lib
 *   - app.data
 *   - app.locale
 *   - app.config
 *   - app.cache
 *   - app.local
 *
 * If you do NOT call this api the virtual paths for app.* will be unset
 */
EAPI void eina_vpath_interface_app_set(const char *app_name, Eina_Prefix *p);

/*
 * Translate a virtual path into a normal path.
 *
 * @return a string that is not virtual anymore
 *
 */
EAPI char* eina_vpath_resolve(Eina_Vpath path);

#endif