Xtandard stuff...
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

153 lines
5.4KB

  1. /*
  2. * Copyright (c) 2023 : Ognjen 'xolatile' Milan Robovic
  3. *
  4. * Xtandard is free software! You will redistribute it or modify it under the terms of the GNU General Public License by Free Software Foundation.
  5. * And when you do redistribute it or modify it, it will use either version 3 of the License, or (at yours truly opinion) any later version.
  6. * It is distributed in the hope that it will be useful or harmful, it really depends... But no warranty what so ever, seriously. See GNU/GPLv3.
  7. */
  8. #ifndef XTANDARD_HEADER
  9. #define XTANDARD_HEADER
  10. #include <stdlib.h>
  11. #include <unistd.h>
  12. #include <fcntl.h>
  13. enum {
  14. LOG_SUCCESS, LOG_WARNING, LOG_FAILURE, LOG_COMMENT,
  15. LOG_COUNT
  16. };
  17. enum {
  18. FILE_TYPE_TEXT, FILE_TYPE_COMMON_ASSEMBLY, FILE_TYPE_FLAT_ASSEMBLY, FILE_TYPE_GNU_ASSEMBLY,
  19. FILE_TYPE_NETWIDE_ASSEMBLY, FILE_TYPE_YET_ANOTHER_ASSEMBLY, FILE_TYPE_C_SOURCE, FILE_TYPE_C_HEADER,
  20. FILE_TYPE_ADA_BODY, FILE_TYPE_ADA_SPECIFICATION, FILE_TYPE_CPP_SOURCE, FILE_TYPE_CPP_HEADER,
  21. FILE_TYPE_COUNT
  22. };
  23. enum {
  24. EFFECT_NORMAL, EFFECT_BOLD, EFFECT_DARK, EFFECT_ITALIC, EFFECT_UNDERLINE, EFFECT_BLINK, EFFECT_UNDEFINED, EFFECT_REVERSE,
  25. EFFECT_COUNT
  26. };
  27. enum {
  28. COLOUR_GREY, COLOUR_RED, COLOUR_GREEN, COLOUR_YELLOW, COLOUR_BLUE, COLOUR_PINK, COLOUR_CYAN, COLOUR_WHITE,
  29. COLOUR_COUNT
  30. };
  31. enum {
  32. SIGNAL_NONE,
  33. SIGNAL_A, SIGNAL_B, SIGNAL_C, SIGNAL_D, SIGNAL_E, SIGNAL_F, SIGNAL_G, SIGNAL_H,
  34. SIGNAL_I, SIGNAL_J, SIGNAL_K, SIGNAL_L, SIGNAL_M, SIGNAL_N, SIGNAL_O, SIGNAL_P,
  35. SIGNAL_Q, SIGNAL_R, SIGNAL_S, SIGNAL_T, SIGNAL_U, SIGNAL_V, SIGNAL_W, SIGNAL_X,
  36. SIGNAL_Y, SIGNAL_Z, SIGNAL_0, SIGNAL_1, SIGNAL_2, SIGNAL_3, SIGNAL_4, SIGNAL_5,
  37. SIGNAL_6, SIGNAL_7, SIGNAL_8, SIGNAL_9, SIGNAL_SPACEBAR, SIGNAL_TABULATOR, SIGNAL_RETURN, SIGNAL_NEW_LINE,
  38. SIGNAL_SLASH, SIGNAL_BACKSLASH, SIGNAL_QUOTE, SIGNAL_BACKQUOTE, SIGNAL_BACKSPACE, SIGNAL_ESCAPE, SIGNAL_CONTROL, SIGNAL_SHIFT,
  39. SIGNAL_COUNT
  40. };
  41. extern char * program_name;
  42. extern char * program_mode;
  43. extern char * program_license;
  44. extern char * log_notify;
  45. extern int argument_count;
  46. extern char * * argument_nick;
  47. extern char * * argument_name;
  48. extern char * argument_input;
  49. extern char * argument_output;
  50. extern void (* * argument_function) (void);
  51. extern int file_list_active;
  52. extern int file_list_count;
  53. extern int * file_list_mark;
  54. extern int * file_list_size;
  55. extern char * * file_list_name;
  56. extern char * * file_list_data;
  57. extern void in (void *, int);
  58. extern void out (void *, int);
  59. extern void log_in (int, int, char *);
  60. extern void log_out (char *);
  61. extern void echo (char *);
  62. extern void dump (char *, char *);
  63. extern void echo_byte (int);
  64. extern void fatal_failure (int, char *);
  65. extern void limit (int *, int, int);
  66. extern void * allocate (int);
  67. extern void * reallocate (void *, int);
  68. extern void * deallocate (void *);
  69. extern void * memorize (int);
  70. extern void * record (void);
  71. extern void argument_define (char *, char *, void (*) (void));
  72. extern void argument_select (int, char * *);
  73. extern void argument_delete (void);
  74. extern int file_open (char *, int);
  75. extern int file_close (int);
  76. extern void file_read (int, void *, int);
  77. extern void file_write (int, void *, int);
  78. extern int file_seek (int, int);
  79. extern int file_size (int);
  80. extern int file_type (char *);
  81. extern char * file_import (char *);
  82. extern void file_export (char *, void *);
  83. extern void file_list_import (char *);
  84. extern void file_list_export (char *);
  85. extern void file_list_delete (void);
  86. extern int character_is_uppercase (char);
  87. extern int character_is_lowercase (char);
  88. extern int character_is_digit (char);
  89. extern int character_is_blank (char);
  90. extern int character_is_alpha (char);
  91. extern int character_is_symbol (char);
  92. extern int character_is_visible (char);
  93. extern int character_is_invisible (char);
  94. extern int character_is_escape (char);
  95. extern int character_is_underscore (char);
  96. extern int character_is_hexadecimal (char);
  97. extern int character_compare_array (char, char *);
  98. extern int string_length (char *);
  99. extern void string_reverse (char *);
  100. extern void string_delete (char *, int);
  101. extern int string_compare (char *, char *);
  102. extern void string_copy (char *, char *);
  103. extern void string_concatenate (char *, char *);
  104. extern int string_compare_limit (char *, char *, int);
  105. extern void string_copy_limit (char *, char *, int);
  106. extern void string_concatenate_limit (char *, char *, int);
  107. extern int string_split_space (char *);
  108. extern void memory_delete (void *, int);
  109. extern int memory_compare (void *, void *, int);
  110. extern void memory_copy (void *, void *, int);
  111. extern void terminal_clear (void);
  112. extern void terminal_colour (int, int);
  113. extern void terminal_cancel (void);
  114. extern void terminal_show_cursor (int);
  115. extern int encode_byte (char *);
  116. extern char * decode_byte (int);
  117. #endif