summaryrefslogtreecommitdiffstats
path: root/Src/Console.h
diff options
context:
space:
mode:
authorChristian Gromm <christian.gromm@microchip.com>2016-12-08 16:46:07 +0100
committerChristian Gromm <christian.gromm@microchip.com>2016-12-08 16:46:07 +0100
commit0a28683a1ff9f3975c8b68b15017cf342bab5f3d (patch)
tree2f350b709db4d45532fc0624cfce22ec11e43ccf /Src/Console.h
parent18c9e9fc0000861257ab06f6a033612b0c567674 (diff)
src: vod-server: import sources
This patch adds the source tree of the Video-On-Demand server and its configuration scripts. Change-Id: I6db8c43d46c7450baf117a541bd7153496dbcd4c Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Diffstat (limited to 'Src/Console.h')
-rw-r--r--Src/Console.h113
1 files changed, 113 insertions, 0 deletions
diff --git a/Src/Console.h b/Src/Console.h
new file mode 100644
index 0000000..aab7e71
--- /dev/null
+++ b/Src/Console.h
@@ -0,0 +1,113 @@
+/*
+ * Video On Demand Samples
+ *
+ * Copyright (C) 2015 Microchip Technology Germany II GmbH & Co. KG
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * You may also obtain this software under a propriety license from Microchip.
+ * Please contact Microchip for further information.
+ *
+ */
+
+/*----------------------------------------------------------*/
+/*! \file
+ * \brief This file contains C-functions starting with "Console" to provide
+ * process and thread safe access to the console output.
+ */
+/*----------------------------------------------------------*/
+#ifndef _CONSOLE_H_
+#define _CONSOLE_H_
+
+#define RESETCOLOR "\033[0m"
+#define GREEN "\033[0;32m"
+#define RED "\033[0;31m"
+#define YELLOW "\033[1;33m"
+#define BLUE "\033[0;34m"
+
+#include <stdbool.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+ typedef enum
+ {
+ PRIO_LOW = 0,
+ PRIO_MEDIUM = 1,
+ PRIO_HIGH = 2,
+ PRIO_ERROR = 0xFF
+ } ConsolePrio_t;
+
+ /*----------------------------------------------------------*/
+ /*! \brief Initializes the resources needed to synchronize between processes and threads.
+ * \note This function must be called before any other function of this component.
+ * \param synchronizeProcesses - If set to true, multiple processes using this component will synchronize their output.
+ *
+ */
+ /*----------------------------------------------------------*/
+ void ConsoleInit( bool synchronizeProcesses );
+
+ /*----------------------------------------------------------*/
+ /*! \brief Destroys the resources needed to synchronize between processes and threads.
+ * \note After this function, any other function (except ConsoleInit) must not be called.
+ *
+ */
+ /*----------------------------------------------------------*/
+ void ConsoleDeinit( void );
+
+
+ /*----------------------------------------------------------*/
+ /*! \brief Sets the minimum priority to be displayed. Lower priority messages are discarded
+ * \param prio - The minimum priority to display
+ */
+ /*----------------------------------------------------------*/
+ void ConsoleSetPrio( ConsolePrio_t prio );
+
+ /*----------------------------------------------------------*/
+ /*! \brief Uses the board specific PRINT mechanism and provides thread and process safety.
+ *
+ */
+ /*----------------------------------------------------------*/
+ void ConsolePrintf( ConsolePrio_t prio, const char *statement, ... );
+
+
+ /*----------------------------------------------------------*/
+ /*! \brief Starts to print and stay blocked after exit of this function
+ *
+ */
+ /*----------------------------------------------------------*/
+ void ConsolePrintfStart( ConsolePrio_t prio, const char *statement, ... );
+
+ /*----------------------------------------------------------*/
+ /*! \brief Continue to print and stay blocked after exit of this function
+ * \note ConsolePrintfStart must be called before and when finished ConsolePrintfExit must be called.
+ * \note This function may be called multiple times.
+ */
+ /*----------------------------------------------------------*/
+ void ConsolePrintfContinue( const char *statement, ... );
+
+ /*----------------------------------------------------------*/
+ /*! \brief Continue to print and unblock after finishing.
+ * \note ConsolePrintfStart must be called before. ConsolePrintfContinue may have been called before multiple times.
+ */
+ /*----------------------------------------------------------*/
+ void ConsolePrintfExit( const char *statement, ... );
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif //_CONSOLE_H_