|
ugBASIC 1.18
An isomorphic BASIC language compiler for retrocomputers
|
#include <math.h>#include <ctype.h>#include <errno.h>#include <stdio.h>#include <stdarg.h>#include "../../ugbc.h"Go to the source code of this file.
Macros | |
| #define | strcmp_nocase strcasecmp |
| #define | UNESCAPE_COLOR(c, d) |
Functions | |
| void | memory_area_assign (MemoryArea *_first, Variable *_variable) |
| void | memory_area_unassign (MemoryArea *_first, Variable *_variable) |
| Bank * | bank_find (Bank *_first, char *_name) |
| Constant * | constant_create (Environment *_environment, char *_name) |
| Constant * | constant_find (Environment *_environment, char *_name) |
| Offsetting * | offsetting_size_count (Environment *_environment, int _size, int _count) |
| void | offsetting_add_variable_reference (Environment *_environment, Offsetting *_first, Variable *_var, int _sequence) |
| void | variable_global (Environment *_environment, char *_pattern) |
| Variable * | variable_retrieve_internal (Environment *_environment, char *_name, int _mandatory) |
| Retrieve the definition of a variable. | |
| Variable * | variable_define (Environment *_environment, char *_name, VariableType _type, int _value) |
| Define a variable for the program. | |
| Variable * | variable_import (Environment *_environment, char *_name, VariableType _type, int _size_or_value) |
| Variable * | variable_export (Environment *_environment, char *_name, VariableType _type, int _size_or_value) |
| Variable * | variable_define_no_init (Environment *_environment, char *_name, VariableType _type) |
| Variable * | variable_retrieve_by_realname (Environment *_environment, char *_name) |
| Variable * | variable_retrieve (Environment *_environment, char *_name) |
| int | variable_exists (Environment *_environment, char *_name) |
| int | variable_exists_by_realname (Environment *_environment, char *_name) |
| int | variable_delete (Environment *_environment, char *_name) |
| Variable * | variable_retrieve_or_define (Environment *_environment, char *_name, VariableType _type, int _value) |
| void | variable_reset (Environment *_environment) |
| Reset the usage flags for the temporary variable pool. | |
| Variable * | variable_array_type (Environment *_environment, char *_name, VariableType _type) |
| Variable * | variable_temporary (Environment *_environment, VariableType _type, char *_meaning) |
| Define a temporary variable. | |
| Variable * | variable_resident (Environment *_environment, VariableType _type, char *_meaning) |
| Variable * | variable_cast (Environment *_environment, char *_source, VariableType _type) |
| Cast a variable from a type to another. | |
| Variable * | variable_store (Environment *_environment, char *_destination, unsigned int _value) |
| Store a direct value to a variable. | |
| Variable * | variable_store_type (Environment *_environment, char *_destination, char *_field, unsigned int _value) |
| Variable * | variable_by_constant (Environment *_environment, VariableType _type, int _value) |
| char * | unescape_string (Environment *_environment, char *_value, int _printing, int *_final_size) |
| Variable * | variable_store_string (Environment *_environment, char *_destination, char *_value) |
| Store a string to a variable. | |
| Variable * | variable_store_float (Environment *_environment, char *_destination, double _value) |
| Store a string to a variable. | |
| Variable * | variable_resize_buffer (Environment *_environment, char *_destination, int _size) |
| Resize the (static) size of a buffer. | |
| Variable * | variable_store_buffer (Environment *_environment, char *_destination, unsigned char *_buffer, int _size, int _at) |
| Variable * | variable_store_array (Environment *_environment, char *_destination, unsigned char *_buffer, int _size, int _at) |
| Variable * | variable_move (Environment *_environment, char *_source, char *_destination) |
| Store the value of a variable inside another variable by converting it. | |
| Variable * | variable_add_const (Environment *_environment, char *_source, int _destination) |
| Add a variable with a constant, and return the sum of them. | |
| Variable * | variable_move_naked (Environment *_environment, char *_source, char *_destination) |
| Store the value of a variable inside another variable without conversion. | |
| Variable * | variable_add (Environment *_environment, char *_source, char *_destination) |
| Add two variable and return the sum of them. | |
| void | variable_add_inplace (Environment *_environment, char *_source, int _destination) |
| void | variable_add_inplace_type (Environment *_environment, char *_source, char *_field, int _destination) |
| void | variable_add_inplace_vars (Environment *_environment, char *_source, char *_destination) |
| Add two variable and return the sum of them on the first. | |
| void | variable_add_inplace_type_vars (Environment *_environment, char *_source, char *_field, char *_destination) |
| void | variable_add_inplace_array (Environment *_environment, char *_source, char *_destination) |
| Add a variable to an array element, and return the sum of them on the array element. | |
| void | variable_add_inplace_mt (Environment *_environment, char *_source, char *_destination) |
| Add two variable and return the sum of them on the first. | |
| void | variable_xor_inplace (Environment *_environment, char *_source, int _destination) |
| void | variable_xor_inplace_vars (Environment *_environment, char *_source, char *_destination) |
| Add two variable and return the sum of them on the first. | |
| void | variable_xor_inplace_mt (Environment *_environment, char *_source, char *_destination) |
| Add two variable and return the sum of them on the first. | |
| Variable * | variable_sub (Environment *_environment, char *_source, char *_dest) |
| Make a differenze between two variable and return the difference of them. | |
| Variable * | variable_sub_const (Environment *_environment, char *_source, int _destination) |
| Make a differenze between a variable a constant, and return the difference of them. | |
| void | variable_sub_inplace (Environment *_environment, char *_source, char *_dest) |
| Make a differenze between two variable and assign the difference of them to the first. | |
| void | variable_swap (Environment *_environment, char *_source, char *_dest) |
| Swap values of two variables. | |
| Variable * | variable_complement_const (Environment *_environment, char *_source, int _value) |
| Calculate the complement of a variable. | |
| Variable * | variable_mul (Environment *_environment, char *_source, char *_destination) |
| Make a multiplication between two variable and return the product of them. | |
| Variable * | variable_div (Environment *_environment, char *_source, char *_destination, char *_remainder) |
| Make a division between two variable and return the product of them. | |
| Variable * | variable_div_const (Environment *_environment, char *_source, int _destination, char *_remainder) |
| void | variable_increment (Environment *_environment, char *_source) |
| Increment a variable by one. | |
| void | variable_increment_type (Environment *_environment, char *_source, char *_field) |
| void | variable_store_mt (Environment *_environment, char *_source, unsigned int _value) |
| Store a variable's value. | |
| Variable * | variable_move_from_mt (Environment *_environment, char *_source, char *_destination) |
| Increment a variable by one. | |
| Variable * | variable_move_to_mt (Environment *_environment, char *_source, char *_destination) |
| void | variable_increment_mt (Environment *_environment, char *_source) |
| Increment a variable by one. | |
| void | variable_decrement (Environment *_environment, char *_source) |
| Decrement a variable by one. | |
| void | variable_decrement_type (Environment *_environment, char *_source, char *_field) |
| void | variable_decrement_mt (Environment *_environment, char *_source) |
| Decrement a variable by one. | |
| void | variable_compare_and_branch_const (Environment *_environment, char *_source, int _destination, char *_name, int _positive) |
| Variable * | variable_compare (Environment *_environment, char *_source, char *_destination) |
| Compare two variable and return the result of comparation. | |
| Variable * | variable_compare_const (Environment *_environment, char *_source, int _destination) |
| Compare two variable and return the result of comparation. | |
| Variable * | variable_compare_not_const (Environment *_environment, char *_source, int _destination) |
| Compare two variable and return the result of comparation. | |
| Variable * | variable_compare_not (Environment *_environment, char *_source, char *_destination) |
| Compare two variable and return the result of comparation. | |
| Variable * | variable_mul2_const (Environment *_environment, char *_destination, int _steps) |
| Double a variable for various times and return the result. | |
| Variable * | variable_sl_const (Environment *_environment, char *_destination, int _steps) |
| Variable * | variable_div2_const (Environment *_environment, char *_destination, int _bits, char *_remainder) |
| Subdivide by two a variable for various times and return the result. | |
| Variable * | variable_sr_const (Environment *_environment, char *_destination, int _bits) |
| Variable * | variable_and_const (Environment *_environment, char *_destination, int _mask) |
| Calculate "and" mask for a variable and it as the result. | |
| Variable * | variable_and (Environment *_environment, char *_left, char *_right) |
| Calculate logical "and" and return it as the result. | |
| Variable * | variable_xor (Environment *_environment, char *_left, char *_right) |
| Calculate logical "xor" and return it as the result. | |
| Variable * | variable_or (Environment *_environment, char *_left, char *_right) |
| Calculate logical "or" and return it as the result. | |
| Variable * | variable_not (Environment *_environment, char *_value) |
| Calculate logical "not" and return it as the result. | |
| Variable * | variable_less_than (Environment *_environment, char *_source, char *_destination, int _equal) |
| Compare two variable and return the result of comparation. | |
| Variable * | variable_less_than_const (Environment *_environment, char *_source, int _destination, int _equal) |
| Variable * | variable_greater_than (Environment *_environment, char *_source, char *_destination, int _equal) |
| Compare two variable and return the result of comparation. | |
| Variable * | variable_greater_than_const (Environment *_environment, char *_source, int _destination, int _equal) |
| Variable * | variable_string_left (Environment *_environment, char *_string, char *_position) |
| Emit code for = LEFT( ..., ... ). | |
| void | variable_string_left_assign (Environment *_environment, char *_string, char *_position, char *_expression) |
| Emit code for LEFT( ..., ... ) = .... | |
| Variable * | variable_string_right (Environment *_environment, char *_string, char *_position) |
| Emit code for = LEFT( ..., ... ). | |
| void | variable_string_right_assign (Environment *_environment, char *_string, char *_position, char *_expression) |
| Emit code for RIGHT( ..., ... ) = .... | |
| Variable * | variable_string_mid (Environment *_environment, char *_string, char *_position, char *_len) |
| Emit code for = MID( ..., ... [, ...] ). | |
| Variable * | variable_string_substring (Environment *_environment, char *_string, char *_start, char *_end) |
| Emit code for = SUBSTRING( ..., ... [, ...] ). | |
| void | variable_string_mid_assign (Environment *_environment, char *_string, char *_position, char *_len, char *_expression) |
| Emit code for MID( ..., ... [, ...] ) = .... | |
| Variable * | variable_string_instr (Environment *_environment, char *_search, char *_searched, char *_start) |
| Emit code for = INSTR( ..., ... [, ...] ). | |
| Variable * | variable_string_lower (Environment *_environment, char *_string) |
| Emit code for = UPPER( ... ). | |
| Variable * | variable_string_upper (Environment *_environment, char *_string) |
| Emit code for = UPPER( ... ). | |
| Variable * | variable_string_str (Environment *_environment, char *_value) |
| Emit code for = STR( ... ). | |
| Variable * | variable_string_val (Environment *_environment, char *_value) |
| Emit code for = VAL( ... ). | |
| Variable * | variable_hex (Environment *_environment, char *_value, int _separator) |
| Emit code for = HEX( ... ). | |
| Variable * | variable_hex2bin (Environment *_environment, char *_value, char *_variable) |
| Emit code for = HEX2BIN( ... ). | |
| Variable * | variable_string_string (Environment *_environment, char *_string, char *_repetitions) |
| Emit code for = STRING( ..., ... ). | |
| Variable * | variable_string_dup (Environment *_environment, char *_string, char *_repetitions) |
| Variable * | variable_string_space (Environment *_environment, char *_repetitions) |
| Emit code for = SPACE( ... ). | |
| Variable * | variable_string_flip (Environment *_environment, char *_string) |
| Emit code for = FLIP( ... ). | |
| Variable * | variable_flip (Environment *_environment, char *_variable) |
| Variable * | variable_string_chr (Environment *_environment, char *_ascii) |
| Emit code for = CHR( ... ). | |
| Variable * | variable_string_asc (Environment *_environment, char *_char) |
| Emit code for = ASC( ... ). | |
| Variable * | variable_string_len (Environment *_environment, char *_string) |
| Emit code for = LEN( ... ). | |
| void | variable_store_array_const_bit (Environment *_environment, Variable *_array, int _value) |
| void | variable_store_array_const_byte (Environment *_environment, Variable *_array, int _value) |
| void | variable_store_array_const (Environment *_environment, char *_array, int _value) |
| void | variable_move_array_bit (Environment *_environment, Variable *_array, char *_value) |
| void | variable_move_array_byte (Environment *_environment, Variable *_array, char *_value) |
| void | variable_move_array (Environment *_environment, char *_array, char *_value) |
| void | variable_move_array_string (Environment *_environment, char *_array, char *_string) |
| Variable * | variable_move_from_array_bit_inplace (Environment *_environment, Variable *_array, Variable *_result) |
| Variable * | variable_move_from_array_bit (Environment *_environment, Variable *_array) |
| void | variable_move_from_array_byte_inplace (Environment *_environment, Variable *_array, Variable *_result) |
| Variable * | variable_move_from_array_byte (Environment *_environment, Variable *_array) |
| void | variable_move_from_array_inplace (Environment *_environment, char *_array, char *_result) |
| Variable * | variable_move_from_array (Environment *_environment, char *_array) |
| int | pattern_match (char *_pattern, char *_value) |
| Variable * | variable_bin (Environment *_environment, char *_value, char *_digits, char *_zero, char *_one) |
| Emit code for <string>BIN(...). | |
| Variable * | variable_bit (Environment *_environment, char *_value, char *_position) |
| Emit code for HAS BIT / BIT(...). | |
| int | reset_screen_mode_selected (Environment *_environment) |
| int | count_screen_mode_selected (Environment *_environment) |
| ScreenMode * | find_screen_mode_by_suggestion (Environment *_environment, int _bitmap, int _width, int _height, int _colors, int _tile_width, int _tile_height) |
| ScreenMode * | find_screen_mode_by_id (Environment *_environment, int _id) |
| Variable * | variable_mod (Environment *_environment, char *_source, char *_destination) |
| int | label_exists_numeric (Environment *_environment, int _label) |
| int | label_exists_named (Environment *_environment, char *_label) |
| void | label_define_numeric (Environment *_environment, int _label) |
| void | label_define_named (Environment *_environment, char *_label) |
| int | label_referred_exists_numeric (Environment *_environment, int _label) |
| int | label_referred_exists_named (Environment *_environment, char *_label) |
| void | label_referred_define_numeric (Environment *_environment, int _label) |
| void | label_referred_define_named (Environment *_environment, char *_label) |
| int | label_stored_exists_named (Environment *_environment, char *_label) |
| void | label_stored_define_named (Environment *_environment, char *_label) |
| void | const_define_numeric (Environment *_environment, char *_name, int _value) |
| void | const_define_string (Environment *_environment, char *_name, char *_value) |
| Variable * | variable_array_count_vars (Environment *_environment, char *_name, char *_target) |
| Variable * | variable_array_sum_vars (Environment *_environment, char *_name) |
| Variable * | variable_array_max_vars (Environment *_environment, char *_name) |
| Variable * | variable_array_min_vars (Environment *_environment, char *_name) |
| void | variable_array_fill (Environment *_environment, char *_name, int _value) |
| void | variable_array_fill_random (Environment *_environment, char *_name, int _base, int _min_value, int _max_value, int _count, int _boolean) |
| void | variable_array_fill_incremental (Environment *_environment, char *_name, int _min, int _count) |
| void | variable_array_shuffle (Environment *_environment, char *_name, int _rounds) |
| void | image_converter_asserts (Environment *_environment, int _width, int _height, int _offset_x, int _offset_y, int *_frame_width, int *_frame_height, int _modulo_x, int _modulo_y) |
| void | image_converter_asserts_free (Environment *_environment, int _width, int _height, int _offset_x, int _offset_y, int *_frame_width, int *_frame_height) |
| void | image_converter_asserts_free_width (Environment *_environment, int _width, int _height, int _offset_x, int _offset_y, int *_frame_width, int *_frame_height, int _modulo_y) |
| void | image_converter_asserts_free_height (Environment *_environment, int _width, int _height, int _offset_x, int _offset_y, int *_frame_width, int *_frame_height, int _modulo_x) |
| char * | resource_load_asserts (Environment *_environment, char *_filename) |
| void | variable_temporary_remove (Environment *_environment, char *_name) |
| int | calculate_white_area (TileData *_tileData) |
| int | calculate_horizontal_edges (TileData *_tileData, int _position) |
| int | calculate_vertical_edges (TileData *_tileData, int _position) |
| TileDescriptor * | calculate_tile_descriptor (TileData *_tileData) |
| TileDescriptors * | precalculate_tile_descriptors_for_font (char *_fontData, int _fontSize) |
| int | calculate_tile_affinity (TileDescriptor *_first, TileDescriptor *_second) |
| int | calculate_nearest_tile (TileDescriptor *_tile, TileDescriptors *_tiles) |
| int | calculate_exact_tile (TileDescriptor *_tile, TileDescriptors *_tiles) |
| int | tile_allocate (TileDescriptors *_tiles, char *_data) |
| char * | parse_buffer (Environment *_environment, char *_buffer, int *_size, int _hex_only) |
| Variable * | parse_buffer_definition (Environment *_environment, char *_buffer, VariableType _type, int _hex_only) |
| char * | image_flip_x (Environment *_environment, char *_source, int _width, int _height, int _depth) |
| char * | image_flip_y (Environment *_environment, char *_source, int _width, int _height, int _depth) |
| char * | image_roll_x_right (Environment *_environment, char *_source, int _width, int _height) |
| char * | image_roll_x_left (Environment *_environment, char *_source, int _width, int _height) |
| char * | image_roll_y_down (Environment *_environment, char *_source, int _width, int _height) |
| char * | image_enlarge_right (Environment *_environment, char *_source, int _width, int _height, int _delta) |
| char * | image_enlarge_bottom (Environment *_environment, char *_source, int _width, int _height, int _delta) |
| char * | image_extract_subimage (Environment *_environment, char *_source, int _width, int _height, int _frame_width, int _frame_height, int _x, int _y, int _depth) |
| int | rgbi_equals_rgb (RGBi *_first, RGBi *_second) |
| int | rgbi_equals_rgba (RGBi *_first, RGBi *_second) |
| void | rgbi_move (RGBi *_source, RGBi *_destination) |
| int | rgbi_distance (RGBi *_e1, RGBi *_e2) |
| Calculate the distance between two colors. | |
| int | rgbi_extract_palette (Environment *_environment, unsigned char *_source, int _width, int _height, int _depth, RGBi _palette[], int _palette_size, int _sorted) |
| Extract the color palette from the given image. | |
| float | max_of_two (float _x, float _y) |
| float | max_of_three (float _m, float _n, float _p) |
| float | min_of_two (float _x, float _y) |
| float | min_of_three (float _m, float _n, float _p) |
| char * | get_temporary_filename (Environment *_environment) |
| int | system_call (Environment *_environment, char *_commandline) |
| Call an external executable. | |
| int | system_remove_safe (Environment *_environment, char *_filename) |
| char * | escape_newlines_full (char *_string, int _size) |
| char * | escape_newlines (char *_string) |
| int | check_if_filename_is_valid (Environment *_environment, char *_filename) |
| RGBi * | malloc_palette (int _size) |
| Allocate a palette space. | |
| RGBi * | palette_match (RGBi *_source, int _source_size, RGBi *_system, int _system_size) |
| Make a "palette match". | |
| RGBi * | palette_match_hardware_index (RGBi *_source, int _source_size, RGBi *_system, int _system_size) |
| RGBi * | palette_remove_duplicates (RGBi *_source, int _source_size, int *_unique_size) |
| Remove duplicates from a palette. | |
| RGBi * | palette_promote_color_as_background (int _index, RGBi *_source, int _source_size) |
| Promote an index color in a palette. | |
| RGBi * | palette_promote_color_as_foreground (int _index, RGBi *_source, int _source_size, int _max_size) |
| Promote an index color in a palette. | |
| RGBi * | palette_shift (RGBi *_source, int _source_size, int _offset) |
| Shift colors in palette. | |
| RGBi * | palette_merge (RGBi *_palette1, int _palette1_size, RGBi *_palette2, int _palette2_size, int *_size) |
| Make a "palette merge". | |
| int | assemblyLineIsAComment (char *_buffer) |
| char * | strtoupper (char *_string) |
| char * | basename (char *_path) |
| Variable * | origin_resolution_relative_transform_x (Environment *_environment, char *_x, int _is_relative) |
| Variable * | origin_resolution_relative_transform_y (Environment *_environment, char *_y, int _is_relative) |
| void | font_descriptors_init (Environment *_environment, int _embedded_present) |
| char * | address_displacement (Environment *_environment, char *_address, char *_displacement) |
| Variable * | calculate_frame_by_type (Environment *_environment, TsxTileset *_tileset, char *_images, char *_description) |
| int | find_frame_by_type (Environment *_environment, TsxTileset *_tileset, char *_images, char *_description) |
| Variable * | variable_direct_assign (Environment *_environment, char *_var, char *_expr) |
| StaticString * | string_reserve (Environment *_environment, char *_value) |
| ArrayReference * | parser_array_retrieve (Environment *_environment) |
| void | parser_array_init (Environment *_environment) |
| void | parser_array_init_by (Environment *_environment, ArrayReference *_array_reference) |
| void | parser_array_cleanup (Environment *_environment) |
| void | parser_array_index_symbolic (Environment *_environment, char *_index) |
| void | parser_array_index_numeric (Environment *_environment, int _index) |
| VariableType | variable_type_from_numeric_value (Environment *_environment, int _number) |
| Variable * | parser_adapted_numeric (Environment *_environment, int _number) |
| Variable * | parser_casted_numeric (Environment *_environment, VariableType _type, int _number) |
| DataSegment * | data_segment_define (Environment *_environment, char *_name) |
| DataSegment * | data_segment_define_numeric (Environment *_environment, int _number) |
| DataSegment * | data_segment_find (Environment *_environment, char *_name) |
| DataSegment * | data_segment_find_numeric (Environment *_environment, int _number) |
| DataSegment * | data_segment_define_or_retrieve (Environment *_environment, char *_name) |
| DataSegment * | data_segment_define_or_retrieve_numeric (Environment *_environment, int _number) |
| void | buffered_fprintf (Environment *_environment, FILE *_stream, const char *_format,...) |
| int | buffered_fputs (Environment *_environment, const char *_string, FILE *_stream) |
| size_t | buffered_fwrite (Environment *_environment, void *_data, size_t _size, size_t _count, FILE *_stream) |
| void | buffered_push_output (Environment *_environment) |
| void | buffered_pop_output (Environment *_environment) |
| void | buffered_prepend_output (Environment *_environment) |
| void | buffered_output (Environment *_environment, FILE *_stream) |
| void | get_image_overwrite_size (Environment *_environment, char *_image, char *_x1, char *_y1, char *_x2, char *_y2) |
| Resource * | build_resource_for_sequence (Environment *_environment, char *_image, char *_frame, char *_sequence) |
| Variable * | variable_int (Environment *_environment, char *_expression) |
| char * | get_default_temporary_path () |
| char * | find_last_path_separator (char *_path) |
| void | prepare_variable_storage (Environment *_environment, char *_name, Variable *_source) |
| char * | generate_storage_filename (Environment *_environment, char *_prefix, char *_suffix, int _number) |
| int | file_get_size (Environment *_environment, char *_filename) |
| Variable * | variable_string_insert (Environment *_environment, char *_string, char *_altstring, char *_pos) |
| Variable * | variable_string_inst (Environment *_environment, char *_string, char *_altstring, char *_pos) |
| Variable * | variable_string_pick (Environment *_environment, char *_string, int _position) |
| char * | resolve_color (Environment *_environment, char *_color) |
| int | show_troubleshooting_and_exit (Environment *_environment, int _argc, char *_argv[]) |
| int | system_move_safe (Environment *_environment, char *_source, char *_destination) |
| int | procedure_exists (Environment *_environment, char *_name) |
| const char * | strstrcase (const char *_x, const char *_y) |
| const char * | strrstr (const char *haystack, const char *needle) |
| void | define_implicit_array_if_needed (Environment *_environment, char *_name) |
| int | check_datatype_limits (VariableType _type, int _value) |
| char * | file_read_csv (Environment *_environment, char *_filename, VariableType _type, int *_size, int *_count) |
| Type * | type_find (Type *_first, char *_name) |
| Field * | field_find (Type *_type, char *_name) |
| void | variable_set_type (Environment *_environment, char *_name, char *_type) |
| Variable * | variable_move_from_type (Environment *_environment, char *_type, char *_field) |
| void | variable_move_from_type_inplace (Environment *_environment, char *_type, char *_field, char *_value) |
| void | variable_move_type (Environment *_environment, char *_type, char *_field, char *_value) |
| void | variable_move_array_type (Environment *_environment, char *_array, char *_field, char *_value) |
| Variable * | variable_move_from_array_type (Environment *_environment, char *_array, char *_field) |
| void | variable_move_from_array_type_inplace (Environment *_environment, char *_array, char *_field, char *_value) |
| void | variable_move_from_array1_type_inplace (Environment *_environment, char *_array, char *_index, char *_field, char *_value) |
| Variable * | variable_move_from_array1_type (Environment *_environment, char *_array, char *_index, char *_field) |
| void | variable_move_array1_type (Environment *_environment, char *_array, char *_index, char *_field, char *_value) |
| void | variable_move_array1_type_fields (Environment *_environment, char *_array, char *_index, char *_field1, char *_field2) |
| void | variable_move_array1_type_const (Environment *_environment, char *_array, char *_index, char *_field, int _value) |
| void | variable_increment_array_type (Environment *_environment, char *_source, char *_field) |
| void | variable_decrement_array_type (Environment *_environment, char *_source, char *_field) |
| void | variable_increment_array (Environment *_environment, char *_source) |
| void | variable_decrement_array (Environment *_environment, char *_source) |
| char * | strcopy (char *_dest, char *_source) |
| char * | strreplace (const char *_orig, const char *_rep, const char *_with) |
| CopperList * | find_copper_list (Environment *_environment, char *_name) |
| char * | import_file_name (char *_import_path) |
| StaticString * | static_string_find_by_value (Environment *_environment, char *_value, int _size) |
| StaticString * | static_string_create_filled (Environment *_environment, int _size, char _value) |
| StaticString * | static_string_create (Environment *_environment, char *_value, int _size) |
| Environment * | environment_create (void) |
| Create a new environment. | |
| void | environment_setup_default (Environment *_environment) |
| Setup default environment values. | |
| void | environment_parse_command_line (Environment *_environment, int _argc, char *_argv[]) |
| Parse command line parameters. | |
| void | environment_setup_10liner (Environment *_environment) |
| void | environment_setup_retrohack (Environment *_environment) |
Variables | |
| char | targetName [] = "atari" |
| RGBi | SYSTEM_PALETTE [] |
| char | BANK_TYPE_AS_STRING [][16] |
| Description of BANK TYPE, in readable format. | |
| char | DATATYPE_AS_STRING [][16] |
| Emit code for BEGIN COPPER. | |
| char | OUTPUT_FILE_TYPE_AS_STRING [][16] |
| int | yydebug |
| char * | importPath |
| #define strcmp_nocase strcasecmp |
Definition at line 118 of file _infrastructure.c.
| #define UNESCAPE_COLOR | ( | c, | |
| d ) |
Definition at line 1855 of file _infrastructure.c.
| char * address_displacement | ( | Environment * | _environment, |
| char * | _address, | ||
| char * | _displacement ) |
Definition at line 14516 of file _infrastructure.c.
| int assemblyLineIsAComment | ( | char * | _buffer | ) |
Definition at line 14280 of file _infrastructure.c.
Definition at line 251 of file _infrastructure.c.
| char * basename | ( | char * | _path | ) |
Definition at line 14314 of file _infrastructure.c.
| void buffered_fprintf | ( | Environment * | _environment, |
| FILE * | _stream, | ||
| const char * | _format, | ||
| ... ) |
Definition at line 15011 of file _infrastructure.c.
| int buffered_fputs | ( | Environment * | _environment, |
| const char * | _string, | ||
| FILE * | _stream ) |
Definition at line 15021 of file _infrastructure.c.
| size_t buffered_fwrite | ( | Environment * | _environment, |
| void * | _data, | ||
| size_t | _size, | ||
| size_t | _count, | ||
| FILE * | _stream ) |
Definition at line 15026 of file _infrastructure.c.
| void buffered_output | ( | Environment * | _environment, |
| FILE * | _stream ) |
Definition at line 15051 of file _infrastructure.c.
| void buffered_pop_output | ( | Environment * | _environment | ) |
Definition at line 15035 of file _infrastructure.c.
| void buffered_prepend_output | ( | Environment * | _environment | ) |
Definition at line 15041 of file _infrastructure.c.
| void buffered_push_output | ( | Environment * | _environment | ) |
Definition at line 15031 of file _infrastructure.c.
| Resource * build_resource_for_sequence | ( | Environment * | _environment, |
| char * | _image, | ||
| char * | _frame, | ||
| char * | _sequence ) |
Definition at line 15073 of file _infrastructure.c.
| int calculate_exact_tile | ( | TileDescriptor * | _tile, |
| TileDescriptors * | _tiles ) |
Definition at line 13128 of file _infrastructure.c.
| Variable * calculate_frame_by_type | ( | Environment * | _environment, |
| TsxTileset * | _tileset, | ||
| char * | _images, | ||
| char * | _description ) |
Definition at line 14541 of file _infrastructure.c.
| int calculate_horizontal_edges | ( | TileData * | _tileData, |
| int | _position ) |
Definition at line 13001 of file _infrastructure.c.
| int calculate_nearest_tile | ( | TileDescriptor * | _tile, |
| TileDescriptors * | _tiles ) |
Definition at line 13108 of file _infrastructure.c.
| int calculate_tile_affinity | ( | TileDescriptor * | _first, |
| TileDescriptor * | _second ) |
Definition at line 13093 of file _infrastructure.c.
| TileDescriptor * calculate_tile_descriptor | ( | TileData * | _tileData | ) |
Definition at line 13041 of file _infrastructure.c.
| int calculate_vertical_edges | ( | TileData * | _tileData, |
| int | _position ) |
Definition at line 13021 of file _infrastructure.c.
| int calculate_white_area | ( | TileData * | _tileData | ) |
Definition at line 12988 of file _infrastructure.c.
| int check_datatype_limits | ( | VariableType | _type, |
| int | _value ) |
Definition at line 15912 of file _infrastructure.c.
| int check_if_filename_is_valid | ( | Environment * | _environment, |
| char * | _filename ) |
Definition at line 13942 of file _infrastructure.c.
| void const_define_numeric | ( | Environment * | _environment, |
| char * | _name, | ||
| int | _value ) |
Definition at line 11862 of file _infrastructure.c.
| void const_define_string | ( | Environment * | _environment, |
| char * | _name, | ||
| char * | _value ) |
Definition at line 11907 of file _infrastructure.c.
| Constant * constant_create | ( | Environment * | _environment, |
| char * | _name ) |
Definition at line 348 of file _infrastructure.c.
| Constant * constant_find | ( | Environment * | _environment, |
| char * | _name ) |
Definition at line 373 of file _infrastructure.c.
| int count_screen_mode_selected | ( | Environment * | _environment | ) |
Definition at line 11498 of file _infrastructure.c.
| DataSegment * data_segment_define | ( | Environment * | _environment, |
| char * | _name ) |
Definition at line 14901 of file _infrastructure.c.
| DataSegment * data_segment_define_numeric | ( | Environment * | _environment, |
| int | _number ) |
Definition at line 14925 of file _infrastructure.c.
| DataSegment * data_segment_define_or_retrieve | ( | Environment * | _environment, |
| char * | _name ) |
Definition at line 14977 of file _infrastructure.c.
| DataSegment * data_segment_define_or_retrieve_numeric | ( | Environment * | _environment, |
| int | _number ) |
Definition at line 14989 of file _infrastructure.c.
| DataSegment * data_segment_find | ( | Environment * | _environment, |
| char * | _name ) |
Definition at line 14949 of file _infrastructure.c.
| DataSegment * data_segment_find_numeric | ( | Environment * | _environment, |
| int | _number ) |
Definition at line 14963 of file _infrastructure.c.
| void define_implicit_array_if_needed | ( | Environment * | _environment, |
| char * | _name ) |
Definition at line 15899 of file _infrastructure.c.
| Environment * environment_create | ( | void | ) |
Create a new environment.
Allocate space and reset (put to zero) the content of the Environment structure.
Definition at line 17283 of file _infrastructure.c.
| void environment_parse_command_line | ( | Environment * | _environment, |
| int | _argc, | ||
| char * | _argv[] ) |
Parse command line parameters.
| _environment | Environment to change |
| _argc | The number of parameters given on the command line. |
| _argv | The array of parameters given on the command line. |
Definition at line 17365 of file _infrastructure.c.
| void environment_setup_10liner | ( | Environment * | _environment | ) |
Definition at line 17748 of file _infrastructure.c.
| void environment_setup_default | ( | Environment * | _environment | ) |
Setup default environment values.
| _environment | Environment to change |
Definition at line 17294 of file _infrastructure.c.
| void environment_setup_retrohack | ( | Environment * | _environment | ) |
Definition at line 17755 of file _infrastructure.c.
| char * escape_newlines | ( | char * | _string | ) |
Definition at line 13936 of file _infrastructure.c.
| char * escape_newlines_full | ( | char * | _string, |
| int | _size ) |
Definition at line 13798 of file _infrastructure.c.
Definition at line 16144 of file _infrastructure.c.
| int file_get_size | ( | Environment * | _environment, |
| char * | _filename ) |
Definition at line 15271 of file _infrastructure.c.
| char * file_read_csv | ( | Environment * | _environment, |
| char * | _filename, | ||
| VariableType | _type, | ||
| int * | _size, | ||
| int * | _count ) |
Definition at line 15940 of file _infrastructure.c.
| CopperList * find_copper_list | ( | Environment * | _environment, |
| char * | _name ) |
Definition at line 17181 of file _infrastructure.c.
| int find_frame_by_type | ( | Environment * | _environment, |
| TsxTileset * | _tileset, | ||
| char * | _images, | ||
| char * | _description ) |
Definition at line 14612 of file _infrastructure.c.
| char * find_last_path_separator | ( | char * | _path | ) |
Definition at line 15206 of file _infrastructure.c.
| ScreenMode * find_screen_mode_by_id | ( | Environment * | _environment, |
| int | _id ) |
Definition at line 11570 of file _infrastructure.c.
| ScreenMode * find_screen_mode_by_suggestion | ( | Environment * | _environment, |
| int | _bitmap, | ||
| int | _width, | ||
| int | _height, | ||
| int | _colors, | ||
| int | _tile_width, | ||
| int | _tile_height ) |
Definition at line 11514 of file _infrastructure.c.
| void font_descriptors_init | ( | Environment * | _environment, |
| int | _embedded_present ) |
Definition at line 14474 of file _infrastructure.c.
| char * generate_storage_filename | ( | Environment * | _environment, |
| char * | _prefix, | ||
| char * | _suffix, | ||
| int | _number ) |
Definition at line 15261 of file _infrastructure.c.
| char * get_default_temporary_path | ( | ) |
Definition at line 15156 of file _infrastructure.c.
| void get_image_overwrite_size | ( | Environment * | _environment, |
| char * | _image, | ||
| char * | _x1, | ||
| char * | _y1, | ||
| char * | _x2, | ||
| char * | _y2 ) |
Definition at line 15055 of file _infrastructure.c.
| char * get_temporary_filename | ( | Environment * | _environment | ) |
Definition at line 13672 of file _infrastructure.c.
| void image_converter_asserts | ( | Environment * | _environment, |
| int | _width, | ||
| int | _height, | ||
| int | _offset_x, | ||
| int | _offset_y, | ||
| int * | _frame_width, | ||
| int * | _frame_height, | ||
| int | _modulo_x, | ||
| int | _modulo_y ) |
Definition at line 12722 of file _infrastructure.c.
| void image_converter_asserts_free | ( | Environment * | _environment, |
| int | _width, | ||
| int | _height, | ||
| int | _offset_x, | ||
| int | _offset_y, | ||
| int * | _frame_width, | ||
| int * | _frame_height ) |
Definition at line 12762 of file _infrastructure.c.
| void image_converter_asserts_free_height | ( | Environment * | _environment, |
| int | _width, | ||
| int | _height, | ||
| int | _offset_x, | ||
| int | _offset_y, | ||
| int * | _frame_width, | ||
| int * | _frame_height, | ||
| int | _modulo_x ) |
Definition at line 12819 of file _infrastructure.c.
| void image_converter_asserts_free_width | ( | Environment * | _environment, |
| int | _width, | ||
| int | _height, | ||
| int | _offset_x, | ||
| int | _offset_y, | ||
| int * | _frame_width, | ||
| int * | _frame_height, | ||
| int | _modulo_y ) |
Definition at line 12783 of file _infrastructure.c.
| char * image_enlarge_bottom | ( | Environment * | _environment, |
| char * | _source, | ||
| int | _width, | ||
| int | _height, | ||
| int | _delta ) |
Definition at line 13465 of file _infrastructure.c.
| char * image_enlarge_right | ( | Environment * | _environment, |
| char * | _source, | ||
| int | _width, | ||
| int | _height, | ||
| int | _delta ) |
Definition at line 13436 of file _infrastructure.c.
| char * image_extract_subimage | ( | Environment * | _environment, |
| char * | _source, | ||
| int | _width, | ||
| int | _height, | ||
| int | _frame_width, | ||
| int | _frame_height, | ||
| int | _x, | ||
| int | _y, | ||
| int | _depth ) |
Definition at line 13478 of file _infrastructure.c.
| char * image_flip_x | ( | Environment * | _environment, |
| char * | _source, | ||
| int | _width, | ||
| int | _height, | ||
| int | _depth ) |
Definition at line 13205 of file _infrastructure.c.
| char * image_flip_y | ( | Environment * | _environment, |
| char * | _source, | ||
| int | _width, | ||
| int | _height, | ||
| int | _depth ) |
Definition at line 13253 of file _infrastructure.c.
| char * image_roll_x_left | ( | Environment * | _environment, |
| char * | _source, | ||
| int | _width, | ||
| int | _height ) |
Definition at line 13346 of file _infrastructure.c.
| char * image_roll_x_right | ( | Environment * | _environment, |
| char * | _source, | ||
| int | _width, | ||
| int | _height ) |
Definition at line 13301 of file _infrastructure.c.
| char * image_roll_y_down | ( | Environment * | _environment, |
| char * | _source, | ||
| int | _width, | ||
| int | _height ) |
Definition at line 13391 of file _infrastructure.c.
| char * import_file_name | ( | char * | _import_path | ) |
Definition at line 17204 of file _infrastructure.c.
| void label_define_named | ( | Environment * | _environment, |
| char * | _label ) |
Definition at line 11739 of file _infrastructure.c.
| void label_define_numeric | ( | Environment * | _environment, |
| int | _label ) |
Definition at line 11718 of file _infrastructure.c.
| int label_exists_named | ( | Environment * | _environment, |
| char * | _label ) |
Definition at line 11705 of file _infrastructure.c.
| int label_exists_numeric | ( | Environment * | _environment, |
| int | _label ) |
Definition at line 11692 of file _infrastructure.c.
| void label_referred_define_named | ( | Environment * | _environment, |
| char * | _label ) |
Definition at line 11807 of file _infrastructure.c.
| void label_referred_define_numeric | ( | Environment * | _environment, |
| int | _label ) |
Definition at line 11786 of file _infrastructure.c.
| int label_referred_exists_named | ( | Environment * | _environment, |
| char * | _label ) |
Definition at line 11773 of file _infrastructure.c.
| int label_referred_exists_numeric | ( | Environment * | _environment, |
| int | _label ) |
Definition at line 11760 of file _infrastructure.c.
| void label_stored_define_named | ( | Environment * | _environment, |
| char * | _label ) |
Definition at line 11841 of file _infrastructure.c.
| int label_stored_exists_named | ( | Environment * | _environment, |
| char * | _label ) |
Definition at line 11828 of file _infrastructure.c.
| RGBi * malloc_palette | ( | int | _size | ) |
Allocate a palette space.
| _size | Size of palette, in entries |
Definition at line 13962 of file _infrastructure.c.
| float max_of_three | ( | float | _m, |
| float | _n, | ||
| float | _p ) |
Definition at line 13660 of file _infrastructure.c.
| float max_of_two | ( | float | _x, |
| float | _y ) |
Definition at line 13656 of file _infrastructure.c.
| void memory_area_assign | ( | MemoryArea * | _first, |
| Variable * | _variable ) |
Definition at line 189 of file _infrastructure.c.
| void memory_area_unassign | ( | MemoryArea * | _first, |
| Variable * | _variable ) |
Definition at line 225 of file _infrastructure.c.
| float min_of_three | ( | float | _m, |
| float | _n, | ||
| float | _p ) |
Definition at line 13668 of file _infrastructure.c.
| float min_of_two | ( | float | _x, |
| float | _y ) |
Definition at line 13664 of file _infrastructure.c.
| void offsetting_add_variable_reference | ( | Environment * | _environment, |
| Offsetting * | _first, | ||
| Variable * | _var, | ||
| int | _sequence ) |
Definition at line 455 of file _infrastructure.c.
| Offsetting * offsetting_size_count | ( | Environment * | _environment, |
| int | _size, | ||
| int | _count ) |
Definition at line 397 of file _infrastructure.c.
| Variable * origin_resolution_relative_transform_x | ( | Environment * | _environment, |
| char * | _x, | ||
| int | _is_relative ) |
Definition at line 14332 of file _infrastructure.c.
| Variable * origin_resolution_relative_transform_y | ( | Environment * | _environment, |
| char * | _y, | ||
| int | _is_relative ) |
Definition at line 14401 of file _infrastructure.c.
Make a "palette match".
| _source | Source palette to match |
| _source_size | Size of the source palette |
| _system | System palette to use as reference |
| _system_size | Size of the reference palette |
Definition at line 13981 of file _infrastructure.c.
| RGBi * palette_match_hardware_index | ( | RGBi * | _source, |
| int | _source_size, | ||
| RGBi * | _system, | ||
| int | _system_size ) |
Definition at line 14015 of file _infrastructure.c.
| RGBi * palette_merge | ( | RGBi * | _palette1, |
| int | _palette1_size, | ||
| RGBi * | _palette2, | ||
| int | _palette2_size, | ||
| int * | _size ) |
Make a "palette merge".
| _palette1 | First palette to merge |
| _palette1_size | Size of the first palette to merge |
| _palette2 | Second palette to merge |
| _palette2_size | Size of the second palette to merge |
| _size | Size of the merged palette |
Definition at line 14216 of file _infrastructure.c.
Promote an index color in a palette.
| _index | Source palette index |
| _source | Source palette to check |
| _source_size | Size of the source palette |
| _unique_size | Size of the unique palette |
Definition at line 14105 of file _infrastructure.c.
| RGBi * palette_promote_color_as_foreground | ( | int | _index, |
| RGBi * | _source, | ||
| int | _source_size, | ||
| int | _max_size ) |
Promote an index color in a palette.
| _index | Source palette index |
| _source | Source palette to check |
| _source_size | Size of the source palette |
| _unique_size | Size of the unique palette |
Definition at line 14141 of file _infrastructure.c.
Remove duplicates from a palette.
| _source | Source palette to check |
| _source_size | Size of the source palette |
| _unique_size | Size of the unique palette |
Definition at line 14052 of file _infrastructure.c.
Shift colors in palette.
| _source | Source palette to shift |
| _source_size | Size of the source palette |
| _offset | Offset to shift (> 0 to right, < 0 to left) |
Definition at line 14183 of file _infrastructure.c.
| char * parse_buffer | ( | Environment * | _environment, |
| char * | _buffer, | ||
| int * | _size, | ||
| int | _hex_only ) |
Definition at line 13168 of file _infrastructure.c.
| Variable * parse_buffer_definition | ( | Environment * | _environment, |
| char * | _buffer, | ||
| VariableType | _type, | ||
| int | _hex_only ) |
Definition at line 13194 of file _infrastructure.c.
| Variable * parser_adapted_numeric | ( | Environment * | _environment, |
| int | _number ) |
Definition at line 14874 of file _infrastructure.c.
| void parser_array_cleanup | ( | Environment * | _environment | ) |
Definition at line 14785 of file _infrastructure.c.
| void parser_array_index_numeric | ( | Environment * | _environment, |
| int | _index ) |
Definition at line 14799 of file _infrastructure.c.
| void parser_array_index_symbolic | ( | Environment * | _environment, |
| char * | _index ) |
Definition at line 14791 of file _infrastructure.c.
| void parser_array_init | ( | Environment * | _environment | ) |
Definition at line 14767 of file _infrastructure.c.
| void parser_array_init_by | ( | Environment * | _environment, |
| ArrayReference * | _array_reference ) |
Definition at line 14776 of file _infrastructure.c.
| ArrayReference * parser_array_retrieve | ( | Environment * | _environment | ) |
Definition at line 14755 of file _infrastructure.c.
| Variable * parser_casted_numeric | ( | Environment * | _environment, |
| VariableType | _type, | ||
| int | _number ) |
Definition at line 14889 of file _infrastructure.c.
| int pattern_match | ( | char * | _pattern, |
| char * | _value ) |
Definition at line 11100 of file _infrastructure.c.
| TileDescriptors * precalculate_tile_descriptors_for_font | ( | char * | _fontData, |
| int | _fontSize ) |
Definition at line 13073 of file _infrastructure.c.
| void prepare_variable_storage | ( | Environment * | _environment, |
| char * | _name, | ||
| Variable * | _source ) |
Definition at line 15218 of file _infrastructure.c.
| int procedure_exists | ( | Environment * | _environment, |
| char * | _name ) |
Definition at line 15841 of file _infrastructure.c.
| int reset_screen_mode_selected | ( | Environment * | _environment | ) |
Definition at line 11487 of file _infrastructure.c.
| char * resolve_color | ( | Environment * | _environment, |
| char * | _color ) |
Definition at line 15426 of file _infrastructure.c.
| char * resource_load_asserts | ( | Environment * | _environment, |
| char * | _filename ) |
Definition at line 12847 of file _infrastructure.c.
Calculate the distance between two colors.
This function calculates the color distance between two colors(_a and _b). By "distance" we mean the geometric distance between two points in a three-dimensional space, where each dimension corresponds to one of the components (red, green and blue). The returned value is normalized to the nearest 8-bit value.
| _e1 | First color |
| _e2 | Second color |
Definition at line 13523 of file _infrastructure.c.
Definition at line 13498 of file _infrastructure.c.
Definition at line 13502 of file _infrastructure.c.
| int rgbi_extract_palette | ( | Environment * | _environment, |
| unsigned char * | _source, | ||
| int | _width, | ||
| int | _height, | ||
| int | _depth, | ||
| RGBi | _palette[], | ||
| int | _palette_size, | ||
| int | _sorted ) |
Extract the color palette from the given image.
| _source | |
| _palette | |
| _palette_size |
Definition at line 13566 of file _infrastructure.c.
Definition at line 13506 of file _infrastructure.c.
| int show_troubleshooting_and_exit | ( | Environment * | _environment, |
| int | _argc, | ||
| char * | _argv[] ) |
Definition at line 15502 of file _infrastructure.c.
| StaticString * static_string_create | ( | Environment * | _environment, |
| char * | _value, | ||
| int | _size ) |
Definition at line 17258 of file _infrastructure.c.
| StaticString * static_string_create_filled | ( | Environment * | _environment, |
| int | _size, | ||
| char | _value ) |
Definition at line 17238 of file _infrastructure.c.
| StaticString * static_string_find_by_value | ( | Environment * | _environment, |
| char * | _value, | ||
| int | _size ) |
Definition at line 17226 of file _infrastructure.c.
| char * strcopy | ( | char * | _dest, |
| char * | _source ) |
Definition at line 17121 of file _infrastructure.c.
| StaticString * string_reserve | ( | Environment * | _environment, |
| char * | _value ) |
Definition at line 14727 of file _infrastructure.c.
| char * strreplace | ( | const char * | _orig, |
| const char * | _rep, | ||
| const char * | _with ) |
Definition at line 17133 of file _infrastructure.c.
| const char * strrstr | ( | const char * | haystack, |
| const char * | needle ) |
Definition at line 15882 of file _infrastructure.c.
| const char * strstrcase | ( | const char * | _x, |
| const char * | _y ) |
Definition at line 15857 of file _infrastructure.c.
| char * strtoupper | ( | char * | _string | ) |
Definition at line 14299 of file _infrastructure.c.
| int system_call | ( | Environment * | _environment, |
| char * | _commandline ) |
Call an external executable.
| _environment | Enviroment to call |
| _commandline | Command line to execute |
Definition at line 13709 of file _infrastructure.c.
| int system_move_safe | ( | Environment * | _environment, |
| char * | _source, | ||
| char * | _destination ) |
Definition at line 15800 of file _infrastructure.c.
| int system_remove_safe | ( | Environment * | _environment, |
| char * | _filename ) |
Definition at line 13784 of file _infrastructure.c.
| int tile_allocate | ( | TileDescriptors * | _tiles, |
| char * | _data ) |
Definition at line 13152 of file _infrastructure.c.
Definition at line 16129 of file _infrastructure.c.
| char * unescape_string | ( | Environment * | _environment, |
| char * | _value, | ||
| int | _printing, | ||
| int * | _final_size ) |
Definition at line 1875 of file _infrastructure.c.
| Variable * variable_add | ( | Environment * | _environment, |
| char * | _source, | ||
| char * | _destination ) |
Add two variable and return the sum of them.
This function allows you to sum the value of two variables. Note that both variables must pre-exist before the operation, under penalty of an exception.
| _environment | Current calling environment |
| _source | Source variable's name |
| _destination | Destination variable's name |
| EXIT_FAILURE | "Destination variable does not cast" |
| EXIT_FAILURE | "Source variable does not exist" |
Definition at line 4147 of file _infrastructure.c.
| Variable * variable_add_const | ( | Environment * | _environment, |
| char * | _source, | ||
| int | _destination ) |
Add a variable with a constant, and return the sum of them.
This function allows you to sum the value of a variables and a constant. Note that variable must pre-exist before the operation, under penalty of an exception.
| _environment | Current calling environment |
| _source | Source variable's name |
| _destination | Destination value to use |
| EXIT_FAILURE | "Destination variable does not cast" |
| EXIT_FAILURE | "Source variable does not exist" |
Definition at line 3868 of file _infrastructure.c.
| void variable_add_inplace | ( | Environment * | _environment, |
| char * | _source, | ||
| int | _destination ) |
Definition at line 4288 of file _infrastructure.c.
| void variable_add_inplace_array | ( | Environment * | _environment, |
| char * | _source, | ||
| char * | _destination ) |
Add a variable to an array element, and return the sum of them on the array element.
| _environment | Current calling environment |
| _source | Source variable's name and destination of sum |
| _destination | Value to sum |
Definition at line 4483 of file _infrastructure.c.
| void variable_add_inplace_mt | ( | Environment * | _environment, |
| char * | _source, | ||
| char * | _destination ) |
Add two variable and return the sum of them on the first.
This function allows you to sum the value of two variables. Note that both variables must pre-exist before the operation, under penalty of an exception.
| _environment | Current calling environment |
| _source | Source variable's name and destination of sum |
| _destination | Value to sum |
| EXIT_FAILURE | "Destination variable does not cast" |
| EXIT_FAILURE | "Source variable does not exist" |
Definition at line 4513 of file _infrastructure.c.
| void variable_add_inplace_type | ( | Environment * | _environment, |
| char * | _source, | ||
| char * | _field, | ||
| int | _destination ) |
Definition at line 4326 of file _infrastructure.c.
| void variable_add_inplace_type_vars | ( | Environment * | _environment, |
| char * | _source, | ||
| char * | _field, | ||
| char * | _destination ) |
Definition at line 4443 of file _infrastructure.c.
| void variable_add_inplace_vars | ( | Environment * | _environment, |
| char * | _source, | ||
| char * | _destination ) |
Add two variable and return the sum of them on the first.
This function allows you to sum the value of two variables. Note that both variables must pre-exist before the operation, under penalty of an exception.
| _environment | Current calling environment |
| _source | Source variable's name and destination of sum |
| _destination | Value to sum |
| EXIT_FAILURE | "Destination variable does not cast" |
| EXIT_FAILURE | "Source variable does not exist" |
Definition at line 4377 of file _infrastructure.c.
| Variable * variable_and | ( | Environment * | _environment, |
| char * | _left, | ||
| char * | _right ) |
Calculate logical "and" and return it as the result.
This function allows you to emit code to make a logical AND between two expressions, and return the result as boolean.
| _environment | Current calling environment |
| _left | Left expression to check |
| _right | Right expression to check |
Definition at line 6816 of file _infrastructure.c.
| Variable * variable_and_const | ( | Environment * | _environment, |
| char * | _destination, | ||
| int | _mask ) |
Calculate "and" mask for a variable and it as the result.
This function allows you to subdivide the value of a variable for two for various times. Note that variable must pre-exist before the operation, under penalty of an exception.
| _environment | Current calling environment |
| _destination | Destination variable's name |
| _mask | And mask to apply |
| EXIT_FAILURE | "Destination variable does not exist" |
Definition at line 6781 of file _infrastructure.c.
| Variable * variable_array_count_vars | ( | Environment * | _environment, |
| char * | _name, | ||
| char * | _target ) |
Definition at line 12042 of file _infrastructure.c.
| void variable_array_fill | ( | Environment * | _environment, |
| char * | _name, | ||
| int | _value ) |
Definition at line 12423 of file _infrastructure.c.
| void variable_array_fill_incremental | ( | Environment * | _environment, |
| char * | _name, | ||
| int | _min, | ||
| int | _count ) |
Definition at line 12563 of file _infrastructure.c.
| void variable_array_fill_random | ( | Environment * | _environment, |
| char * | _name, | ||
| int | _base, | ||
| int | _min_value, | ||
| int | _max_value, | ||
| int | _count, | ||
| int | _boolean ) |
Definition at line 12449 of file _infrastructure.c.
| Variable * variable_array_max_vars | ( | Environment * | _environment, |
| char * | _name ) |
Definition at line 12230 of file _infrastructure.c.
| Variable * variable_array_min_vars | ( | Environment * | _environment, |
| char * | _name ) |
Definition at line 12321 of file _infrastructure.c.
| void variable_array_shuffle | ( | Environment * | _environment, |
| char * | _name, | ||
| int | _rounds ) |
Definition at line 12637 of file _infrastructure.c.
| Variable * variable_array_sum_vars | ( | Environment * | _environment, |
| char * | _name ) |
Definition at line 12142 of file _infrastructure.c.
| Variable * variable_array_type | ( | Environment * | _environment, |
| char * | _name, | ||
| VariableType | _type ) |
Definition at line 1138 of file _infrastructure.c.
| Variable * variable_bin | ( | Environment * | _environment, |
| char * | _value, | ||
| char * | _digits, | ||
| char * | _zero, | ||
| char * | _one ) |
Emit code for <string>BIN(...).
Emit the code to convert the given value in a binary string.
| _environment | Current calling environment |
| _value | Value to convert into string |
| _digits | Number of digits to represent |
Definition at line 11219 of file _infrastructure.c.
| Variable * variable_bit | ( | Environment * | _environment, |
| char * | _value, | ||
| char * | _position ) |
Emit code for HAS BIT / BIT(...).
| _environment | Current calling environment |
| _value | Value to check at bit level |
| _position | Position to check at bit level |
Definition at line 11461 of file _infrastructure.c.
| Variable * variable_by_constant | ( | Environment * | _environment, |
| VariableType | _type, | ||
| int | _value ) |
Definition at line 1848 of file _infrastructure.c.
| Variable * variable_cast | ( | Environment * | _environment, |
| char * | _source, | ||
| VariableType | _type ) |
Cast a variable from a type to another.
This function can be called to convert a variable from one type to another. The function takes care of both creating a temporary variable and copying the value into it, conveying it differently depending on the type. The variable must exist in order to work, otherwise an exception will be thrown.
| _environment | Current calling environment |
| _source | Source variable's name |
| _type | Required type |
| EXIT_FAILURE | "Cannot find source var" |
Definition at line 1636 of file _infrastructure.c.
| Variable * variable_compare | ( | Environment * | _environment, |
| char * | _source, | ||
| char * | _destination ) |
Compare two variable and return the result of comparation.
This function allows you to compare the value of two variables. Note that both variables must pre-exist before the operation, under penalty of an exception.
| _environment | Current calling environment |
| _source | Source variable's name |
| _destination | Destination variable's name |
| EXIT_FAILURE | "Destination variable does not cast" |
| EXIT_FAILURE | "Source variable does not exist" |
Definition at line 5979 of file _infrastructure.c.
| void variable_compare_and_branch_const | ( | Environment * | _environment, |
| char * | _source, | ||
| int | _destination, | ||
| char * | _name, | ||
| int | _positive ) |
Definition at line 5920 of file _infrastructure.c.
| Variable * variable_compare_const | ( | Environment * | _environment, |
| char * | _source, | ||
| int | _destination ) |
Compare two variable and return the result of comparation.
This function allows you to compare the value of two variables. Note that both variables must pre-exist before the operation, under penalty of an exception.
| _environment | Current calling environment |
| _source | Source variable's name |
| _destination | Destination variable's name |
| EXIT_FAILURE | "Destination variable does not cast" |
| EXIT_FAILURE | "Source variable does not exist" |
Definition at line 6409 of file _infrastructure.c.
| Variable * variable_compare_not | ( | Environment * | _environment, |
| char * | _source, | ||
| char * | _destination ) |
Compare two variable and return the result of comparation.
This function allows you to compare the value of two variables. Note that both variables must pre-exist before the operation, under penalty of an exception.
| _environment | Current calling environment |
| _source | Source variable's name |
| _destination | Destination variable's name |
| EXIT_FAILURE | "Destination variable does not cast" |
| EXIT_FAILURE | "Source variable does not exist" |
Definition at line 6489 of file _infrastructure.c.
| Variable * variable_compare_not_const | ( | Environment * | _environment, |
| char * | _source, | ||
| int | _destination ) |
Compare two variable and return the result of comparation.
This function allows you to compare the value of two variables. Note that both variables must pre-exist before the operation, under penalty of an exception.
| _environment | Current calling environment |
| _source | Source variable's name |
| _destination | Destination variable's name |
| EXIT_FAILURE | "Destination variable does not cast" |
| EXIT_FAILURE | "Source variable does not exist" |
Definition at line 6449 of file _infrastructure.c.
| Variable * variable_complement_const | ( | Environment * | _environment, |
| char * | _source, | ||
| int | _value ) |
Calculate the complement of a variable.
This function allows you to calculate a complement of the value of one variable. Note that the variable must pre-exist before the operation, under penalty of an exception.
| _environment | Current calling environment |
| _destination | Destination variable's name |
| _value | Value to use for complement |
| EXIT_FAILURE | "Destination variable does not exist" |
Definition at line 5060 of file _infrastructure.c.
| void variable_decrement | ( | Environment * | _environment, |
| char * | _source ) |
Decrement a variable by one.
| _environment | Current calling environment |
| _source | Source variable's name |
Definition at line 5814 of file _infrastructure.c.
| void variable_decrement_array | ( | Environment * | _environment, |
| char * | _source ) |
Definition at line 17117 of file _infrastructure.c.
| void variable_decrement_array_type | ( | Environment * | _environment, |
| char * | _source, | ||
| char * | _field ) |
Definition at line 17109 of file _infrastructure.c.
| void variable_decrement_mt | ( | Environment * | _environment, |
| char * | _source ) |
Decrement a variable by one.
| _environment | Current calling environment |
| _source | Source variable's name |
Definition at line 5890 of file _infrastructure.c.
| void variable_decrement_type | ( | Environment * | _environment, |
| char * | _source, | ||
| char * | _field ) |
Definition at line 5846 of file _infrastructure.c.
| Variable * variable_define | ( | Environment * | _environment, |
| char * | _name, | ||
| VariableType | _type, | ||
| int | _value ) |
Define a variable for the program.
This function is necessary to define a variable within the program. This call reserves a space compatible with the given variable type, and assigns it to the given name. The initial value of the variable is also passed.
Allowed types:
It is possible to call the function several times with the same variable name: a single memory space will always be reserved. If the type differs, an exception will be thrown. Note that the variable will be defined in the last bank defined by the BANK command as VARIABLES. In other words, it is possible to define different variables in different banks, thus optimizing the space occupied by the program.
| _environment | Current calling environment |
| _name | Name of the variable to define |
| _type | Type of the variable to define |
| _value | Inital valure |
| EXIT_FAILURE | "Variable redefined with a different type" |
Definition at line 718 of file _infrastructure.c.
| Variable * variable_define_no_init | ( | Environment * | _environment, |
| char * | _name, | ||
| VariableType | _type ) |
Definition at line 912 of file _infrastructure.c.
| int variable_delete | ( | Environment * | _environment, |
| char * | _name ) |
Definition at line 1006 of file _infrastructure.c.
| Variable * variable_direct_assign | ( | Environment * | _environment, |
| char * | _var, | ||
| char * | _expr ) |
Definition at line 14639 of file _infrastructure.c.
| Variable * variable_div | ( | Environment * | _environment, |
| char * | _source, | ||
| char * | _destination, | ||
| char * | _remainder ) |
Make a division between two variable and return the product of them.
| _environment | Current calling environment |
| _source | Source variable's name |
| _destination | Destination variable's name |
Definition at line 5238 of file _infrastructure.c.
| Variable * variable_div2_const | ( | Environment * | _environment, |
| char * | _destination, | ||
| int | _bits, | ||
| char * | _remainder ) |
Subdivide by two a variable for various times and return the result.
This function allows you to subdivide the value of a variable for two for various times. Note that variable must pre-exist before the operation, under penalty of an exception.
| _environment | Current calling environment |
| _destination | Destination variable's name |
| _bits | Times to subdivide |
| EXIT_FAILURE | "Destination variable does not exist" |
Definition at line 6608 of file _infrastructure.c.
| Variable * variable_div_const | ( | Environment * | _environment, |
| char * | _source, | ||
| int | _destination, | ||
| char * | _remainder ) |
Definition at line 5385 of file _infrastructure.c.
| int variable_exists | ( | Environment * | _environment, |
| char * | _name ) |
Definition at line 994 of file _infrastructure.c.
| int variable_exists_by_realname | ( | Environment * | _environment, |
| char * | _name ) |
Definition at line 1000 of file _infrastructure.c.
| Variable * variable_export | ( | Environment * | _environment, |
| char * | _name, | ||
| VariableType | _type, | ||
| int | _size_or_value ) |
Definition at line 849 of file _infrastructure.c.
| Variable * variable_flip | ( | Environment * | _environment, |
| char * | _variable ) |
Definition at line 9746 of file _infrastructure.c.
| void variable_global | ( | Environment * | _environment, |
| char * | _pattern ) |
Definition at line 467 of file _infrastructure.c.
| Variable * variable_greater_than | ( | Environment * | _environment, |
| char * | _source, | ||
| char * | _destination, | ||
| int | _equal ) |
Compare two variable and return the result of comparation.
This function allows you to compare the value of two variables. Note that both variables must pre-exist before the operation, under penalty of an exception.
| _environment | Current calling environment |
| _source | Source variable's name |
| _destination | Destination variable's name |
| _equal | True if equal |
| EXIT_FAILURE | "Destination variable does not cast" |
| EXIT_FAILURE | "Source variable does not exist" |
Definition at line 7580 of file _infrastructure.c.
| Variable * variable_greater_than_const | ( | Environment * | _environment, |
| char * | _source, | ||
| int | _destination, | ||
| int | _equal ) |
Definition at line 7917 of file _infrastructure.c.
| Variable * variable_hex | ( | Environment * | _environment, |
| char * | _value, | ||
| int | _separator ) |
Emit code for = HEX( ... ).
| _environment | Current calling environment |
| _value | Number to convert to hexadecimal |
Definition at line 9303 of file _infrastructure.c.
| Variable * variable_hex2bin | ( | Environment * | _environment, |
| char * | _value, | ||
| char * | _variable ) |
Emit code for = HEX2BIN( ... ).
| _environment | Current calling environment |
| _value | Number to convert to hexadecimal |
Definition at line 9393 of file _infrastructure.c.
| Variable * variable_import | ( | Environment * | _environment, |
| char * | _name, | ||
| VariableType | _type, | ||
| int | _size_or_value ) |
Definition at line 778 of file _infrastructure.c.
| void variable_increment | ( | Environment * | _environment, |
| char * | _source ) |
Increment a variable by one.
| _environment | Current calling environment |
| _source | Source variable's name |
Definition at line 5494 of file _infrastructure.c.
| void variable_increment_array | ( | Environment * | _environment, |
| char * | _source ) |
Definition at line 17113 of file _infrastructure.c.
| void variable_increment_array_type | ( | Environment * | _environment, |
| char * | _source, | ||
| char * | _field ) |
Definition at line 17105 of file _infrastructure.c.
| void variable_increment_mt | ( | Environment * | _environment, |
| char * | _source ) |
Increment a variable by one.
| _environment | Current calling environment |
| _source | Source variable's name |
Definition at line 5740 of file _infrastructure.c.
| void variable_increment_type | ( | Environment * | _environment, |
| char * | _source, | ||
| char * | _field ) |
Definition at line 5524 of file _infrastructure.c.
| Variable * variable_int | ( | Environment * | _environment, |
| char * | _expression ) |
Definition at line 15145 of file _infrastructure.c.
| Variable * variable_less_than | ( | Environment * | _environment, |
| char * | _source, | ||
| char * | _destination, | ||
| int | _equal ) |
Compare two variable and return the result of comparation.
This function allows you to compare the value of two variables. Note that both variables must pre-exist before the operation, under penalty of an exception.
| _environment | Current calling environment |
| _source | Source variable's name |
| _destination | Destination variable's name |
| _equal | True if equal |
| EXIT_FAILURE | "Destination variable does not cast" |
| EXIT_FAILURE | "Source variable does not exist" |
Definition at line 7225 of file _infrastructure.c.
| Variable * variable_less_than_const | ( | Environment * | _environment, |
| char * | _source, | ||
| int | _destination, | ||
| int | _equal ) |
Definition at line 7533 of file _infrastructure.c.
| Variable * variable_mod | ( | Environment * | _environment, |
| char * | _source, | ||
| char * | _destination ) |
Definition at line 11646 of file _infrastructure.c.
| Variable * variable_move | ( | Environment * | _environment, |
| char * | _source, | ||
| char * | _destination ) |
Store the value of a variable inside another variable by converting it.
This function allows you to store the value of one variable in another, making it (implicitly) cast (type conversion). Note that both variables must pre-exist before the operation, under penalty of an exception.
| _environment | Current calling environment |
| _source | Destination variable's name |
| _destination | Destination variable's name |
| EXIT_FAILURE | "Destination variable does not exist" |
| EXIT_FAILURE | "Source variable does not cast" |
Definition at line 3089 of file _infrastructure.c.
| void variable_move_array | ( | Environment * | _environment, |
| char * | _array, | ||
| char * | _value ) |
Definition at line 10527 of file _infrastructure.c.
| void variable_move_array1_type | ( | Environment * | _environment, |
| char * | _array, | ||
| char * | _index, | ||
| char * | _field, | ||
| char * | _value ) |
Definition at line 16687 of file _infrastructure.c.
| void variable_move_array1_type_const | ( | Environment * | _environment, |
| char * | _array, | ||
| char * | _index, | ||
| char * | _field, | ||
| int | _value ) |
Definition at line 16914 of file _infrastructure.c.
| void variable_move_array1_type_fields | ( | Environment * | _environment, |
| char * | _array, | ||
| char * | _index, | ||
| char * | _field1, | ||
| char * | _field2 ) |
Definition at line 16796 of file _infrastructure.c.
| void variable_move_array_bit | ( | Environment * | _environment, |
| Variable * | _array, | ||
| char * | _value ) |
Definition at line 10269 of file _infrastructure.c.
| void variable_move_array_byte | ( | Environment * | _environment, |
| Variable * | _array, | ||
| char * | _value ) |
Definition at line 10291 of file _infrastructure.c.
| void variable_move_array_string | ( | Environment * | _environment, |
| char * | _array, | ||
| char * | _string ) |
Definition at line 10551 of file _infrastructure.c.
| void variable_move_array_type | ( | Environment * | _environment, |
| char * | _array, | ||
| char * | _field, | ||
| char * | _value ) |
Definition at line 16288 of file _infrastructure.c.
| Variable * variable_move_from_array | ( | Environment * | _environment, |
| char * | _array ) |
Definition at line 11077 of file _infrastructure.c.
| Variable * variable_move_from_array1_type | ( | Environment * | _environment, |
| char * | _array, | ||
| char * | _index, | ||
| char * | _field ) |
Definition at line 16655 of file _infrastructure.c.
| void variable_move_from_array1_type_inplace | ( | Environment * | _environment, |
| char * | _array, | ||
| char * | _index, | ||
| char * | _field, | ||
| char * | _value ) |
Definition at line 16546 of file _infrastructure.c.
| Variable * variable_move_from_array_bit | ( | Environment * | _environment, |
| Variable * | _array ) |
Definition at line 10635 of file _infrastructure.c.
| Variable * variable_move_from_array_bit_inplace | ( | Environment * | _environment, |
| Variable * | _array, | ||
| Variable * | _result ) |
Definition at line 10606 of file _infrastructure.c.
| Variable * variable_move_from_array_byte | ( | Environment * | _environment, |
| Variable * | _array ) |
Definition at line 11046 of file _infrastructure.c.
| void variable_move_from_array_byte_inplace | ( | Environment * | _environment, |
| Variable * | _array, | ||
| Variable * | _result ) |
Definition at line 10645 of file _infrastructure.c.
| void variable_move_from_array_inplace | ( | Environment * | _environment, |
| char * | _array, | ||
| char * | _result ) |
Definition at line 11056 of file _infrastructure.c.
| Variable * variable_move_from_array_type | ( | Environment * | _environment, |
| char * | _array, | ||
| char * | _field ) |
Definition at line 16406 of file _infrastructure.c.
| void variable_move_from_array_type_inplace | ( | Environment * | _environment, |
| char * | _array, | ||
| char * | _field, | ||
| char * | _value ) |
Definition at line 16438 of file _infrastructure.c.
| Variable * variable_move_from_mt | ( | Environment * | _environment, |
| char * | _source, | ||
| char * | _destination ) |
Increment a variable by one.
| _environment | Current calling environment |
| _source | Source variable's name |
Definition at line 5696 of file _infrastructure.c.
| Variable * variable_move_from_type | ( | Environment * | _environment, |
| char * | _type, | ||
| char * | _field ) |
Definition at line 16177 of file _infrastructure.c.
| void variable_move_from_type_inplace | ( | Environment * | _environment, |
| char * | _type, | ||
| char * | _field, | ||
| char * | _value ) |
Definition at line 16196 of file _infrastructure.c.
| Variable * variable_move_naked | ( | Environment * | _environment, |
| char * | _source, | ||
| char * | _destination ) |
Store the value of a variable inside another variable without conversion.
This function allows you to store the value of one variable in another, without cast (type conversion). Note that both variables must pre-exist before the operation, under penalty of an exception.
| _environment | Current calling environment |
| _source | Destination variable's name |
| _destination | Destination variable's name |
| EXIT_FAILURE | "Destination variable does not exist" |
| EXIT_FAILURE | "Source variable does not exist" |
Definition at line 3922 of file _infrastructure.c.
| Variable * variable_move_to_mt | ( | Environment * | _environment, |
| char * | _source, | ||
| char * | _destination ) |
Definition at line 5716 of file _infrastructure.c.
| void variable_move_type | ( | Environment * | _environment, |
| char * | _type, | ||
| char * | _field, | ||
| char * | _value ) |
Definition at line 16243 of file _infrastructure.c.
| Variable * variable_mul | ( | Environment * | _environment, |
| char * | _source, | ||
| char * | _destination ) |
Make a multiplication between two variable and return the product of them.
This function allows you to multiplicate the value of two variables. Note that both variables must pre-exist before the operation, under penalty of an exception.
| _environment | Current calling environment |
| _source | Source variable's name |
| _destination | Destination variable's name |
| EXIT_FAILURE | "Destination variable does not cast" |
| EXIT_FAILURE | "Source variable does not exist" |
Definition at line 5097 of file _infrastructure.c.
| Variable * variable_mul2_const | ( | Environment * | _environment, |
| char * | _destination, | ||
| int | _steps ) |
Double a variable for various times and return the result.
This function allows you to double the value of a variable for various times. Note that variable must pre-exist before the operation, under penalty of an exception.
| _environment | Current calling environment |
| _destination | Destination variable's name |
| EXIT_FAILURE | "Destination variable does not exist" |
Definition at line 6508 of file _infrastructure.c.
| Variable * variable_not | ( | Environment * | _environment, |
| char * | _value ) |
Calculate logical "not" and return it as the result.
This function allows you to emit code to make a logical OR between two expressions, and return the result as boolean.
| _environment | Current calling environment |
| _value | Left expression to check |
Definition at line 7183 of file _infrastructure.c.
| Variable * variable_or | ( | Environment * | _environment, |
| char * | _left, | ||
| char * | _right ) |
Calculate logical "or" and return it as the result.
This function allows you to emit code to make a logical OR between two expressions, and return the result as boolean.
| _environment | Current calling environment |
| _left | Left expression to check |
| _right | Right expression to check |
Definition at line 7070 of file _infrastructure.c.
| void variable_reset | ( | Environment * | _environment | ) |
Reset the usage flags for the temporary variable pool.
This function allows you to reset the use flag of each temporary variable in the pool. The purpose of this function is to allow the reuse of variables.
| _environment | Current calling environment |
Definition at line 1128 of file _infrastructure.c.
| Variable * variable_resident | ( | Environment * | _environment, |
| VariableType | _type, | ||
| char * | _meaning ) |
Definition at line 1518 of file _infrastructure.c.
| Variable * variable_resize_buffer | ( | Environment * | _environment, |
| char * | _destination, | ||
| int | _size ) |
Resize the (static) size of a buffer.
| _environment | Current calling environment |
| _destination | Destination variable's name |
| _size | Size of the buffer, in bytes |
Definition at line 2162 of file _infrastructure.c.
| Variable * variable_retrieve | ( | Environment * | _environment, |
| char * | _name ) |
Definition at line 988 of file _infrastructure.c.
| Variable * variable_retrieve_by_realname | ( | Environment * | _environment, |
| char * | _name ) |
Definition at line 967 of file _infrastructure.c.
| Variable * variable_retrieve_internal | ( | Environment * | _environment, |
| char * | _name, | ||
| int | _mandatory ) |
Retrieve the definition of a variable.
This function allows you to retrieve the definition of an actual or temporary variable, searching for it by name. Where the variable does not exist, a NULL will be returned. Otherwise, a pointer to the structure with the variable definition.
| _environment | Current calling environment |
| _name | Name of the variable to look for. |
Definition at line 521 of file _infrastructure.c.
| Variable * variable_retrieve_or_define | ( | Environment * | _environment, |
| char * | _name, | ||
| VariableType | _type, | ||
| int | _value ) |
Definition at line 1040 of file _infrastructure.c.
| void variable_set_type | ( | Environment * | _environment, |
| char * | _name, | ||
| char * | _type ) |
Definition at line 16159 of file _infrastructure.c.
| Variable * variable_sl_const | ( | Environment * | _environment, |
| char * | _destination, | ||
| int | _steps ) |
Definition at line 6553 of file _infrastructure.c.
| Variable * variable_sr_const | ( | Environment * | _environment, |
| char * | _destination, | ||
| int | _bits ) |
Definition at line 6647 of file _infrastructure.c.
| Variable * variable_store | ( | Environment * | _environment, |
| char * | _destination, | ||
| unsigned int | _value ) |
Store a direct value to a variable.
This function outputs code to initialize a variable to a specific direct value. The variable must exist in order to work, otherwise an exception will be thrown.
| _environment | Current calling environment |
| _destination | Destination variable's name |
| _value | Value to assign |
| EXIT_FAILURE | "Destination variable does not exists" |
Definition at line 1720 of file _infrastructure.c.
| Variable * variable_store_array | ( | Environment * | _environment, |
| char * | _destination, | ||
| unsigned char * | _buffer, | ||
| int | _size, | ||
| int | _at ) |
Definition at line 2224 of file _infrastructure.c.
| void variable_store_array_const | ( | Environment * | _environment, |
| char * | _array, | ||
| int | _value ) |
Definition at line 10245 of file _infrastructure.c.
| void variable_store_array_const_bit | ( | Environment * | _environment, |
| Variable * | _array, | ||
| int | _value ) |
Definition at line 10111 of file _infrastructure.c.
| void variable_store_array_const_byte | ( | Environment * | _environment, |
| Variable * | _array, | ||
| int | _value ) |
Definition at line 10134 of file _infrastructure.c.
| Variable * variable_store_buffer | ( | Environment * | _environment, |
| char * | _destination, | ||
| unsigned char * | _buffer, | ||
| int | _size, | ||
| int | _at ) |
Definition at line 2175 of file _infrastructure.c.
| Variable * variable_store_float | ( | Environment * | _environment, |
| char * | _destination, | ||
| double | _value ) |
Store a string to a variable.
| _environment | Current calling environment |
| _destination | Destination variable's name |
| _value | Value to assign |
Definition at line 2038 of file _infrastructure.c.
| void variable_store_mt | ( | Environment * | _environment, |
| char * | _source, | ||
| unsigned int | _value ) |
Store a variable's value.
| _environment | Current calling environment |
| _source | Source variable's name |
Definition at line 5675 of file _infrastructure.c.
| Variable * variable_store_string | ( | Environment * | _environment, |
| char * | _destination, | ||
| char * | _value ) |
Store a string to a variable.
| _environment | Current calling environment |
| _destination | Destination variable's name |
| _value | Value to assign |
Definition at line 1995 of file _infrastructure.c.
| Variable * variable_store_type | ( | Environment * | _environment, |
| char * | _destination, | ||
| char * | _field, | ||
| unsigned int | _value ) |
Definition at line 1808 of file _infrastructure.c.
| Variable * variable_string_asc | ( | Environment * | _environment, |
| char * | _char ) |
Emit code for = ASC( ... ).
| _environment | Current calling environment |
| _char | String to convert to ascii |
Definition at line 9927 of file _infrastructure.c.
| Variable * variable_string_chr | ( | Environment * | _environment, |
| char * | _ascii ) |
Emit code for = CHR( ... ).
| _environment | Current calling environment |
| _ascii | ASCII value to convert to string |
Definition at line 9822 of file _infrastructure.c.
| Variable * variable_string_dup | ( | Environment * | _environment, |
| char * | _string, | ||
| char * | _repetitions ) |
Definition at line 9578 of file _infrastructure.c.
| Variable * variable_string_flip | ( | Environment * | _environment, |
| char * | _string ) |
Emit code for = FLIP( ... ).
| _environment | Current calling environment |
| _string | String to flip |
Definition at line 9710 of file _infrastructure.c.
| Variable * variable_string_insert | ( | Environment * | _environment, |
| char * | _string, | ||
| char * | _altstring, | ||
| char * | _pos ) |
Definition at line 15281 of file _infrastructure.c.
| Variable * variable_string_inst | ( | Environment * | _environment, |
| char * | _string, | ||
| char * | _altstring, | ||
| char * | _pos ) |
Definition at line 15357 of file _infrastructure.c.
| Variable * variable_string_instr | ( | Environment * | _environment, |
| char * | _search, | ||
| char * | _searched, | ||
| char * | _start ) |
Emit code for = INSTR( ..., ... [, ...] ).
| _environment | Current calling environment |
| _search | String to be searched |
| _searched | String to search |
| _start | Starting position to start to search |
Definition at line 8795 of file _infrastructure.c.
| Variable * variable_string_left | ( | Environment * | _environment, |
| char * | _string, | ||
| char * | _position ) |
Emit code for = LEFT( ..., ... ).
| _environment | Current calling environment |
| _string | String to extract text from |
| _position | Position to start from |
Definition at line 7994 of file _infrastructure.c.
| void variable_string_left_assign | ( | Environment * | _environment, |
| char * | _string, | ||
| char * | _position, | ||
| char * | _expression ) |
Emit code for LEFT( ..., ... ) = ....
| _environment | Current calling environment |
| _string | String to extract text from |
| _position | Position to start from |
Definition at line 8085 of file _infrastructure.c.
| Variable * variable_string_len | ( | Environment * | _environment, |
| char * | _string ) |
Emit code for = LEN( ... ).
| _environment | Current calling environment |
| _string | String to examinate |
Definition at line 10007 of file _infrastructure.c.
| Variable * variable_string_lower | ( | Environment * | _environment, |
| char * | _string ) |
Emit code for = UPPER( ... ).
| _environment | Current calling environment |
| _string | String to convert in lower case |
Definition at line 8944 of file _infrastructure.c.
| Variable * variable_string_mid | ( | Environment * | _environment, |
| char * | _string, | ||
| char * | _position, | ||
| char * | _len ) |
Emit code for = MID( ..., ... [, ...] ).
| _environment | Current calling environment |
| _string | String to extract text from |
| _position | Position to start from |
| _len | Length to extract |
Definition at line 8397 of file _infrastructure.c.
| void variable_string_mid_assign | ( | Environment * | _environment, |
| char * | _string, | ||
| char * | _position, | ||
| char * | _len, | ||
| char * | _expression ) |
Emit code for MID( ..., ... [, ...] ) = ....
| _environment | Current calling environment |
| _string | String to extract text from |
| _position | Position to start from |
| _len | Length to extract |
Definition at line 8657 of file _infrastructure.c.
| Variable * variable_string_pick | ( | Environment * | _environment, |
| char * | _string, | ||
| int | _position ) |
Definition at line 15401 of file _infrastructure.c.
| Variable * variable_string_right | ( | Environment * | _environment, |
| char * | _string, | ||
| char * | _position ) |
Emit code for = LEFT( ..., ... ).
| _environment | Current calling environment |
| _string | String to extract text from |
| _position | Position to start from |
Definition at line 8201 of file _infrastructure.c.
| void variable_string_right_assign | ( | Environment * | _environment, |
| char * | _string, | ||
| char * | _position, | ||
| char * | _expression ) |
Emit code for RIGHT( ..., ... ) = ....
| _environment | Current calling environment |
| _string | String to extract text from |
| _position | Position to start from |
Definition at line 8307 of file _infrastructure.c.
| Variable * variable_string_space | ( | Environment * | _environment, |
| char * | _repetitions ) |
Emit code for = SPACE( ... ).
| _environment | Current calling environment |
| _repetitions | Number of spaces to produce in output string |
Definition at line 9669 of file _infrastructure.c.
| Variable * variable_string_str | ( | Environment * | _environment, |
| char * | _value ) |
Emit code for = STR( ... ).
| _environment | Current calling environment |
| _value | Number to convert to string |
Definition at line 9104 of file _infrastructure.c.
| Variable * variable_string_string | ( | Environment * | _environment, |
| char * | _string, | ||
| char * | _repetitions ) |
Emit code for = STRING( ..., ... ).
| _environment | Current calling environment |
| _string | String to use as base (the first letter) |
| _repetitions | Number of repetition of output string |
Definition at line 9495 of file _infrastructure.c.
| Variable * variable_string_substring | ( | Environment * | _environment, |
| char * | _string, | ||
| char * | _start, | ||
| char * | _end ) |
Emit code for = SUBSTRING( ..., ... [, ...] ).
| _environment | Current calling environment |
| _string | String to extract text from |
| _start | Position to start from |
| _end | Length to end to |
Definition at line 8566 of file _infrastructure.c.
| Variable * variable_string_upper | ( | Environment * | _environment, |
| char * | _string ) |
Emit code for = UPPER( ... ).
| _environment | Current calling environment |
| _string | String to convert in uppercase |
Definition at line 9039 of file _infrastructure.c.
| Variable * variable_string_val | ( | Environment * | _environment, |
| char * | _value ) |
Emit code for = VAL( ... ).
| _environment | Current calling environment |
| _value | String to convert to number |
Definition at line 9201 of file _infrastructure.c.
| Variable * variable_sub | ( | Environment * | _environment, |
| char * | _source, | ||
| char * | _dest ) |
Make a differenze between two variable and return the difference of them.
This function allows you to difference the value of two variables. Note that both variables must pre-exist before the operation, under penalty of an exception.
| _environment | Current calling environment |
| _source | Source variable's name |
| _destination | Destination variable's name |
| EXIT_FAILURE | "Destination variable does not cast" |
| EXIT_FAILURE | "Source variable does not exist" |
Definition at line 4660 of file _infrastructure.c.
| Variable * variable_sub_const | ( | Environment * | _environment, |
| char * | _source, | ||
| int | _destination ) |
Make a differenze between a variable a constant, and return the difference of them.
This function allows you to difference the value of a variable and a constant. Note that both variable must pre-exist before the operation, under penalty of an exception.
| _environment | Current calling environment |
| _source | Source variable's name |
| _destination | Value to subtract |
| EXIT_FAILURE | "Destination variable does not cast" |
| EXIT_FAILURE | "Source variable does not exist" |
Definition at line 4786 of file _infrastructure.c.
| void variable_sub_inplace | ( | Environment * | _environment, |
| char * | _source, | ||
| char * | _dest ) |
Make a differenze between two variable and assign the difference of them to the first.
This function allows you to difference the value of two variables. Note that both variables must pre-exist before the operation, under penalty of an exception.
| _environment | Current calling environment |
| _source | Source variable's name and destination of the subtraction |
| _destination | Destination variable's name |
| EXIT_FAILURE | "Destination variable does not cast" |
| EXIT_FAILURE | "Source variable does not exist" |
Definition at line 4834 of file _infrastructure.c.
| void variable_swap | ( | Environment * | _environment, |
| char * | _source, | ||
| char * | _dest ) |
Swap values of two variables.
This function allows you to swap the value of two variables. Note that none variable must pre-exist before the operation.
| _environment | Current calling environment |
| _source | Source variable's name |
| _destination | Destination variable's name |
Definition at line 4984 of file _infrastructure.c.
| Variable * variable_temporary | ( | Environment * | _environment, |
| VariableType | _type, | ||
| char * | _meaning ) |
Define a temporary variable.
This function is necessary to define a temporary variable. This call will search for a (unused) temporary variable of the same type. If there is none, a new temporary variable will be reserved. The name will be chosen so as not to collide with either existing temporary variables or already defined actual variables. Note that the variable will be defined in the last bank defined by the BANK command as TEMPORARY. In other words, it is possible to define different variables in different banks, thus optimizing the space occupied by the program.
Allowed types:
| _environment | Current calling environment |
| _type | Type of the variable to define |
Definition at line 1388 of file _infrastructure.c.
| void variable_temporary_remove | ( | Environment * | _environment, |
| char * | _name ) |
Definition at line 12956 of file _infrastructure.c.
| VariableType variable_type_from_numeric_value | ( | Environment * | _environment, |
| int | _number ) |
Definition at line 14807 of file _infrastructure.c.
| Variable * variable_xor | ( | Environment * | _environment, |
| char * | _left, | ||
| char * | _right ) |
Calculate logical "xor" and return it as the result.
This function allows you to emit code to make a logical XOR between two expressions, and return the result as boolean.
| _environment | Current calling environment |
| _left | Left expression to check |
| _right | Right expression to check |
Definition at line 6943 of file _infrastructure.c.
| void variable_xor_inplace | ( | Environment * | _environment, |
| char * | _source, | ||
| int | _destination ) |
Definition at line 4537 of file _infrastructure.c.
| void variable_xor_inplace_mt | ( | Environment * | _environment, |
| char * | _source, | ||
| char * | _destination ) |
Add two variable and return the sum of them on the first.
This function allows you to sum the value of two variables. Note that both variables must pre-exist before the operation, under penalty of an exception.
| _environment | Current calling environment |
| _source | Source variable's name and destination of sum |
| _destination | Value to sum |
| EXIT_FAILURE | "Destination variable does not cast" |
| EXIT_FAILURE | "Source variable does not exist" |
Definition at line 4620 of file _infrastructure.c.
| void variable_xor_inplace_vars | ( | Environment * | _environment, |
| char * | _source, | ||
| char * | _destination ) |
Add two variable and return the sum of them on the first.
This function allows you to sum the value of two variables. Note that both variables must pre-exist before the operation, under penalty of an exception.
| _environment | Current calling environment |
| _source | Source variable's name and destination of sum |
| _destination | Value to sum |
| EXIT_FAILURE | "Destination variable does not cast" |
| EXIT_FAILURE | "Source variable does not exist" |
Definition at line 4576 of file _infrastructure.c.
| char BANK_TYPE_AS_STRING[][16] |
Description of BANK TYPE, in readable format.
Definition at line 125 of file _infrastructure.c.
| char DATATYPE_AS_STRING[][16] |
Emit code for BEGIN COPPER.
This variable defines as an array of constant pointers. Each element of the array represents the "human" name of a ugBASIC's data type. The main reason is to map an IDto a readable string. If ugBASIC encounters an error, you don't want it to print "Error in type 2," but rather "Error in type FLOAT.". Note that it's vital that the order of strings in the array exactly reflects the order of the IDs in your enum. If you move an element to one, you must also move it to the other, otherwise the mapping will be staggered. Often, a final NULL or UNKNOWN string is added to handle error cases or to allow you to loop through the array without knowing its size beforehand.
Definition at line 133 of file _infrastructure.c.
|
extern |
This variable holds the name of the folder containing the set of definitions to be used with the IMPORT DECLARES command. Executing this statement loads the relevant ugBASIC file for the target in question from this location. If NULL, the import path will be search against the following paths: ../../imports, ../imports and, finally, ./imports.
Definition at line 250 of file ugbc.tab.c.
| char OUTPUT_FILE_TYPE_AS_STRING[][16] |
In technical terms, it's an array (or list) of constant strings. Each string represents the description of the generated format. This variable has three main purposes in the compiler workflow: the compiler uses this array to rename output files based on the source filename; òets the compiler know which output "stages" the user has requested; finally, before writing a file, the system checks whether the desired extension is one of the "managed" or supported types on the target architecture.
Definition at line 172 of file _infrastructure.c.
|
extern |
| char targetName[] = "atari" |
Definition at line 55 of file _infrastructure.c.
|
extern |
In Bison, the yydebug variable is the primary tool for runtime debugging of the generated parser. When enabled, it allows you to see exactly what's happening "under the hood" as the parser parses the input.
Normally, a Bison parser operates silently: it reads tokens and reduces the rules. If there's an error, you only receive a generic "syntax error". When yydebug is enabled (1), the parser prints a detailed log to standard error (stderr), including when a token is read and pushed onto the stack (shifts), when a sequence of symbols is transformed into a non-terminal according to a grammatical rule (reductions) and the evolution of parser states (stack state).
This variable is a global integer variable (of type int). To enable logging, you must set it to a non-zero value (usually 1). This value is driven by "-y" command line parameter (-y0 or -y1) Inside the Bison definition, we defined the debug macro to include the code needed for tracing support.
Definition at line 168 of file ugbc.tab.c.