2012-09-17 15:18:44 -03:00
|
|
|
/****************************************************************************
|
2013-01-16 20:30:12 -04:00
|
|
|
* binfmt/libbuiltin/libbuiltin_getname.c
|
2012-09-17 15:18:44 -03:00
|
|
|
*
|
2013-01-15 17:01:37 -04:00
|
|
|
* Originally by:
|
|
|
|
*
|
|
|
|
* Copyright (C) 2011 Uros Platise. All rights reserved.
|
2012-09-17 15:18:44 -03:00
|
|
|
* Author: Uros Platise <uros.platise@isotel.eu>
|
|
|
|
*
|
2013-01-15 17:01:37 -04:00
|
|
|
* With subsequent updates, modifications, and general maintenance by:
|
|
|
|
*
|
|
|
|
* Copyright (C) 2012-2013 Gregory Nutt. All rights reserved.
|
|
|
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
|
|
|
*
|
2012-09-17 15:18:44 -03:00
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
*
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in
|
|
|
|
* the documentation and/or other materials provided with the
|
|
|
|
* distribution.
|
|
|
|
* 3. Neither the name NuttX nor the names of its contributors may be
|
|
|
|
* used to endorse or promote products derived from this software
|
|
|
|
* without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
|
|
|
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
|
|
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
2013-01-16 13:05:00 -04:00
|
|
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
2012-09-17 15:18:44 -03:00
|
|
|
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
|
|
|
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
|
|
|
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
2013-01-16 13:05:00 -04:00
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
2012-09-17 15:18:44 -03:00
|
|
|
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
* POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Included Files
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include <nuttx/config.h>
|
2013-01-16 10:14:14 -04:00
|
|
|
|
2013-01-16 13:05:00 -04:00
|
|
|
#include <nuttx/binfmt/builtin.h>
|
2013-01-16 10:14:14 -04:00
|
|
|
|
2012-09-17 15:18:44 -03:00
|
|
|
/****************************************************************************
|
|
|
|
* Pre-processor Definitions
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
2013-01-16 13:05:00 -04:00
|
|
|
* Private Types
|
2012-09-17 15:18:44 -03:00
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
2013-01-16 13:05:00 -04:00
|
|
|
* Private Function Prototypes
|
2012-09-17 15:18:44 -03:00
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
2013-01-16 13:05:00 -04:00
|
|
|
* Private Data
|
2012-09-17 15:18:44 -03:00
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
2013-01-16 13:05:00 -04:00
|
|
|
* Private Functions
|
2012-09-17 15:18:44 -03:00
|
|
|
****************************************************************************/
|
|
|
|
|
2013-01-16 13:05:00 -04:00
|
|
|
/****************************************************************************
|
|
|
|
* Public Functions
|
|
|
|
****************************************************************************/
|
2012-09-17 15:18:44 -03:00
|
|
|
|
|
|
|
/****************************************************************************
|
2012-12-23 16:22:41 -04:00
|
|
|
* Name: builtin_getname
|
2012-09-17 15:18:44 -03:00
|
|
|
*
|
|
|
|
* Description:
|
2013-01-16 13:05:00 -04:00
|
|
|
* Return the name of the application at index in the table of builtin
|
|
|
|
* applications.
|
2012-09-17 15:18:44 -03:00
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
2013-01-16 13:05:00 -04:00
|
|
|
FAR const char *builtin_getname(int index)
|
|
|
|
{
|
2013-01-17 14:32:13 -04:00
|
|
|
FAR const struct builtin_s *builtin;
|
2013-01-16 13:05:00 -04:00
|
|
|
|
2013-01-17 14:32:13 -04:00
|
|
|
builtin = builtin_for_index(index);
|
2013-01-17 10:43:55 -04:00
|
|
|
|
2013-01-17 14:32:13 -04:00
|
|
|
if (builtin != NULL)
|
2013-01-17 10:43:55 -04:00
|
|
|
{
|
2013-01-17 14:32:13 -04:00
|
|
|
return builtin->name;
|
2013-01-17 10:43:55 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
2013-01-16 13:05:00 -04:00
|
|
|
}
|