# Z88DK Z80 Macro Assembler
#
# Copyright (C) Gunther Strube, InterLogic 1993-99
# Copyright (C) Paulo Custodio, 2011-2020
# License: The Artistic License 2.0, http://www.perlfoundation.org/artistic_license_2_0
# Repository: https://github.com/pauloscustodio/z88dk-z80asm
#
# Define error messages

---
errors:
  # File errors
  - type	: ErrError
    func	: error_read_file
    args	: const char *filename
    message	: "\"cannot read file '%s'\", filename"
	
  - type	: ErrError
    func	: error_write_file
    args	: const char *filename
    message	: "\"cannot write file '%s'\", filename"
	
  - type	: ErrError
    func	: error_include_recursion
    args	: const char *filename
    message	: "\"cannot include file '%s' recursively\", filename"
	
  # Command line parsing errors
  - type	: ErrError
    func	: error_no_src_file
    args	: void
    message	: '"source file missing"'
	
  - type	: ErrError
    func	: error_illegal_option
    args	: const char *option
    message	: "\"illegal option: %s\", option"
	
  - type	: ErrError
    func	: error_glob
    args	: const char *filename, const char *error
    message	: "\"problem with '%s': %s\", filename, error"
	
  - type	: ErrError
    func	: error_glob_no_files
    args	: const char *filename
    message	: "\"pattern '%s' returned no files\", filename"
	
  - type	: ErrError
    func	: error_not_regular_file
    args	: const char *filename
    message	: "\"file '%s' is not a regular file\", filename"
	
  # Warnings
  - type	: ErrWarn
    func	: warn_symbol_different
    args	: 'const char *name, const char *used'
    message	: "\"symbol '%s' used as '%s'\", name, used"
	
  - type	: ErrWarn
    func	: warn_expr_in_parens
    args	: void
    message	: '"interpreting indirect value as immediate"'
	
  # Macros
  - type	: ErrError
    func	: error_redefined_macro
    args	: 'const char *name'
    message	: "\"macro '%s' redefined\", name"
	
  # Assembly errors
  - type	: ErrError
    func	: error_syntax
    args	: void
    message	: '"syntax error"'
	
  - type	: ErrError
    func	: error_syntax_expr
    args	: void
    message	: '"syntax error in expression"'
	
  - type	: ErrError
    func	: error_invalid_squoted_string
    args	: void
    message	: '"invalid single quoted character"'
	
  - type	: ErrError
    func	: error_unclosed_string
    args	: void
    message	: '"unclosed quoted string"'
	
  - type	: ErrError
    func	: error_divide_by_zero
    args	: void
    message	: '"division by zero"'
	
  - type	: ErrError
    func	: error_missing_block
    args	: void
    message	: '"missing {} block"'
	
  - type	: ErrError
    func	: error_missing_close_block
    args	: void
    message	: '"{} block not closed"'
	
  - type	: ErrError
    func	: error_unbalanced_struct_at
    args	: 'const char *filename, int line_nr'
    message	: "\"unbalanced control structure started at file '%s' line %d\", filename, line_nr"
	
  - type	: ErrError
    func	: error_unbalanced_struct
    args	: void
    message	: '"unbalanced control structure"'
	
  - type	: ErrError
    func	: error_not_defined
    args	: const char *name
    message	: "\"symbol '%s' not defined\", name"
	
  - type	: ErrError
    func	: error_illegal_ident
    args	: void
    message	: '"illegal identifier"'
	
  - type	: ErrError
    func	: error_jr_not_local
    args	: void
    message	: '"relative jump address must be local"'
	
  - type	: ErrError
    func	: error_expected_const_expr
    args	: void
    message	: '"expected constant expression"'
	
  # Symbol errors
  - type	: ErrError
    func	: error_symbol_redefined
    args	: const char *symbol
    message	: "\"symbol '%s' already defined\", symbol"
	
  - type	: ErrError
    func	: error_symbol_redefined_module
    args	: 'const char *symbol, const char *module'
    message	: "\"symbol '%s' already defined in module '%s'\", symbol, module"
	
  - type	: ErrError
    func	: error_symbol_decl_local
    args	: const char *symbol
    message	: "\"symbol '%s' already declared local\", symbol"
	
  - type	: ErrError
    func	: error_symbol_redecl
    args	: const char *symbol
    message	: "\"re-declaration of '%s' not allowed\", symbol"
	
  - type	: ErrError
    func	: error_expression_recursion
    args	: const char *name
    message	: "\"expression for '%s' depends on itself\", name"
	
  # Link errors
  - type	: ErrError
    func	: error_max_codesize
    args	: long size
    message	: '"max. code size of %ld bytes reached", size'
	
  - type	: ErrError
    func	: error_org_redefined
    args	: void
    message	: '"ORG redefined"'
	
  - type	: ErrError
    func	: error_align_redefined
    args	: void
    message	: '"ALIGN redefined"'
	
  - type	: ErrError
    func	: error_org_not_aligned
    args	: int org, int align
    message	: "\"ORG '0x%04X' not ALIGNed '%d'\", org, align"
	
  - type	: ErrError
    func	: error_invalid_org_option
    args	: const char *org_hex
    message	: "\"invalid origin (-r) option '%s'\", org_hex"
	
  - type	: ErrError
    func	: error_invalid_define_option
    args	: const char *define
    message	: "\"invalid -DVAR=VAL option '%s'\", define"
	
  - type	: ErrError
    func	: error_invalid_org
    args	: int origin
    message	: "\"invalid origin: %d\", origin"
	
  - type	: ErrError
    func	: error_invalid_filler_option
    args	: const char *filler_hex
    message	: "\"invalid filler value: %s\", filler_hex"
	
  - type	: ErrWarn
    func	: warn_org_ignored
    args	: 'const char *filename, const char *section_name'
    message	: "\"ORG ignored at file '%s', section '%s'\", filename, section_name"
	
  - type	: ErrError
    func	: error_not_obj_file
    args	: const char *filename
    message	: "\"file '%s' not an object file\", filename"
	
  - type	: ErrError
    func	: error_obj_file_version
    args	: const char *filename, int found_version, int expected_version
    message	: "\"object file '%s' version %d, expected version %d\", filename, found_version, expected_version"

  - type	: ErrError
    func	: error_not_lib_file
    args	: const char *filename
    message	: "\"file '%s' not a library file\", filename"
	
  - type	: ErrError
    func	: error_lib_file_version
    args	: const char *filename, int found_version, int expected_version
    message	: "\"library file '%s' version %d, expected version %d\", filename, found_version, expected_version"

  # Range error or warning
  - type	: ErrWarn
    func	: warn_int_range
    args	: long value
    message	: "\"integer '%ld' out of range\", value"
	
  - type	: ErrError
    func	: error_int_range
    args	: long value
    message	: "\"integer '%ld' out of range\", value"

  - type	: ErrError
    func	: error_base_register_illegal
    args	: long value
    message	: "\"base register byte '%ld' is illegal\", value"

  - type	: ErrError
    func	: error_missing_arguments
    args	: void
    message	: "\"DMA missing register group member(s)\""

  - type	: ErrError
    func	: error_extra_arguments
    args	: void
    message	: "\"DMA too many arguments\""

  - type	: ErrError
    func	: error_port_A_timing
    args	: void
    message	: "\"port A timing is illegal\""

  - type	: ErrError
    func	: error_dma_unsupported_interrupts
    args	: void
    message	: "\"DMA does not support interrupts\""
	
  - type	: ErrError
    func	: error_dma_illegal_mode
    args	: void
    message	: "\"DMA mode is illegal\""
	
  - type	: ErrError
    func	: error_dma_illegal_command
    args	: void
    message	: "\"illegal DMA command\""
	
  - type	: ErrError
    func	: error_dma_illegal_read_mask
    args	: void
    message	: "\"DMA read mask is illegal\""
	
  - type	: ErrError
    func	: error_port_B_timing
    args	: void
    message	: "\"port B timing is illegal\""

  - type	: ErrWarn
    func	: warn_dma_unsupported_features
    args	: void
    message	: "\"DMA does not support some features\""
	
  - type	: ErrWarn
    func	: warn_dma_unsupported_command
    args	: void
    message	: "\"DMA does not implement this command\""
	
  - type	: ErrWarn
    func	: warn_dma_half_cycle_timing
    args	: void
    message	: "\"DMA does not support half cycle timing\""
	
  - type	: ErrWarn
    func	: warn_dma_ready_signal_unsupported
    args	: void
    message	: "\"DMA does not support ready signals\""
	
  # system call errors
  - type	: ErrError
    func	: error_cmd_failed
    args	: const char *cmd
    message	: "\"command '%s' failed\", cmd"
