summaryrefslogtreecommitdiff
path: root/nuttx/include
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-01-16 17:05:00 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-01-16 17:05:00 +0000
commit880aa24ce3cb2bae6decbbdb2650f91a2547ba53 (patch)
tree6e7738015216d3c39847602e0ea776a3e14faa19 /nuttx/include
parentd904fafdf2f9f7ad686bd9d8b616aa310f5346eb (diff)
downloadpx4-nuttx-880aa24ce3cb2bae6decbbdb2650f91a2547ba53.tar.gz
px4-nuttx-880aa24ce3cb2bae6decbbdb2650f91a2547ba53.tar.bz2
px4-nuttx-880aa24ce3cb2bae6decbbdb2650f91a2547ba53.zip
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
Diffstat (limited to 'nuttx/include')
-rw-r--r--nuttx/include/nuttx/binfmt/builtin.h81
-rw-r--r--nuttx/include/nuttx/fs/binfs.h11
-rw-r--r--nuttx/include/nuttx/fs/ioctl.h6
3 files changed, 81 insertions, 17 deletions
diff --git a/nuttx/include/nuttx/binfmt/builtin.h b/nuttx/include/nuttx/binfmt/builtin.h
index c27605cac..632f8944d 100644
--- a/nuttx/include/nuttx/binfmt/builtin.h
+++ b/nuttx/include/nuttx/binfmt/builtin.h
@@ -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)
diff --git a/nuttx/include/nuttx/fs/binfs.h b/nuttx/include/nuttx/fs/binfs.h
index df92375e3..d967506d8 100644
--- a/nuttx/include/nuttx/fs/binfs.h
+++ b/nuttx/include/nuttx/fs/binfs.h
@@ -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
diff --git a/nuttx/include/nuttx/fs/ioctl.h b/nuttx/include/nuttx/fs/ioctl.h
index 8f2fdd7d9..9cde497a8 100644
--- a/nuttx/include/nuttx/fs/ioctl.h
+++ b/nuttx/include/nuttx/fs/ioctl.h
@@ -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 **************************************/