From patchwork Mon Jan 8 10:45:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Herbrechtsmeier X-Patchwork-Id: 856761 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4010:c07::23b; helo=mail-lf0-x23b.google.com; envelope-from=swupdate+bncbdn7dbh5yqibbm4xzxjakgqeh2ttqpy@googlegroups.com; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.b="CirgcwFg"; dkim-atps=neutral Received: from mail-lf0-x23b.google.com (mail-lf0-x23b.google.com [IPv6:2a00:1450:4010:c07::23b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zFX3V4nPpz9rxj for ; Mon, 8 Jan 2018 21:45:10 +1100 (AEDT) Received: by mail-lf0-x23b.google.com with SMTP id v198sf554242lfa.8 for ; Mon, 08 Jan 2018 02:45:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1515408307; cv=pass; d=google.com; s=arc-20160816; b=VnU2Aja8jv08AagK5FwTKddbV6X73zzrf4wwPDKrRv/4o92e3A/GI0H3xanvPn/MX3 TS+nKIfHkvo0PPxSssAOu06ykw4IYKx7sYLASxz6QvDG280wHxjEzDkeYrE9jPgkZ7w8 PBxqxFGCmbTYkNltNasH5H75YXsLbe4Fgwgmicq32fPF2hExyNAoAm153t0NBNOPKXIA Ty+3fx8odb4cmt34g6kbTtN5DMSLN0ODumnQ3YXz4WFHAjLKMU/xsk0rkk3KfE7k3+F6 x7dX2UrfjA7SAP83NcD785AUG7/6tGOMBuKAT8A26C0k+9UB2FXwByruyjOSribpNXM8 y2GA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:message-id:date:subject:cc:to:from :arc-authentication-results:arc-message-signature:mime-version :sender:dkim-signature:arc-authentication-results; bh=1xEYAhhWaJBdB50vinjzBVYLv4GZykeHbMQ7a/sBZy8=; b=yscawbVr5/K6cEHv8qYrJvXw7sI4vNi9WpDpg5aPNti2q9S9TK3+zP8axYa5/cCTdD 3MI0I6shBzNtChCauYv2jjv5Sa4QgAQyOQFDbIIqCUOlXu7kKGQ0J0DMnsXQV2agrAU3 2m0KrZaujio4v4VwdwUq2vzQASvz5YS5hn4kE3EUSq3Ul4T/FNLltQHpaO2lSU1LTaYR 2mzbFTJ4Pds386Kw7VRL+hL5hA3nsyQvhWGU9D6/YiS0K0fvfDnc8G7YZx9rjA/rlvxO aAoFF5jjTsJbjWEBmdKXpNQvPt0UxDqXClXyaDZj1KdFq1SolOgszQmNSuW1woRWxxsB ZANg== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 85.13.157.12 is neither permitted nor denied by best guess record for domain of stefan@herbrechtsmeier.net) smtp.mailfrom=stefan@herbrechtsmeier.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:mime-version:from:to:cc:subject:date:message-id :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=1xEYAhhWaJBdB50vinjzBVYLv4GZykeHbMQ7a/sBZy8=; b=CirgcwFgEbPGj1ycz8VMlZMtyQlqpY/sUM/DPC2FMJyplFLfMcvaFj1nXh47WBMV54 rzqsK5tsyPvKRlupQsYim1jRPvC5ni/D9siDcLhNjZJSyyv/O3Sv1LdleSlyd8g9VsFt hnNjkdKYbaJA4/0d5OXWGfKNBAqWA+c/LRGoDSB9uW/Zn8WUOhuwvXy7b5nTmm2iZX+U JqfB9i/ji8qdHvx+tul/2CeS3L4QrS8Tdg7G4G5ShplGAQw2POnwi1pYWkbHgpzHmTLZ DuznOUdo2moxps0NB6bNk7eGevsusGIhp2VTRXOhMfosjyC3tMze+E/ps6hs9XxH2P4c HjgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:mime-version:from:to:cc:subject:date :message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=1xEYAhhWaJBdB50vinjzBVYLv4GZykeHbMQ7a/sBZy8=; b=gCNejceCAg/ml/y0LegkA+e1DoVrlpy+7bntQg2+2rCkWpRpZSHS6pb7K9r616Wi7G qbxiZZaeZNS1clWlESQhG6w20a5qiqCeN/WAqt1j8tFtom8lYnjNHibnZSo8Ve86MqIf GLqqaNfCX8HIGRm8ECyMw+pbf+h6LFQNWjz7BqMeibS7MYwX/2YdBazm/nJQW0BZE/Tb YR8nx3sHVbci6opfL+9EZsbM0Lvf5m+x+/QxJUUNdDm4tLB2M8+OEm62tBqCfpFrruHP wjXUh/xGZZXVM8XmryfJruQuPrz8c1maK5fiiQ5uFyYS+TjLUWai4KCGfLIrFCc64JDo Kc4g== Sender: swupdate@googlegroups.com X-Gm-Message-State: AKwxytcaWB1nN+Tqws979lRyCRasM45MU28odw/Nm1RYoSwv43fdVnWM QokaGBCGtmF7Q4iSl1zMs0o= X-Google-Smtp-Source: ACJfBos4cTWJ+wO4zwWkt16jhN+3k735deGamfbp1p7x//9vi2CSrexsamBnoIoe5s+1UAm53w9eeQ== X-Received: by 10.46.125.22 with SMTP id y22mr234ljc.1.1515408307584; Mon, 08 Jan 2018 02:45:07 -0800 (PST) MIME-Version: 1.0 X-BeenThere: swupdate@googlegroups.com Received: by 10.46.23.207 with SMTP id 76ls1001558ljx.5.gmail; Mon, 08 Jan 2018 02:45:06 -0800 (PST) X-Received: by 10.25.32.212 with SMTP id g203mr539361lfg.20.1515408306856; Mon, 08 Jan 2018 02:45:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515408306; cv=none; d=google.com; s=arc-20160816; b=tgAYmSMDj3qIGemeMljxm9Xk0XdvPST9kY9rWKLc4KpWu+nty20Xxk+sNHsHbI2PI4 uHSBGYRoC20wC7iq/JeyfC0FTrbKFSiZj2+AeXcVKBqej+SEmTR5c3zon1ATBS49IoJS jMjw9ZdJmg1iaA8ddbjF0UnPi41PSQMBKSgByz0TGdSRPHukn24HA/QsR1I6yGah1pr/ Nd4QGAHWsHlU63aJwYat96y4r3RAi8udjItfaM/lnXs3zd6pmahrecKJGaKNHFjj/T09 C6WK52X6M6cMdxnopL4k4YlYMQJUmLSt4tyFSxsi4QQbBA0l0ImzOVUTOY93/ne5AYQB IUQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:arc-authentication-results; bh=7sIuX+ORuinBPWpGjE263mXsghlzXOW+HwzsayXgFp0=; b=qydmjR3t27NgAlGRIgLeE7SAMZs1vA5yzrR8EfHHiNo3elfzDGqtpsNgYaT5xQw5VC HQ44fAI5SvK5mT5D/9OleWWPaaz9kg1Idq6exDPVxVGljz41WlJGrlwDx/mMcahXQIrF 0FnYhVJe1rhShr1PX7Hm9G4R83xkQA1OccVz3gMlBhrdilhlapB1Yzf3EqdT+KDAW1uv tA8si7HT6PhTOf8l1cLhCls7kYPk8XEsf5SO5+nFoL92vlaf5GsTKCrQu5NqbsL8iObh QoQ7RytFSkRVKhJ39/gjoflTzmz7YHtE3uF/7eiw6MYJ39Mrgn8wRnM5wXNE2NkO+41C lRbQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 85.13.157.12 is neither permitted nor denied by best guess record for domain of stefan@herbrechtsmeier.net) smtp.mailfrom=stefan@herbrechtsmeier.net Received: from dd41138.kasserver.com (dd41138.kasserver.com. [85.13.157.12]) by gmr-mx.google.com with ESMTPS id b78si1627318ljf.3.2018.01.08.02.45.06 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Jan 2018 02:45:06 -0800 (PST) Received-SPF: neutral (google.com: 85.13.157.12 is neither permitted nor denied by best guess record for domain of stefan@herbrechtsmeier.net) client-ip=85.13.157.12; Received: from WS08941.weidmueller.com (unknown [217.244.7.16]) by dd41138.kasserver.com (Postfix) with ESMTPSA id B56A311A00D0; Mon, 8 Jan 2018 11:45:05 +0100 (CET) From: stefan@herbrechtsmeier.net To: swupdate@googlegroups.com Cc: Stefan Herbrechtsmeier Subject: [swupdate] [PATCH] Lua: Add image properties to table Date: Mon, 8 Jan 2018 11:45:01 +0100 Message-Id: <1515408301-31416-1-git-send-email-stefan@herbrechtsmeier.net> X-Mailer: git-send-email 2.7.4 X-Original-Sender: stefan@herbrechtsmeier.net X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 85.13.157.12 is neither permitted nor denied by best guess record for domain of stefan@herbrechtsmeier.net) smtp.mailfrom=stefan@herbrechtsmeier.net Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , From: Stefan Herbrechtsmeier Signed-off-by: Stefan Herbrechtsmeier --- corelib/lua_interface.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/corelib/lua_interface.c b/corelib/lua_interface.c index f873aac..3ed3d4d 100644 --- a/corelib/lua_interface.c +++ b/corelib/lua_interface.c @@ -420,6 +420,8 @@ static int l_istream_read(lua_State* L) static void update_table(lua_State* L, struct img_type *img) { + struct dict_entry *property; + if (L && img) { luaL_checktype(L, -1, LUA_TTABLE); @@ -445,6 +447,15 @@ static void update_table(lua_State* L, struct img_type *img) LUA_PUSH_IMG_NUMBER(img, "size", size); LUA_PUSH_IMG_NUMBER(img, "checksum", checksum); + lua_pushstring(L, "properties"); + lua_newtable (L); + LIST_FOREACH(property, &img->properties, next) { + lua_pushstring(L, property->varname); + lua_pushstring(L, property->value); + lua_settable(L, -3); + } + lua_settable(L, -3); + #ifdef CONFIG_HANDLER_IN_LUA if (is_type(L, LUA_TYPE_HANDLER)) { lua_pushstring(L, "copy2file");