aboutsummaryrefslogtreecommitdiffstats
path: root/src/wgt-info.c
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2015-12-11 14:57:32 +0100
committerJosé Bollo <jose.bollo@iot.bzh>2015-12-11 14:57:32 +0100
commit9ab266df6642c6e930e03b3024d7c3d53ef88bbc (patch)
tree95c7686ad33af3c012a02412938f9b2c0191dc7b /src/wgt-info.c
parent26d75de504d808191dbadc9a735009a214a789b0 (diff)
don't change of directory anymore
Change-Id: I9f5906d3e053b3fa0f3000d07c4af3f666fe079a
Diffstat (limited to 'src/wgt-info.c')
-rw-r--r--src/wgt-info.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/wgt-info.c b/src/wgt-info.c
index ddecb9a..d5f664b 100644
--- a/src/wgt-info.c
+++ b/src/wgt-info.c
@@ -334,7 +334,7 @@ static void dump_desc(struct wgt_desc *desc, FILE *f, const char *prefix)
}
}
-struct wgt_info *wgt_info_get(struct wgt *wgt, int icons, int features, int preferences)
+struct wgt_info *wgt_info_create(struct wgt *wgt, int icons, int features, int preferences)
{
int rc;
struct wgt_info *result;
@@ -366,11 +366,30 @@ struct wgt_info *wgt_info_get(struct wgt *wgt, int icons, int features, int pref
return result;
}
+struct wgt_info *wgt_info_createat(int dirfd, const char *pathname, int icons, int features, int preferences)
+{
+ struct wgt_info *result = NULL;
+ struct wgt *wgt = wgt_createat(dirfd, pathname);
+ if (wgt) {
+ result = wgt_info_create(wgt, icons, features, preferences);
+ wgt_unref(wgt);
+ }
+ return result;
+}
+
const struct wgt_desc *wgt_info_desc(struct wgt_info *ifo)
{
+ assert(ifo);
return &ifo->desc;
}
+struct wgt *wgt_info_wgt(struct wgt_info *ifo)
+{
+ assert(ifo);
+ assert(ifo->wgt);
+ return ifo->wgt;
+}
+
void wgt_info_addref(struct wgt_info *ifo)
{
assert(ifo);