Skip to content

Commit

Permalink
Fix nasa#972, Split _CFE_CORE_-only API parts
Browse files Browse the repository at this point in the history
Create a separate "core_internal.h" header file for prototypes
that were only intended for CFE core use.
  • Loading branch information
jphickey committed Mar 10, 2021
1 parent 6051fbc commit 03c2942
Show file tree
Hide file tree
Showing 20 changed files with 628 additions and 371 deletions.
105 changes: 0 additions & 105 deletions modules/core_api/fsw/inc/cfe_es.h
Original file line number Diff line number Diff line change
Expand Up @@ -1672,109 +1672,4 @@ CFE_Status_t CFE_ES_GetGenCounterName(char *CounterName, CFE_ES_CounterId_t Coun

/**@}*/


/*
* The internal APIs prototyped within this block are only intended to be invoked from
* other CFE core apps. They still need to be prototyped in the shared header such that
* they can be called from other core modules, but applications should not call these.
*/
#ifdef _CFE_CORE_

/** @defgroup CFEAPIESCoreInternal cFE Internal Executive Service APIs, internal to CFE core
* @{
*/


/*****************************************************************************/
/**
** \brief Entry Point for cFE Core Application
**
** \par Description
** This is the entry point to the cFE ES Core Application.
**
** \par Assumptions, External Events, and Notes:
** None
**
**
******************************************************************************/
extern void CFE_ES_TaskMain(void);


/*****************************************************************************/
/**
** \brief Initializes the cFE core module API Library
**
** \par Description
** Initializes the cFE core module API Library
**
** \par Assumptions, External Events, and Notes:
** -# This function MUST be called before any module API's are called.
**
******************************************************************************/
extern int32 CFE_ES_CDS_EarlyInit(void);


/*****************************************************************************/
/**
** \brief Reserve space (or re-obtain previously reserved space) in the Critical Data Store (CDS)
**
** \par Description
** This routine is identical to #CFE_ES_RegisterCDS except it identifies the contents
** of the CDS as a critical table. This is crucial because a critical table CDS must
** only be deleted by cFE Table Services, not via an ES delete CDS command. Otherwise,
** Table Services may be out of sync with the contents of the CDS.
**
** \par Assumptions, External Events, and Notes:
** -# This function assumes input parameters are error free and have met size/value restrictions.
** -# The calling function is responsible for issuing any event messages associated with errors.
**
** \param[in, out] HandlePtr Pointer Application's variable that will contain the CDS Memory Block Handle. *HandlePtr is the handle of the CDS block that can be used in #CFE_ES_CopyToCDS and #CFE_ES_RestoreFromCDS.
**
** \param[in] UserBlockSize The number of bytes needed in the CDS.
**
** \param[in] Name Pointer to character string containing the Application's local name for
** the CDS.
**
** \param[in] CriticalTbl Indicates whether the CDS is to be used as a Critical Table or not
**
**
** \return See return codes for #CFE_ES_RegisterCDS
**
******************************************************************************/
int32 CFE_ES_RegisterCDSEx(CFE_ES_CDSHandle_t *HandlePtr, size_t UserBlockSize, const char *Name, bool CriticalTbl);

/*****************************************************************************/
/**
** \brief Deletes the specified CDS from the CDS Registry and frees CDS Memory
**
** \par Description
** Removes the record of the specified CDS from the CDS Registry and
** frees the associated CDS memory for future use.
**
** \par Assumptions, External Events, and Notes:
** None
**
** \param[in] CDSName - Pointer to character string containing complete
** CDS Name (of the format "AppName.CDSName").
**
** \param[in] CalledByTblServices - Flag that identifies whether the CDS is supposed to
** be a Critical Table Image or not.
**
** \return #CFE_SUCCESS \copydoc CFE_SUCCESS
** \return #CFE_ES_CDS_WRONG_TYPE_ERR \copydoc CFE_ES_CDS_WRONG_TYPE_ERR
** \return #CFE_ES_CDS_OWNER_ACTIVE_ERR \copydoc CFE_ES_CDS_OWNER_ACTIVE_ERR
** \return #CFE_ES_ERR_NAME_NOT_FOUND \copydoc CFE_ES_ERR_NAME_NOT_FOUND
** \return Any of the return values from #CFE_ES_UpdateCDSRegistry
** \return Any of the return values from #CFE_ES_GenPoolPutBlock
**
******************************************************************************/
int32 CFE_ES_DeleteCDS(const char *CDSName, bool CalledByTblServices);


/**@}*/

#endif /* _CFE_CORE_ */



#endif /* CFE_ES_API_H */
141 changes: 141 additions & 0 deletions modules/core_api/fsw/inc/cfe_es_core_internal.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
/*
** GSC-18128-1, "Core Flight Executive Version 6.7"
**
** Copyright (c) 2006-2019 United States Government as represented by
** the Administrator of the National Aeronautics and Space Administration.
** All Rights Reserved.
**
** Licensed 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.
*/

/*
** File: cfe_es.h
**
** Purpose:
** Unit specification for Executive Services library functions and macros.
**
** References:
** Flight Software Branch C Coding Standard Version 1.0a
** cFE Flight Software Application Developers Guide
**
** Notes:
**
*/

#ifndef CFE_ES_CORE_INTERNAL_H
#define CFE_ES_CORE_INTERNAL_H

#include "common_types.h"
#include "cfe_es_extern_typedefs.h"

/*
* The internal APIs prototyped within this block are only intended to be invoked from
* other CFE core apps. They still need to be prototyped in the shared header such that
* they can be called from other core modules, but applications should not call these.
*/

/** @defgroup CFEAPIESCoreInternal cFE Internal Executive Service APIs, internal to CFE core
* @{
*/


/*****************************************************************************/
/**
** \brief Entry Point for cFE Core Application
**
** \par Description
** This is the entry point to the cFE ES Core Application.
**
** \par Assumptions, External Events, and Notes:
** None
**
**
******************************************************************************/
extern void CFE_ES_TaskMain(void);


/*****************************************************************************/
/**
** \brief Initializes the cFE core module API Library
**
** \par Description
** Initializes the cFE core module API Library
**
** \par Assumptions, External Events, and Notes:
** -# This function MUST be called before any module API's are called.
**
******************************************************************************/
extern int32 CFE_ES_CDS_EarlyInit(void);


/*****************************************************************************/
/**
** \brief Reserve space (or re-obtain previously reserved space) in the Critical Data Store (CDS)
**
** \par Description
** This routine is identical to #CFE_ES_RegisterCDS except it identifies the contents
** of the CDS as a critical table. This is crucial because a critical table CDS must
** only be deleted by cFE Table Services, not via an ES delete CDS command. Otherwise,
** Table Services may be out of sync with the contents of the CDS.
**
** \par Assumptions, External Events, and Notes:
** -# This function assumes input parameters are error free and have met size/value restrictions.
** -# The calling function is responsible for issuing any event messages associated with errors.
**
** \param[in, out] HandlePtr Pointer Application's variable that will contain the CDS Memory Block Handle. *HandlePtr is the handle of the CDS block that can be used in #CFE_ES_CopyToCDS and #CFE_ES_RestoreFromCDS.
**
** \param[in] UserBlockSize The number of bytes needed in the CDS.
**
** \param[in] Name Pointer to character string containing the Application's local name for
** the CDS.
**
** \param[in] CriticalTbl Indicates whether the CDS is to be used as a Critical Table or not
**
**
** \return See return codes for #CFE_ES_RegisterCDS
**
******************************************************************************/
int32 CFE_ES_RegisterCDSEx(CFE_ES_CDSHandle_t *HandlePtr, size_t UserBlockSize, const char *Name, bool CriticalTbl);

/*****************************************************************************/
/**
** \brief Deletes the specified CDS from the CDS Registry and frees CDS Memory
**
** \par Description
** Removes the record of the specified CDS from the CDS Registry and
** frees the associated CDS memory for future use.
**
** \par Assumptions, External Events, and Notes:
** None
**
** \param[in] CDSName - Pointer to character string containing complete
** CDS Name (of the format "AppName.CDSName").
**
** \param[in] CalledByTblServices - Flag that identifies whether the CDS is supposed to
** be a Critical Table Image or not.
**
** \return #CFE_SUCCESS \copydoc CFE_SUCCESS
** \return #CFE_ES_CDS_WRONG_TYPE_ERR \copydoc CFE_ES_CDS_WRONG_TYPE_ERR
** \return #CFE_ES_CDS_OWNER_ACTIVE_ERR \copydoc CFE_ES_CDS_OWNER_ACTIVE_ERR
** \return #CFE_ES_ERR_NAME_NOT_FOUND \copydoc CFE_ES_ERR_NAME_NOT_FOUND
** \return Any of the return values from #CFE_ES_UpdateCDSRegistry
** \return Any of the return values from #CFE_ES_GenPoolPutBlock
**
******************************************************************************/
int32 CFE_ES_DeleteCDS(const char *CDSName, bool CalledByTblServices);


/**@}*/


#endif /* CFE_ES_CORE_INTERNAL_H */
57 changes: 0 additions & 57 deletions modules/core_api/fsw/inc/cfe_evs.h
Original file line number Diff line number Diff line change
Expand Up @@ -337,61 +337,4 @@ CFE_Status_t CFE_EVS_ResetFilter (int16 EventID);
CFE_Status_t CFE_EVS_ResetAllFilters ( void );
/**@}*/


/*
* The internal APIs prototyped within this block are only intended to be invoked from
* other CFE core apps. They still need to be prototyped in the shared header such that
* they can be called from other core modules, but applications should not call these.
*/
#ifdef _CFE_CORE_

/** @defgroup CFEAPIEVSCoreInternal cFE Internal Event Services APIs, internal to CFE core
* @{
*/

/*****************************************************************************/
/**
** \brief Entry Point for cFE Core Application
**
** \par Description
** This is the entry point to the cFE EVS Core Application.
**
** \par Assumptions, External Events, and Notes:
** None
**
**
******************************************************************************/
extern void CFE_EVS_TaskMain(void);

/*****************************************************************************/
/**
** \brief Initializes the cFE core module API Library
**
** \par Description
** Initializes the cFE core module API Library
**
** \par Assumptions, External Events, and Notes:
** -# This function MUST be called before any module API's are called.
**
******************************************************************************/
extern int32 CFE_EVS_EarlyInit(void);

/*****************************************************************************/
/**
** \brief Removes EVS resources associated with specified Application
**
** \par Description
** This function is called by cFE Executive Services to cleanup after
** an Application has been terminated. It frees resources
** that have been allocated to the specified Application.
**
******************************************************************************/
extern int32 CFE_EVS_CleanUpApp(CFE_ES_AppId_t AppId);


/**@}*/

#endif /* _CFE_CORE_ */


#endif /* CFE_EVS_API_H */
Loading

0 comments on commit 03c2942

Please sign in to comment.