2023-08-25 16:57:12 -04:00
|
|
|
/*
|
2023-10-06 13:40:49 -04:00
|
|
|
Copyright (c) 2023 : Ognjen 'xolatile' Milan Robovic
|
|
|
|
|
|
|
|
Xtandard is free software! You will redistribute it or modify it under the terms of the GNU General Public License by Free Software Foundation.
|
|
|
|
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.
|
|
|
|
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.
|
|
|
|
*/
|
2023-08-25 16:57:12 -04:00
|
|
|
|
|
|
|
#ifndef XTANDARD_HEADER
|
|
|
|
#define XTANDARD_HEADER
|
|
|
|
|
2023-10-07 02:45:08 -04:00
|
|
|
#define SIGNAL_CONTROL (0X100)
|
|
|
|
#define SIGNAL_SHIFT (0X200)
|
|
|
|
#define SIGNAL_ALTERNATE (0X400)
|
|
|
|
#define SIGNAL_SYSTEM (0X800)
|
|
|
|
|
2023-08-28 09:02:20 -04:00
|
|
|
enum {
|
2023-10-01 06:06:40 -04:00
|
|
|
LOG_SUCCESS, LOG_WARNING, LOG_FAILURE, LOG_COMMENT,
|
|
|
|
LOG_COUNT
|
2023-08-28 09:02:20 -04:00
|
|
|
};
|
2023-08-25 16:57:12 -04:00
|
|
|
|
|
|
|
enum {
|
2023-10-01 06:06:40 -04:00
|
|
|
FILE_TYPE_TEXT, FILE_TYPE_COMMON_ASSEMBLY, FILE_TYPE_FLAT_ASSEMBLY, FILE_TYPE_GNU_ASSEMBLY,
|
|
|
|
FILE_TYPE_NETWIDE_ASSEMBLY, FILE_TYPE_YET_ANOTHER_ASSEMBLY, FILE_TYPE_C_SOURCE, FILE_TYPE_C_HEADER,
|
|
|
|
FILE_TYPE_ADA_BODY, FILE_TYPE_ADA_SPECIFICATION, FILE_TYPE_CPP_SOURCE, FILE_TYPE_CPP_HEADER,
|
|
|
|
FILE_TYPE_COUNT
|
2023-08-25 16:57:12 -04:00
|
|
|
};
|
|
|
|
|
2023-09-17 14:28:03 -04:00
|
|
|
enum {
|
2023-10-07 02:45:08 -04:00
|
|
|
EFFECT_NORMAL, EFFECT_BOLD, EFFECT_ITALIC, EFFECT_UNDERLINE, EFFECT_BLINK, EFFECT_REVERSE,
|
2023-10-01 06:06:40 -04:00
|
|
|
EFFECT_COUNT
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
COLOUR_GREY, COLOUR_RED, COLOUR_GREEN, COLOUR_YELLOW, COLOUR_BLUE, COLOUR_PINK, COLOUR_CYAN, COLOUR_WHITE,
|
|
|
|
COLOUR_COUNT
|
2023-09-17 14:28:03 -04:00
|
|
|
};
|
|
|
|
|
2023-10-02 16:25:11 -04:00
|
|
|
enum {
|
|
|
|
SIGNAL_NONE,
|
2023-10-04 17:50:29 -04:00
|
|
|
SIGNAL_ANY,
|
2023-10-02 16:25:11 -04:00
|
|
|
SIGNAL_A, SIGNAL_B, SIGNAL_C, SIGNAL_D, SIGNAL_E, SIGNAL_F, SIGNAL_G, SIGNAL_H,
|
|
|
|
SIGNAL_I, SIGNAL_J, SIGNAL_K, SIGNAL_L, SIGNAL_M, SIGNAL_N, SIGNAL_O, SIGNAL_P,
|
|
|
|
SIGNAL_Q, SIGNAL_R, SIGNAL_S, SIGNAL_T, SIGNAL_U, SIGNAL_V, SIGNAL_W, SIGNAL_X,
|
|
|
|
SIGNAL_Y, SIGNAL_Z, SIGNAL_0, SIGNAL_1, SIGNAL_2, SIGNAL_3, SIGNAL_4, SIGNAL_5,
|
2023-10-07 02:45:08 -04:00
|
|
|
SIGNAL_6, SIGNAL_7, SIGNAL_8, SIGNAL_9, SIGNAL_ESCAPE, SIGNAL_TABULATOR, SIGNAL_RETURN, SIGNAL_NEW_LINE,
|
|
|
|
SIGNAL_SLASH, SIGNAL_BACKSLASH, SIGNAL_QUOTE, SIGNAL_BACKQUOTE, SIGNAL_SPACE, SIGNAL_BACKSPACE, SIGNAL_DOT, SIGNAL_COMMA,
|
|
|
|
SIGNAL_CITE, SIGNAL_CAPS_LOCK, SIGNAL_L_BRACKET, SIGNAL_R_BRACKET, SIGNAL_MINUS, SIGNAL_EQUAL,
|
2023-10-02 16:25:11 -04:00
|
|
|
SIGNAL_COUNT
|
|
|
|
};
|
|
|
|
|
2023-10-07 08:58:42 -04:00
|
|
|
extern void in (void * data, int size);
|
|
|
|
extern void out (void * data, int size);
|
2023-08-25 16:57:12 -04:00
|
|
|
|
2023-10-07 08:58:42 -04:00
|
|
|
extern void log_in (int type, int flag, char * data);
|
|
|
|
extern void log_out (char * name);
|
2023-10-04 15:11:46 -04:00
|
|
|
|
2023-10-07 08:58:42 -04:00
|
|
|
extern void echo (char * data);
|
|
|
|
extern void dump (char * name, char * data);
|
2023-10-01 06:06:40 -04:00
|
|
|
|
2023-10-07 08:58:42 -04:00
|
|
|
extern void echo_byte (int byte);
|
2023-09-05 12:29:48 -04:00
|
|
|
|
2023-10-07 08:58:42 -04:00
|
|
|
extern void fatal_failure (int condition, char * message);
|
2023-08-25 16:57:12 -04:00
|
|
|
|
2023-10-07 08:58:42 -04:00
|
|
|
extern void limit (int * value, int minimum, int maximum);
|
2023-09-20 07:45:17 -04:00
|
|
|
|
2023-10-07 08:58:42 -04:00
|
|
|
extern void * allocate (int size);
|
|
|
|
extern void * reallocate (void * data, int size);
|
|
|
|
extern void * deallocate (void * data);
|
|
|
|
extern void * memorize (int size);
|
2023-08-25 16:57:12 -04:00
|
|
|
|
|
|
|
extern void * record (void);
|
|
|
|
|
2023-10-07 08:58:42 -04:00
|
|
|
extern void argument_define (char * nick, char * name, void (* function) (void));
|
|
|
|
extern void argument_select (int count, char * * array);
|
2023-09-05 12:29:48 -04:00
|
|
|
extern void argument_delete (void);
|
|
|
|
|
2023-10-07 08:58:42 -04:00
|
|
|
extern int file_open (char * name, int mode);
|
|
|
|
extern int file_close (int file);
|
|
|
|
extern void file_read (int file, void * data, int size);
|
|
|
|
extern void file_write (int file, void * data, int size);
|
|
|
|
extern int file_seek (int file, int whence);
|
2023-10-28 13:50:40 -04:00
|
|
|
extern int file_size (char * name);
|
2023-10-07 08:58:42 -04:00
|
|
|
extern int file_type (char * name);
|
2023-10-28 13:50:40 -04:00
|
|
|
extern void * file_record (char * name);
|
2023-10-07 08:58:42 -04:00
|
|
|
extern char * file_import (char * name);
|
|
|
|
extern void file_export (char * name, void * data);
|
|
|
|
|
|
|
|
extern void file_list_import (char * name);
|
|
|
|
extern void file_list_export (char * name);
|
2023-09-05 14:22:23 -04:00
|
|
|
extern void file_list_delete (void);
|
|
|
|
|
2023-10-07 08:58:42 -04:00
|
|
|
extern int character_is_uppercase (char character);
|
|
|
|
extern int character_is_lowercase (char character);
|
|
|
|
extern int character_is_digit (char character);
|
|
|
|
extern int character_is_blank (char character);
|
|
|
|
extern int character_is_alpha (char character);
|
|
|
|
extern int character_is_symbol (char character);
|
|
|
|
extern int character_is_visible (char character);
|
|
|
|
extern int character_is_invisible (char character);
|
|
|
|
extern int character_is_escape (char character);
|
|
|
|
extern int character_is_underscore (char character);
|
|
|
|
extern int character_is_hexadecimal (char character);
|
2023-09-12 07:25:34 -04:00
|
|
|
|
2023-10-07 08:58:42 -04:00
|
|
|
extern int character_compare_array (char character, char * character_array);
|
2023-09-12 05:22:25 -04:00
|
|
|
|
2023-10-07 08:58:42 -04:00
|
|
|
extern int string_length (char * string);
|
2023-08-25 16:57:12 -04:00
|
|
|
|
2023-10-19 17:10:50 -04:00
|
|
|
extern char * string_reverse_limit (char * string, int limit);
|
|
|
|
extern char * string_reverse (char * string);
|
2023-09-05 14:22:23 -04:00
|
|
|
|
2023-10-19 17:10:50 -04:00
|
|
|
extern char * string_delete (char * string, int length);
|
2023-08-28 18:53:13 -04:00
|
|
|
|
2023-10-19 17:10:50 -04:00
|
|
|
extern int string_compare (char * string_0, char * string_1);
|
|
|
|
extern char * string_copy (char * string_0, char * string_1);
|
|
|
|
extern char * string_concatenate (char * string_0, char * string_1);
|
|
|
|
|
|
|
|
extern int string_compare_limit (char * string_0, char * string_1, int limit);
|
|
|
|
extern char * string_copy_limit (char * string_0, char * string_1, int limit);
|
|
|
|
extern char * string_concatenate_limit (char * string_0, char * string_1, int limit);
|
2023-08-25 16:57:12 -04:00
|
|
|
|
2023-10-07 08:58:42 -04:00
|
|
|
extern int string_split_space (char * string);
|
2023-09-10 14:42:06 -04:00
|
|
|
|
2023-10-07 08:58:42 -04:00
|
|
|
extern void memory_delete (void * memory, int length);
|
2023-09-12 10:15:13 -04:00
|
|
|
|
2023-10-07 08:58:42 -04:00
|
|
|
extern int memory_compare (void * memory, void * source, int length);
|
|
|
|
extern void memory_copy (void * memory, void * source, int length);
|
2023-09-12 10:15:13 -04:00
|
|
|
|
2023-09-12 05:22:25 -04:00
|
|
|
extern void terminal_clear (void);
|
2023-10-07 08:58:42 -04:00
|
|
|
extern void terminal_colour (int colour, int effect);
|
2023-09-20 06:27:59 -04:00
|
|
|
extern void terminal_cancel (void);
|
2023-10-07 08:58:42 -04:00
|
|
|
extern void terminal_show_cursor (int show);
|
2023-09-12 05:22:25 -04:00
|
|
|
|
2023-10-07 08:58:42 -04:00
|
|
|
extern int encode_byte (char * byte);
|
2023-10-19 17:10:50 -04:00
|
|
|
extern char * decode_byte (int byte);
|
|
|
|
|
2023-10-28 13:50:40 -04:00
|
|
|
extern char * number_to_string (int number);
|
2023-09-18 15:36:50 -04:00
|
|
|
|
2023-08-25 16:57:12 -04:00
|
|
|
#endif
|