Corrected pcode.h header file

This commit is contained in:
Gregory Nutt 2014-05-08 11:11:44 -06:00
parent 7fffa72ee5
commit 765805234f

View File

@ -1,14 +1,7 @@
/**************************************************************************** /****************************************************************************
* include/nuttx/binfmt/builtin.h * include/nuttx/binfmt/pcode.h
* *
* Originally by: * Copyright (C) 2014 Gregory Nutt. All rights reserved.
*
* 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> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -40,35 +33,27 @@
* *
****************************************************************************/ ****************************************************************************/
#ifndef __INCLUDE_NUTTX_BINFMT_BUILTIN_H #ifndef __INCLUDE_NUTTX_BINFMT_PCODE_H
#define __INCLUDE_NUTTX_BINFMT_BUILTIN_H #define __INCLUDE_NUTTX_BINFMT_PCODE_H
/**************************************************************************** /****************************************************************************
* Included Files * Included Files
****************************************************************************/ ****************************************************************************/
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h>
/**************************************************************************** /****************************************************************************
* Public Types * Public Types
****************************************************************************/ ****************************************************************************/
struct builtin_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 * Public Data
****************************************************************************/ ****************************************************************************/
#if defined(__cplusplus) #if defined(__cplusplus)
#define EXTERN extern "C" #define EXTERN extern "C"
extern "C" { extern "C"
{
#else #else
#define EXTERN extern #define EXTERN extern
#endif #endif
@ -78,12 +63,12 @@ extern "C" {
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: builtin_initialize * Name: pcode_initialize
* *
* Description: * Description:
* Builtin support is built unconditionally. However, in order to * P-code support is built based on the configuration. However, in order
* use this binary format, this function must be called during system * to use this binary format, this function must be called during system
* format in order to register the builtin binary format. * initialization in order to register the P-Code binary format.
* *
* Returned Value: * Returned Value:
* This is a NuttX internal function so it follows the convention that * This is a NuttX internal function so it follows the convention that
@ -92,87 +77,25 @@ extern "C" {
* *
****************************************************************************/ ****************************************************************************/
int builtin_initialize(void); int pcode_initialize(void);
/**************************************************************************** /****************************************************************************
* Name: builtin_uninitialize * Name: pcode_uninitialize
* *
* Description: * Description:
* Unregister the builtin binary loader * Unregister the pcode binary loader
* *
* Returned Value: * Returned Value:
* None * None
* *
****************************************************************************/ ****************************************************************************/
void builtin_uninitialize(void); void pcode_uninitialize(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: builtin_for_index
*
* Description:
* Returns the builtin_s structure for the selected builtin.
* If support for builtin functions is enabled in the NuttX configuration,
* then this function must be provided by the application code.
*
* Input Parameter:
* index, from 0 and on...
*
* Returned Value:
* Returns valid pointer pointing to the builtin_s structure if index is
* valid.
* Otherwise, NULL is returned.
*
****************************************************************************/
EXTERN FAR const struct builtin_s *builtin_for_index(int index);
#undef EXTERN #undef EXTERN
#if defined(__cplusplus) #if defined(__cplusplus)
} }
#endif #endif
#endif /* __INCLUDE_NUTTX_BINFMT_BUILTIN_H */ #endif /* __INCLUDE_NUTTX_BINFMT_PCODE_H */