From: Pawel Szewczyk
Date: Tue, 14 Jul 2015 12:01:57 +0000 (+0200)
Subject: gadget: Print functions in gadget show command
X-Git-Tag: accepted/tizen/3.0/common/20161114.110810~26
X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ca950764383901af5d50cac990635f1e68a2c7bd;p=platform%2Fupstream%2Fgt.git
gadget: Print functions in gadget show command
When --recursive flag is used, functions are also printed.
Change-Id: I3d58c53111cd1db2e934b46cb4cc89a852b74451
Signed-off-by: Pawel Szewczyk
---
diff --git a/source/gadget/CMakeLists.txt b/source/gadget/CMakeLists.txt
index ed550e5..5120fa6 100644
--- a/source/gadget/CMakeLists.txt
+++ b/source/gadget/CMakeLists.txt
@@ -1,5 +1,6 @@
-INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/include )
+INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${CMAKE_SOURCE_DIR}/function/include )
SET( GADGET_SRC
${CMAKE_CURRENT_SOURCE_DIR}/src/gadget.c
diff --git a/source/gadget/src/gadget_libusbg.c b/source/gadget/src/gadget_libusbg.c
index 5b81275..1930ac2 100644
--- a/source/gadget/src/gadget_libusbg.c
+++ b/source/gadget/src/gadget_libusbg.c
@@ -23,6 +23,7 @@
#include "backend.h"
#include "common.h"
#include "settings.h"
+#include "function.h"
/**
* @brief Get implicite gadget
@@ -288,6 +289,7 @@ static int print_gadget(usbg_gadget *g, int opts)
{
usbg_gadget_attrs g_attrs;
usbg_udc *u;
+ usbg_function *f;
int usbg_ret;
const char *name;
@@ -321,7 +323,13 @@ static int print_gadget(usbg_gadget *g, int opts)
if (opts & GT_VERBOSE)
print_gadget_attrs(&g_attrs, NULL);
- /* TODO --recursive*/
+ if (opts & GT_RECURSIVE) {
+ usbg_for_each_function(f, g) {
+ gt_print_function_libusbg(f, opts);
+ }
+
+ /* TODO print config */
+ }
return 0;
}