mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 09:18:00 +08:00
Rename apps/include/apps.h to builtin.h. Move parts of apps/builtins/exec_builtin.c to binfmt/libbuiltin/libbuiltin_utils.c
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5524 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -1,10 +1,15 @@
|
||||
/****************************************************************************
|
||||
* include/nuttx/binfmt/builtin.h
|
||||
*
|
||||
* Originally by:
|
||||
*
|
||||
* Copyright (C) 2011 Uros Platise. All rights reserved.
|
||||
* Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
|
||||
* Authors: Uros Platise <uros.platise@isotel.eu>
|
||||
* Gregory Nutt <gnutt@nuttx.org>
|
||||
* Author: Uros Platise <uros.platise@isotel.eu>
|
||||
*
|
||||
* With subsequent updates, modifications, and general maintenance by:
|
||||
*
|
||||
* Copyright (C) 2012-2013 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -43,7 +48,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <apps/apps.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
@@ -68,13 +73,79 @@ extern "C" {
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
/* The g_builtins[] array holds information about each builtin function. If
|
||||
* support for builtin functions is enabled in the NuttX configuration, then
|
||||
* this arrary (along with the number_builtins() function) must be provided
|
||||
* by the application code.
|
||||
*/
|
||||
|
||||
EXTERN const struct builtin_s g_builtins[];
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
EXTERN int number_builtins(void);
|
||||
/****************************************************************************
|
||||
* Utility Functions Provided to Applications by binfmt/libbuiltin
|
||||
****************************************************************************/
|
||||
/****************************************************************************
|
||||
* Name: builtin_isavail
|
||||
*
|
||||
* Description:
|
||||
* Checks for availabiliy of application registerred during compile time.
|
||||
*
|
||||
* Input Parameter:
|
||||
* filename - Name of the linked-in binary to be started.
|
||||
*
|
||||
* Returned Value:
|
||||
* This is an end-user function, so it follows the normal convention:
|
||||
* Returns index of builtin application. If it is not found then it
|
||||
* returns -1 (ERROR) and sets errno appropriately.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int builtin_isavail(FAR const char *appname);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: builtin_getname
|
||||
*
|
||||
* Description:
|
||||
* Returns pointer to a name of built-in application pointed by the
|
||||
* index.
|
||||
*
|
||||
* Input Parameter:
|
||||
* index, from 0 and on ...
|
||||
*
|
||||
* Returned Value:
|
||||
* Returns valid pointer pointing to the app name if index is valid.
|
||||
* Otherwise NULL is returned.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR const char *builtin_getname(int index);
|
||||
|
||||
/****************************************************************************
|
||||
* Data Set Access Functions Provided to Applications by binfmt/libbuiltin
|
||||
****************************************************************************/
|
||||
/****************************************************************************
|
||||
* Name: number_builtins
|
||||
*
|
||||
* Description:
|
||||
* Returns the number of builtin functions in the g_builtins[] array. If
|
||||
* support for builtin functions is enabled in the NuttX configuration,
|
||||
* then this function (along with g_builtins[]) must be provided by the
|
||||
* application code.
|
||||
*
|
||||
* Input Parameter:
|
||||
* None
|
||||
*
|
||||
* Returned Value:
|
||||
* The number of entries in the g_builtins[] array. This function does
|
||||
* not return failures.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int number_builtins(void);
|
||||
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
|
||||
@@ -42,22 +42,11 @@
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <nuttx/fs/ioctl.h>
|
||||
|
||||
#ifdef CONFIG_FS_BINFS
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
/* This is the BINFS ioctl that can be used to recover the filename
|
||||
* associated with the builtin task.
|
||||
*/
|
||||
|
||||
#define FIOC_FILENAME FIOC_USER /* IN: FAR const char ** pointer
|
||||
* OUT: Pointer to a persistent file name
|
||||
* (Guaranteed to persist while the file
|
||||
* is open).
|
||||
*/
|
||||
|
||||
/****************************************************************************
|
||||
* Type Definitions
|
||||
|
||||
@@ -105,7 +105,11 @@
|
||||
#define FIOC_OPTIMIZE _FIOC(0x0003) /* IN: None
|
||||
* OUT: None
|
||||
*/
|
||||
#define FIOC_USER _FIOC(0x0004) /* File system-specific */
|
||||
#define FIOC_FILENAME _FIOC(0x0004) /* IN: FAR const char ** pointer
|
||||
* OUT: Pointer to a persistent file name
|
||||
* (Guaranteed to persist while the file
|
||||
* is open).
|
||||
*/
|
||||
|
||||
/* NuttX file system ioctl definitions **************************************/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user