2011-05-10 00:21:10 +02:00
|
|
|
/****************************************************************************
|
2016-07-01 15:08:03 +02:00
|
|
|
* apps/include/builtin/builtin.h
|
2011-05-10 00:21:10 +02:00
|
|
|
*
|
2021-06-11 08:28:21 +02:00
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed with
|
|
|
|
* this work for additional information regarding copyright ownership. The
|
|
|
|
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
|
|
|
* "License"); you may not use this file except in compliance with the
|
|
|
|
* License. You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
|
|
* License for the specific language governing permissions and limitations
|
|
|
|
* under the License.
|
2011-05-10 00:21:10 +02:00
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
2016-07-01 15:08:03 +02:00
|
|
|
#ifndef __APPS_INCLUDE_BUILTIN_BUILTIN_H
|
|
|
|
#define __APPS_INCLUDE_BUILTIN_BUILTIN_H
|
2011-05-10 00:21:10 +02:00
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Included Files
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include <nuttx/config.h>
|
2013-01-16 15:14:14 +01:00
|
|
|
|
2011-05-10 00:21:10 +02:00
|
|
|
#include <sys/types.h>
|
|
|
|
|
2019-08-23 17:12:20 +02:00
|
|
|
#include <nuttx/lib/builtin.h>
|
2013-01-16 15:14:14 +01:00
|
|
|
|
2011-05-10 00:21:10 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* Pre-processor Definitions
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public Types
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public Data
|
|
|
|
****************************************************************************/
|
|
|
|
|
2013-01-15 22:01:37 +01:00
|
|
|
#undef EXTERN
|
|
|
|
#if defined(__cplusplus)
|
|
|
|
#define EXTERN extern "C"
|
2015-06-13 02:07:47 +02:00
|
|
|
extern "C"
|
|
|
|
{
|
2013-01-15 22:01:37 +01:00
|
|
|
#else
|
|
|
|
#define EXTERN extern
|
|
|
|
#endif
|
|
|
|
|
2011-05-10 00:21:10 +02:00
|
|
|
/****************************************************************************
|
2021-06-11 11:07:52 +02:00
|
|
|
* Public Functions Prototypes
|
2011-05-10 00:21:10 +02:00
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
2012-12-23 21:22:41 +01:00
|
|
|
* Name: exec_builtin
|
2011-05-10 00:21:10 +02:00
|
|
|
*
|
|
|
|
* Description:
|
2012-12-23 21:22:41 +01:00
|
|
|
* Executes builtin applications registered during 'make context' time.
|
2011-05-10 00:21:10 +02:00
|
|
|
* New application is run in a separate task context (and thread).
|
|
|
|
*
|
|
|
|
* Input Parameter:
|
2013-01-15 22:01:37 +01:00
|
|
|
* filename - Name of the linked-in binary to be started.
|
|
|
|
* argv - Argument list
|
2021-08-26 14:36:43 +02:00
|
|
|
* redirfile - If output is redirected, this parameter will be non-NULL
|
2013-01-15 22:01:37 +01:00
|
|
|
* 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.
|
2011-05-10 00:21:10 +02:00
|
|
|
*
|
|
|
|
* Returned Value:
|
|
|
|
* This is an end-user function, so it follows the normal convention:
|
2021-08-26 14:36:43 +02:00
|
|
|
* Returns the PID of the exec'ed module. On failure, it returns
|
2011-05-10 00:21:10 +02:00
|
|
|
* -1 (ERROR) and sets errno appropriately.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
2015-06-13 02:07:47 +02:00
|
|
|
int exec_builtin(FAR const char *appname, FAR char * const *argv,
|
|
|
|
FAR const char *redirfile, int oflags);
|
2011-05-10 00:21:10 +02:00
|
|
|
|
|
|
|
#undef EXTERN
|
|
|
|
#if defined(__cplusplus)
|
|
|
|
}
|
|
|
|
#endif
|
2012-07-17 05:58:11 +02:00
|
|
|
|
2016-07-01 15:08:03 +02:00
|
|
|
#endif /* __APPS_INCLUDE_BUILTIN_BUILTIN_H */
|