#ifndef _FOSA_H_
#define _FOSA_H_
+#include "fosa_cpp_macros.h"
#include "fosa_configuration_parameters.h"
#include "fosa_types.h"
* -DOSE
* -DMARTE_OS
* -DAQuoSA
- * -DPARTIKLE
*
* This module contains all other modules that are internal to the
* FRSH implementation.
#include "fosa_types.h"
+FOSA_CPP_BEGIN_DECLS
+
/**
* @defgroup appdefsched Application Defined Scheduling
* @ingroup fosa
/*}*/
+FOSA_CPP_END_DECLS
#endif /* !FOSA_APP_DEF_SCHED_H_ */
#include "fosa_types.h"
#include "fosa_configuration_parameters.h"
+FOSA_CPP_BEGIN_DECLS
+
/**
* @defgroup clocksandtimers Clocks and Timers
* @ingroup fosa
/*@}*/
+FOSA_CPP_END_DECLS
#endif /* !FOSA_CLOCKS_AND_TIMERS_H_ */
#ifndef _FOSA_CONFIG_PARAM_H_
#define _FOSA_CONFIG_PARAM_H_
-
+FOSA_CPP_BEGIN_DECLS
// the realtime clock used internally by the FRSH implementation
// as the time basis for all timed services
// The preemption level of the ADS scheduler thread
#define FOSA_ADS_SCHEDULER_LEVEL 0xffff
+FOSA_CPP_END_DECLS
+
#endif // _FOSA_CONFIG_PARAM_H_
--- /dev/null
+#ifndef _FOSA_CPP_MACROS_H_
+#define _FOSA_CPP_MACROS_H_
+
+#if defined(__cplusplus)
+#define FOSA_CPP_BEGIN_DECLS extern "C" {
+#else
+#define FOSA_CPP_BEGIN_DECLS
+#endif
+
+#if defined(__cplusplus)
+#define FOSA_CPP_END_DECLS }
+#else
+#define FOSA_CPP_END_DECLS
+#endif
+
+#endif // _FOSA_CPP_MACROS_H_
+
+
#include "fosa_types.h"
#include "fosa_opaque_types.h"
+FOSA_CPP_BEGIN_DECLS
+
/**
* @defgroup longjumps Long Jumps
* @ingroup fosa
/*@}*/
+FOSA_CPP_END_DECLS
+
#endif /* !FOSA_LONG_JUMP */
#include "fosa_types.h"
+FOSA_CPP_BEGIN_DECLS
+
/**
* @defgroup mutexesandcondvars Mutexes and Condvars
* @ingroup fosa
/*@}*/
-
+FOSA_CPP_END_DECLS
#endif /* !FOSA_MUTEX_AND_CONDVARS_H_ */
#include <stdbool.h>
+#include "fosa_cpp_macros.h"
+
/////////////////////// MARTE_OS /////////////////////////////
#ifdef MARTE_OS
#include <sched.h>
#include <errno.h>
+FOSA_CPP_BEGIN_DECLS
+
/* Time */
/********/
// typedef struct timespec fosa_rel_time_t;
#endif /* DUMMY */
//////////////////////////End of DUMMY_OS ////////////////////////////////////
-
+FOSA_CPP_END_DECLS
#endif // _FOSA_OPAQUE_TYPES_H_
#include "fosa_types.h"
+
+FOSA_CPP_BEGIN_DECLS
+
+
/**
* @defgroup threadandsignals Thread and Signals
* @ingroup fosa
/*}*/
+FOSA_CPP_END_DECLS
#endif /* !FOSA_THREAD_AND_SIGNALS_H_ */
#ifndef FOSA_TIME_H_
#define FOSA_TIME_H_
+FOSA_CPP_BEGIN_DECLS
+
/**
* fosa_eat()
*
**/
void inline fosa_eat(const struct timespec *cpu_time);
+FOSA_CPP_END_DECLS
#endif /* !FOSA_TIME_H_ */
#define _FOSA_TYPES_H_
#include "fosa_opaque_types.h"
+
+FOSA_CPP_BEGIN_DECLS
+
/**
* @addtogroup threadandsignals
*
typedef FOSA_LONG_JUMP_CONTEXT_T_OPAQUE fosa_long_jump_context_t;
+FOSA_CPP_END_DECLS
#endif // _FOSA_TYPES_H_
#include <time.h> // for timespec
#include <string.h> // for memset
+FOSA_CPP_BEGIN_DECLS
+
#define smaller_timespec(t1, t2) \
( \
(t1)->tv_sec < (t2)->tv_sec || ((t1)->tv_sec == (t2)->tv_sec && \
return tmp;
}
+FOSA_CPP_BEGIN_DECLS
+
#endif /* _MARTE_MISC_TIMESPEC_OPERATIONS_H_ */
//================================================
-#include "fosa_clocks_and_timers.h"
#include <pthread.h>
#include <time.h>
#include <stdio.h>
+#include "fosa_clocks_and_timers.h"
+
static const struct timespec zero_time={0,0};