/******************************************************************************* * mm_output.h - Copyright (c) 2014 www.mahonri.info. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE * USE OR OTHER DEALINGS IN THE SOFTWARE. *------------------------------------------------------------------------------ * @file mm_stdout.h * @author www.mahonri.info * @brief stdout related functions. */ #ifndef __MM_OUTPUT_H__ #define __MM_OUTPUT_H__ typedef enum MM_OUTPUT_INTENSITY_E { MM_OUTPUT_INTENSITY_LOW = 0, MM_OUTPUT_INTENSITY_NORMAL = 1, MM_OUTPUT_INTENSITY_HIGH = 2 } MM_OUTPUT_INTENSITY_T; typedef enum MM_OUTPUT_COLOR_E { MM_OUTPUT_COLOR_BLACK = 0, MM_OUTPUT_COLOR_RED = 1, MM_OUTPUT_COLOR_GREEN = 2, MM_OUTPUT_COLOR_YELLOW = 3, MM_OUTPUT_COLOR_BLUE = 4, MM_OUTPUT_COLOR_MAGENTA = 5, MM_OUTPUT_COLOR_CYAN = 6, MM_OUTPUT_COLOR_WHITE = 7, MM_OUTPUT_COLOR_DEFAULT = 9 } MM_OUTPUT_COLOR_T; #define MM_OUTPUT_RESET_ALL ("\x1b[0m") #define MM_OUTPUT_UNDERLINE(state) (state ? "\x1b[4m" : "\x1b[24m") #define MM_OUTPUT_BLINK(state) (state ? "\x1b[5m" : "\x1b[25m") #define MM_OUTPUT_INVERSE(state) (state ? "\x1b[7m" : "\x1b[27m") extern int MM_OutputPrompt( FILE *I__stream, const char *I__prompt ); #endif /*__MM_OUTPUT_H__ */