terminal.h 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. * Copyright (c) 2002-2007 Volkswagen Group Electronic Research
  3. * All rights reserved.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions
  7. * are met:
  8. * 1. Redistributions of source code must retain the above copyright
  9. * notice, this list of conditions and the following disclaimer.
  10. * 2. Redistributions in binary form must reproduce the above copyright
  11. * notice, this list of conditions and the following disclaimer in the
  12. * documentation and/or other materials provided with the distribution.
  13. * 3. Neither the name of Volkswagen nor the names of its contributors
  14. * may be used to endorse or promote products derived from this software
  15. * without specific prior written permission.
  16. *
  17. * Alternatively, provided that this notice is retained in full, this
  18. * software may be distributed under the terms of the GNU General
  19. * Public License ("GPL") version 2, in which case the provisions of the
  20. * GPL apply INSTEAD OF those given above.
  21. *
  22. * The provided data structures and external interfaces from this code
  23. * are not restricted to be used by modules with a GPL compatible license.
  24. *
  25. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  26. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  27. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  28. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  29. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  30. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  31. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  32. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  33. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  34. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  35. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
  36. * DAMAGE.
  37. *
  38. * Send feedback to <linux-can@vger.kernel.org>
  39. *
  40. */
  41. #ifndef TERMINAL_H
  42. #define TERMINAL_H
  43. /* reset to default */
  44. #define ATTRESET "\33[0m"
  45. /* attributes */
  46. #define ATTBOLD "\33[1m"
  47. #define ATTUNDERLINE "\33[4m"
  48. #define ATTBLINK "\33[5m"
  49. #define ATTINVERSE "\33[7m"
  50. #define ATTINVISIBLE "\33[8m"
  51. /* foreground colors */
  52. #define FGBLACK "\33[30m"
  53. #define FGRED "\33[31m"
  54. #define FGGREEN "\33[32m"
  55. #define FGYELLOW "\33[33m"
  56. #define FGBLUE "\33[34m"
  57. #define FGMAGENTA "\33[35m"
  58. #define FGCYAN "\33[36m"
  59. #define FGWHITE "\33[37m"
  60. /* background colors */
  61. #define BGBLACK "\33[40m"
  62. #define BGRED "\33[41m"
  63. #define BGGREEN "\33[42m"
  64. #define BGYELLOW "\33[43m"
  65. #define BGBLUE "\33[44m"
  66. #define BGMAGENTA "\33[45m"
  67. #define BGCYAN "\33[46m"
  68. #define BGWHITE "\33[47m"
  69. /* cursor */
  70. #define CSR_HOME "\33[H"
  71. #define CSR_UP "\33[A"
  72. #define CSR_DOWN "\33[B"
  73. #define CSR_RIGHT "\33[C"
  74. #define CSR_LEFT "\33[D"
  75. #define CSR_HIDE "\33[?25l"
  76. #define CSR_SHOW "\33[?25h"
  77. /* clear screen */
  78. #define CLR_SCREEN "\33[2J"
  79. #endif /* TERMINAL_H */