diff options
author | px4dev <px4@purgatory.org> | 2013-01-17 01:00:46 -0800 |
---|---|---|
committer | px4dev <px4@purgatory.org> | 2013-01-17 01:00:46 -0800 |
commit | 1a532d16dd3a90f20c3668b00ea4f3a86ea32c49 (patch) | |
tree | a770db1fe91e5a3c08e4cb03b216ac36c6f7684d /apps/include | |
parent | 7d7c352fb44b718cb96096a624a19b5225e39f92 (diff) | |
parent | caeef71797019505fd450b1a0ae573ac5e490c6e (diff) | |
download | px4-firmware-1a532d16dd3a90f20c3668b00ea4f3a86ea32c49.tar.gz px4-firmware-1a532d16dd3a90f20c3668b00ea4f3a86ea32c49.tar.bz2 px4-firmware-1a532d16dd3a90f20c3668b00ea4f3a86ea32c49.zip |
Merge NuttX r5527
Diffstat (limited to 'apps/include')
-rw-r--r-- | apps/include/builtin.h (renamed from apps/include/apps.h) | 92 |
1 files changed, 27 insertions, 65 deletions
diff --git a/apps/include/apps.h b/apps/include/builtin.h index 520128203..24cf204fa 100644 --- a/apps/include/apps.h +++ b/apps/include/builtin.h @@ -1,9 +1,16 @@ /**************************************************************************** - * apps/include/apps.h + * apps/include/builtin.h * - * Copyright(C) 2011 Uros Platise. All rights reserved. + * Originally by: + * + * Copyright (C) 2011 Uros Platise. All rights reserved. * 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 * are met: @@ -33,16 +40,18 @@ * ****************************************************************************/ -#ifndef __APPS_INCLUDE_APPS_H -#define __APPS_INCLUDE_APPS_H +#ifndef __APPS_INCLUDE_BUILTIN_H +#define __APPS_INCLUDE_BUILTIN_H /**************************************************************************** * Included Files ****************************************************************************/ #include <nuttx/config.h> + #include <sys/types.h> -#include <stdint.h> + +#include <nuttx/binfmt/builtin.h> /**************************************************************************** * Pre-processor Definitions @@ -52,31 +61,10 @@ * Public Types ****************************************************************************/ -struct namedapp_s -{ - const char *name; /* Invocation name and as seen under /sbin/ */ - int priority; /* Use: SCHED_PRIORITY_DEFAULT */ - int stacksize; /* Desired stack size */ - main_t main; /* Entry point: main(int argc, char *argv[]) */ -}; - /**************************************************************************** * Public Data ****************************************************************************/ -/* The "bindir" is file system that supports access to the named applications. - * It is typically mounted under /bin. - */ - -#ifdef CONFIG_APPS_BINDIR -struct mountpt_operations; -extern const struct mountpt_operations binfs_operations; -#endif - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - #undef EXTERN #if defined(__cplusplus) #define EXTERN extern "C" @@ -86,51 +74,24 @@ extern "C" { #endif /**************************************************************************** - * Name: namedapp_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. - * - ****************************************************************************/ - -EXTERN int namedapp_isavail(FAR const char *appname); - -/**************************************************************************** - * Name: namedapp_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. - * + * Public Functions ****************************************************************************/ -EXTERN const char *namedapp_getname(int index); - /**************************************************************************** - * Name: exec_namedapp + * Name: exec_builtin * * Description: - * Executes builtin named application registered during compile time. + * Executes builtin applications registered during 'make context' time. * New application is run in a separate task context (and thread). * * Input Parameter: - * filename - Name of the linked-in binary to be started. - * argv - Argument list + * filename - Name of the linked-in binary to be started. + * argv - Argument list + * redirfile - If output if redirected, this parameter will be non-NULL + * and will provide the full path to the file. + * oflags - If output is redirected, this parameter will provide the + * open flags to use. This will support file replacement + * of appending to an existing file. * * Returned Value: * This is an end-user function, so it follows the normal convention: @@ -139,11 +100,12 @@ EXTERN const char *namedapp_getname(int index); * ****************************************************************************/ -EXTERN int exec_namedapp(FAR const char *appname, FAR const char **argv); +EXTERN int exec_builtin(FAR const char *appname, FAR const char **argv, + FAR const char *redirfile, int oflags); #undef EXTERN #if defined(__cplusplus) } #endif -#endif /* __APPS_INCLUDE_APPS_H */ +#endif /* __APPS_INCLUDE_BUILTIN_H */ |