From: Wolfgang Denk Date: Tue, 23 Sep 2008 16:37:49 +0200 Subject: [U-Boot] [RFC] exposing finding a command for subcommands In-Reply-To: References: Message-ID: <20080923143749.AF65124844@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Kumar Gala, In message you wrote: > How about something like this for exposing the command table code for > subcommands. I'll follow this up with an example of usage based on the > bootm subcommand patch Looks good to me. Just a question: > -cmd_tbl_t *find_cmd (const char *cmd) > +cmd_tbl_t *__find_cmd (const char *cmd, cmd_tbl_t *table, int table_len) That means we would export __find_cmd() to other functions? We shouldn't do that - "__" names are reserved. > +#define U_BOOT_CMD_INIT(name,maxargs,rep,cmd,usage,help) \ > +{#name, maxargs, rep, cmd, usage, help} > + I think "INIT" is not a good name here. To me it sounds like a macro to use just once. How about "ENTRY" or "MKENT" or something like this? Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de "Open the pod bay doors, HAL." - Dave Bowman, 2001